/* ==========================================================================
   Tramelovixa — public site stylesheet
   Calm editorial wellness design: sage green, warm cream & beige, clay accent.
   ========================================================================== */

/* Fonts (self-hosted, SIL Open Font License) */
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-wght-italic.woff2") format("woff2");
  font-weight: 300 900; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("../fonts/public-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("../fonts/public-sans-latin-wght-italic.woff2") format("woff2");
  font-weight: 100 900; font-style: italic; font-display: swap;
}

/* Design tokens ------------------------------------------------------------ */
:root {
  --bg: #FBF8F2;
  --bg-tint: #F3EDE1;
  --surface: #FFFFFF;
  --surface-2: #F7F2E8;
  --ink: #1F2A24;
  --ink-soft: #3A4740;
  --muted: #5E6A63;
  --line: #E5DCCB;
  --line-strong: #D3C7B0;
  --primary: #3F6B4F;
  --primary-hover: #345B42;
  --primary-ink: #FFFFFF;
  --primary-soft: #E2ECE2;
  --primary-softer: #EEF4ED;
  --accent: #B85F3C;
  --accent-soft: #F5E2D6;
  --gold: #C9A45C;
  --focus: #2E6A8F;
  --success-bg: #E5F1E6; --success-ink: #24563A;
  --error-bg: #F9E5E0; --error-ink: #8A2E1C;
  --shadow-sm: 0 1px 2px rgba(31, 42, 36, .06), 0 1px 1px rgba(31, 42, 36, .04);
  --shadow-md: 0 10px 30px -12px rgba(31, 42, 36, .22);
  --brand-mark-bg: #3F6B4F;
  --brand-mark-fg: #FBF8F2;
  --brand-mark-accent: #E7C98F;

  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --container: 1180px;
  --narrow: 760px;
  --gutter: clamp(16px, 4vw, 32px);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #111714;
  --bg-tint: #161E1A;
  --surface: #19221D;
  --surface-2: #1E2823;
  --ink: #E9EEEA;
  --ink-soft: #CBD5CF;
  --muted: #A3B0A8;
  --line: #2C3832;
  --line-strong: #3B4942;
  --primary: #8EC09C;
  --primary-hover: #A5D0B1;
  --primary-ink: #0F1A13;
  --primary-soft: #22332A;
  --primary-softer: #1C2A23;
  --accent: #E39B7B;
  --accent-soft: #3A2A22;
  --gold: #D8B978;
  --focus: #8CC6EA;
  --success-bg: #1E3326; --success-ink: #A9DDB8;
  --error-bg: #3A2320; --error-ink: #F3B4A6;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-md: 0 14px 34px -14px rgba(0, 0, 0, .6);
  --brand-mark-bg: #8EC09C;
  --brand-mark-fg: #111714;
  --brand-mark-accent: #E7C98F;
  color-scheme: dark;
}

