/*
Theme Name: Earthofpet Terrain
Theme URI: https://earthofpet.com/
Author: earthofpet
Description: A field-journal inspired editorial theme for earthofpet.com. Earthy paper tones, contour-line textures, leaf-cut imagery and a rotating Popular Topics band on every post. Includes a "Header" widget area printed directly after the closing header tag for Google Analytics / AdSense code.
Version: 1.0.0
Requires at least: 6.0
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: earthofpet
Tags: blog, news, two-columns, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready
*/

/* ==========================================================================
   1. Tokens (primitive -> semantic). Naming follows daisyUI-style roles.
   ========================================================================== */
:root {
	/* primitives */
	--paper-50: #faf7f0;
	--paper-100: #f3eee3;
	--paper-200: #e9e1d0;
	--paper-300: #d8ccb4;
	--forest-900: #17221b;
	--forest-800: #1f2e24;
	--forest-700: #2c4232;
	--moss-600: #3a5a41;
	--moss-500: #4f7556;
	--moss-300: #9db79a;
	--clay-700: #8f3f1d;
	--clay-600: #a64b24;
	--clay-500: #c2643c;
	--clay-200: #f0c9b2;
	--sun-400: #e3ab3e;
	--sun-200: #f5dca6;
	--stone-600: #4c544b;

	/* semantic roles */
	--color-base-100: var(--paper-100);
	--color-base-200: var(--paper-200);
	--color-base-300: var(--paper-300);
	--color-base-content: var(--forest-900);
	--color-muted: var(--stone-600);
	--color-primary: var(--moss-600);
	--color-primary-content: var(--paper-50);
	--color-secondary: var(--clay-500);
	--color-link: var(--clay-600);
	--color-link-hover: var(--clay-700);
	--color-accent: var(--sun-400);
	--color-neutral: var(--forest-800);
	--color-neutral-content: var(--paper-100);
	--color-card: var(--paper-50);
	--color-line: #d9cfbb;
	--ring: 0 0 0 3px var(--paper-50), 0 0 0 5px var(--clay-600);

	/* type */
	--font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
	--font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--step--1: clamp(0.82rem, 0.8rem + 0.1vw, 0.88rem);
	--step-0: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
	--step-1: clamp(1.2rem, 1.12rem + 0.35vw, 1.4rem);
	--step-2: clamp(1.45rem, 1.3rem + 0.7vw, 1.9rem);
	--step-3: clamp(1.9rem, 1.55rem + 1.5vw, 2.85rem);
	--step-4: clamp(2.4rem, 1.8rem + 2.8vw, 4.3rem);

	/* shape + space */
	--leaf: 28px 28px 28px 6px;
	--leaf-alt: 6px 28px 28px 28px;
	--radius-pill: 999px;
	--wrap: 1240px;
	--gutter: clamp(16px, 4vw, 40px);
	--shadow-soft: 0 1px 0 rgba(23, 34, 27, .06), 0 12px 30px -18px rgba(23, 34, 27, .35);
	--ease-out: cubic-bezier(.22, 1, .36, 1);

	/* textures */
	--grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.13 0 0 0 0 0.1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
	--contours: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='400' viewBox='0 0 600 400' fill='none' stroke='%23ffffff' stroke-opacity='.09' stroke-width='1.2'%3E%3Cpath d='M-20 60c80-40 150 30 240 0s150-60 250-20 120 40 160 10'/%3E%3Cpath d='M-20 110c90-40 160 40 250 5s160-55 250-15 110 35 150 10'/%3E%3Cpath d='M-20 165c100-35 170 45 260 10s150-50 240-15 100 30 140 10'/%3E%3Cpath d='M-20 225c110-30 170 40 255 15s150-45 245-10 100 25 140 5'/%3E%3Cpath d='M-20 285c95-25 175 35 260 15s150-40 240-10 100 20 140 0'/%3E%3Cpath d='M-20 345c105-20 170 30 255 10s150-35 245-5 100 20 140 0'/%3E%3Cellipse cx='470' cy='190' rx='60' ry='34'/%3E%3Cellipse cx='470' cy='190' rx='34' ry='18'/%3E%3C/svg%3E");
}

