/*
Theme Name: Occlusa
Theme URI: https://dentalnet32.com/
Author: dentalnet32
Description: An editorial theme for dental health publications. Enamel-ivory paper, deep teal ink and a gum-coral accent, built around a 32-tooth index motif. Includes random Popular Topics, a Header code widget area and clean navigation rules.
Version: 1.0.0
Requires at least: 6.2
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: occlusa
Tags: blog, news, two-columns, right-sidebar, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ---------- Tokens ---------- */
:root {
	--bg: #F4F0E6;
	--surface: #FFFDF7;
	--surface-2: #EBE5D7;
	--ink: #0F2B2E;
	--ink-2: #3F5A5B;
	--ink-3: #6B7E7C;
	--line: #DAD2C1;
	--mint: #2AA88F;
	--mint-ink: #0D6F5D;
	--mint-soft: #CFE7DE;
	--coral: #F0715A;
	--coral-ink: #B23F29;
	--coral-soft: #F8DCD2;
	--sand-soft: #EADFC6;
	--sky-soft: #D3E3E8;
	--band: #0F2B2E;
	--band-ink: #F4F0E6;
	--band-card: #16383B;
	--band-line: #24494C;
	--arch: rgba(15, 43, 46, .10);
	--arch-hi: var(--coral);

	--f-display: "Newsreader", "Iowan Old Style", Georgia, serif;
	--f-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	--f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

	--wrap: 1240px;
	--gutter: clamp(16px, 4vw, 40px);
	--r-sm: 10px;
	--r-md: 16px;
	--r-lg: 28px;
	--ease: cubic-bezier(.2, .7, .2, 1);
	--shadow: 0 1px 0 rgba(15, 43, 46, .05), 0 12px 30px -18px rgba(15, 43, 46, .35);
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0B1C1E;
		--surface: #112729;
		--surface-2: #173235;
		--ink: #EEE8DB;
		--ink-2: #BFC9C4;
		--ink-3: #8EA19D;
		--line: #23403F;
		--mint-ink: #6FD3BC;
		--mint-soft: #16403A;
		--coral-ink: #FF9A85;
		--coral-soft: #3A2622;
		--sand-soft: #2C2A22;
		--sky-soft: #1A3138;
		--band: #071416;
		--band-card: #0F2426;
		--band-line: #1D3739;
		--arch: rgba(238, 232, 219, .08);
		--shadow: 0 12px 30px -18px rgba(0, 0, 0, .7);
		color-scheme: dark;
	}
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font: 400 1rem/1.65 var(--f-body);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
	outline: 2px solid var(--coral);
	outline-offset: 3px;
	border-radius: 4px;
}
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 500; line-height: 1.12; letter-spacing: -.015em; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only, .screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
	position: absolute; left: 12px; top: -60px; z-index: 100;
	background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--r-sm);
	text-decoration: none; transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

.kicker {
	font: 500 .72rem/1.3 var(--f-mono);
	text-transform: uppercase;
	letter-spacing: .12em;
	color: var(--mint-ink);
	margin: 0 0 14px;
	display: flex; align-items: center; gap: 10px;
}
.kicker::before { content: ""; width: 22px; height: 2px; background: var(--coral); border-radius: 2px; }