/* Base --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 90px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 560; line-height: 1.18; color: var(--ink); letter-spacing: -.01em; font-variation-settings: "SOFT" 50, "opsz" 72; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 600; }
.skip-link:focus { top: 12px; color: var(--bg); }
main:focus { outline: none; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.container--narrow { max-width: calc(var(--narrow) + 2 * var(--gutter)); }

.eyebrow { font-size: .78rem; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 .5rem; }

/* Buttons ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 46px; padding: .7em 1.35em; border-radius: 999px; border: 1px solid transparent;
  background: var(--primary); color: var(--primary-ink); font-weight: 600; font-size: .98rem;
  text-decoration: none; cursor: pointer; transition: background-color .15s ease, transform .15s ease;
}
.btn:hover { background: var(--primary-hover); color: var(--primary-ink); }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn--light { background: var(--bg); color: var(--ink); }
.btn--light:hover { background: var(--surface); color: var(--ink); }
.link-button { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; text-underline-offset: .18em; cursor: pointer; font-size: inherit; }
.icon-button {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
}
.icon-button:hover { background: var(--surface-2); }

/* Header ------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) { .site-header { background: var(--bg); } }
.header-inner { display: flex; align-items: center; gap: 20px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand:hover { color: var(--ink); }
.brand__mark { flex-shrink: 0; }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font-family: var(--font-display); font-size: 1.42rem; font-weight: 600; letter-spacing: -.015em; font-variation-settings: "SOFT" 100, "opsz" 60; }
.brand__tagline { font-size: .72rem; color: var(--muted); letter-spacing: .04em; margin-top: 3px; }

.primary-nav { margin-left: auto; display: flex; align-items: center; }
.primary-nav__list { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.primary-nav__list > li > a, .topics-menu > summary {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 999px;
  color: var(--ink-soft); text-decoration: none; font-weight: 550; font-size: .97rem; cursor: pointer; list-style: none;
}
.topics-menu > summary::-webkit-details-marker { display: none; }
.primary-nav__list > li > a:hover, .topics-menu > summary:hover { background: var(--surface-2); color: var(--ink); }
.primary-nav__list > li > a[aria-current="page"], .topics-menu > summary[aria-current] { color: var(--primary); background: var(--primary-softer); }
.topics-menu { position: relative; }
.topics-menu[open] > summary svg { transform: rotate(180deg); }
.topics-panel {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%); width: min(640px, 92vw);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 10px;
}
.topics-panel ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.topics-panel a { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.topics-panel a:hover { background: var(--primary-softer); }
.topics-panel strong { display: block; font-weight: 600; font-size: .95rem; }
.topics-panel small { display: block; color: var(--muted); font-size: .82rem; line-height: 1.4; margin-top: 2px; }
.topics-panel__icon { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; background: var(--primary-soft); color: var(--primary); }
.nav-search { display: none; }

.header-actions { display: flex; align-items: center; gap: 8px; }
.header-search { position: relative; display: flex; align-items: center; }
.header-search input {
  width: 190px; height: 42px; padding: 0 40px 0 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-size: .92rem; transition: width .2s ease, border-color .2s ease;
}
.header-search input:focus { width: 240px; border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
.header-search button { position: absolute; right: 4px; width: 34px; height: 34px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.theme-toggle__sun { display: none; }
[data-theme="dark"] .theme-toggle__sun { display: block; }
[data-theme="dark"] .theme-toggle__moon { display: none; }
.no-js .theme-toggle { display: none; }
.menu-toggle { display: none; }

@media (max-width: 1080px) {
  .header-search { display: none; }
}
@media (max-width: 900px) {
  .brand__tagline { display: none; }
  .js .menu-toggle { display: inline-grid; }
  .header-actions { margin-left: auto; }
  .primary-nav { order: 3; }
  .js .primary-nav {
    position: fixed; inset: 72px 0 auto 0; max-height: calc(100vh - 72px); overflow-y: auto;
    background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md);
    padding: 12px var(--gutter) 22px; display: none; flex-direction: column; align-items: stretch;
  }
  .js .primary-nav.is-open { display: flex; }
  .primary-nav__list { flex-direction: column; align-items: stretch; gap: 2px; }
  .primary-nav__list > li > a, .topics-menu > summary { width: 100%; padding: 12px 14px; border-radius: 12px; font-size: 1.02rem; }
  .topics-panel { position: static; transform: none; width: 100%; box-shadow: none; border: 0; padding: 4px 0 8px 8px; background: transparent; }
  .topics-panel ul { grid-template-columns: 1fr; }
  .nav-search { display: flex; gap: 8px; margin-top: 12px; }
  .nav-search input { flex: 1; min-width: 0; height: 46px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); padding: 0 16px; }
  .nav-search button { height: 46px; border-radius: 999px; border: 0; padding: 0 18px; background: var(--primary); color: var(--primary-ink); font-weight: 600; }
  /* Without JavaScript the menu simply wraps below the logo. */
  .no-js .header-inner { flex-wrap: wrap; padding-bottom: 10px; }
  .no-js .primary-nav { width: 100%; flex-direction: column; align-items: stretch; margin: 0; }
}