/* ==========================================================================
   2. Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
	margin: 0;
	background-color: var(--color-base-100);
	background-image: var(--grain);
	color: var(--color-base-content);
	font-family: var(--font-body);
	font-size: var(--step-0);
	line-height: 1.65;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}
img, svg, video, iframe { max-width: 100%; height: auto; }
img { display: block; }
a { color: var(--color-link); text-underline-offset: .18em; text-decoration-thickness: 1px; transition: color .2s var(--ease-out); }
a:hover { color: var(--color-link-hover); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-display);
	font-weight: 600;
	line-height: 1.12;
	letter-spacing: -0.015em;
	font-variation-settings: "opsz" 96, "SOFT" 50;
	margin: 0 0 .5em;
	color: var(--forest-900);
	text-wrap: balance;
}
p { margin: 0 0 1.1em; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--sun-200); color: var(--forest-900); }

.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0;
	position: absolute !important; word-wrap: normal !important;
}
.skip-link:focus {
	clip: auto; clip-path: none; height: auto; width: auto; margin: 0;
	left: 12px; top: 12px; z-index: 1000; padding: 12px 18px;
	background: var(--forest-900); color: var(--paper-50); border-radius: 10px; text-decoration: none;
}

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.wrap--narrow { width: min(100% - 2 * var(--gutter), 760px); margin-inline: auto; }

/* ==========================================================================
   3. Small components (btn, chip, kicker)
   ========================================================================== */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .5em;
	min-height: 44px; padding: .6em 1.25em;
	border: 1.5px solid var(--forest-900); border-radius: var(--radius-pill);
	background: var(--forest-900); color: var(--paper-50);
	font-weight: 600; font-size: var(--step--1); letter-spacing: .02em;
	text-decoration: none; cursor: pointer;
	transition: transform .2s var(--ease-out), background-color .2s, color .2s;
}
.btn:hover { background: var(--clay-600); border-color: var(--clay-600); color: #fff; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--forest-900); }
.btn--ghost:hover { background: var(--forest-900); border-color: var(--forest-900); color: var(--paper-50); }

.chip {
	display: inline-flex; align-items: center; gap: .4em;
	padding: .28em .75em; border-radius: var(--radius-pill);
	background: var(--sun-200); color: var(--forest-900);
	font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
	text-decoration: none; line-height: 1.4;
	transition: background-color .2s, transform .2s var(--ease-out);
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--clay-500); }
a.chip:hover { background: var(--clay-200); color: var(--forest-900); transform: translateX(2px); }

.kicker {
	display: flex; align-items: center; gap: .75rem;
	font-size: var(--step--1); font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
	color: var(--moss-600); margin: 0 0 .9rem;
}
.kicker::before { content: ""; width: 34px; height: 2px; background: currentColor; border-radius: 2px; }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: clamp(1.25rem, 3vw, 2rem); }
.section-head h2 { font-size: var(--step-3); margin: 0; }
.section-head h2 em { font-style: italic; font-weight: 500; color: var(--clay-600); }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .9rem; font-size: var(--step--1); color: var(--color-muted); }
.meta > * + *::before { content: "•"; margin-right: .9rem; color: var(--paper-300); }

/* ==========================================================================
   4. Header
   ========================================================================== */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: color-mix(in srgb, var(--paper-100) 92%, transparent);
	-webkit-backdrop-filter: saturate(140%) blur(10px);
	backdrop-filter: saturate(140%) blur(10px);
}
.site-header::after { /* hand-drawn wavy rule */
	content: ""; position: absolute; left: 0; right: 0; bottom: -7px; height: 8px; pointer-events: none;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='8' viewBox='0 0 120 8'%3E%3Cpath d='M0 4c10-4 20-4 30 0s20 4 30 0 20-4 30 0 20 4 30 0' fill='none' stroke='%232c4232' stroke-opacity='.35' stroke-width='1.5'/%3E%3C/svg%3E") repeat-x;
}
.site-header__inner { display: flex; align-items: center; gap: 1.5rem; min-height: 76px; }

