/*
Theme Name: NBC 2026
Description: 뉴스브리핑 캄보디아 새 사이트 샘플 — 모던 에디토리얼(각진 모서리·가는 선·명조 제목), 휴대폰 우선, 가벼움.
Version: 0.3
Text Domain: nbc2026
*/

/* Fonts (scripts/make_fonts.py). NBC Sans = Pretendard cut to the 2,124 syllables our articles use.
   NBC Serif = Nanum Myeongjo ExtraBold cut to headline syllables. "Rest" files load only when a page needs one. */
@font-face { font-family: "NBC Sans"; font-weight: 400; font-display: swap; src: url(assets/fonts/nbc-core-400.woff2) format("woff2"); }
@font-face { font-family: "NBC Sans"; font-weight: 700; font-display: swap; src: url(assets/fonts/nbc-core-700.woff2) format("woff2"); }
@font-face { font-family: "NBC Sans Rest"; font-weight: 400; font-display: swap; src: url(assets/fonts/nbc-rest-400.woff2) format("woff2"); unicode-range: U+AC00-D7A3; }
@font-face { font-family: "NBC Sans Rest"; font-weight: 700; font-display: swap; src: url(assets/fonts/nbc-rest-700.woff2) format("woff2"); unicode-range: U+AC00-D7A3; }
@font-face { font-family: "NBC Serif"; font-weight: 800; font-display: swap; src: url(assets/fonts/nbc-serif-core.woff2) format("woff2"); }
@font-face { font-family: "NBC Serif Rest"; font-weight: 800; font-display: swap; src: url(assets/fonts/nbc-serif-rest.woff2) format("woff2"); unicode-range: U+AC00-D7A3; }

/* ── colours: light by default, dark when the phone asks for it or the reader picks it ── */
:root {
	--ink: #111418; --sub: #565d68; --mute: #8a919b; --line: #e4e6ea; --rule: #111418;
	--bg: #ffffff; --soft: #f3f4f6; --brand: #17408b; --brand-ink: #0f2c63; --accent: #d9342b;
	--band: #0f2c63; --scrim: 8, 10, 14;
	--wrap: 1180px;
	--sans: "NBC Sans", "NBC Sans Rest", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
	--serif: "NBC Serif", "NBC Serif Rest", "NBC Sans", "AppleMyungjo", "Noto Serif KR", "Batang", serif;
	--ease: cubic-bezier(.2, .8, .2, 1);
	color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans);
	font-size: 17.5px; line-height: 1.6; letter-spacing: -.012em; word-break: keep-all; overflow-wrap: anywhere;
	-webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3 { font-weight: 700; letter-spacing: -.03em; text-wrap: balance; }
