/**
 * Fonts99 Blog — Design System
 * blog.fonts99.com
 *
 * Pairing: Fraunces (display/brand) + Source Serif 4 (body/UI)
 * Load in <head>:
 * <link rel="preconnect" href="https://fonts.googleapis.com">
 * <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
 * <link href="https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Source+Serif+4:opsz,wght@8..60,400;8..60,500;8..60,600;8..60,700&display=swap" rel="stylesheet">
 */

/* ==========================================================================
   1. Custom properties
   ========================================================================== */

:root {
  /* Brand — deep teal / ink + warm sand */
  --color-ink: #0b3d4a;
  --color-ink-deep: #072c36;
  --color-ink-soft: #165566;
  --color-sand: #c9a66b;
  --color-sand-deep: #a8844a;
  --color-sand-soft: #e6d5b5;
  --color-paper: #f8f6f2;
  --color-paper-warm: #f2efe8;
  --color-surface: #fffcf8;
  --color-muted: #5c6f76;
  --color-muted-soft: #7a8d94;
  --color-border: rgba(11, 61, 74, 0.12);
  --color-border-strong: rgba(11, 61, 74, 0.22);
  --color-focus: #0b3d4a;
  --color-link: #0b3d4a;
  --color-link-hover: #165566;
  --color-success: #2a6b4f;
  --color-overlay: rgba(7, 44, 54, 0.45);

  /* Type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-opsz-display: "opsz" 144;
  --font-opsz-body: "opsz" 14;

  --text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.84rem + 0.2vw, 0.9375rem);
  --text-base: clamp(1.0625rem, 1.02rem + 0.25vw, 1.125rem);
  --text-md: clamp(1.125rem, 1.06rem + 0.35vw, 1.25rem);
  --text-lg: clamp(1.35rem, 1.2rem + 0.7vw, 1.625rem);
  --text-xl: clamp(1.75rem, 1.45rem + 1.4vw, 2.375rem);
  --text-2xl: clamp(2.25rem, 1.75rem + 2.2vw, 3.25rem);
  --text-hero: clamp(2.5rem, 1.9rem + 2.8vw, 3.75rem);

  --leading-tight: 1.15;
  --leading-snug: 1.3;
  --leading-normal: 1.55;
  --leading-relaxed: 1.7;
  --leading-article: 1.75;

  --tracking-tight: -0.02em;
  --tracking-display: -0.025em;
  --tracking-wide: 0.04em;

  /* Space */
  --space-3xs: 0.25rem;
  --space-2xs: 0.375rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 2.75rem;
  --space-3xl: 4rem;
  --space-4xl: 5.5rem;
  --space-5xl: 7.5rem;

  /* Layout */
  --measure: 42rem;          /* ~672px reading column */
  --measure-wide: 46rem;     /* ~736px */
  --shell: 72rem;            /* ~1152px site max */
  --shell-narrow: 48rem;
  --gutter: clamp(1rem, 4vw, 1.75rem);
  --header-height: 3.75rem;

  /* Radii — restrained, not pill-like */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 150ms;
  --duration: 220ms;

  /* Elevation — single soft shadow only when needed */
  --shadow-soft: 0 1px 2px rgba(7, 44, 54, 0.06);

  /* Atmosphere */
  --gradient-paper:
    radial-gradient(120% 80% at 0% 0%, rgba(201, 166, 107, 0.14) 0%, transparent 55%),
    radial-gradient(90% 70% at 100% 10%, rgba(11, 61, 74, 0.07) 0%, transparent 50%),
    linear-gradient(180deg, var(--color-paper) 0%, var(--color-paper-warm) 100%);
  --texture-paper:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

/* ==========================================================================
   2. Reset / base
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--space-md);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-optical-sizing: auto;
  font-size: var(--text-base);
  font-weight: 400;
  line-height: var(--leading-normal);
  color: var(--color-ink-deep);
  background-color: var(--color-paper);
  background-image: var(--texture-paper), var(--gradient-paper);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

img {
  border-style: none;
}

figure {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

a {
  color: var(--color-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--color-link-hover);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

:focus:not(:focus-visible) {
  outline: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-variation-settings: var(--font-opsz-display);
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  color: var(--color-ink);
  text-wrap: balance;
}

p,
ul,
ol,
dl,
blockquote {
  margin: 0;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

address {
  font-style: normal;
}

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--space-2xl) 0;
}

/* ==========================================================================
   3. Typography utilities
   ========================================================================== */

.u-display {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-variation-settings: var(--font-opsz-display);
  letter-spacing: var(--tracking-display);
}

.u-eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-sand-deep);
}