.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--forest-900); flex-shrink: 0; }
.brand:hover { color: var(--forest-900); }
.brand__mark { width: 44px; height: 44px; transition: transform .5s var(--ease-out); }
.brand:hover .brand__mark { transform: rotate(-12deg); }
.brand__word { font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.brand__word i { font-weight: 500; color: var(--clay-600); padding: 0 .08em; }
.brand img.custom-logo { max-height: 52px; width: auto; }

.site-nav { margin-left: auto; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: .25rem; }
.site-nav li { position: relative; }
.site-nav a {
	display: inline-flex; align-items: center; min-height: 44px; padding: .4rem .95rem;
	border-radius: var(--radius-pill); color: var(--forest-900); text-decoration: none; font-weight: 600; font-size: .95rem;
	transition: background-color .2s, color .2s;
}
.site-nav a:hover, .site-nav .current-menu-item > a, .site-nav a[aria-current="page"] { background: var(--paper-200); color: var(--forest-900); }
.site-nav .sub-menu {
	position: absolute; top: calc(100% + 6px); left: 0; min-width: 220px; display: block; padding: .5rem;
	background: var(--paper-50); border: 1px solid var(--color-line); border-radius: 16px; box-shadow: var(--shadow-soft);
	opacity: 0; visibility: hidden; transform: translateY(6px); transition: .2s var(--ease-out);
}
.site-nav li:hover > .sub-menu, .site-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.site-nav .sub-menu a { display: flex; border-radius: 10px; }

.header-actions { display: flex; align-items: center; gap: .4rem; }
.icon-btn {
	display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0;
	border: 1.5px solid var(--forest-900); border-radius: 50%; background: transparent; color: var(--forest-900); cursor: pointer;
	transition: background-color .2s, color .2s, transform .2s var(--ease-out);
}
.icon-btn:hover { background: var(--forest-900); color: var(--paper-50); }
.icon-btn svg { width: 20px; height: 20px; }
.menu-toggle { display: none; }

.search-panel { border-top: 1px solid var(--color-line); padding: 1rem 0 1.25rem; }
.search-panel[hidden] { display: none; }

.search-form { display: flex; gap: .5rem; width: 100%; }
.search-form label { flex: 1; }
.search-field {
	width: 100%; min-height: 48px; padding: .6rem 1.1rem;
	border: 1.5px solid var(--forest-700); border-radius: var(--radius-pill); background: var(--paper-50);
}
.search-field::placeholder { color: #6c7268; }

/* ==========================================================================
   5. Cards & thumbs
   ========================================================================== */
.thumb { position: relative; display: block; overflow: hidden; aspect-ratio: 4 / 3; border-radius: var(--leaf); background: var(--paper-200); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease-out); }
.thumb--fallback { display: grid; place-items: center; }
.thumb--fallback::before {
	content: ""; position: absolute; inset: 0;
	background-image: radial-gradient(circle at 20% 30%, rgba(255,255,255,.18) 0 9px, transparent 10px), radial-gradient(circle at 70% 70%, rgba(255,255,255,.12) 0 14px, transparent 15px);
	background-size: 80px 80px, 110px 110px;
}
.thumb--fallback span { position: relative; font-family: var(--font-display); font-style: italic; font-size: clamp(3rem, 7vw, 5rem); line-height: 1; color: rgba(255,255,255,.92); }
.tone-0 { background: var(--moss-600); }
.tone-1 { background: var(--clay-500); }
.tone-2 { background: #b98722; }
.tone-3 { background: var(--forest-700); }

.card { display: flex; flex-direction: column; gap: .85rem; }
.card__body { display: flex; flex-direction: column; gap: .55rem; }
.card__title { font-size: var(--step-1); margin: 0; }
.card__title a { color: var(--forest-900); text-decoration: none; background: linear-gradient(var(--sun-200), var(--sun-200)) no-repeat 0 92% / 0 .38em; transition: background-size .45s var(--ease-out); }
.card:hover .card__title a { background-size: 100% .38em; }
.card:hover .thumb img { transform: scale(1.045); }
.card__excerpt { color: var(--color-muted); font-size: .97rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card:nth-child(3n+2) .thumb { border-radius: var(--leaf-alt); }

.grid { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem) clamp(1.25rem, 2.5vw, 2rem); grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ==========================================================================
   6. Home: hero
   ========================================================================== */
.hero { padding: clamp(2rem, 5vw, 4rem) 0 clamp(2.5rem, 6vw, 5rem); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.lead { position: relative; }
.lead__media { position: relative; }
.lead__media .thumb { aspect-ratio: 16 / 11; border-radius: 44px 44px 44px 10px; }
.lead__badge {
	position: absolute; right: -10px; top: -14px; width: 104px; height: 104px; border-radius: 50%;
	display: grid; place-items: center; text-align: center; padding: 10px;
	background: var(--sun-400); color: var(--forest-900); font-family: var(--font-display); font-style: italic; font-size: .95rem; line-height: 1.1;
	transform: rotate(10deg); box-shadow: var(--shadow-soft);
}
.lead__body { position: relative; margin: -70px 0 0 clamp(0px, 4vw, 48px); padding: clamp(1.25rem, 3vw, 2rem); background: var(--paper-50); border-radius: var(--leaf-alt); box-shadow: var(--shadow-soft); max-width: 640px; }
.lead__title { font-size: var(--step-3); margin: .6rem 0 .6rem; }
.lead__title a { color: inherit; text-decoration: none; }
.lead__title a:hover { color: var(--clay-700); }

.trail { position: relative; padding-left: 1.75rem; }
.trail::before { content: ""; position: absolute; left: 6px; top: .5rem; bottom: .5rem; border-left: 2px dashed var(--moss-300); }
.trail__intro h1 { font-size: var(--step-2); margin: 0 0 .25rem; }
.trail__intro p { color: var(--color-muted); }
.trail__list { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: 1.25rem; }
.trail__item { position: relative; display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 1rem; align-items: center; }
.trail__item::before { content: ""; position: absolute; left: calc(-1.75rem + 1px); top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--paper-100); border: 2px solid var(--moss-600); }
.trail__item .thumb { aspect-ratio: 1; border-radius: 22px 22px 22px 4px; }
.trail__item h3 { font-size: 1.08rem; margin: .3rem 0 0; }
.trail__item h3 a { color: var(--forest-900); text-decoration: none; }
.trail__item h3 a:hover { color: var(--clay-700); }
.trail__item:hover .thumb img { transform: scale(1.06); }

.latest { padding: clamp(2rem, 5vw, 4rem) 0 clamp(3rem, 6vw, 5rem); }

/* ==========================================================================
   7. Popular topics band
   ========================================================================== */
.popular {
	position: relative; overflow: hidden; color: var(--paper-100);
	background-color: var(--forest-800); background-image: var(--contours), radial-gradient(1200px 500px at 85% -10%, rgba(227,171,62,.16), transparent 60%);
	padding: clamp(3rem, 7vw, 5.5rem) 0;
	border-radius: clamp(28px, 5vw, 64px) clamp(28px, 5vw, 64px) 0 0;
}
.popular + .site-footer, .popular--flush { border-radius: clamp(28px, 5vw, 64px) clamp(28px, 5vw, 64px) 0 0; }
.popular .kicker { color: var(--sun-400); }
.popular .section-head h2 { color: var(--paper-50); }
.popular .section-head h2 em { color: var(--sun-400); }
.popular .section-head p { margin: 0; max-width: 34ch; color: #c9d3c6; font-size: .97rem; }
.pop-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 1.5rem); list-style: none; margin: 0; padding: 0; counter-reset: pop; }
.pop-card {
	position: relative; display: flex; flex-direction: column; height: 100%;
	background: var(--paper-50); color: var(--forest-900); border-radius: var(--leaf); overflow: hidden;
	transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out);
}
.pop-grid > li:nth-child(even) .pop-card { border-radius: var(--leaf-alt); }
.pop-card:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: 0 22px 40px -22px rgba(0,0,0,.6); }
.pop-card .thumb { border-radius: 0; aspect-ratio: 16 / 10; }
.pop-card:hover .thumb img { transform: scale(1.05); }
.pop-card__link { display: flex; flex-direction: column; flex: 1; color: inherit; text-decoration: none; }
.pop-card__link:hover { color: inherit; }
.pop-card__link:focus-visible { box-shadow: inset 0 0 0 3px var(--clay-600); border-radius: inherit; }
.pop-card__body { position: relative; display: flex; flex-direction: column; gap: .4rem; flex: 1; padding: 1.1rem 1.15rem 1.25rem; }
.pop-card__num {
	position: absolute; top: -28px; right: 14px; width: 52px; height: 52px; border-radius: 50%;
	display: grid; place-items: center; background: var(--sun-400); color: var(--forest-900);
	font-family: var(--font-display); font-style: italic; font-weight: 500; font-size: 1.15rem; border: 3px solid var(--paper-50);
}
.pop-card__title { font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; line-height: 1.22; margin: 0; padding-right: 2.6rem; }
.pop-card__more { margin-top: auto; padding-top: .35rem; display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--clay-600); }
.pop-card__more svg { width: 16px; height: 16px; transition: transform .3s var(--ease-out); }
.pop-card:hover .pop-card__more svg { transform: translateX(4px); }
.pop-card__cat { position: absolute; top: 12px; left: 12px; z-index: 2; }