/* Sections ----------------------------------------------------------------- */
.section { padding: clamp(44px, 7vw, 84px) 0; }
.section--tight { padding: clamp(24px, 4vw, 44px) 0 clamp(44px, 6vw, 72px); }
.section--tinted { background: var(--bg-tint); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section-title { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0; }
.section-link { font-weight: 600; text-decoration: none; white-space: nowrap; }
.section-link:hover { text-decoration: underline; }

/* Home intro --------------------------------------------------------------- */
.home-intro {
  position: relative; overflow: hidden;
  padding: clamp(44px, 7vw, 88px) 0 clamp(28px, 4vw, 44px);
  background:
    radial-gradient(60% 80% at 92% 10%, var(--primary-soft) 0%, transparent 60%),
    radial-gradient(40% 70% at 5% 100%, var(--accent-soft) 0%, transparent 65%);
}
.home-intro__inner { max-width: 860px; text-align: center; }
.home-intro__title { font-size: clamp(2.2rem, 5.4vw, 3.9rem); margin: 0 0 .4em; font-weight: 520; line-height: 1.08; font-variation-settings: "SOFT" 100, "opsz" 144; }
.home-intro__title em { font-style: italic; color: var(--primary); font-weight: 480; }
.home-intro__lede { font-size: clamp(1.05rem, 1.8vw, 1.22rem); color: var(--ink-soft); max-width: 640px; margin: 0 auto 1.6em; }
.home-search { display: flex; gap: 8px; max-width: 520px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px; box-shadow: var(--shadow-sm); }
.home-search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0 16px; font-size: 1rem; }
.home-search input:focus { outline: none; }
.home-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.home-search--page { margin: 20px 0 0; }

/* Cards -------------------------------------------------------------------- */
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s ease, transform .2s ease; }
.card:hover { box-shadow: var(--shadow-md); }
@media (prefers-reduced-motion: no-preference) { .card:hover { transform: translateY(-2px); } }
.card__media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card__title { font-size: 1.22rem; margin: 10px 0 8px; line-height: 1.25; }
.card__title a { color: var(--ink); text-decoration: none; }
.card__title a:hover { color: var(--primary); }
.card__title a::after { content: ""; } /* keeps tag link clickable separately */
.card__excerpt { color: var(--muted); font-size: .96rem; margin: 0 0 14px; }
.card__meta { margin: auto 0 0; font-size: .83rem; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  align-self: flex-start; display: inline-block; font-size: .74rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase;
  color: var(--primary); background: var(--primary-softer); border: 1px solid var(--primary-soft); padding: 4px 10px; border-radius: 999px; text-decoration: none;
}
.tag:hover { background: var(--primary-soft); color: var(--primary); }

.card--hero { height: 100%; }
.card--hero .card__body { padding: 24px 28px 28px; }
.card--hero .card__title { font-size: clamp(1.6rem, 3vw, 2.25rem); line-height: 1.15; margin: 14px 0 12px; }
.card--hero .card__excerpt { font-size: 1.05rem; }

.card--compact { flex-direction: row; align-items: stretch; }
.card--compact .card__media { width: 38%; flex-shrink: 0; aspect-ratio: auto; }
.card--compact .card__body { padding: 14px 16px; }
.card--compact .card__title { font-size: 1.05rem; margin: 8px 0 6px; }
.card--compact .tag { font-size: .66rem; padding: 3px 8px; }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 1000px) { .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .card-grid { grid-template-columns: 1fr; } }

.feature-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 24px; }
.feature-grid__side { display: flex; flex-direction: column; gap: 14px; }
.side-label { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; margin: 0 0 2px; }
@media (max-width: 900px) { .feature-grid { grid-template-columns: 1fr; } }
@media (max-width: 460px) { .card--compact .card__media { width: 34%; } .card--compact .card__meta { display: none; } }