.chip {
	display: inline-flex; align-items: center; gap: 6px;
	font: 600 .74rem/1 var(--f-body);
	letter-spacing: .02em;
	padding: 7px 11px 7px 9px;
	border-radius: 999px;
	background: var(--mint-soft);
	color: var(--mint-ink);
	text-decoration: none;
	transition: background .2s var(--ease), color .2s var(--ease);
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip:hover { background: var(--ink); color: var(--bg); }

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	min-height: 46px; padding: 0 22px;
	font: 600 .95rem/1 var(--f-body);
	border: 1.5px solid var(--ink); border-radius: 999px;
	background: transparent; color: var(--ink);
	cursor: pointer; text-decoration: none;
	transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn-ink { background: var(--ink); color: var(--bg); }
.btn-ink:hover { background: var(--coral); border-color: var(--coral); color: #2B0F09; }
.btn:active { transform: translateY(1px); }

.no {
	font: 500 .78rem/1 var(--f-mono);
	color: var(--ink-3);
	letter-spacing: .04em;
}

/* ---------- Header ---------- */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: color-mix(in srgb, var(--bg) 86%, transparent);
	-webkit-backdrop-filter: saturate(1.4) blur(14px);
	backdrop-filter: saturate(1.4) blur(14px);
	border-bottom: 1px solid transparent;
	transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand-mark { width: 40px; height: 40px; color: var(--ink); --mark-tooth: var(--bg); }
.brand-img { max-height: 46px; width: auto; }
.brand-word { font: 600 1.42rem/1 var(--f-display); letter-spacing: -.02em; }
.brand-word b { font-family: var(--f-mono); font-weight: 500; font-size: .7em; color: var(--coral-ink); margin-left: 2px; vertical-align: .32em; }

.primary-nav { margin-left: auto; }
.primary-nav .menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.primary-nav .menu > li { position: relative; }
.primary-nav a {
	display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
	font: 600 .92rem/1 var(--f-body); text-decoration: none; color: var(--ink-2);
	border-radius: 999px; transition: background .2s var(--ease), color .2s var(--ease);
}
.primary-nav a:hover, .primary-nav .current-menu-item > a { color: var(--ink); background: var(--surface-2); }
.primary-nav .sub-menu {
	list-style: none; margin: 0; padding: 8px; position: absolute; top: 100%; left: 0; min-width: 220px;
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow);
	opacity: 0; visibility: hidden; transform: translateY(6px); transition: all .2s var(--ease);
}
.primary-nav li:hover > .sub-menu, .primary-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.primary-nav .sub-menu a { width: 100%; border-radius: var(--r-sm); }

.header-tools { display: flex; gap: 6px; }
.icon-btn {
	width: 44px; height: 44px; display: grid; place-items: center;
	border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink);
	cursor: pointer; transition: background .2s var(--ease), border-color .2s var(--ease);
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.menu-btn { display: none; }

.search-panel { border-top: 1px solid var(--line); padding: 18px 0; background: var(--bg); }
.search-form { display: flex; gap: 10px; }
.search-input {
	flex: 1; min-width: 0; min-height: 50px; padding: 0 20px;
	font: 400 1rem var(--f-body); color: var(--ink);
	background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px;
}
.search-input:focus { border-color: var(--ink); outline: none; }

.read-progress { height: 2px; overflow: hidden; display: none; }
.is-reading .read-progress { display: block; }
.read-progress span { display: block; height: 100%; background: var(--coral); transform: scaleX(0); transform-origin: 0 50%; }

/* ---------- Hero ---------- */
.hero { padding: clamp(28px, 6vw, 72px) 0 clamp(36px, 6vw, 64px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero-chip { margin-bottom: 18px; }
.hero-title { font-size: clamp(2.2rem, 4.6vw, 4.1rem); font-weight: 500; line-height: 1.04; letter-spacing: -.025em; }
.hero-title a { text-decoration: none; background: linear-gradient(var(--coral), var(--coral)) 0 96% / 0 3px no-repeat; transition: background-size .45s var(--ease); }
.hero-title a:hover { background-size: 100% 3px; }
.hero-excerpt { margin: 22px 0 18px; font-size: 1.12rem; color: var(--ink-2); max-width: 52ch; }
.hero-meta { font: 500 .8rem/1 var(--f-mono); color: var(--ink-3); display: flex; gap: 10px; margin-bottom: 28px; }
.hero-media { position: relative; display: block; aspect-ratio: 5 / 4.4; }
.hero-media .media-img, .hero-media .media-tile {
	width: 100%; height: 100%; object-fit: cover;
	border-radius: 46% 46% 32% 32% / 38% 38% 24% 24%;
	box-shadow: var(--shadow);
}
.hero-media::after {
	content: ""; position: absolute; right: 6%; top: 4%; width: 18%; aspect-ratio: 1;
	border-radius: 50%; background: var(--coral); mix-blend-mode: multiply; opacity: .9;
}
.hero-arch { position: absolute; left: -9%; bottom: -10%; width: 36%; --arch: rgba(42, 168, 143, .35); pointer-events: none; }

/* ---------- Page heads ---------- */
.page-head { padding: clamp(36px, 6vw, 72px) 0 28px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.page-title { font-size: clamp(2rem, 4vw, 3.4rem); }
.page-desc { color: var(--ink-2); max-width: 60ch; margin-top: 14px; }
.page-search { margin-top: 24px; max-width: 620px; }
.is-404 .page-title { max-width: 18ch; }

/* ---------- Split layout (stream + rail) ---------- */
.layout-split {
	display: grid; grid-template-columns: minmax(0, 1fr) 340px;
	gap: clamp(28px, 4vw, 64px); padding-top: 24px; padding-bottom: clamp(48px, 7vw, 96px);
	align-items: start;
}
.section-label {
	font: 500 .72rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .14em; color: var(--ink-3);
	display: flex; align-items: center; gap: 14px; margin: 8px 0 8px;
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.entries { display: grid; }
.entry {
	display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 26px;
	padding: 26px 0; border-bottom: 1px solid var(--line); align-items: start;
}
.entry-media { display: block; aspect-ratio: 8 / 6; border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); }
.entry-media .media-img, .entry-media .media-tile { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.entry:hover .entry-media .media-img, .entry:hover .entry-media .media-tile { transform: scale(1.04); }
.entry-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.entry-title { font-size: clamp(1.32rem, 2.1vw, 1.7rem); line-height: 1.16; }
.entry-title a { text-decoration: none; }
.entry-title a:hover { color: var(--mint-ink); }
.entry-excerpt { color: var(--ink-2); margin: 10px 0 12px; font-size: .98rem; }
.entry-meta { font: 500 .76rem/1 var(--f-mono); color: var(--ink-3); display: flex; gap: 8px; }

.empty-state { padding: 40px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r-lg); margin-top: 24px; }
.empty-state h2 { font-size: 1.6rem; margin-bottom: 10px; }

/* Pagination */
.pagination { margin-top: 36px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-numbers {
	min-width: 44px; min-height: 44px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center;
	border-radius: 999px; border: 1px solid var(--line); text-decoration: none;
	font: 500 .85rem/1 var(--f-mono); color: var(--ink-2); background: var(--surface);
}
.page-numbers:hover { border-color: var(--ink); color: var(--ink); }
.page-numbers.current { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.page-numbers.dots { border: 0; background: none; }

/* ---------- Media tile (no-image fallback, never empty) ---------- */
.media-tile {
	position: relative; display: grid; place-items: center; width: 100%; height: 100%; overflow: hidden;
	background:
		radial-gradient(circle at 78% 22%, rgba(255, 255, 255, .55) 0 14%, transparent 15%),
		repeating-linear-gradient(135deg, transparent 0 14px, rgba(15, 43, 46, .05) 14px 15px),
		var(--tile, var(--mint-soft));
	color: var(--ink);
}
.media-tile.tone-1 { --tile: var(--coral-soft); }
.media-tile.tone-2 { --tile: var(--sand-soft); }
.media-tile.tone-3 { --tile: var(--sky-soft); }
.tile-mark { width: 38%; max-width: 92px; color: var(--ink); --mark-tooth: var(--surface); opacity: .92; }
.tile-no { position: absolute; left: 12px; bottom: 10px; font: 500 .72rem/1 var(--f-mono); letter-spacing: .08em; color: var(--ink-2); }

/* ---------- Popular Topics: rail ---------- */
.popular-rail {
	position: sticky; top: 96px;
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
	padding: 22px 18px 12px; box-shadow: var(--shadow);
}
.rail-head { display: flex; align-items: center; gap: 10px; padding: 0 6px 14px; border-bottom: 1px solid var(--line); }
.rail-mark { width: 28px; height: 28px; color: var(--coral); --mark-tooth: var(--surface); --mark-dot: var(--ink); }
.popular-rail .popular-title { font-size: 1.32rem; }
.pt-rail { list-style: none; margin: 0; padding: 0; }
.pt-row + .pt-row { border-top: 1px dashed var(--line); }
.pt-row a {
	display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 14px; align-items: center;
	padding: 12px 6px; text-decoration: none; border-radius: var(--r-sm);
	transition: background .2s var(--ease);
}
.pt-row a:hover { background: var(--bg); }
.pt-thumb { display: block; width: 62px; height: 62px; border-radius: 14px; overflow: hidden; }
.pt-thumb .media-img, .pt-thumb .media-tile { width: 100%; height: 100%; object-fit: cover; }
.pt-thumb .tile-no, .pt-media .tile-no { display: none; }
.pt-thumb .tile-mark { width: 54%; }
.pt-body { display: grid; gap: 5px; min-width: 0; }
.pt-no { font: 500 .7rem/1 var(--f-mono); color: var(--coral-ink); letter-spacing: .06em; }
.pt-row .pt-title {
	font: 600 .93rem/1.32 var(--f-body); color: var(--ink);
	display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.pt-row a:hover .pt-title { color: var(--mint-ink); }

/* ---------- Popular Topics: grid band ---------- */
.popular-grid {
	background: var(--band); color: var(--band-ink);
	padding: clamp(48px, 7vw, 96px) 0; margin-top: clamp(40px, 6vw, 80px);
	position: relative; overflow: hidden;
	--arch: rgba(244, 240, 230, .08);
}
.popular-head { position: relative; display: grid; gap: 4px; margin-bottom: clamp(28px, 4vw, 44px); }
.popular-grid .kicker { color: var(--mint); }
.popular-grid .popular-title { font-size: clamp(2rem, 4vw, 3.2rem); color: var(--band-ink); }
.popular-arch { position: absolute; right: -2%; top: -40%; width: min(420px, 50%); pointer-events: none; }
.pt-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; position: relative; }
.pt-card a {
	display: flex; flex-direction: column; height: 100%;
	background: var(--band-card); border: 1px solid var(--band-line); border-radius: var(--r-md);
	overflow: hidden; text-decoration: none; color: var(--band-ink);
	transition: transform .3s var(--ease), border-color .3s var(--ease);
}
.pt-card a:hover { transform: translateY(-4px); border-color: var(--mint); }
.pt-media { display: block; aspect-ratio: 16 / 10; overflow: hidden; }
.pt-media .media-img, .pt-media .media-tile { width: 100%; height: 100%; object-fit: cover; }
.pt-card .pt-body { padding: 16px 16px 18px; gap: 8px; flex: 1; align-content: start; }
.pt-card .pt-no { color: var(--coral); }
.pt-card .pt-title {
	font: 500 1.12rem/1.24 var(--f-display); letter-spacing: -.005em;
	display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.pt-meta { font: 500 .72rem/1 var(--f-mono); color: rgba(244, 240, 230, .6); margin-top: auto; padding-top: 6px; }

/* ---------- Article ---------- */
.article-head { padding-top: clamp(24px, 4vw, 48px); max-width: 980px; }
.crumbs ol { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; font: 500 .76rem/1.4 var(--f-mono); color: var(--ink-3); }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--line); }
.crumb { text-decoration: none; color: var(--ink-2); }
.crumb:hover { color: var(--coral-ink); }
.article-chip { margin-bottom: 18px; }
.article-title { font-size: clamp(2.1rem, 4.8vw, 3.9rem); line-height: 1.06; letter-spacing: -.025em; }
.article-dek { font: 400 1.25rem/1.5 var(--f-display); color: var(--ink-2); margin: 20px 0 0; max-width: 62ch; }
.article-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); font: 500 .78rem/1 var(--f-mono); color: var(--ink-3); }
.article-figure { margin: clamp(24px, 4vw, 44px) auto 0; max-width: 1100px; }
.article-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-lg); }
.article-figure figcaption { font-size: .85rem; color: var(--ink-3); margin-top: 10px; }

.article-layout {
	display: grid; grid-template-columns: 220px minmax(0, 720px); gap: clamp(28px, 5vw, 80px);
	justify-content: center; padding-top: clamp(28px, 4vw, 48px);
}
.article-layout.is-single-col { grid-template-columns: minmax(0, 760px); }
.article-layout .toc[hidden] + .article-main { grid-column: 1 / -1; justify-self: center; width: 100%; max-width: 720px; }
.toc { position: sticky; top: 104px; align-self: start; }
.toc-label { font: 500 .7rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .14em; color: var(--ink-3); margin-bottom: 14px; }
.toc-list { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); counter-reset: toc; }
.toc-list li { counter-increment: toc; }
.toc-link {
	display: block; padding: 7px 0 7px 16px; margin-left: -1px; border-left: 2px solid transparent;
	font-size: .86rem; line-height: 1.35; color: var(--ink-2); text-decoration: none;
}
.toc-link::before { content: counter(toc, decimal-leading-zero) "  "; font: 500 .7rem var(--f-mono); color: var(--ink-3); }
.toc-link:hover { color: var(--ink); }
.toc-link.is-active { border-left-color: var(--coral); color: var(--ink); font-weight: 600; }