/* ==========================================================================
   8. Single / page
   ========================================================================== */
.read-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; background: linear-gradient(90deg, var(--clay-500), var(--sun-400)); transform-origin: 0 50%; transform: scaleX(0); }
.crumbs { font-size: var(--step--1); color: var(--color-muted); margin-bottom: 1.1rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: .4rem; color: var(--paper-300); }
.crumbs a { color: var(--moss-600); text-decoration: none; font-weight: 600; }
.crumbs a:hover { color: var(--clay-700); }

.entry-header { padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(1.25rem, 3vw, 2rem); }
.entry-title { font-size: var(--step-4); margin: .9rem 0 .8rem; max-width: 18ch; }
.page .entry-title { max-width: 22ch; }
.entry-dek { font-size: var(--step-1); line-height: 1.5; color: var(--stone-600); max-width: 60ch; font-family: var(--font-display); font-weight: 400; font-style: italic; }
.entry-media { margin-block: 0 clamp(2rem, 4vw, 3rem); }
.entry-media .thumb { aspect-ratio: 16 / 8; border-radius: 48px 48px 48px 12px; }
.entry-media figcaption { font-size: var(--step--1); color: var(--color-muted); margin-top: .6rem; }

.entry-content { font-size: clamp(1.05rem, 1rem + .25vw, 1.15rem); line-height: 1.75; }
.entry-content > * { margin-block: 0 1.25em; }
.entry-content h2 { font-size: var(--step-2); margin-top: 2em; }
.entry-content h3 { font-size: var(--step-1); margin-top: 1.7em; }
.entry-content > p:first-of-type::first-letter {
	float: left; font-family: var(--font-display); font-size: 4.1em; line-height: .82; padding: .06em .12em 0 0; color: var(--clay-600); font-weight: 600;
}
.entry-content a { color: var(--clay-700); text-decoration-thickness: 1.5px; }
.entry-content img, .entry-content .wp-block-image img { border-radius: 22px; height: auto; }
.entry-content blockquote {
	margin-inline: 0; padding: 1.25rem 1.5rem; border-left: 4px solid var(--sun-400); background: var(--paper-50); border-radius: 0 22px 22px 0;
	font-family: var(--font-display); font-style: italic; font-size: 1.15em;
}
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li::marker { color: var(--clay-500); }
.entry-content table { width: 100%; border-collapse: collapse; font-size: .95em; }
.entry-content th, .entry-content td { padding: .6rem .75rem; border-bottom: 1px solid var(--color-line); text-align: left; }
.entry-content .alignwide { width: min(100vw - 2 * var(--gutter), 1100px); margin-left: 50%; transform: translateX(-50%); max-width: none; }
.entry-content .alignfull { width: 100vw; margin-left: 50%; transform: translateX(-50%); max-width: none; }
.entry-content pre { overflow-x: auto; background: var(--forest-900); color: var(--paper-100); padding: 1rem 1.25rem; border-radius: 16px; font-size: .9em; }
.entry-content .wp-caption-text, .entry-content figcaption { font-size: var(--step--1); color: var(--color-muted); }
.alignleft { float: left; margin: .3em 1.5em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.5em; }
.aligncenter { margin-inline: auto; }