.u-lede {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--color-muted);
  max-width: 36rem;
}

.u-meta {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.u-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   4. Layout shells
   ========================================================================== */

.site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

.shell--narrow {
  width: min(100% - (var(--gutter) * 2), var(--shell-narrow));
}

.shell--measure {
  width: min(100% - (var(--gutter) * 2), var(--measure-wide));
}

/* --- Above-header ad zone (F99_blog — in-flow) --- */
.ad-zone--blog {
  display: flex;
  justify-content: center;
  padding: var(--space-sm) var(--gutter);
  background: linear-gradient(180deg, rgba(255, 252, 248, 0.9), transparent);
}

/*
 * Sticky ad overlays (F99_header / f99_footer)
 * - position:fixed only — NOT in document flow
 * - visually collapsed until GPT fills (no empty white gap)
 * - site header is NOT sticky and scrolls away normally
 */
.ad-overlay {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
  line-height: 0;
  /* Collapsed by default — zero visual footprint */
  max-height: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
}

.ad-overlay--header {
  top: 0;
}

.ad-overlay--footer {
  bottom: 0;
}

.ad-overlay.is-filled {
  max-height: none;
  overflow: visible;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  background: color-mix(in srgb, var(--color-surface) 94%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ad-overlay--header.is-filled {
  padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 1px solid var(--color-border);
}

.ad-overlay--footer.is-filled {
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-top: 1px solid var(--color-border);
}

/* Hide sticky ad bars while custom interstitial overlay is open */
html.has-interstitial .ad-overlay--header,
html.has-interstitial .ad-overlay--footer {
  visibility: hidden;
  pointer-events: none;
}

/* Custom closable interstitial overlay (NOT Google OOP INTERSTITIAL) */
.f99-ad-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.f99-ad-overlay[hidden] {
  display: none !important;
}

.f99-ad-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 44, 54, 0.55);
  cursor: pointer;
}

.f99-ad-overlay__panel {
  position: relative;
  z-index: 1;
  width: min(96vw, 360px);
  max-height: min(92vh, 720px);
  overflow: auto;
  background: var(--color-surface, #fffcf8);
  border: 1px solid var(--color-border, rgba(11, 61, 74, 0.12));
  border-radius: var(--radius-md, 0.375rem);
  box-shadow: 0 12px 40px rgba(7, 44, 54, 0.28);
  padding: 2.25rem 0.75rem 0.75rem;
}

.f99-ad-overlay__label {
  margin: 0 0 0.5rem;
  text-align: center;
  font-size: var(--text-xs, 0.75rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-muted, #5c6f76);
}

.f99-ad-overlay__close {
  position: absolute;
  top: 0.25rem;
  right: 0.35rem;
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: var(--radius-md, 0.375rem);
  background: transparent;
  color: var(--color-ink, #0b3d4a);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.f99-ad-overlay__close:hover,
.f99-ad-overlay__close:focus-visible {
  background: rgba(11, 61, 74, 0.08);
  outline: none;
}

.f99-ad-overlay__slot {
  min-width: 300px;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Site header (scrolls away — NOT sticky) --- */
.site-header {
  position: relative;
  z-index: 20;
  background: color-mix(in srgb, var(--color-surface) 94%, transparent);
  border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: var(--header-height);
}

.site-logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35em;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 1.2rem + 0.6vw, 1.65rem);
  font-weight: 700;
  font-variation-settings: "opsz" 72;
  letter-spacing: var(--tracking-tight);
  color: var(--color-ink);
  text-decoration: none;
  line-height: 1;
}

.site-logo:hover {
  color: var(--color-ink-soft);
}

.site-logo__mark {
  color: var(--color-sand-deep);
}

.site-logo__blog {
  font-family: var(--font-body);
  font-size: 0.55em;
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-muted);
  position: relative;
  top: -0.15em;
}

/* Nav */
.site-nav {
  display: none;
}

.site-nav__list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md) var(--space-lg);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav__link {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-ink);
  text-decoration: none;
  position: relative;
}

.site-nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.25em;
  width: 100%;
  height: 1.5px;
  background: var(--color-sand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration) var(--ease-out);
}

.site-nav__link:hover,
.site-nav__link[aria-current="page"] {
  color: var(--color-ink-deep);
}