/* Topic tiles -------------------------------------------------------------- */
.topic-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1000px) { .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .topic-grid { grid-template-columns: 1fr; } }
.topic-card a {
  display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 22px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: border-color .2s ease, box-shadow .2s ease;
}
.topic-card a:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); color: var(--ink); }
.topic-card__icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; margin-bottom: 8px; background: var(--primary-soft); color: var(--primary); }
.topic-card--2 .topic-card__icon { background: var(--accent-soft); color: var(--accent); }
.topic-card--3 .topic-card__icon { background: color-mix(in srgb, var(--gold) 22%, var(--surface)); color: color-mix(in srgb, var(--gold) 70%, var(--ink)); }
.topic-card--4 .topic-card__icon { background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line); }
.topic-card__name { font-family: var(--font-display); font-weight: 600; font-size: 1.14rem; line-height: 1.25; }
.topic-card__desc { color: var(--muted); font-size: .9rem; line-height: 1.5; }
.topic-card__count { margin-top: auto; padding-top: 8px; font-size: .8rem; font-weight: 600; color: var(--primary); }

/* Popular + approach ------------------------------------------------------- */
.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.popular .section-title { margin-bottom: 18px; }
.popular-list { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.popular-list li { display: flex; gap: 18px; padding: 18px 0; border-top: 1px solid var(--line); }
.popular-list li:last-child { border-bottom: 1px solid var(--line); }
.popular-list__num { font-family: var(--font-display); font-size: 1.9rem; font-weight: 400; color: var(--accent); line-height: 1; min-width: 44px; font-variation-settings: "SOFT" 100, "opsz" 144; }
.popular-list__title { display: block; font-family: var(--font-display); font-size: 1.2rem; font-weight: 560; line-height: 1.3; color: var(--ink); text-decoration: none; }
.popular-list__title:hover { color: var(--primary); text-decoration: underline; }
.popular-list__meta { display: block; margin-top: 4px; font-size: .85rem; color: var(--muted); }
.approach { background: var(--primary); color: var(--primary-ink); border-radius: var(--radius-lg); padding: clamp(24px, 4vw, 36px); }
[data-theme="dark"] .approach { background: var(--primary-soft); color: var(--ink); }
.approach__title { color: inherit; font-size: 1.6rem; margin: 0 0 14px; }
.approach__list { list-style: none; padding: 0; margin: 0 0 20px; }
.approach__list li { padding: 12px 0; border-top: 1px solid rgba(255, 255, 255, .22); font-size: .97rem; line-height: 1.55; }
[data-theme="dark"] .approach__list li { border-top-color: var(--line); }
.approach .section-link { color: inherit; text-decoration: underline; }

/* Topic columns ------------------------------------------------------------ */
.topic-columns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 1000px) { .topic-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .topic-columns { grid-template-columns: 1fr; } }
.topic-column { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 20px 18px; display: flex; flex-direction: column; }
.topic-column__title { font-size: 1.08rem; margin: 0 0 10px; }
.topic-column__title a { display: flex; gap: 8px; align-items: center; color: var(--ink); text-decoration: none; }
.topic-column__title svg { color: var(--primary); width: 20px; height: 20px; flex-shrink: 0; }
.topic-column ul { list-style: none; margin: 0 0 12px; padding: 0; }
.topic-column li { padding: 8px 0; border-top: 1px dashed var(--line); font-size: .93rem; line-height: 1.4; }
.topic-column li a { color: var(--ink-soft); text-decoration: none; }
.topic-column li a:hover { color: var(--primary); text-decoration: underline; }
.topic-column__more { margin-top: auto; font-size: .86rem; font-weight: 600; text-decoration: none; }