.ad-slot { margin: 2rem 0; text-align: center; }
.ad-slot:empty { display: none; }

.entry-footer { display: grid; gap: 1.5rem; margin: 2.5rem 0 3rem; }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.tag-chip { padding: .35em .85em; border: 1.5px solid var(--color-line); border-radius: var(--radius-pill); color: var(--forest-800); font-size: .85rem; font-weight: 600; text-decoration: none; }
.tag-chip:hover { border-color: var(--forest-800); background: var(--forest-800); color: var(--paper-50); }
.author-box { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 1rem; align-items: center; padding: 1.25rem; background: var(--paper-50); border-radius: var(--leaf); }
.author-box img { border-radius: 50%; }
.author-box h2 { font-size: 1.15rem; margin: 0 0 .2rem; }
.author-box p { margin: 0; color: var(--color-muted); font-size: .95rem; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 0 0 3rem; }
.post-nav a { display: block; height: 100%; padding: 1.1rem 1.25rem; border: 1.5px solid var(--color-line); border-radius: var(--leaf); color: var(--forest-900); text-decoration: none; transition: border-color .2s, background-color .2s; }
.post-nav a:hover { border-color: var(--moss-600); background: var(--paper-50); }
.post-nav span { display: block; font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--moss-600); }
.post-nav strong { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; line-height: 1.3; }
.post-nav .next { text-align: right; grid-column: 2; }