.site-nav__link:hover::after,
.site-nav__link[aria-current="page"]::after {
  transform: scaleX(1);
}

/* Category links in header */
.site-nav__item--cats {
  width: 100%;
}

.site-nav__label {
  display: block;
  margin: var(--space-sm) 0 var(--space-xs);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-sand-deep);
}

.site-nav__cats {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav__link--cat {
  font-weight: 500;
}

/* Mobile nav toggle */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  color: var(--color-ink);
  background: var(--color-surface);
  transition: background var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
}

.nav-toggle:hover {
  background: var(--color-paper-warm);
  border-color: var(--color-ink);
}

.nav-toggle__bars {
  display: block;
  width: 1.1rem;
  height: 0.75rem;
  position: relative;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after,
.nav-toggle__bars span {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transition: transform var(--duration) var(--ease-out),
    opacity var(--duration-fast) var(--ease-out),
    top var(--duration) var(--ease-out);
}

.nav-toggle__bars::before {
  top: 0;
}

.nav-toggle__bars span {
  top: 50%;
  transform: translateY(-50%);
}

.nav-toggle__bars::after {
  bottom: 0;
  top: auto;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after {
  bottom: auto;
  top: 50%;
  transform: translateY(-50%) rotate(-45deg);
}

.site-nav--open {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  padding: var(--space-md) var(--gutter) var(--space-lg);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
}

.site-nav--open .site-nav__list {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-md);
}

@media (min-width: 900px) {
  .nav-toggle {
    display: none;
  }

  .site-nav {
    display: block;
    max-width: min(46rem, 70vw);
  }

  .site-nav--open {
    position: static;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .site-nav--open .site-nav__list,
  .site-nav__list {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-sm) var(--space-md);
  }

  /* Flatten category list into the main nav row */
  .site-nav__item--cats,
  .site-nav__cats {
    display: contents;
  }

  .site-nav__label {
    display: none;
  }

  .site-nav__link--cat {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-muted);
  }

  .site-nav__link--cat:hover,
  .site-nav__link--cat[aria-current="page"] {
    color: var(--color-ink);
  }
}

/* Main */
.site-main {
  flex: 1 0 auto;
  padding-block: var(--space-xl) var(--space-4xl);
}

.site-main--home {
  padding-top: 0;
}

/* Footer */
.site-footer {
  margin-top: auto;
  padding: var(--space-2xl) 0 var(--space-xl);
  border-top: 1px solid var(--color-border);
  background:
    linear-gradient(180deg, transparent, rgba(11, 61, 74, 0.03)),
    color-mix(in srgb, var(--color-surface) 80%, var(--color-paper-warm));
}

.site-footer__inner {
  display: grid;
  gap: var(--space-xl);
}

.site-footer__brand {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-ink);
  text-decoration: none;
}

.site-footer__tagline {
  margin-top: var(--space-xs);
  font-size: var(--text-sm);
  color: var(--color-muted);
  max-width: 28rem;
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-lg);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer__nav a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-ink);
  text-decoration: none;
}

.site-footer__nav a:hover {
  color: var(--color-ink-soft);
  text-decoration: underline;
}

.site-footer__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-sm);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-xs);
  color: var(--color-muted-soft);
}

@media (min-width: 640px) {
  .site-footer__inner {
    grid-template-columns: 1.4fr 1fr;
    align-items: start;
  }
}

/* ==========================================================================
   5. Homepage hero + post listing
   ========================================================================== */