/* Follow band -------------------------------------------------------------- */
.follow-band { display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: clamp(24px, 4vw, 40px); border-radius: var(--radius-lg); background: var(--ink); color: var(--bg); }
.follow-band__title { color: inherit; font-size: clamp(1.35rem, 2.6vw, 1.75rem); margin: 0 0 .35em; }
.follow-band p { margin: 0; opacity: .85; max-width: 560px; }
[data-theme="dark"] .follow-band { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }

/* Breadcrumbs -------------------------------------------------------------- */
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 18px; font-size: .85rem; color: var(--muted); }
.breadcrumbs li { display: inline-flex; gap: 6px; align-items: center; }
.breadcrumbs li + li::before { content: "/"; color: var(--line-strong); }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--primary); text-decoration: underline; }
.breadcrumbs [aria-current] { color: var(--ink-soft); max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Article ------------------------------------------------------------------ */
.article-header { padding-top: clamp(28px, 5vw, 56px); padding-bottom: 28px; }
.article-title { font-size: clamp(2rem, 4.6vw, 3.1rem); margin: 16px 0 14px; font-weight: 540; line-height: 1.1; font-variation-settings: "SOFT" 80, "opsz" 144; }
.article-dek { font-size: clamp(1.08rem, 2vw, 1.26rem); color: var(--ink-soft); line-height: 1.55; margin: 0 0 20px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .9rem; color: var(--muted); padding-top: 16px; border-top: 1px solid var(--line); }
.article-meta a { color: var(--ink-soft); font-weight: 600; text-decoration: none; }
.article-meta a:hover { text-decoration: underline; }
.article-hero { margin: 0 auto clamp(28px, 5vw, 48px); max-width: 1140px; }
@media (max-width: 700px) { .article-hero img { aspect-ratio: 16 / 9; } }
.article-hero img { width: 100%; border-radius: var(--radius-lg); aspect-ratio: 2 / 1; object-fit: cover; background: var(--surface-2); }
.article-hero figcaption, .prose figcaption { font-size: .86rem; color: var(--muted); margin-top: 10px; text-align: center; }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(32px, 5vw, 64px); align-items: start; padding-bottom: clamp(48px, 7vw, 80px); }
.article-main { max-width: var(--narrow); min-width: 0; }
@media (max-width: 1000px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-main { margin: 0 auto; width: 100%; }
  .article-sidebar { max-width: var(--narrow); margin: 0 auto; width: 100%; }
}

.toc { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 32px; }
.toc summary { font-weight: 650; cursor: pointer; font-size: .95rem; }
.toc ol { margin: 10px 0 0; padding-left: 22px; font-size: .95rem; }
.toc li { margin: 6px 0; }
.toc a { color: var(--ink-soft); text-decoration: none; }
.toc a:hover { color: var(--primary); text-decoration: underline; }

/* Long-form typography */
.prose { font-size: 1.1rem; line-height: 1.75; color: var(--ink-soft); }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.25em; }
.prose h2 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); margin: 1.9em 0 .6em; color: var(--ink); }
.prose h3 { font-size: clamp(1.18rem, 2vw, 1.35rem); margin: 1.6em 0 .5em; color: var(--ink); font-weight: 600; }
.prose h4 { font-family: var(--font-body); font-size: 1.02rem; font-weight: 700; margin: 1.4em 0 .4em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.35em; }
.prose li { margin: .45em 0; padding-left: .2em; }
.prose li::marker { color: var(--primary); }
.prose strong { color: var(--ink); font-weight: 650; }
.prose a { font-weight: 500; }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--accent); font-family: var(--font-display); font-size: 1.25rem; font-style: italic; color: var(--ink); }
.prose img { border-radius: var(--radius); margin: 1.5em auto; }
.prose figure { margin: 1.8em 0; }
.prose figure img { margin: 0 auto; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .96rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); color: var(--ink); }
.prose .callout, .prose aside.tip {
  background: var(--primary-softer); border: 1px solid var(--primary-soft); border-radius: var(--radius); padding: 18px 20px; margin: 1.6em 0; font-size: 1rem;
}
.prose .callout > :last-child { margin-bottom: 0; }
.prose .callout strong:first-child { display: block; font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 4px; }

