/*
Theme Name: Talk With Tech
Theme URI: https://talkwithtech.com
Author: Talk With Tech
Description: Clean, fast news theme for Talk With Tech. Light by default, optional dark mode.
Version: 1.0.0
Requires PHP: 8.1
Text Domain: talkwithtech
*/

/* ---------- Fonts (self-hosted, sans-serif only) ---------- */
@font-face {
	font-family: "Archivo";
	src: url("assets/fonts/Archivo-normal.woff2") format("woff2");
	font-weight: 500 800;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Public Sans";
	src: url("assets/fonts/PublicSans-normal.woff2") format("woff2");
	font-weight: 400 700;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Public Sans";
	src: url("assets/fonts/PublicSans-italic.woff2") format("woff2");
	font-weight: 400;
	font-style: italic;
	font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
	--bg: #ffffff;
	--surface: #ffffff;
	--surface-2: #f4f4f5;
	--ink: #0a0a0a;
	--ink-2: #3f3f46;
	--ink-3: #71717a;
	--line: #e4e4e7;
	--accent: #0a0a0a;
	--accent-ink: #000000;
	--accent-soft: #f4f4f5;
	--mint: #52525b;
	--focus: #0a0a0a;
	--shadow: 0 1px 2px rgba(10, 10, 10, .05), 0 6px 20px rgba(10, 10, 10, .06);

	--font-head: "Archivo", "Helvetica Neue", Arial, system-ui, sans-serif;
	--font-body: "Public Sans", "Segoe UI", Roboto, Arial, system-ui, sans-serif;
	--font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

	--wrap: 1200px;
	--read: 700px;
	--radius: 8px;
	--gutter: clamp(16px, 4vw, 32px);
	color-scheme: light;
}
:root[data-theme="dark"] {
	--bg: #0b0b0c;
	--surface: #141416;
	--surface-2: #1c1c1f;
	--ink: #f4f4f5;
	--ink-2: #c8c8cd;
	--ink-3: #8f8f97;
	--line: #2a2a2e;
	--accent: #fafafa;
	--accent-ink: #ffffff;
	--accent-soft: #1f1f23;
	--mint: #a1a1aa;
	--focus: #fafafa;
	--shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .25);
	color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 17px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--ink-2); }
h2 a:hover, h3 a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-head);
	color: var(--ink);
	line-height: 1.2;
	letter-spacing: -.012em;
	margin: 0 0 .5em;
	font-weight: 700;
}
p { margin: 0 0 1.1em; }
button, input, select, textarea { font: inherit; color: inherit; }
code, kbd, pre, samp { font-family: var(--font-mono); font-size: .9em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto; z-index: 100; top: 8px; left: 8px;
	background: var(--surface); padding: 8px 14px; border-radius: var(--radius); box-shadow: var(--shadow);
}
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Header ---------- */
.topbar {
	border-bottom: 1px solid var(--line);
	font-size: 13px;
	color: var(--ink-3);
}
.topbar .wrap { display: flex; justify-content: space-between; gap: 16px; padding-top: 7px; padding-bottom: 7px; }
.topbar a:hover { color: var(--accent); }
.topbar-links { display: flex; gap: 18px; }

.site-header {
	position: sticky; top: 0; z-index: 40;
	background: color-mix(in srgb, var(--bg) 92%, transparent);
	backdrop-filter: saturate(1.4) blur(10px);
	-webkit-backdrop-filter: saturate(1.4) blur(10px);
	border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 34px; height: 34px; color: var(--ink); flex-shrink: 0; }
.brand-mark svg { width: 100%; height: 100%; }
.brand-mark .g, .byline-avatar .g, .thumb-empty .g { fill: var(--bg); }
.brand-name {
	font-family: var(--font-head);
	font-size: 22px;
	letter-spacing: -.035em;
	line-height: 1;
	color: var(--ink);
}
.brand-name b { font-weight: 800; }
.brand-name i { font-style: normal; font-weight: 500; color: var(--ink-3); margin: 0 1px; }
.brand-name b:last-child { color: var(--accent); }