.home-hero {
  position: relative;
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 4vw, 3rem);
  overflow: hidden;
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 90% at 85% 20%, rgba(201, 166, 107, 0.18), transparent 55%),
    radial-gradient(ellipse 50% 60% at 10% 80%, rgba(11, 61, 74, 0.08), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Soft geometric atmosphere — not decorative clutter */
.home-hero::after {
  content: "";
  position: absolute;
  right: -8%;
  top: 10%;
  width: min(42vw, 22rem);
  height: min(42vw, 22rem);
  border: 1px solid rgba(11, 61, 74, 0.08);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

@keyframes f99-fade-up {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes f99-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.post-grid > li {
  animation: f99-fade-up 600ms var(--ease-out) both;
}

.post-grid > li:nth-child(1) { animation-delay: 40ms; }
.post-grid > li:nth-child(2) { animation-delay: 90ms; }
.post-grid > li:nth-child(3) { animation-delay: 140ms; }
.post-grid > li:nth-child(4) { animation-delay: 190ms; }
.post-grid > li:nth-child(5) { animation-delay: 240ms; }
.post-grid > li:nth-child(6) { animation-delay: 290ms; }

.home-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 38rem;
  animation: f99-fade-up 700ms var(--ease-out) both;
}

.home-hero__brand {
  display: block;
  margin-bottom: var(--space-lg);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  font-variation-settings: "opsz" 144;
  letter-spacing: var(--tracking-display);
  color: var(--color-ink);
  line-height: var(--leading-tight);
}

.home-hero__brand span {
  color: var(--color-sand-deep);
}

.home-hero__title {
  font-size: var(--text-hero);
  font-weight: 600;
  margin-bottom: var(--space-md);
  max-width: 16ch;
}

.home-hero__support {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--color-muted);
  max-width: 32rem;
  margin-bottom: var(--space-xl);
}

.home-hero__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: 2.75rem;
  padding: 0.65rem 1.15rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-surface);
  background: var(--color-ink);
  border-radius: var(--radius-md);
  text-decoration: none;
  animation: f99-fade-in 900ms var(--ease-out) 180ms both;
  transition: background var(--duration) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.home-hero__cta:hover {
  background: var(--color-ink-soft);
  color: var(--color-surface);
}

.home-hero__cta:active {
  transform: translateY(1px);
}

.home-hero__cta-arrow {
  display: inline-block;
  transition: transform var(--duration) var(--ease-out);
}

.home-hero__cta:hover .home-hero__cta-arrow {
  transform: translateX(3px);
}

/* Section: latest posts */
.section-posts {
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border);
}

.section-posts__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.section-posts__title {
  font-size: var(--text-lg);
  font-weight: 600;
}

.section-posts__support {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-muted);
}

/* Post grid — cards only because items are interactive */
.post-grid {
  display: grid;
  gap: var(--space-xl);
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 640px) {
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2xl) var(--space-xl);
  }
}

@media (min-width: 1024px) {
  .post-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.post-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-lg);
  transition: transform var(--duration) var(--ease-out);
}

.post-card:hover {
  color: inherit;
  transform: translateY(-2px);
}

.post-card:focus-visible {
  outline-offset: 4px;
}

.post-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--color-paper-warm), var(--color-sand-soft));
  margin-bottom: var(--space-md);
}

.post-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms var(--ease-out);
}

.post-card:hover .post-card__media img {
  transform: scale(1.03);
}

.post-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  flex: 1;
}

.post-card__category {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-sand-deep);
}

.post-card__title {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 600;
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  color: var(--color-ink);
  text-wrap: balance;
}

.post-card:hover .post-card__title {
  color: var(--color-ink-soft);
}

.post-card__excerpt {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__meta {
  margin-top: auto;
  padding-top: var(--space-sm);
  font-size: var(--text-xs);
  color: var(--color-muted-soft);
}

/* Alternative: elegant list layout (optional class on ul) */
.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-list .post-card {
  flex-direction: column;
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  transform: none;
}

.post-list .post-card:first-child {
  padding-top: 0;
}

.post-list .post-card:hover {
  transform: none;
}

.post-list .post-card__media {
  margin-bottom: var(--space-md);
}

@media (min-width: 720px) {
  .post-list .post-card {
    flex-direction: row;
    gap: var(--space-xl);
    align-items: stretch;
  }

  .post-list .post-card__media {
    flex: 0 0 38%;
    max-width: 17rem;
    margin-bottom: 0;
    aspect-ratio: 4 / 3;
  }

  .post-list .post-card__body {
    justify-content: center;
  }

  .post-list .post-card__title {
    font-size: var(--text-lg);
  }
}

/* Pagination */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-3xl);
}

.pagination__link,
.pagination__current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0 var(--space-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  color: var(--color-ink);
  background: var(--color-surface);
}

.pagination__link:hover {
  border-color: var(--color-ink);
  color: var(--color-ink);
}

.pagination__current {
  background: var(--color-ink);
  border-color: var(--color-ink);
  color: var(--color-surface);
}

.pagination__link[aria-disabled="true"] {
  opacity: 0.4;
  pointer-events: none;
}

/* ==========================================================================
   6. Article page
   ========================================================================== */

.article {
  width: min(100% - (var(--gutter) * 2), var(--measure-wide));
  margin-inline: auto;
}

.article__header {
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-border);
}

.article__category {
  display: inline-block;
  margin-bottom: var(--space-md);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-sand-deep);
  text-decoration: none;
}