/* Prose */
.prose { font-size: 1.1rem; line-height: 1.75; color: var(--ink); }
.prose > * + * { margin-top: 1.15em; }
.prose p { margin: 0; }
.prose h2 { font-size: clamp(1.6rem, 2.6vw, 2.05rem); margin-top: 2em; padding-top: .2em; }
.prose h3 { font-size: 1.4rem; margin-top: 1.7em; }
.prose h4 { font: 700 1.05rem var(--f-body); margin-top: 1.5em; }
.prose a { color: var(--mint-ink); text-decoration-color: color-mix(in srgb, var(--mint-ink) 40%, transparent); }
.prose a:hover { text-decoration-color: currentColor; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .4em; }
.prose ul li::marker { color: var(--coral); }
.prose ol li::marker { font-family: var(--f-mono); font-size: .85em; color: var(--mint-ink); }
.prose blockquote {
	margin: 1.8em 0; padding: 22px 26px; border-radius: var(--r-md);
	background: var(--surface); border-left: 4px solid var(--coral);
	font: 400 1.25rem/1.5 var(--f-display); font-style: italic;
}
.prose blockquote p { margin: 0; }
.prose img, .prose figure img { border-radius: var(--r-md); }
.prose figure { margin: 1.8em 0; }
.prose figcaption, .wp-element-caption { font-size: .85rem; color: var(--ink-3); margin-top: 8px; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { font: 600 .82rem var(--f-body); text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 2.4em 0; }
.prose code { font: .9em var(--f-mono); background: var(--surface-2); padding: .1em .35em; border-radius: 6px; }
.prose .alignwide { margin-inline: calc(-1 * clamp(0px, 8vw, 120px)); }
.prose .alignleft { float: left; margin: .3em 1.4em 1em 0; max-width: 50%; }
.prose .alignright { float: right; margin: .3em 0 1em 1.4em; max-width: 50%; }
.prose .aligncenter { margin-inline: auto; }

.note {
	margin-top: 40px; padding: 16px 18px 16px 48px; position: relative;
	font-size: .9rem; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
}
.note::before {
	content: "i"; position: absolute; left: 16px; top: 15px; width: 20px; height: 20px; border-radius: 50%;
	display: grid; place-items: center; background: var(--mint-ink); color: var(--surface);
	font: 700 .75rem/1 var(--f-display); font-style: italic;
}
.tags { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-block; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: .82rem; text-decoration: none; color: var(--ink-2); }
.tag:hover { border-color: var(--ink); color: var(--ink); }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 40px; }
.post-nav > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 20px; }
.post-nav-next { text-align: right; grid-column: 2; }
.post-nav-label { display: block; font: 500 .7rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); margin-bottom: 8px; }
.post-nav a { font: 500 1.1rem/1.3 var(--f-display); text-decoration: none; }
.post-nav a:hover { color: var(--mint-ink); }
.page-links { margin-top: 24px; display: flex; gap: 8px; }