.main-nav { flex: 1; min-width: 0; overflow: hidden; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.main-nav a {
	display: block;
	padding: 8px 11px;
	border-radius: 6px;
	font-family: var(--font-head);
	font-weight: 600;
	font-size: 15px;
	color: var(--ink-2);
	white-space: nowrap;
}
.main-nav a:hover { color: var(--ink); background: var(--surface-2); }
.main-nav .current-menu-item > a, .main-nav .current-cat > a, .main-nav .current-post-ancestor > a { color: var(--accent); }

.header-tools { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.icon-btn {
	display: inline-grid; place-items: center;
	width: 40px; height: 40px;
	border: 0; border-radius: 50%;
	background: transparent; color: var(--ink-2);
	cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
.menu-toggle { display: none; }

.search-panel { display: none; border-top: 1px solid var(--line); padding: 14px 0; }
.search-panel.is-open { display: block; }
.search-form { display: flex; gap: 8px; max-width: 640px; }
.search-form input[type="search"] {
	flex: 1; min-width: 0;
	padding: 11px 14px;
	border: 1px solid var(--line); border-radius: var(--radius);
	background: var(--surface);
	font-size: 16px;
}
.search-form input[type="search"]:focus { outline: none; border-color: var(--accent); }

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 11px 18px;
	border: 1px solid var(--ink); border-radius: var(--radius);
	background: var(--ink); color: var(--bg);
	font-family: var(--font-head); font-weight: 600; font-size: 15px;
	cursor: pointer;
}
.btn:hover { background: var(--ink-2); border-color: var(--ink-2); color: var(--bg); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--ink-3); }

/* ---------- Shared bits ---------- */
.kicker {
	display: inline-block;
	font-family: var(--font-head);
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--accent);
}
a.kicker:hover { color: var(--accent-ink); }
.meta { font-size: 13.5px; color: var(--ink-3); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.meta .dot::before { content: "·"; }
.thumb { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--surface-2); aspect-ratio: 16 / 9; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
a:hover .thumb img, .card:hover .thumb img { transform: scale(1.025); }
.thumb-empty { display: grid; place-items: center; color: var(--ink-3); }
.thumb-empty svg { width: 40%; opacity: .25; }

.section { padding: 40px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head {
	display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
	margin-bottom: 22px;
}
.section-title { font-size: 22px; margin: 0; display: flex; align-items: center; gap: 10px; }
.section-title::before { content: ""; width: 4px; height: 20px; background: var(--accent); border-radius: 2px; }
.section-link { font-family: var(--font-head); font-weight: 600; font-size: 14.5px; color: var(--ink-2); white-space: nowrap; }
.section-link:hover { color: var(--accent); }

/* ---------- Home: lead ---------- */
.lead-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 36px; padding-top: 32px; padding-bottom: 40px; }
.lead-story .thumb { aspect-ratio: 16 / 9; margin-bottom: 18px; }
.lead-story h2 { font-size: clamp(26px, 3.2vw, 38px); line-height: 1.12; letter-spacing: -.022em; margin: 8px 0 12px; }
.lead-story .excerpt { font-size: 18px; color: var(--ink-2); margin-bottom: 12px; }

.top-list { display: flex; flex-direction: column; }
.top-list-title {
	font-family: var(--font-head); font-size: 13px; font-weight: 700; letter-spacing: .08em;
	text-transform: uppercase; color: var(--ink-3);
	padding-bottom: 12px; border-bottom: 2px solid var(--ink); margin-bottom: 4px;
}
.top-item { display: grid; grid-template-columns: minmax(0, 1fr) 132px; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.top-item:last-child { border-bottom: 0; }
.top-item h3 { font-size: 17px; line-height: 1.3; margin: 4px 0 6px; font-weight: 650; }
.top-item .thumb { aspect-ratio: 16 / 10; }

/* ---------- Cards ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.card h3 { font-size: 19px; line-height: 1.28; margin: 12px 0 8px; }
.card .thumb { margin-bottom: 2px; }
.card .excerpt { color: var(--ink-2); font-size: 15.5px; margin: 0 0 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Latest + sidebar ---------- */
.with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; }
.row-list { display: flex; flex-direction: column; }
.row-item { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 22px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.row-item:first-child { padding-top: 0; }
.row-item h3 { font-size: 21px; line-height: 1.25; margin: 6px 0 8px; }
.row-item .excerpt { color: var(--ink-2); font-size: 16px; margin: 0 0 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.sidebar { display: flex; flex-direction: column; gap: 32px; }
.side-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.side-box h4 { font-size: 16px; margin-bottom: 14px; }
.ranked { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.ranked li { counter-increment: rank; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; padding: 11px 0; border-top: 1px solid var(--line); }
.ranked li:first-child { border-top: 0; padding-top: 0; }
.ranked li::before { content: counter(rank); font-family: var(--font-head); font-weight: 800; font-size: 20px; color: var(--accent); line-height: 1.2; }
.ranked a { font-weight: 600; font-size: 15px; line-height: 1.35; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
	display: inline-block; padding: 6px 12px;
	border: 1px solid var(--line); border-radius: 999px;
	font-size: 14px; font-weight: 500; color: var(--ink-2);
	background: var(--bg);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.side-note p { color: var(--ink-2); font-size: 15px; margin: 0; }

/* ---------- Archive header ---------- */
.page-head { padding: 44px 0 28px; border-bottom: 1px solid var(--line); margin-bottom: 32px; }
.page-head h1 { font-size: clamp(30px, 4vw, 44px); margin: 6px 0 8px; letter-spacing: -.025em; }
.page-head .desc { color: var(--ink-2); font-size: 18px; max-width: 680px; margin: 0; }
.page-head .desc p { margin: 0; }

.pagination { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; padding: 36px 0 8px; }
.pagination .page-numbers {
	min-width: 42px; height: 42px; padding: 0 12px;
	display: inline-grid; place-items: center;
	border: 1px solid var(--line); border-radius: var(--radius);
	font-family: var(--font-head); font-weight: 600; font-size: 15px;
	background: var(--surface);
}
.pagination .page-numbers.current { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pagination a.page-numbers:hover { border-color: var(--accent); color: var(--accent); }
.pagination .dots { border: 0; background: none; }

/* ---------- Single article ---------- */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--accent); z-index: 60; }
.article-head { max-width: 820px; margin: 0 auto; padding: 40px 0 24px; text-align: left; }
.breadcrumbs { font-size: 13.5px; color: var(--ink-3); margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { opacity: .6; }
.article-title { font-size: clamp(30px, 4.6vw, 48px); line-height: 1.1; letter-spacing: -.028em; margin: 10px 0 16px; }
.article-dek { font-size: clamp(18px, 2vw, 21px); line-height: 1.5; color: var(--ink-2); margin: 0 0 22px; }
.byline { display: flex; align-items: center; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.byline-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.byline-avatar svg { width: 20px; height: 20px; }
.byline-text { display: flex; flex-direction: column; line-height: 1.35; }
.byline-name { font-weight: 600; font-size: 15px; }
.byline .meta { font-size: 13.5px; }
.byline-share { margin-left: auto; display: flex; gap: 2px; }

.article-figure { max-width: 1000px; margin: 8px auto 36px; }
.article-figure .thumb { border-radius: 12px; aspect-ratio: auto; }
.article-figure .thumb img { aspect-ratio: 16 / 9; }
.article-figure figcaption { font-size: 13.5px; color: var(--ink-3); margin-top: 10px; }

.entry { max-width: var(--read); margin: 0 auto; font-size: 18.5px; line-height: 1.75; }
.entry > * { margin-top: 0; margin-bottom: 1.25em; }
.entry h2 { font-size: 27px; margin-top: 1.8em; margin-bottom: .6em; letter-spacing: -.02em; }
.entry h3 { font-size: 22px; margin-top: 1.6em; margin-bottom: .5em; }
.entry a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.entry a:hover { color: var(--accent-ink); }
.entry ul, .entry ol { padding-left: 1.3em; }
.entry li { margin-bottom: .45em; }
.entry li::marker { color: var(--accent); }
.entry strong { font-weight: 650; color: var(--ink); }
.entry blockquote {
	margin: 1.6em 0; padding: 4px 0 4px 22px;
	border-left: 3px solid var(--accent);
	font-size: 20px; color: var(--ink); font-style: italic;
}
.entry blockquote p:last-child { margin-bottom: 0; }
.entry img, .entry figure { border-radius: var(--radius); }
.entry figure { margin-left: 0; margin-right: 0; }
.entry figcaption { font-size: 14px; color: var(--ink-3); margin-top: 8px; }
.entry table { width: 100%; border-collapse: collapse; font-size: 16px; display: block; overflow-x: auto; }
.entry th, .entry td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.entry th { font-family: var(--font-head); font-weight: 650; background: var(--surface-2); }
.entry pre { background: var(--surface-2); padding: 16px; border-radius: var(--radius); overflow-x: auto; line-height: 1.5; }
.entry :not(pre) > code { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; }

/* Article helpers produced by the newsroom pipeline */
.entry .twt-keypoints {
	background: var(--accent-soft);
	border-radius: 12px;
	padding: 22px 26px 10px;
	margin-bottom: 1.8em;
}
.entry .twt-keypoints h2 { font-size: 15px; letter-spacing: .07em; text-transform: uppercase; margin: 0 0 12px; color: var(--accent-ink); }
.entry .twt-keypoints ul { margin: 0 0 12px; }
.entry .twt-keypoints li { font-size: 17px; margin-bottom: .5em; }
.entry .twt-explain {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 20px 24px 6px;
	margin: 1.8em 0;
}
.entry .twt-explain h3 { margin-top: 0; font-size: 18px; }
.entry .twt-explain p { font-size: 17px; }
.entry .twt-faq h3 { font-size: 19px; margin-top: 1.3em; }

.article-foot { max-width: var(--read); margin: 40px auto 0; }
.sources { font-size: 15px; color: var(--ink-2); padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.sources strong { font-family: var(--font-head); color: var(--ink); display: block; margin-bottom: 6px; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; }
.sources ul { margin: 0; padding-left: 1.1em; }
.sources a { text-decoration: underline; text-underline-offset: 3px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
.share-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.share-row > span { font-family: var(--font-head); font-weight: 650; font-size: 15px; margin-right: 6px; }
.share-btn {
	display: inline-grid; place-items: center;
	width: 40px; height: 40px; border-radius: 50%;
	border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
	cursor: pointer;
}
.share-btn:hover { border-color: var(--accent); color: var(--accent); }
.share-btn svg { width: 18px; height: 18px; }
.share-btn.copied { border-color: var(--ink); color: var(--ink); background: var(--surface-2); }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 28px 0 0; }
.post-nav a { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.post-nav a:hover { border-color: var(--accent); }
.post-nav small { display: block; color: var(--ink-3); font-size: 13px; margin-bottom: 4px; }
.post-nav strong { font-family: var(--font-head); font-size: 16px; line-height: 1.3; display: block; }
.post-nav .next { text-align: right; }

.related { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--line); }

/* ---------- Story layout (sectioned reading) ---------- */
.story-grid {
	display: grid;
	grid-template-columns: 200px minmax(0, 700px) 300px;
	justify-content: center;
	gap: 48px;
	padding-top: 36px;
	max-width: 1420px;
}
.story-rail { position: relative; }
.rail-inner { position: sticky; top: 96px; padding-top: 6px; }
.rail-label {
	font-family: var(--font-head); font-size: 12px; font-weight: 700; letter-spacing: .09em;
	text-transform: uppercase; color: var(--ink-3); margin: 0 0 12px;
}
.rail-inner .rail-label + .toc { margin-bottom: 32px; }
.toc { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc a {
	display: grid; grid-template-columns: 26px 1fr; gap: 6px;
	padding: 8px 0 8px 14px; margin-left: -2px;
	border-left: 2px solid transparent;
	font-size: 14.5px; line-height: 1.35; color: var(--ink-3);
	transition: color .15s, border-color .15s;
}
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--ink); border-left-color: var(--accent); font-weight: 600; }
.toc a.is-active .toc-n { color: var(--accent); }
.toc-n { font-family: var(--font-head); font-weight: 700; font-size: 12.5px; padding-top: 2px; color: var(--ink-3); }
.rail-share { display: flex; flex-wrap: wrap; gap: 8px; }

.story-head { padding-bottom: 8px; }
.story-head .article-title { margin-top: 6px; }
.story-head .byline-avatar { background: none; width: 40px; height: 40px; color: var(--accent); }
.story-head .byline-avatar svg { width: 40px; height: 40px; }

.story-figure { margin: 22px 0 0; }
.story-figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px; background: var(--surface-2); }
.story-figure figcaption { font-size: 13.5px; color: var(--ink-3); margin-top: 10px; }

.mode-bar {
	position: sticky; top: 68px; z-index: 30;
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	margin: 26px 0 30px; padding: 10px 0;
	background: var(--bg);
	border-bottom: 1px solid var(--line);
}
.mode-switch { display: inline-flex; padding: 4px; background: var(--surface-2); border-radius: 999px; gap: 2px; }
.mode-switch button {
	border: 0; background: transparent; cursor: pointer;
	padding: 8px 16px; border-radius: 999px;
	font-family: var(--font-head); font-weight: 600; font-size: 14.5px; color: var(--ink-2);
	white-space: nowrap;
}
.mode-switch button small { font-weight: 500; color: var(--ink-3); margin-left: 4px; font-size: 12.5px; }
.mode-switch button.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(14, 17, 22, .12); }
:root[data-theme="dark"] .mode-switch button.is-active { background: var(--line); }
.toc-btn {
	display: none; align-items: center; gap: 6px; min-width: 0;
	border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
	padding: 8px 12px 8px 14px; cursor: pointer;
	font-family: var(--font-head); font-weight: 600; font-size: 14px; color: var(--ink-2);
}
.toc-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.toc-btn-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }
.toc-sheet {
	display: none; position: absolute; left: 0; right: 0; top: 100%;
	background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
	box-shadow: var(--shadow); padding: 8px 14px; margin-top: 6px;
	border-left: 1px solid var(--line);
}
.toc-sheet.is-open { display: block; }
.toc-sheet a { border-left: 0; padding-left: 0; margin-left: 0; }

.story-intro { font-size: 19.5px; }
.story-intro p:first-child::first-line { font-weight: 600; }
.story-sec { padding-top: 34px; margin-top: 34px; border-top: 1px solid var(--line); scroll-margin-top: 140px; }
.sec-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; }
.sec-n {
	font-family: var(--font-head); font-weight: 800; font-size: 15px; color: var(--accent);
	background: var(--accent-soft); border-radius: 8px; padding: 4px 8px; line-height: 1.2; flex-shrink: 0;
	position: relative; top: -3px;
}
.sec-head h2 { font-size: 26px; margin: 0; letter-spacing: -.02em; }
.story-body .entry { max-width: none; margin: 0; }
.story-sec.is-faq .sec-body h3 { font-size: 18px; margin-top: 1.1em; }

/* Quick read: keep the first block of every section, hide the rest. */
.quick-end { display: none; }
.is-quick .sec-body > *:not(:first-child) { display: none; }
.is-quick .story-sec.is-faq .sec-body > * { display: revert; }
.is-quick .quick-end {
	display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
	margin-top: 36px; padding: 18px 22px; border-radius: 14px; background: var(--accent-soft);
}
.is-quick .quick-end p { margin: 0; font-weight: 600; color: var(--accent-ink); }

/* Separately written quick version */
.story-quick { display: none; }
.has-quick.is-quick .story-full { display: none; }
.has-quick.is-quick .story-quick { display: block; }
.story-quick .entry { font-size: 19px; }
.quick-label {
	display: inline-block; margin: 6px 0 14px;
	font-family: var(--font-head); font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
	color: var(--ink-3);
}
.reading-quick .story-rail .toc, .reading-quick .story-rail .rail-label:first-child, .reading-quick .toc-btn { display: none; }

/* Inline photos */
.entry .twt-figure, .twt-figure { margin: 34px 0; }
.twt-figure img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; background: var(--surface-2); }
.twt-figure figcaption { font-size: 14px; color: var(--ink-3); margin-top: 10px; line-height: 1.5; }
.sec-body .twt-figure:first-child { margin-top: 8px; }

.story .article-foot { max-width: none; margin-top: 44px; }
.story .related { margin-top: 64px; padding: 48px 0 8px; border-top: 1px solid var(--line); background: var(--surface-2); }

@media (max-width: 1360px) {
	.story-grid { grid-template-columns: minmax(0, 700px) 300px; gap: 48px; }
	.story-rail { display: none; }
	.toc-btn { display: inline-flex; }
}
@media (max-width: 1080px) {
	.story-grid { grid-template-columns: minmax(0, 720px); gap: 0; padding-top: 24px; }
	.story-side { margin-top: 56px; padding-top: 8px; border-top: 1px solid var(--line); }
	.side-inner, .sidebar-sticky { position: static; max-height: none; overflow: visible; }
	.story-side .side-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px; }
	.story-side .side-list + .side-list { margin-top: 0; }
	.story-rail { display: none; }
	.toc-btn { display: inline-flex; }
	.mode-bar { top: 60px; }
}
@media (max-width: 640px) {
	.mode-switch button { padding: 8px 12px; font-size: 14px; }
	.mode-switch button small { display: none; }
	.story-intro { font-size: 18px; }
	.sec-head h2 { font-size: 22px; }
	.story-figure { margin-left: calc(var(--gutter) * -1); margin-right: calc(var(--gutter) * -1); }
	.story-figure img { border-radius: 0; }
}