.note-box { display: flex; gap: 14px; align-items: flex-start; background: var(--accent-soft); border-radius: var(--radius); padding: 18px 20px; margin: 36px 0 28px; color: var(--ink-soft); font-size: .95rem; }
.note-box svg { flex-shrink: 0; color: var(--accent); margin-top: 2px; }
.note-box p { margin: 0; }

.sources { border-top: 1px solid var(--line); padding-top: 22px; margin-top: 28px; }
.sources__title { font-size: 1.2rem; margin: 0 0 10px; }
.sources ol { padding-left: 1.3em; margin: 0; font-size: .92rem; color: var(--muted); }
.sources li { margin: 6px 0; }
.sources a { overflow-wrap: anywhere; }

.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 28px 0; }
.share__label { font-size: .85rem; font-weight: 650; color: var(--muted); margin-right: 4px; text-transform: uppercase; letter-spacing: .08em; }
.share__link { display: inline-block; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); font-size: .86rem; text-decoration: none; cursor: pointer; }
.share__link:hover { border-color: var(--primary); color: var(--primary); }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 24px; }
.post-nav__item { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 560; line-height: 1.3; background: var(--surface); }
.post-nav__item span { display: block; font-family: var(--font-body); font-size: .78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.post-nav__item:hover { border-color: var(--primary); color: var(--primary); }
.post-nav__item--next { text-align: right; grid-column: 2; }
@media (max-width: 600px) { .post-nav { grid-template-columns: 1fr; } .post-nav__item--next { grid-column: auto; text-align: left; } }

.article-sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 92px; }
@media (max-width: 1000px) { .article-sidebar { position: static; } }
.sidebar-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.sidebar-box__title { font-size: 1.05rem; margin: 0 0 12px; }
.sidebar-links { list-style: none; margin: 0; padding: 0; }
.sidebar-links li + li { border-top: 1px solid var(--line); }
.sidebar-links a { display: flex; gap: 12px; align-items: center; padding: 10px 0; color: var(--ink); text-decoration: none; font-size: .92rem; line-height: 1.35; font-weight: 550; }
.sidebar-links a:hover { color: var(--primary); }
.sidebar-links__thumb { width: 64px; height: 48px; flex-shrink: 0; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.sidebar-links__thumb img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-topics { list-style: none; margin: 0; padding: 0; }
.sidebar-topics a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; color: var(--ink-soft); text-decoration: none; font-size: .92rem; }
.sidebar-topics a svg { width: 18px; height: 18px; color: var(--primary); flex-shrink: 0; }
.sidebar-topics a span { flex: 1; }
.sidebar-topics a small { color: var(--muted); font-size: .8rem; }
.sidebar-topics a:hover, .sidebar-topics a[aria-current] { background: var(--primary-softer); color: var(--ink); }

/* Ads (only rendered when enabled by the site owner) ------------------------ */
.ad-slot { margin: 36px 0; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; min-height: 120px; }
.ad-label { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 8px; }
.ad-slot--sidebar { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-height: 280px; }
.consent-pending .ad-slot, .consent-declined .ad-slot { display: none; }

/* Listings ----------------------------------------------------------------- */
.listing-header { padding: clamp(32px, 5vw, 60px) 0 8px; background: linear-gradient(180deg, var(--bg-tint), var(--bg)); }
.listing-header__icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); margin-bottom: 14px; }
.listing-header__icon svg { width: 28px; height: 28px; }
.page-title { font-size: clamp(2rem, 4.4vw, 3rem); margin: 0 0 14px; font-weight: 540; font-variation-settings: "SOFT" 80, "opsz" 144; }
.listing-header__intro { max-width: 760px; color: var(--ink-soft); font-size: 1.08rem; }
.listing-header__intro.prose p:last-child { margin-bottom: 0; }
.chip-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 24px 0 0; }
.chip-list--center { justify-content: center; }
.chip { display: inline-block; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); font-size: .88rem; text-decoration: none; font-weight: 550; }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.is-active { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.result-summary { color: var(--muted); font-size: .92rem; margin: 0 0 20px; }
.empty-state { text-align: center; padding: 48px 20px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); }
.empty-state h2 { margin-top: 0; }

