/*
Theme Name: RTV News
Theme URI: https://rtv.tokyo/
Author: Mana株式会社
Author URI: https://rtv.tokyo/
Description: RTV Security Service のセキュリティニュース「物見櫓 — RTV セキュリティ便り」（https://rtv.tokyo/news/）のテーマ。接続元を絞った編集用の WordPress で使い、公開は静的に書き出した HTML で行う。本体のホームページ（rtv.tokyo）と同じ見た目で、記事ごとに重要度・対象の製品・CVE 番号・今すること・出典を出す。出典のない記事は公開できない。
Version: 1.2.0
Requires at least: 7.0
Tested up to: 7.1
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: rtv-news
*/

/* ── 色と字（本体のサイトと同じ） ───────────────────────── */
:root {
	--ink: #0F1B1E;
	--ink-2: #3A4A4D;
	--ink-3: #5B6B6E;
	--bg: #F3F5F4;
	--panel: #FFFFFF;
	--line: #E3E8E6;
	--line-2: #D5DCDA;
	--teal: #0E5B5A;
	--teal-dark: #083C3B;
	--accent: #E3A008;
	--night: #0F1B1E;
	--night-2: #0A1315;
	--night-line: #23383C;
	--on-night: #E9EEEC;
	--on-night-2: #C9D4D1;
	--on-night-3: #A9B6B3;
	--f-body: "BIZ UDPGothic", system-ui, sans-serif;
	--f-head: "Zen Kaku Gothic New", "BIZ UDPGothic", sans-serif;
	--f-mono: "IBM Plex Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--f-body);
	font-size: 16px;
	line-height: 1.8;
	-webkit-font-smoothing: antialiased;
	overflow-wrap: anywhere;
}
a { color: var(--teal); }
a:hover { color: var(--teal-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 2px;
}
img { max-width: 100%; height: auto; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}
.skip-link {
	position: absolute; left: 8px; top: -60px; z-index: 100;
	background: var(--accent); color: var(--ink);
	padding: 10px 16px; border-radius: 6px; font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 8px; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: 960px; }
.site-main { padding: 48px 0 72px; }

/* ── ヘッダー ─────────────────────────────────────────── */
.site-header { background: var(--night); color: var(--on-night); border-bottom: 1px solid var(--night-line); }
.site-header__inner {
	max-width: 1160px; margin: 0 auto; padding: 14px 24px;
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--on-night); text-decoration: none; }
.brand:hover { color: var(--on-night); }
.brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.brand__name { font-family: var(--f-head); font-weight: 700; font-size: 17px; letter-spacing: .04em; }
.brand__sub { font-weight: 500; margin-left: 6px; }
.brand__tag { font-family: var(--f-mono); font-weight: 500; font-size: 11px; letter-spacing: .06em; color: var(--on-night-3); }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 22px; font-size: 14px; }
.site-nav a { color: var(--on-night-2); text-decoration: none; padding: 10px 0; }
.site-nav a:hover { color: #FFFFFF; }
.site-nav a.is-current { color: #FFFFFF; box-shadow: inset 0 -2px 0 var(--accent); }
.site-nav .site-nav__cta {
	background: var(--accent); color: var(--ink); font-weight: 700;
	padding: 10px 18px; border-radius: 6px; min-height: 44px;
	display: inline-flex; align-items: center;
}
.site-nav .site-nav__cta:hover { color: var(--ink); background: #F0B11F; }

/* ── 一覧の見出し・道具 ─────────────────────────────── */
.page-head { margin-bottom: 28px; }
.page-head__label { margin: 0; font-family: var(--f-mono); font-size: 13px; letter-spacing: .08em; color: var(--teal); }
.page-head__title {
	margin: 4px 0 0; font-family: var(--f-head); font-weight: 900;
	font-size: clamp(26px, 3.4vw, 38px); line-height: 1.4;
}
.page-head__title--brand { font-size: clamp(34px, 5vw, 52px); letter-spacing: .08em; }
.page-head__title--brand rt { font-family: var(--f-body); font-weight: 400; font-size: 13px; letter-spacing: .2em; color: var(--ink-3); }
.page-head__lead { margin: 10px 0 0; color: var(--ink-2); max-width: 44em; }
.page-head__lead p { margin: 0; }

.list-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 24px; }
.list-tools:has(.cats) { padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.search { display: flex; flex: 1 1 320px; max-width: 480px; }
.search__input {
	flex: 1; min-width: 0; min-height: 44px; padding: 8px 12px;
	font: inherit; font-size: 15px; color: var(--ink);
	background: var(--panel); border: 1px solid var(--line-2); border-right: 0; border-radius: 6px 0 0 6px;
}
.search__button {
	min-height: 44px; padding: 8px 18px; font: inherit; font-weight: 700; font-size: 15px;
	color: #FFFFFF; background: var(--teal); border: 0; border-radius: 0 6px 6px 0; cursor: pointer;
}
.search__button:hover { background: var(--teal-dark); }
.cats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cats::before { content: "カテゴリー"; content: "カテゴリー" / ""; margin-right: 4px; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.search + .cats { padding-left: 20px; border-left: 1px solid var(--line); }
@media (max-width: 600px) { .search + .cats { padding-left: 0; border-left: 0; } }
.cats a {
	font-size: 13px; text-decoration: none; color: var(--ink-2);
	padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--panel);
}
.cats a:hover, .cats a.is-current { color: #FFFFFF; background: var(--teal); border-color: var(--teal); }

/* ── 重要度の札（報告書の重要度と同じ色） ─────────────── */
.sev {
	display: inline-flex; align-items: center; justify-content: center; min-width: 3.4em;
	padding: 2px 10px; border-radius: 4px; font-size: 13px; font-weight: 700; line-height: 1.6;
	border: 1px solid transparent;
}
.sev--urgent { background: #F8D7DA; color: #8A1C24; border-color: #EDB3B8; }
.sev--high { background: #FDE7CF; color: #8A4B08; border-color: #F4C995; }
.sev--medium { background: #FFF6CC; color: #6B5900; border-color: #EBDB8A; }
.sev--info { background: #F3F5F8; color: #5A6472; border-color: #D9DEE5; }

/* ── 一覧の1件 ───────────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.card {
	background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
	padding: 20px 22px; display: flex; flex-direction: column; gap: 8px;
}
.card.sticky { border-color: var(--accent); }
.card__meta, .entry__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; color: var(--ink-3); }
.kicker { font-family: var(--f-mono); font-weight: 600; font-size: 12px; letter-spacing: .04em; color: var(--teal); text-decoration: none; }
.entry-updated { margin-left: 4px; }
.card__title { margin: 0; font-family: var(--f-head); font-weight: 700; font-size: 19px; line-height: 1.5; }
.card__title a { color: var(--ink); text-decoration: none; }
.card__title a:hover { color: var(--teal); text-decoration: underline; }
.card__products { margin: 0; font-size: 13px; color: var(--ink-2); }
.card__label {
	display: inline-block; margin-right: 8px; padding: 0 6px; border-radius: 3px;
	font-size: 12px; background: #E6ECEA; color: var(--ink-2);
}
.card__excerpt { font-size: 14px; color: var(--ink-2); }
.card__excerpt p { margin: 0; }

.pagination { margin-top: 32px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pagination .page-numbers {
	min-width: 44px; min-height: 44px; padding: 8px 12px; display: inline-flex; align-items: center; justify-content: center;
	background: var(--panel); border: 1px solid var(--line-2); border-radius: 6px; text-decoration: none; color: var(--ink);
}
.pagination .page-numbers.current { background: var(--teal); border-color: var(--teal); color: #FFFFFF; font-weight: 700; }
.pagination .page-numbers.dots { border: 0; background: none; }

.search-status { margin: 0 0 16px; font-weight: 700; color: var(--ink-2); }
.search-status:empty { display: none; }
.empty { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.empty p { margin: 0; }

.legend { margin-top: 40px; font-size: 14px; color: var(--ink-2); }
.legend summary { cursor: pointer; color: var(--teal); font-weight: 700; padding: 8px 0; }
.legend dl { margin: 8px 0; display: grid; gap: 8px; }
.legend__row { display: grid; grid-template-columns: 5em 1fr; gap: 12px; align-items: baseline; }
.legend dt, .legend dd { margin: 0; }
.legend p { margin: 8px 0 0; }

/* ── 記事 ─────────────────────────────────────────────── */
.entry { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: clamp(22px, 4vw, 48px); }
.entry__title {
	margin: 10px 0 0; font-family: var(--f-head); font-weight: 900;
	font-size: clamp(24px, 3.2vw, 34px); line-height: 1.45;
}
.facts { margin: 20px 0 0; border-top: 1px solid var(--line); }
.facts__row { display: grid; grid-template-columns: 4.5em 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.facts dt { margin: 0; font-weight: 700; color: var(--ink-3); }
.facts dd { margin: 0; }
.facts__cves a { font-family: var(--f-mono); font-weight: 500; margin-right: 10px; white-space: nowrap; }

.actions {
	margin: 28px 0 8px; padding: 18px 22px;
	background: #FFF4D6; border: 1px solid #EBD38A; border-left: 6px solid var(--accent); border-radius: 10px;
}
.actions__title { margin: 0 0 6px; font-family: var(--f-head); font-weight: 900; font-size: 18px; }
.actions__list { margin: 0; padding-left: 1.3em; }
.actions__list li { margin: 4px 0; font-weight: 700; }

.entry__content { margin-top: 28px; font-size: 17px; }
.entry__content > * { margin-top: 0; margin-bottom: 1.2em; }
.entry__content h2 { font-family: var(--f-head); font-weight: 900; font-size: 22px; line-height: 1.5; margin: 2em 0 .6em; padding-top: 1em; border-top: 1px solid var(--line); }
.entry__content h3 { font-family: var(--f-head); font-weight: 700; font-size: 19px; margin: 1.6em 0 .4em; }
.entry__content blockquote { margin-left: 0; padding: 4px 0 4px 18px; border-left: 4px solid var(--line-2); color: var(--ink-2); }
.entry__content code { font-family: var(--f-mono); font-size: .92em; background: #E6ECEA; padding: 1px 5px; border-radius: 3px; }
.entry__content pre { overflow-x: auto; background: var(--night); color: var(--on-night); padding: 16px; border-radius: 8px; font-size: 14px; line-height: 1.6; }
.entry__content pre code { background: none; padding: 0; color: inherit; }
.entry__content table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.entry__content th, .entry__content td { border: 1px solid var(--line-2); padding: 8px 10px; text-align: left; vertical-align: top; }
.entry__content th { background: #F6F8F7; }
.entry__content figure { margin-left: 0; margin-right: 0; }
.entry__content figcaption { font-size: 13px; color: var(--ink-3); }

.sources { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
.sources__title { margin: 0 0 8px; font-family: var(--f-head); font-weight: 700; font-size: 17px; }
.sources__list { margin: 0; padding-left: 1.2em; }
.sources__list li { margin: 4px 0; }
.sources__date, .sources__host { margin-left: 10px; font-size: 13px; color: var(--ink-3); }
.sources__host { font-family: var(--f-mono); }
.sources__note { margin: 12px 0 0; font-size: 13px; color: var(--ink-3); }
.entry__tags { margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.entry__tags a { font-size: 13px; text-decoration: none; padding: 2px 10px; border-radius: 999px; background: #E6ECEA; color: var(--ink-2); }

/* ── 相談の案内 ───────────────────────────────────────── */
.cta {
	margin-top: 24px; padding: clamp(22px, 4vw, 40px); border-radius: 16px;
	background: var(--night); color: var(--on-night);
}
.cta__kicker { margin: 0; font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; color: var(--accent); }
.cta__title { margin: 6px 0 0; font-family: var(--f-head); font-weight: 900; font-size: clamp(20px, 2.6vw, 26px); line-height: 1.5; }
.cta__text { margin: 10px 0 0; color: var(--on-night-2); }
.cta__buttons { margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 12px; }
.button {
	display: inline-flex; align-items: center; justify-content: center; min-height: 48px;
	padding: 10px 22px; border-radius: 8px; font-weight: 700; text-decoration: none;
}
.button--accent { background: var(--accent); color: var(--ink); }
.button--accent:hover { background: #F0B11F; color: var(--ink); }
.button--ghost { border: 1px solid var(--on-night-3); color: var(--on-night); }
.button--ghost:hover { border-color: #FFFFFF; color: #FFFFFF; }

.post-navigation { margin-top: 24px; }
.post-navigation .nav-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.post-navigation a {
	display: flex; flex-direction: column; gap: 2px; height: 100%;
	background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; text-decoration: none;
}
.post-navigation .nav-next a { text-align: right; }
.post-nav__label { font-size: 12px; color: var(--ink-3); }
.post-nav__title { color: var(--ink); font-weight: 700; }

.back-link { margin-top: 20px; }

/* ── フッター ─────────────────────────────────────────── */
.site-footer { background: var(--night-2); color: var(--on-night-3); padding: 40px 0 48px; font-size: 13px; }
.site-footer__inner { max-width: 1160px; margin: 0 auto; padding: 0 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.site-footer__about { display: flex; flex-direction: column; gap: 6px; }
.site-footer__name { font-family: var(--f-head); font-weight: 700; font-size: 15px; color: var(--on-night); }
.site-footer__tag { font-family: var(--f-mono); font-weight: 500; font-size: 12px; color: var(--on-night-3); margin-left: 10px; }
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: flex-start; }
.site-footer__nav a { color: var(--on-night-2); padding: 6px 0; }
.site-footer__note { margin: 0; flex: 1 1 100%; border-top: 1px solid var(--night-line); padding-top: 16px; line-height: 1.7; }

/* ── 小さい画面 ───────────────────────────────────────── */
@media (max-width: 600px) {
	.site-main { padding: 32px 0 56px; }
	.container { padding: 0 16px; }
	.site-header__inner { padding: 12px 16px; }
	.site-nav { gap: 0 16px; }
	.entry__content { font-size: 16px; }
	.legend__row, .facts__row { grid-template-columns: 4em 1fr; }
}

@media print {
	.site-header, .site-footer, .cta, .post-navigation, .list-tools, .skip-link { display: none; }
	body { background: #FFFFFF; }
	.entry { border: 0; padding: 0; }
}