/* ---------- Right-side shortcuts (Featured / Recommended / New) ---------- */
.story-side { min-width: 0; }
.side-inner {
	position: sticky; top: 92px;
	max-height: calc(100vh - 108px); overflow-y: auto; overscroll-behavior: contain;
	scrollbar-width: thin; scrollbar-color: var(--line) transparent; padding: 6px 4px 12px 0;
}
.sidebar-sticky { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 32px; }
.side-list + .side-list { margin-top: 30px; }
.side-list h4 {
	font-size: 12.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
	padding-bottom: 10px; margin: 0 0 2px; border-bottom: 2px solid var(--ink);
}
.side-list ul { list-style: none; margin: 0; padding: 0; }
.side-list li a {
	display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: start;
	padding: 12px 0; border-bottom: 1px solid var(--line);
}
.side-list li:last-child a { border-bottom: 0; }
.side-list li a:not(:has(.side-thumb)) { grid-template-columns: minmax(0, 1fr); }
.side-thumb img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
.side-title {
	font-family: var(--font-head); font-weight: 650; font-size: 14.5px; line-height: 1.32; color: var(--ink);
	display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.side-list li a:hover .side-title { text-decoration: underline; text-underline-offset: 3px; }
.side-time { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
.side-list .is-lead a { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.side-list .is-lead .side-thumb img { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 10px; }
.side-list .is-lead .side-title { font-size: 16.5px; -webkit-line-clamp: 4; }
.side-new .side-thumb { display: none; }
.side-new li a { grid-template-columns: minmax(0, 1fr); }

/* Embedded videos and related links inside articles */
.entry iframe { max-width: 100%; }
.entry iframe[src*="youtube"] { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; margin: 30px 0 10px; background: #000; }
.entry .twt-video-cap { font-size: 14px; color: var(--ink-3); margin-top: 0; }
.entry .twt-related { background: var(--surface-2); border-radius: 12px; padding: 16px 22px 6px; margin: 30px 0; }
.entry .twt-related p { margin: 0 0 6px; font-size: 13px; letter-spacing: .07em; text-transform: uppercase; }
.entry .twt-related ul { margin: 0 0 10px; padding-left: 1.1em; }
.entry .twt-related li { font-size: 16.5px; }
.entry .twt-related a { color: var(--ink); font-weight: 600; text-decoration: none; }
.entry .twt-related a:hover { text-decoration: underline; }

/* ---------- Pages ---------- */
.page-content { max-width: var(--read); margin: 0 auto; padding-bottom: 40px; }

/* ---------- 404 / empty ---------- */
.empty { text-align: center; padding: 80px 0; max-width: 560px; margin: 0 auto; }
.empty h1 { font-size: 40px; }
.empty p { color: var(--ink-2); }
.empty .search-form { margin: 24px auto 0; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 64px; background: var(--surface-2); border-top: 1px solid var(--line); font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding-top: 48px; padding-bottom: 40px; }
.footer-about p { color: var(--ink-2); max-width: 340px; margin-top: 14px; }
.site-footer h5 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.site-footer ul a { color: var(--ink-2); }
.site-footer ul a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--line); }
.footer-bottom .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 18px; color: var(--ink-3); font-size: 13.5px; }
.socials { display: flex; gap: 6px; margin-top: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
	.with-sidebar { grid-template-columns: minmax(0, 1fr); }
	.sidebar { display: block; }
	.sidebar-sticky { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (max-width: 1180px) {
	.menu-toggle { display: inline-grid; }
	.main-nav {
		display: none;
		position: absolute; top: 100%; left: 0; right: 0;
		background: var(--bg); border-bottom: 1px solid var(--line);
		padding: 8px var(--gutter) 16px;
		box-shadow: var(--shadow);
	}
	.main-nav.is-open { display: block; }
	.main-nav { overflow: visible; }
	.main-nav ul { flex-direction: column; gap: 0; }
	.main-nav a { padding: 12px 4px; font-size: 17px; border-bottom: 1px solid var(--line); border-radius: 0; }
	.main-nav a:hover { background: none; }
}
@media (max-width: 960px) {
	.lead-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
	.grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
	body { font-size: 16px; }
	.topbar { display: none; }
	.header-row { height: 60px; gap: 12px; }
	.brand-name { font-size: 20px; }
	.brand-mark { width: 26px; height: 26px; }
	.grid-3 { grid-template-columns: minmax(0, 1fr); gap: 26px; }
	.row-item { grid-template-columns: 112px minmax(0, 1fr); gap: 14px; padding: 16px 0; }
	.row-item .thumb { aspect-ratio: 1 / 1; }
	.row-item h3 { font-size: 17px; margin-top: 2px; }
	.row-item .excerpt { display: none; }
	.top-item { grid-template-columns: minmax(0, 1fr) 104px; }
	.sidebar-sticky { grid-template-columns: minmax(0, 1fr); }
	.entry { font-size: 17.5px; }
	.entry h2 { font-size: 23px; }
	.byline-share { display: none; }
	.post-nav { grid-template-columns: 1fr; }
	.post-nav .next { text-align: left; }
	.footer-grid { grid-template-columns: 1fr; gap: 28px; }
	.article-figure { margin-left: calc(var(--gutter) * -1); margin-right: calc(var(--gutter) * -1); }
	.article-figure .thumb { border-radius: 0; }
	.article-figure figcaption { padding: 0 var(--gutter); }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
	.site-header, .topbar, .site-footer, .share-row, .related, .post-nav, .progress, .byline-share { display: none !important; }
	body { background: #fff; color: #000; }
}

/* Captions are not shown (older posts may still contain them) */
.twt-figure figcaption, .entry .twt-video-cap, .story-figure figcaption { display: none; }