.article__category:hover {
  color: var(--color-sand-deep);
  text-decoration: underline;
}

.article__title {
  font-size: var(--text-xl);
  font-weight: 650;
  line-height: var(--leading-tight);
  margin-bottom: var(--space-md);
  max-width: 22ch;
}

.article__dek {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--color-muted);
  max-width: 36rem;
  margin-bottom: var(--space-lg);
}

.article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-md);
  font-size: var(--text-sm);
  color: var(--color-muted-soft);
}

.article__meta time {
  font-variant-numeric: tabular-nums;
}

.article__hero-image {
  margin: 0 0 var(--space-2xl);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-paper-warm);
}

.article__hero-image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article__hero-image figcaption {
  padding: var(--space-sm) var(--space-md);
  font-size: var(--text-xs);
  color: var(--color-muted-soft);
  background: color-mix(in srgb, var(--color-surface) 70%, transparent);
}

/* Reading column — tight measure for body text */
.article__content {
  max-width: var(--measure);
  font-size: var(--text-base);
  line-height: var(--leading-article);
  color: var(--color-ink-deep);
}

.article__content > * + * {
  margin-top: 1.15em;
}

.article__content > h2,
.article__content > h3,
.article__content > h4 {
  margin-top: 1.75em;
  margin-bottom: 0.4em;
  line-height: var(--leading-snug);
  color: var(--color-ink);
}

.article__content > h2 {
  font-size: var(--text-lg);
  font-weight: 650;
  padding-top: 0.25em;
}

.article__content > h3 {
  font-size: var(--text-md);
  font-weight: 600;
}

.article__content > h4 {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: 0;
  font-variation-settings: var(--font-opsz-body);
}

.article__content p {
  max-width: 65ch;
}

.article__content a {
  text-decoration: underline;
  text-decoration-color: rgba(11, 61, 74, 0.35);
}

.article__content a:hover {
  text-decoration-color: var(--color-sand);
}

.article__content ul,
.article__content ol {
  padding-left: 1.35em;
  max-width: 60ch;
}

.article__content li + li {
  margin-top: 0.4em;
}

.article__content blockquote {
  margin-inline: 0;
  padding: var(--space-md) 0 var(--space-md) var(--space-lg);
  border-left: 3px solid var(--color-sand);
  color: var(--color-ink);
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 500;
  line-height: var(--leading-snug);
  font-variation-settings: "opsz" 36;
}

.article__content blockquote p + p {
  margin-top: 0.75em;
}

.article__content strong {
  font-weight: 700;
  color: var(--color-ink);
}

.article__content hr {
  margin: var(--space-2xl) 0;
  max-width: 4rem;
  border-top-color: var(--color-sand);
}

/* Content images / figures */
.content-image {
  margin: var(--space-2xl) 0;
  max-width: 100%;
}

.content-image img {
  width: 100%;
  border-radius: var(--radius-md);
  background: var(--color-paper-warm);
}

.content-image figcaption {
  margin-top: var(--space-sm);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-muted);
  max-width: 42rem;
}

.content-image--wide {
  width: 100%;
}

@media (min-width: 800px) {
  .content-image--wide {
    width: calc(100% + 4rem);
    margin-left: -2rem;
    margin-right: -2rem;
    max-width: none;
  }
}

/* First paragraph after title — slightly larger lede feel if marked */
.article__content > p:first-of-type {
  font-size: var(--text-md);
  color: var(--color-ink);
}

/* Inline ad after first para sits as sibling — spacing handled by ad slot */

.article__footer {
  margin-top: var(--space-3xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border);
  max-width: var(--measure);
}

.article__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  list-style: none;
  margin: 0 0 var(--space-lg);
  padding: 0;
}

.article__tags a {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  font-size: var(--text-xs);
  font-weight: 600;
  text-decoration: none;
  color: var(--color-ink);
  background: var(--color-paper-warm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.article__tags a:hover {
  border-color: var(--color-ink);
}

.article__related-title {
  font-size: var(--text-md);
  margin-bottom: var(--space-md);
}

/* ==========================================================================
   7. Legal / static pages
   ========================================================================== */

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

.page__header {
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.page__title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-sm);
}

.page__updated {
  font-size: var(--text-sm);
  color: var(--color-muted-soft);
}

.page__content {
  max-width: var(--measure);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-ink-deep);
}

.page__content > * + * {
  margin-top: 1em;
}