/* Comments */
.comments { margin-top: 56px; padding-top: 36px; border-top: 1px solid var(--line); }
.comments-title, .comment-reply-title { font-size: 1.6rem; margin-bottom: 20px; }
.comment-list, .comment-list .children { list-style: none; margin: 0; padding: 0; }
.comment-list .children { padding-left: clamp(16px, 4vw, 40px); }
.comment-body { padding: 18px 0; border-bottom: 1px solid var(--line); }
.comment-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.comment-avatar { border-radius: 50%; }
.comment-author { font-weight: 600; }
.comment-head time { font: 500 .74rem var(--f-mono); color: var(--ink-3); margin-left: auto; }
.comment-reply-link { font-size: .85rem; font-weight: 600; color: var(--mint-ink); }
.comment-form { display: grid; gap: 14px; }
.comment-form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; padding: 12px 14px; font: inherit; color: var(--ink);
	background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-sm);
}
.comment-form textarea:focus, .comment-form input:focus { border-color: var(--ink); outline: none; }
.comment-form-cookies-consent { display: flex; gap: 8px; align-items: flex-start; }
.comment-form-cookies-consent label { font-weight: 400; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-top: clamp(40px, 6vw, 72px); position: relative; overflow: hidden; }
.popular-grid + .site-footer { border-top: 0; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; position: relative; padding-bottom: 40px; }
.footer-brand p { color: var(--ink-2); max-width: 46ch; margin-top: 18px; font-size: .95rem; }
.footer-nav .menu { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 6px 36px; justify-content: end; }
.footer-nav a { display: inline-flex; min-height: 40px; align-items: center; text-decoration: none; font-weight: 500; color: var(--ink-2); }
.footer-nav a:hover { color: var(--coral-ink); }
.footer-arch { position: absolute; left: 50%; bottom: -150px; width: 260px; transform: translateX(-50%); pointer-events: none; }
.footer-brand, .footer-nav { position: relative; z-index: 1; }
.footer-base {
	display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
	padding-top: 18px; padding-bottom: 28px; border-top: 1px solid var(--line);
	font: 500 .76rem/1 var(--f-mono); color: var(--ink-3); position: relative;
}
.to-top { text-decoration: none; color: var(--ink-2); min-height: 44px; display: inline-flex; align-items: center; }
.to-top:hover { color: var(--coral-ink); }