.pagination { margin-top: 40px; }
.pagination ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 0; margin: 0; }
.pagination a, .pagination span { display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: .92rem; }
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .is-current { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.pagination .pagination__gap { border: 0; background: transparent; }

/* Static pages / contact --------------------------------------------------- */
.page-header { padding-top: clamp(32px, 5vw, 60px); padding-bottom: 12px; }
.page-updated { color: var(--muted); font-size: .9rem; margin: 0 0 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.static-page { padding-bottom: clamp(48px, 7vw, 80px); }
.contact-layout { padding-bottom: clamp(48px, 7vw, 80px); }
.contact-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(20px, 4vw, 36px); margin-top: 12px; }
.form .field { margin-bottom: 18px; }
.form label { display: block; font-weight: 600; font-size: .94rem; margin-bottom: 6px; }
.form input[type="text"], .form input[type="email"], .form select, .form textarea {
  width: 100%; border: 1px solid var(--line-strong); background: var(--bg); border-radius: 10px; padding: 12px 14px; font-size: 1rem;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.form-row--2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 600px) { .form-row--2 { grid-template-columns: 1fr; } }
.field-help { font-size: .86rem; color: var(--muted); margin: 6px 0 16px; }
.form-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alert { border-radius: var(--radius); padding: 14px 18px; margin-bottom: 20px; font-size: .96rem; }
.alert ul { margin: 6px 0 0; padding-left: 1.2em; }
.alert--success { background: var(--success-bg); color: var(--success-ink); }
.alert--error { background: var(--error-bg); color: var(--error-ink); }

.notfound { text-align: center; }
.notfound__text { font-size: 1.1rem; color: var(--ink-soft); }
.notfound .home-search { margin: 24px auto; }
.notfound .chip-list { margin-bottom: 28px; }

.preview-banner { background: var(--gold); color: #1F2A24; text-align: center; padding: 10px var(--gutter); font-weight: 600; font-size: .92rem; }
.preview-banner a { color: #1F2A24; margin-left: 10px; }

/* Footer ------------------------------------------------------------------- */
.site-footer { background: var(--bg-tint); border-top: 1px solid var(--line); padding: clamp(40px, 6vw, 64px) 0 24px; font-size: .94rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand p { color: var(--ink-soft); max-width: 420px; margin-top: 14px; }
.footer-note { font-size: .86rem; color: var(--muted) !important; }
.footer-heading { font-family: var(--font-body); font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 6px 0 14px; font-weight: 700; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 8px 0; }
.footer-col a, .footer-col .link-button { color: var(--ink-soft); text-decoration: none; font-size: .94rem; }
.footer-col a:hover, .footer-col .link-button:hover { color: var(--primary); text-decoration: underline; }
.footer-bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; color: var(--muted); font-size: .84rem; }
.footer-bottom p { margin: 0; }

/* Consent banner ------------------------------------------------------------ */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; display: flex; justify-content: center; }
.consent[hidden] { display: none; }
.consent__inner { max-width: 760px; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 16px 20px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: space-between; font-size: .92rem; }
.consent__inner p { margin: 0; flex: 1 1 320px; }
.consent__actions { display: flex; gap: 8px; }
.consent .btn { min-height: 40px; padding: .5em 1.1em; }

/* Print -------------------------------------------------------------------- */
@media print {
  .site-header, .site-footer, .article-sidebar, .share, .post-nav, .ad-slot, .consent, .toc, .section--tinted { display: none !important; }
  body { background: #fff; color: #000; }
  .article-layout { display: block; }
}