.page__content h2 {
  font-size: var(--text-lg);
  margin-top: 1.75em;
}

.page__content h3 {
  font-size: var(--text-md);
  margin-top: 1.5em;
}

.page__content ul,
.page__content ol {
  padding-left: 1.35em;
}

.page__content a {
  text-decoration: underline;
  text-decoration-color: rgba(11, 61, 74, 0.35);
}

/* Contact form (static pages) */
.form {
  display: grid;
  gap: var(--space-md);
  max-width: 28rem;
  margin-top: var(--space-xl);
}

.form__label {
  display: grid;
  gap: var(--space-2xs);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-ink);
}

.form__input,
.form__textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  transition: border-color var(--duration-fast) var(--ease-out);
}

.form__input:hover,
.form__textarea:hover {
  border-color: var(--color-ink);
}

.form__input:focus-visible,
.form__textarea:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-color: var(--color-ink);
}

.form__textarea {
  min-height: 8rem;
  resize: vertical;
}

.form__submit {
  justify-self: start;
  min-height: 2.75rem;
  padding: 0.65rem 1.25rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-surface);
  background: var(--color-ink);
  border-radius: var(--radius-md);
  transition: background var(--duration) var(--ease-out);
}

.form__submit:hover {
  background: var(--color-ink-soft);
}

/* ==========================================================================
   8. Ad slot wrappers (CLS-safe reserved heights)
   ========================================================================== */

.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-inline: auto;
  overflow: hidden;
  background: transparent;
}

.ad-slot__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 320×480 above header (blog top) */
.ad-slot--blog {
  position: relative;
  width: 320px;
  max-width: 100%;
  min-height: 480px;
  height: 480px;
}

/* F99_header / f99_footer — sizes 320x100 and 300x75 only */
.ad-slot--header,
.ad-slot--footer {
  position: relative;
  width: auto;
  max-width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 0;
}

.ad-slot--header #div-gpt-ad-f99-header,
.ad-slot--footer #div-gpt-ad-f99-footer {
  width: auto;
  min-width: 0;
  min-height: 0;
  line-height: 0;
}

.ad-slot--header #div-gpt-ad-f99-header iframe,
.ad-slot--footer #div-gpt-ad-f99-footer iframe {
  display: block;
  margin: 0 auto;
}

/* After first paragraph: 320×480 / 336×280 only */
.ad-slot--para1 {
  position: relative;
  width: 320px;
  max-width: 100%;
  min-height: 280px;
  margin-block: var(--space-xl);
}

.ad-slot--para1 #div-gpt-ad-f99-para1 {
  min-width: 320px;
  min-height: 280px;
  margin: 0 auto;
}

/* Optional inline placement helper inside article content */
.article__content .ad-slot--para1 {
  margin-inline: auto;
}

/* Prevent ads from breaking reading flow with accidental overflow */
.ad-slot iframe,
.ad-slot > div {
  max-width: 100%;
}

/* ==========================================================================
   9. Category / archive header
   ========================================================================== */

.archive-header {
  margin-bottom: var(--space-2xl);
}

.archive-header__title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-xs);
}

.archive-header__desc {
  font-size: var(--text-md);
  color: var(--color-muted);
  max-width: 36rem;
}

/* ==========================================================================
   10. 404 / empty states
   ========================================================================== */

.empty-state {
  text-align: center;
  padding: var(--space-4xl) var(--gutter);
  max-width: 28rem;
  margin-inline: auto;
}

.empty-state__title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-md);
}

.empty-state__text {
  color: var(--color-muted);
  margin-bottom: var(--space-xl);
}

.empty-state__link {
  font-weight: 600;
}

/* ==========================================================================
   11. Motion / reduced-motion
   ========================================================================== */

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

  .post-card:hover,
  .home-hero__cta:active,
  .home-hero__cta:hover .home-hero__cta-arrow,
  .post-card:hover .post-card__media img {
    transform: none;
  }
}

/* ==========================================================================
   12. Print (articles)
   ========================================================================== */

@media print {
  body {
    background: white;
    color: black;
  }

  .ad-zone--blog,
  .ad-overlay,
  .ad-slot,
  .site-header,
  .site-footer,
  .nav-toggle,
  .home-hero__cta {
    display: none !important;
  }

  .article__content {
    max-width: 100%;
    font-size: 12pt;
    line-height: 1.5;
  }

  a {
    text-decoration: underline;
    color: black;
  }
}