/* Gutenberg basics */
.wp-block-image img { height: auto; }
.wp-block-button__link { border-radius: 999px; background: var(--ink); color: var(--bg); }
.has-text-align-center { text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
	.pt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.layout-split { grid-template-columns: minmax(0, 1fr) 300px; }
	.entry { grid-template-columns: 190px minmax(0, 1fr); gap: 20px; }
	.article-layout { grid-template-columns: minmax(0, 720px); }
	.toc { display: none; }
}

@media (max-width: 900px) {
	.menu-btn { display: grid; }
	.primary-nav {
		position: fixed; inset: 76px 0 auto 0; margin: 0;
		background: var(--bg); border-bottom: 1px solid var(--line); padding: 12px var(--gutter) 20px;
		transform: translateY(-8px); opacity: 0; visibility: hidden; transition: all .22s var(--ease);
		max-height: calc(100vh - 76px); overflow-y: auto;
	}
	.menu-open .primary-nav { transform: none; opacity: 1; visibility: visible; }
	.primary-nav .menu { flex-direction: column; }
	.primary-nav a { width: 100%; font-size: 1.05rem; border-radius: var(--r-sm); }
	.primary-nav .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 0 0 14px; background: none; }
	.header-tools { margin-left: auto; }

	.hero-grid { grid-template-columns: minmax(0, 1fr); }
	.hero-media { order: -1; aspect-ratio: 16 / 11; max-width: 560px; }
	.layout-split { grid-template-columns: minmax(0, 1fr); }
	.popular-rail { position: static; }
	.pt-rail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
	.pt-row + .pt-row { border-top: 0; }
	.pt-row { border-bottom: 1px dashed var(--line); }
	.footer-grid { grid-template-columns: minmax(0, 1fr); }
	.footer-arch { left: auto; right: 0; transform: none; width: 200px; bottom: -120px; }
	.footer-nav .menu { justify-content: start; }
}

@media (max-width: 640px) {
	body { font-size: .98rem; }
	.header-inner { min-height: 66px; gap: 12px; }
	.primary-nav { inset: 66px 0 auto 0; }
	.brand-mark { width: 34px; height: 34px; }
	.brand-word { font-size: 1.22rem; }
	.entry { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 22px 0; }
	.entry-media { aspect-ratio: 16 / 10; }
	.pt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	.pt-card .pt-body { padding: 12px 12px 14px; }
	.pt-card .pt-title { font-size: 1rem; }
	.pt-rail { grid-template-columns: minmax(0, 1fr); }
	.prose { font-size: 1.04rem; }
	.post-nav { grid-template-columns: minmax(0, 1fr); }
	.post-nav-next { grid-column: auto; text-align: left; }
	.search-form { flex-direction: column; }
	.footer-arch { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media print {
	.site-header, .popular, .site-footer, .toc, .comments, .post-nav { display: none !important; }
	body { background: #fff; color: #000; }
}