/* ==========================================================================
   9. Archive / search / 404
   ========================================================================== */
.archive-head { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(1.5rem, 4vw, 2.5rem); }
.archive-head h1 { font-size: var(--step-4); margin: 0 0 .5rem; }
.archive-head .desc { max-width: 60ch; color: var(--color-muted); }
.archive-head .search-form { max-width: 560px; margin-top: 1rem; }
.empty-state { padding: 2rem; background: var(--paper-50); border-radius: var(--leaf); }

.pagination { margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.pagination .page-numbers {
	display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 .9rem;
	border: 1.5px solid var(--color-line); border-radius: var(--radius-pill); color: var(--forest-900); text-decoration: none; font-weight: 600;
}
.pagination .page-numbers.current, .pagination a.page-numbers:hover { background: var(--forest-900); border-color: var(--forest-900); color: var(--paper-50); }

.notfound { padding: clamp(3rem, 8vw, 6rem) 0; text-align: center; }
.notfound__big { font-family: var(--font-display); font-style: italic; font-size: clamp(5rem, 16vw, 11rem); line-height: .9; color: var(--clay-500); margin: 0; }
.notfound .search-form { max-width: 520px; margin: 1.5rem auto 0; }

/* ==========================================================================
   10. Comments
   ========================================================================== */
.comments-area { padding: 0 0 clamp(3rem, 6vw, 4.5rem); }
.comments-title { font-size: var(--step-2); }
.comment-list, .comment-list .children { list-style: none; margin: 0; padding: 0; }
.comment-list .children { padding-left: clamp(1rem, 4vw, 2.5rem); border-left: 2px dashed var(--moss-300); }
.comment-body { padding: 1.1rem 0; border-bottom: 1px solid var(--color-line); }
.comment-head { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.comment-head img { border-radius: 50%; }
.comment-head b { font-weight: 700; }
.comment-permalink { font-size: var(--step--1); color: var(--color-muted); text-decoration: none; }
.comment-reply-link { display: inline-block; margin-top: .25rem; font-size: var(--step--1); font-weight: 700; color: var(--clay-600); }
.comment-form { display: grid; gap: 1rem; }
.comment-form label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .3rem; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; padding: .75rem 1rem; border: 1.5px solid var(--paper-300); border-radius: 14px; background: var(--paper-50);
}
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--moss-600); outline: none; box-shadow: 0 0 0 3px rgba(58,90,65,.18); }
.comment-form .submit { min-height: 48px; padding: .7rem 1.5rem; border: 0; border-radius: var(--radius-pill); background: var(--forest-900); color: var(--paper-50); font-weight: 700; cursor: pointer; }
.comment-form .submit:hover { background: var(--clay-600); }
.comment-form-cookies-consent { display: flex; gap: .5rem; align-items: start; }
.comment-form-cookies-consent label { font-weight: 400; }