p { text-wrap: pretty; }
button, input { font: inherit; letter-spacing: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
img { max-width: 100%; height: auto; display: block; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.screen-reader-text { position: absolute; left: -9999px; }
.serif { font-family: var(--serif); font-weight: 800; letter-spacing: -.035em; }

/* title underline that draws itself on hover */
.u { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .45s var(--ease); }
a:hover .u { background-size: 100% 1px; }

/* top bar */
.topbar { background: var(--brand-ink); color: #dfe6f3; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; gap: 14px; align-items: center; justify-content: space-between; height: 42px; white-space: nowrap; overflow: hidden; }
.topbar .fx b { color: #fff; font-weight: 700; }
.topbar .fx .note { color: #9fb0cf; margin-left: 4px; }
.topbar .short { display: none; }
@media (max-width: 767px) { .topbar .long, .topbar .fx .note { display: none; } .topbar .short { display: inline; } }

/* header: sticks 10px higher than its height, so it looks slimmer once stuck (no layout change) */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: -10px; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 104px; }
.logo img { height: 54px; width: auto; transform-origin: 0 50%; }
.nav { display: none; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.nav a { display: block; padding: 8px 13px; font-weight: 700; font-size: 16.5px; color: var(--ink); position: relative; }
.nav a::after { content: ""; position: absolute; left: 13px; right: 13px; bottom: 2px; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; transition: transform .35s var(--ease); }
.nav a:hover { color: var(--ink); }
.nav a:hover::after, .nav .on a::after { transform: scaleX(1); }
.tools { display: flex; align-items: center; gap: 2px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; color: var(--sub); background: none; border: 0; cursor: pointer; }
.icon-btn:hover { color: var(--ink); }

/* reading bar (article pages) */
.readbar { position: fixed; left: 0; right: 0; top: 0; height: 3px; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; z-index: 40; pointer-events: none; }

/* section titles */
.sec { margin: 44px 0 0; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; border-top: 2px solid var(--rule); padding-top: 12px; margin-bottom: 18px; }
.sec-head h2 { font-size: 21.5px; margin: 0; }
.sec-head a.more { font-size: 14.5px; color: var(--sub); }

/* photos: a colour close to the photo shows while it loads, then the photo fades in */
.img { background: var(--soft); overflow: hidden; }
.img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease), opacity .6s ease; }
.js .img img.fade { opacity: 0; }
.js .img img.fade.on { opacity: 1; }

/* hero: the photo darkens toward the bottom, the headline sits in that shade */
.top { display: grid; gap: 28px; margin-top: 22px; }
.hero a { display: block; position: relative; color: #fff; background: #1b2230; }
.hero a:hover { color: #fff; }
.hero .img { aspect-ratio: 4 / 3; background: none; }
.hero a:hover .img img { transform: scale(1.02); }
.hero .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 90px 18px 18px; background: linear-gradient(to top, rgba(var(--scrim), .9) 0%, rgba(var(--scrim), .62) 48%, rgba(var(--scrim), 0) 100%); }
.kicker { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 13.5px; font-weight: 700; letter-spacing: .04em; }
.kicker::before { content: ""; width: 20px; height: 2px; background: var(--accent); }
.hero h1 { font-size: 28px; line-height: 1.28; margin: 0; text-shadow: 0 1px 12px rgba(0, 0, 0, .25); }
.hero p { display: none; color: rgba(255, 255, 255, .84); margin: 12px 0 0; font-size: 16.5px; line-height: 1.6; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero .meta { display: none; margin-top: 10px; color: rgba(255, 255, 255, .66); }
.meta { color: var(--mute); font-size: 14px; letter-spacing: 0; }

/* latest list: no box, just rules */
.latest { border-top: 2px solid var(--rule); padding-top: 12px; }
.latest h2 { font-size: 18.5px; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; }
.live { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; }
.live::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); animation: live 2s ease-out infinite; }
@keyframes live { from { transform: scale(1); opacity: .6; } to { transform: scale(3); opacity: 0; } }
.latest ol { list-style: none; margin: 0; padding: 0; }
.latest li { border-top: 1px solid var(--line); padding: 12px 0; display: grid; grid-template-columns: 50px 1fr; gap: 10px; }
.latest li:first-child { border-top: 0; }
.latest time { color: var(--accent); font-size: 13.5px; font-weight: 700; padding-top: 2px; letter-spacing: 0; }
.latest a { font-weight: 700; font-size: 16.5px; line-height: 1.45; letter-spacing: -.03em; }
.latest .all { display: block; font-size: 14.5px; color: var(--sub); padding: 12px 0 0; border-top: 1px solid var(--line); }

/* cards */
.grid { display: grid; gap: 22px; }
.card .img { aspect-ratio: 16 / 10; }
.card a:hover .img img, .row-item:hover .img img { transform: scale(1.05); }
.card h3 { font-size: 18.5px; line-height: 1.42; margin: 12px 0 6px; }
.card p { color: var(--sub); font-size: 15.5px; margin: 0 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* compact rows (lists) */
.row-item { display: grid; grid-template-columns: 1fr 104px; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); align-items: start; }
.row-item:first-child { border-top: 0; }
.row-item h3 { font-size: 17.5px; line-height: 1.45; margin: 0 0 4px; }
.row-item .img { aspect-ratio: 4 / 3; }

/* weekly issue band */
.issue { margin-top: 48px; background: var(--band); color: #fff; display: grid; }
.issue .img { background: none; }
.issue .img img { aspect-ratio: 16 / 10; }
.issue .txt { padding: 24px 22px 26px; }
.issue .no { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14.5px; letter-spacing: .04em; color: #c9d4ea; }
.issue .no::before { content: ""; width: 20px; height: 2px; background: var(--accent); }
.issue h2 { font-size: 27px; line-height: 1.32; margin: 12px 0 10px; }
.issue p { color: #c9d4ea; margin: 0 0 18px; }
.issue a.btn { display: inline-block; border: 1px solid rgba(255, 255, 255, .6); color: #fff; font-weight: 700; padding: 9px 18px; font-size: 15.5px; transition: background .3s, color .3s; }
.issue a.btn:hover { background: #fff; color: var(--band); }

/* article */
.article { max-width: 760px; margin: 30px auto 0; }
.article .cat { color: var(--accent); font-weight: 700; font-size: 15px; }
.article h1 { font-size: 33.5px; line-height: 1.3; margin: 10px 0 16px; }
.article .meta { display: flex; gap: 10px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.share { display: flex; gap: 8px; margin: 16px 0 6px; flex-wrap: wrap; }
.share a, .share button { border: 1px solid var(--line); background: none; padding: 7px 14px; font-size: 14.5px; font-weight: 700; color: var(--sub); cursor: pointer; transition: border-color .25s, color .25s; }
.share a:hover, .share button:hover { border-color: var(--ink); color: var(--ink); }
.entry { font-size: calc(19.5px * var(--fs, 1)); line-height: 1.85; margin-top: 20px; }
.entry p { margin: 0 0 1.15em; }
.entry img { margin: 8px auto; }
.entry a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.entry a:has(img) { text-decoration: none; }
.entry .wp-caption, .entry figure { max-width: 100% !important; margin: 1.2em 0; }
.entry .wp-caption-text, .entry figcaption, .entry [style*="font-size: 13px"] { color: var(--mute); font-size: 15px !important; line-height: 1.6; display: block; text-align: center; }
.entry iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; }
.entry b, .entry strong { font-weight: 700; }
.related { max-width: 760px; margin: 48px auto 0; }

/* boxes and half columns from old articles */
.nbc-box { border-left: 3px solid var(--line); background: var(--soft); padding: 14px 18px; margin: 1.2em 0; }
.nbc-box-blue { border-color: #3b6fd8; } .nbc-box-green { border-color: #2f9e6b; } .nbc-box-yellow { border-color: #d9a520; }
.nbc-box-red { border-color: var(--accent); } .nbc-box-grey { border-color: var(--mute); }
.nbc-box > :last-child { margin-bottom: 0; }
@media (min-width: 768px) { .nbc-half { width: calc(50% - 12px); display: inline-block; vertical-align: top; margin-right: 12px; } }

/* archive */
.page-title { font-size: 30px; margin: 30px 0 8px; }
.list { max-width: 860px; }
.list .row-item { grid-template-columns: 1fr 140px; padding: 18px 0; }
.list .row-item p { margin: 0 0 4px; color: var(--sub); font-size: 15.5px; }
.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin: 28px 0; }
.pagination .page-numbers { padding: 7px 13px; border: 1px solid var(--line); font-size: 15px; }
.pagination .current { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.searchform { display: flex; gap: 8px; max-width: 560px; margin: 16px 0; }
.searchform input[type=search] { flex: 1; padding: 11px 14px; border: 1px solid var(--rule); background: var(--bg); }
.searchform button { font-weight: 700; padding: 0 20px; border: 0; background: var(--ink); color: var(--bg); cursor: pointer; }

/* footer */
.site-footer { margin-top: 64px; border-top: 2px solid var(--rule); color: var(--sub); font-size: 14.5px; padding: 28px 0 96px; }
.site-footer .wrap { display: grid; gap: 10px; }
.site-footer b { color: var(--ink); }

/* phone bottom tab bar: hides while reading down, returns on the way up */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--bg); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); transition: transform .35s var(--ease); }
.tabbar.hide { transform: translateY(105%); }
.tabbar a { display: grid; justify-items: center; gap: 2px; font-size: 12.5px; font-weight: 700; color: var(--sub); padding: 4px 0; }
.tabbar svg { width: 22px; height: 22px; }
.tabbar a.on { color: var(--ink); }

/* page-to-page morph: the card photo grows into the article photo (Chrome/Edge 126+, Safari 18.2+) */
@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: .45s; animation-timing-function: var(--ease); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .25s; }
::view-transition-old(*.photo), ::view-transition-new(*.photo) { height: 100%; object-fit: cover; overflow: clip; }

/* tablet / desktop */
@media (min-width: 768px) {
	.nav { display: block; }
	.tabbar { display: none; }
	.site-footer { padding-bottom: 36px; }
	.top { grid-template-columns: 1.75fr 1fr; align-items: start; }
	.hero .cap { padding: 140px 30px 26px; }
	.hero h1 { font-size: 43px; line-height: 1.24; }
	.hero p { display: -webkit-box; }
	.hero .meta { display: block; }
	.grid.g4 { grid-template-columns: 1.6fr 1fr 1fr; gap: 26px 22px; }
	.grid.g4 .card:first-child { grid-row: span 2; }
	.grid.g4 .card:first-child h3 { font-size: 26px; line-height: 1.32; }
	.grid.g3 { grid-template-columns: repeat(3, 1fr); }
	.issue { grid-template-columns: 1.1fr 1fr; }
	.issue .txt { padding: 36px 40px; align-self: center; }
	.issue h2 { font-size: 32.5px; }
	.logo img { height: 46px; }
	.article h1 { font-size: 45.5px; line-height: 1.26; }
}
@media (max-width: 767px) {
	/* phones: first story big, the rest as compact rows (title left, small photo right) */
	.grid { gap: 0; }
	.card:first-child { margin-bottom: 8px; }
	.card:first-child h3 { font-size: 21.5px; line-height: 1.36; }
	.card.small { border-top: 1px solid var(--line); padding: 14px 0; }
	.card.small a { display: grid; grid-template-columns: 1fr 104px; column-gap: 14px; align-items: start; }
	.card.small .img { grid-column: 2; grid-row: 1 / span 2; aspect-ratio: 4 / 3; }
	.card.small h3 { grid-column: 1; margin: 0 0 4px; font-size: 17.5px; }
	.card.small p { display: none; }
	.card.small .meta { grid-column: 1; }
	.hero a { margin: 0 -16px; }
	.issue { margin-left: -16px; margin-right: -16px; }
}

/* ── motion: only where the browser supports it, never for readers who asked for less motion ── */
@media (prefers-reduced-motion: no-preference) {
	@supports (animation-timeline: view()) {
		.reveal { animation: nbc-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 65%; }
		.readbar { animation: nbc-grow linear both; animation-timeline: scroll(root); }
		.site-header { animation: nbc-shadow linear both; animation-timeline: scroll(root); animation-range: 0 140px; }
		.site-header .wrap { animation: nbc-slim linear both; animation-timeline: scroll(root); animation-range: 0 140px; }
		.logo img { animation: nbc-logo linear both; animation-timeline: scroll(root); animation-range: 0 140px; }
	}
}
@media (prefers-reduced-motion: no-preference) and (min-width: 768px) {
	@supports (animation-timeline: view()) {
		.grid .reveal:nth-child(3n+2) { animation-range: entry 10% entry 75%; }
		.grid .reveal:nth-child(3n) { animation-range: entry 20% entry 85%; }
	}
}
@keyframes nbc-rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes nbc-grow { to { transform: scaleX(1); } }
@keyframes nbc-shadow { to { border-bottom-color: transparent; box-shadow: 0 8px 24px -14px rgba(0, 0, 0, .35); } }
@keyframes nbc-slim { to { transform: translateY(5px); } }
@keyframes nbc-logo { to { transform: scale(.84); } }
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after, ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; transition: none !important; }
}

/* article footer: heart + translate links */
.after { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 20px; margin: 34px 0 10px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.like { display: inline-flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 999px; background: none; padding: 10px 20px; font-size: 17.5px; font-weight: 700; color: var(--sub); cursor: pointer; transition: border-color .25s, color .25s, background .25s; }
.like svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; transition: fill .25s, transform .35s var(--ease); }
.like:hover { border-color: var(--accent); color: var(--accent); }
.like.on { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.like.on svg { fill: var(--accent); animation: nbcPop .45s var(--ease); }
@keyframes nbcPop { 0% { transform: scale(.7); } 55% { transform: scale(1.3); } 100% { transform: scale(1); } }
.tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 14.5px; color: var(--sub); }
.tr a { font-weight: 700; color: var(--ink); border-bottom: 1px solid var(--line); }
.tr a:hover { border-color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .like.on svg { animation: none; } }

.topbar .wx { color: #fff; font-weight: 700; margin-left: 4px; }
.topbar .wx:empty { display: none; }

/* article page: text on the left, recent + most read on the right */
.single-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 34px; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.single-grid .article { margin: 30px 0 0; max-width: none; }
.side { display: grid; gap: 26px; align-content: start; margin-top: 8px; }
.side-box h2 { font-size: 17.5px; margin: 0 0 6px; padding-bottom: 8px; border-bottom: 2px solid var(--rule); }
.side-box ol { list-style: none; margin: 0; padding: 0; }
.side-box li a { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; line-height: 1.45; }
.side-box .n { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.side-box .t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.side-box time { color: var(--mute); font-size: 13px; font-variant-numeric: tabular-nums; }
.side-box li a:hover .t { color: var(--brand); }
@media (min-width: 1000px) {
	.single-grid { grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; }
	.single-grid .article { max-width: 780px; }
	.side { position: sticky; top: 76px; align-self: start; margin-top: 30px; max-height: calc(100vh - 96px); overflow: auto; }
}

/* ENG / ខ្មែរ in the article's top line */
.article .meta .tr { margin-left: auto; display: inline-flex; gap: 6px; }
.article .meta .tr button { border: 1px solid var(--line); background: none; color: var(--sub); font-size: 13.5px; font-weight: 700; padding: 3px 10px; cursor: pointer; border-radius: 4px; transition: border-color .2s, color .2s; }
.article .meta .tr button:hover, .article .meta .tr button.on { border-color: var(--brand); color: var(--brand); }
.article .meta .tr button[hidden] { display: none; }
/* hide Google's own bar; the site's buttons are the control */
body { top: 0 !important; }
.skiptranslate iframe, .goog-te-banner-frame, #goog-gt-tt, .goog-te-balloon-frame { display: none !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }

/* share row with icons */
.share a, .share button { display: inline-flex; align-items: center; gap: 7px; }
.share svg { width: 17px; height: 17px; flex: none; }
.share a[href*="t.me"]:hover { color: #229ed9; border-color: #229ed9; }
.share a[href*="facebook"]:hover { color: #1877f2; border-color: #1877f2; }

/* flag buttons */
.article .meta .tr button { padding: 3px 5px; line-height: 0; display: inline-flex; align-items: center; }
.article .meta .tr button .flag { display: block; border: 1px solid rgba(0, 0, 0, .15); border-radius: 2px; }
.article .meta .tr button.on { box-shadow: 0 0 0 2px var(--brand); border-color: var(--brand); }

/* sub-category chips (정보 › 일반 · 생활 · 관광) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.chips a { border: 1px solid var(--line); padding: 7px 16px; font-weight: 700; font-size: 15.5px; color: var(--sub); border-radius: 999px; transition: border-color .2s, color .2s, background .2s; }
.chips a:hover { border-color: var(--ink); color: var(--ink); }
.chips a.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* header search: always an input on wide screens, a button that opens it on phones */
.hsearch { display: flex; align-items: center; position: relative; }
.hsearch input { width: 200px; height: 38px; border: 1px solid var(--line); border-right: 0; background: var(--bg); color: var(--ink); padding: 0 12px; font-size: 15.5px; outline: 0; border-radius: 4px 0 0 4px; transition: width .25s var(--ease), border-color .2s; -webkit-appearance: none; }
.hsearch input:focus { border-color: var(--ink); }
.hsearch input::-webkit-search-cancel-button { display: none; }
.hsearch button { width: 40px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--soft); color: var(--sub); cursor: pointer; border-radius: 0 4px 4px 0; }
.hsearch button:hover { color: var(--ink); border-color: var(--ink); }
@media (max-width: 899px) {
	.hsearch input { width: 0; padding: 0; border-width: 0; }
	.hsearch.open input, .hsearch:focus-within input { width: min(46vw, 220px); padding: 0 10px; border-width: 1px; border-right: 0; }
}

/* footer: channels + credit */
.site-footer .follow { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 4px 0; }
.site-footer .follow a { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); padding: 7px 14px; font-weight: 700; font-size: 14.5px; color: var(--ink); transition: border-color .2s, color .2s; }
.site-footer .follow svg { width: 17px; height: 17px; flex: none; }
.site-footer .follow a:nth-child(1):hover { color: #1877f2; border-color: #1877f2; }
.site-footer .follow a:nth-child(2):hover { color: #229ed9; border-color: #229ed9; }
.site-footer .follow a:nth-child(3):hover { color: #e00; border-color: #e00; }
.site-footer .credit { font-size: 13.5px; color: var(--mute); }

/* reader's text size: button + popover (작게 · 보통 · 크게 · 아주 크게 · 최대) */
.fsize { position: relative; display: inline-flex; }
.fsize > button { border: 1px solid var(--line); background: none; color: var(--sub); font-weight: 700; padding: 2px 9px; cursor: pointer; border-radius: 4px; display: inline-flex; align-items: baseline; gap: 1px; line-height: 1.4; }
.fsize > button:hover, .fsize > button[aria-expanded="true"] { border-color: var(--brand); color: var(--brand); }
.fsize > button small { font-size: 11px; } .fsize > button b { font-size: 16px; }
.fs-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(10, 14, 22, .16); padding: 14px 16px 12px; width: 330px; max-width: calc(100vw - 32px); }
.fs-pop[hidden] { display: none; }
.fs-pop .hd { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 15px; margin-bottom: 12px; }
.fs-pop .hd button { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--sub); cursor: pointer; padding: 0 2px; }
.fs-steps { display: grid; grid-template-columns: repeat(5, 1fr); position: relative; }
.fs-steps::before { content: ""; position: absolute; left: 10%; right: 10%; top: 18px; height: 8px; background: var(--soft); border-radius: 4px; }
.fs-steps button { position: relative; display: grid; justify-items: center; gap: 6px; border: 0; background: none; cursor: pointer; color: var(--sub); font-size: 13px; padding: 0; }
.fs-steps button i { font-style: normal; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line); color: var(--ink); font-weight: 700; }
.fs-steps button:nth-child(1) i { font-size: 12px; } .fs-steps button:nth-child(2) i { font-size: 14px; } .fs-steps button:nth-child(3) i { font-size: 16px; } .fs-steps button:nth-child(4) i { font-size: 18px; } .fs-steps button:nth-child(5) i { font-size: 20px; }
.fs-steps button.on { color: var(--brand); font-weight: 700; }
.fs-steps button.on i { background: var(--brand); border-color: var(--brand); color: #fff; }
.article .meta .tools-r { margin-left: auto; display: inline-flex; gap: 8px; align-items: center; }
.article .meta .tools-r .tr { margin-left: 0; }
/* top bar link */
.topbar .pb { color: #fff; font-weight: 700; margin-right: 14px; border-bottom: 1px solid rgba(255, 255, 255, .35); }
.topbar .pb:hover { color: #fff; border-color: #fff; }
.topbar .right { display: inline-flex; align-items: center; }

/* side lists flow with the page (no inner scrollbar) */
@media (min-width: 1000px) { .side { position: static; max-height: none; overflow: visible; } }
/* home: phonebook button under the latest list */
.pb-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-top: 14px; padding: 14px 16px; background: var(--brand-ink); color: #fff; border-radius: 10px; transition: transform .25s var(--ease), box-shadow .25s; }
.pb-card:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15, 44, 99, .28); }
.pb-card .ic { width: 42px; height: 42px; border-radius: 50%; background: rgba(255, 255, 255, .14); display: grid; place-items: center; }
.pb-card .tx b { display: block; font-size: 17px; letter-spacing: -.02em; }
.pb-card .tx small { display: block; color: #c9d6ef; font-size: 13px; margin-top: 2px; }
.pb-card .go { font-size: 20px; transition: transform .25s var(--ease); }
.pb-card:hover .go { transform: translateX(4px); }

/* plain pages */
.page-article { margin-top: 30px; }
.page-kids { margin: 6px 0 20px; }
.page-kids a { font-size: 14px; padding: 6px 13px; }

/* 전화번호부: the 텔레브리핑 app inside the site */
.pb-page { max-width: 900px; margin: 0 auto; padding: 0 16px; }
.pb-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 20px; margin: 28px 0 14px; }
.pb-head h1 { margin: 0 0 6px; font-size: 32px; }
.pb-head p { margin: 0; color: var(--sub); font-size: 15px; max-width: 620px; }
.pb-open { flex: none; border: 1px solid var(--line); padding: 8px 14px; font-weight: 700; font-size: 14.5px; border-radius: 6px; }
.pb-open:hover { border-color: var(--brand); color: var(--brand); }
.pb-frame { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--soft); }
.pb-frame iframe { display: block; width: 100%; height: max(640px, calc(100vh - 150px)); border: 0; }
@media (max-width: 600px) { .pb-head h1 { font-size: 25px; } .pb-frame { border-radius: 10px; } .pb-frame iframe { height: calc(100vh - 120px); } }

/* floating phonebook button (home + articles): always on screen, right side */
.pb-float { position: fixed; z-index: 40; right: max(16px, calc((100vw - var(--wrap)) / 2 - 150px)); bottom: 28px; display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px 12px 14px; background: var(--brand-ink); color: #fff; font-weight: 700; font-size: 15.5px; border-radius: 999px; box-shadow: 0 10px 28px rgba(15, 44, 99, .35); transition: transform .25s var(--ease), box-shadow .25s; animation: pbFloat 3.2s ease-in-out infinite; }
.pb-float:hover { color: #fff; transform: translateY(-3px); box-shadow: 0 14px 32px rgba(15, 44, 99, .45); animation-play-state: paused; }
@keyframes pbFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -4px; } }
@media (max-width: 767px) { .pb-float { bottom: 78px; right: 14px; padding: 12px; } .pb-float span { display: none; } }
@media (prefers-reduced-motion: reduce) { .pb-float { animation: none; } }

/* taller top on wide screens; phones keep a compact header */
@media (max-width: 767px) { .site-header .wrap { height: 70px; } .logo img { height: 40px; } .topbar .wrap { height: 34px; } }

/* ads (managed in 광고 관리) */
.ad-slot { position: relative; margin: 18px 0; line-height: 0; }
.ad-slot img { width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); }
.ad-slot a { display: block; }
.ad-slot .ad-label { position: absolute; right: 8px; top: 8px; background: rgba(17, 20, 24, .55); color: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; line-height: 1; padding: 3px 6px; border-radius: 3px; }
.latest .ad-home_side { margin: 14px 0 0; }
.ad-home_mid { max-width: 820px; margin: 34px auto 6px; }
.side .ad-side { margin: 0; }
.side .ad-side_top { margin: 0 0 22px; }
.entry .ad-in_article { margin: 26px 0; }
.ad-emag, .ad-phonebook { max-width: 820px; margin: 0 auto 16px; }

/* home slogan box (editor will fill it in 광고 관리 › 홈 슬로건) */
.slogan { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); font-weight: 700; font-size: 15px; letter-spacing: -.02em; color: var(--brand-ink); }
.slogan .kh { flex: none; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.slogan.empty { border-style: dashed; color: var(--mute); font-weight: 400; }
.slogan.img { display: block; padding: 4px 0 2px; border: 0; background: none; }
.slogan.img img { display: block; width: 100%; height: auto; }

/* footer: deep blue like the top bar, a little softer */
.site-footer { background: #13254b; color: #c3cde2; border-top: 0; margin-top: 64px; }
.site-footer b { color: #fff; }
.site-footer a { color: #e7ecf6; }
.site-footer .follow a { border-color: rgba(255, 255, 255, .22); color: #fff; }
.site-footer .follow a:nth-child(1):hover { color: #fff; border-color: #1877f2; background: #1877f2; }
.site-footer .follow a:nth-child(2):hover { color: #fff; border-color: #229ed9; background: #229ed9; }
.site-footer .follow a:nth-child(3):hover { color: #fff; border-color: #e00; background: #e00; }
.site-footer .credit { color: #8d9bbb; }

/* home ad in the right margin, following the scroll — only where the margin is wide enough (≥1600px);
   narrower screens and phones keep it under the 전화번호부 card */
@media (min-width: 1600px) {
	.latest .ad-home_side, .side .ad-side_top { position: fixed; z-index: 30; top: 170px; right: 24px; width: min(360px, calc((100vw - var(--wrap)) / 2 - 48px)); margin: 0; }
	.latest .ad-home_side img, .side .ad-side_top img { box-shadow: 0 10px 28px rgba(10, 14, 22, .14); }
}

/* new logo (2026-10-13) a size bigger: 72px on wide screens, 60px on tablets/small laptops, 48px on phones */
.logo img { height: 60px; }
@media (min-width: 1200px) { .logo img { height: 72px; } }
@media (max-width: 767px) { .logo img { height: 48px; } }
/* tablets (768–1023px): keep the menu words on one line next to the bigger logo */
.nav a { white-space: nowrap; }
@media (min-width: 768px) and (max-width: 1023px) {
	.logo img { height: 46px; }
	.nav a { padding: 8px 8px; font-size: 15.5px; }
	.nav a::after { left: 8px; right: 8px; }
	.hsearch input { width: 120px; }
}

/* phones (2026-10-13): ☰ menu instead of the bottom tab bar; logo becomes the 'b' mark while searching */
.tabbar { display: none !important; }
.logo { display: flex; align-items: center; }
.logo-mark { display: none; height: 40px; width: 40px; }
.menu-btn { display: none; }
.mnav { display: none; }
@media (max-width: 767px) {
	.site-footer { padding-bottom: 36px; }
	.pb-float { bottom: 22px; }
	.tools { display: flex; align-items: center; gap: 6px; }
	.menu-btn { display: inline-grid; align-content: center; gap: 5px; width: 42px; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); cursor: pointer; }
	.menu-btn span { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s var(--ease), opacity .2s; }
	.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
	.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
	.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
	.mnav { display: block; border-top: 1px solid var(--line); background: var(--bg); box-shadow: 0 14px 24px rgba(10, 14, 22, .10); }
	.mnav[hidden] { display: none; }
	.mnav ul { list-style: none; margin: 0 auto; max-width: var(--wrap); padding: 6px 16px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
	.mnav li a { display: block; padding: 13px 4px; font-size: 17px; font-weight: 700; color: var(--ink); border-bottom: 1px solid var(--line); }
	.mnav li.on a { color: var(--accent); }
	.mnav li.pb a { color: var(--brand-ink); }
	.site-header.searching .logo-full { display: none; }
	.site-header.searching .logo-mark { display: block; }
	.site-header .wrap { gap: 8px; }
	.logo { flex: 0 1 auto; min-width: 0; }
	.logo-full { max-width: 100%; object-fit: contain; object-position: left center; }
}

/* no black rule above the slogan image (editor 2026-10-13) */
.latest:has(.slogan.img) { border-top: 0; padding-top: 0; }

/* phone turned sideways (short screen): a slim header so the page/e-magazine keeps the height */
@media (orientation: landscape) and (max-height: 520px) {
	.site-header .wrap { height: 62px; }
	.logo img.logo-full { height: 40px; }
	.pb-float { bottom: 14px; }
}