/* ==========================================================================
   11. Footer
   ========================================================================== */
.site-footer { position: relative; overflow: hidden; background: var(--forest-900); color: #c9d3c6; padding: clamp(3rem, 6vw, 4.5rem) 0 1.75rem; }
.popular + .site-footer { border-radius: 0; }
.popular + .site-footer::before { content: ""; position: absolute; left: var(--gutter); right: var(--gutter); top: 0; border-top: 1px solid rgba(255,255,255,.1); }
.site-footer a { color: var(--paper-100); }
.site-footer a:hover { color: var(--sun-400); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 2rem 3rem; align-items: start; }
.site-footer .brand { color: var(--paper-50); }
.site-footer .brand__word i { color: var(--sun-400); }
.footer-about { max-width: 46ch; margin: 1rem 0 0; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem 1.5rem; }
.footer-nav a { display: inline-flex; min-height: 40px; align-items: center; text-decoration: none; font-weight: 600; }
.footer-word {
	margin: clamp(2rem, 5vw, 3rem) 0 1rem; font-family: var(--font-display); font-weight: 600; letter-spacing: -.04em; line-height: .85;
	font-size: clamp(3.5rem, 15vw, 13rem); color: transparent; -webkit-text-stroke: 1px rgba(243,238,227,.22); white-space: nowrap; user-select: none;
}
.footer-word i { font-weight: 500; -webkit-text-stroke-color: rgba(227,171,62,.5); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,.1); font-size: var(--step--1); }
.to-top { white-space: nowrap; display: inline-flex; align-items: center; gap: .4rem; text-decoration: none; font-weight: 700; }

/* ==========================================================================
   12. Motion
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
	.reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   13. Responsive
   ========================================================================== */
@media (max-width: 1080px) {
	.pop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.hero__grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
	.menu-toggle { display: inline-grid; }
	.site-nav { position: absolute; left: 0; right: 0; top: 100%; margin: 0; padding: .75rem var(--gutter) 1.25rem; background: var(--paper-100); border-bottom: 1px solid var(--color-line); display: none; }
	.site-nav.is-open { display: block; }
	.site-nav ul { flex-direction: column; align-items: stretch; }
	.site-nav a { width: 100%; border-radius: 12px; }
	.site-nav .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; background: transparent; padding: 0 0 0 1rem; }
	.header-actions { margin-left: auto; }
	.footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
	.grid { grid-template-columns: 1fr; }
	.card .thumb { aspect-ratio: 16 / 10; }
	.lead__body { margin: -40px 10px 0; }
	.lead__badge { width: 84px; height: 84px; font-size: .8rem; right: 6px; }
	.section-head { flex-direction: column; align-items: start; }
	.pop-grid { grid-template-columns: 1fr; }
	.pop-card__link { flex-direction: row; }
	.pop-card .thumb { width: 38%; flex-shrink: 0; aspect-ratio: auto; min-height: 120px; }
	.pop-card__num { position: static; width: 34px; height: 34px; font-size: .9rem; border-width: 0; }
	.pop-card__title { padding-right: 0; font-size: 1.02rem; }
	.pop-card__cat { display: none; }
	.pop-card__more { display: none; }
	.post-nav { grid-template-columns: 1fr; }
	.post-nav .next { grid-column: auto; }
	.footer-nav ul { grid-template-columns: 1fr; }
	.entry-media .thumb { aspect-ratio: 4 / 3; border-radius: 28px 28px 28px 8px; }
}
@media print {
	.site-header, .popular, .site-footer, .comments-area, .post-nav, .read-progress, .ad-slot { display: none !important; }
	body { background: #fff; }
}
