/* ==========================================================================
   Techlist — Tech News & Lists Template
   Pure HTML/CSS — no framework dependency
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens (CSS Custom Properties) — Light & Dark themes
   -------------------------------------------------------------------------- */
:root {
  /* Brand */
  --brand: #22c55e;
  --brand-bright: #4ade80;
  --brand-dark: #16a34a;
  --brand-darker: #15803d;

  /* Neutrals — light theme */
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-muted: #f3f4f6;
  --surface: #ffffff;
  --border: #e5e7eb;
  --border-soft: #f1f5f9;
  --divider: #e5e7eb;

  /* Text */
  --text: #111827;
  --text-body: #374151;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;
  --placeholder: #d1d5db;

  /* Effects */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.12);

  /* Radii */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  /* Layout */
  --container: 1300px;
  --header-h: 68px;

  /* Type */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";

  /* Transitions */
  --t-fast: 0.15s ease;
  --t: 0.25s ease;
  --t-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --bg: #0b0f17;
  --bg-soft: #111827;
  --bg-muted: #151c2a;
  --surface: #131a26;
  --border: #232c3b;
  --border-soft: #1a2332;

  --text: #f3f4f6;
  --text-body: #cbd5e1;
  --text-muted: #94a3b8;
  --text-faint: #64748b;
  --placeholder: #475569;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.6);
}

/* Slightly brighter divider color in dark mode so the gapped grid lines
   read clearly against the dark background. */
[data-theme="dark"] {
  --divider: #334155;
}

/* --------------------------------------------------------------------------
   2. Reset & Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--t), color var(--t);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--t-fast);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  padding: 0;
  margin: 0;
  line-height: normal;
  /* The two rules above fix a real bug: Astra's parent theme CSS sets a
     global `button{padding:.7em 1em}`. Without this override, that
     padding applies unopposed inside every fixed-size icon button
     (theme toggle, search, hamburger, scroll-to-top, search overlay
     close/submit) since neither rule previously set `padding` at all —
     same-specificity element selectors don't "win" over each other,
     whichever sets a property simply applies it. This is the root
     cause of the stretched toggle and missing/misaligned icons. */
}

ul,
ol {
  list-style: none;
  margin: 0;
  padding: 0;
  /* The two lines above fix a real bug in the original reset: removing
     list-style alone doesn't remove the browser's default padding-left
     (~40px) on <ul>/<ol>, which is exactly what produced the footer
     nav columns' "shifted right" indentation. Any place that wants a
     bullet/number list back (e.g. inside article body content via
     the_content()) restores it explicitly — see .post-content ul/ol
     further down, which already sets its own list-style and padding. */
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

:focus-visible {
  outline: 3px solid var(--brand-bright);
  outline-offset: 2px;
  border-radius: 3px;
}

/* --------------------------------------------------------------------------
   3. Layout helpers
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}

.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;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 2000;
  background: var(--brand);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
}

main {
  flex: 1 0 auto;
  width: 100%;
}

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  transition: background-color var(--t-fast), color var(--t-fast),
    box-shadow var(--t-fast), transform var(--t-fast), border-color var(--t-fast);
  white-space: nowrap;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover {
  background: var(--brand-dark);
  box-shadow: 0 6px 16px rgba(34, 197, 94, 0.35);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: var(--bg-soft);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 13px 30px;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   5. Header / Navigation (sticky)
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--header-bg, #72ca42);
  color: var(--header-text, #ffffff);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  transition: background-color var(--t), border-color var(--t),
    box-shadow var(--t), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.site-header.scrolled {
  box-shadow: var(--shadow-sm);
}
.site-header.header-hidden {
  transform: translateY(-100%);
  box-shadow: none;
}
/* Offset body for the fixed header so content isn't hidden behind it */
body {
  padding-top: var(--header-h);
}

.nav {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  color: var(--text);
}
.nav-toggle:hover {
  background: var(--bg-soft);
}
.nav-toggle svg {
  width: 22px;
  height: 22px;
}

/* Logo */
.logo {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--brand);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}
.logo:hover {
  opacity: 0.85;
}

/* Primary nav */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: 14px;
}
.nav-menu > li {
  position: relative;
}
.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-body);
  padding: 8px 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  position: relative;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 0;
  height: 2px;
  background: var(--brand);
  transition: width var(--t);
  border-radius: 2px;
}
.nav-link:hover {
  color: var(--text);
}
.nav-link:hover::after {
  width: 100%;
}
.nav-link .caret {
  width: 12px;
  height: 12px;
  transition: transform var(--t-fast);
  opacity: 0.6;
}
.has-dropdown:hover > .nav-link .caret,
.has-dropdown.open > .nav-link .caret {
  transform: rotate(180deg);
}

/* Dropdown */
.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--t-fast), transform var(--t-fast), visibility var(--t-fast);
  z-index: 50;
}
.has-dropdown:hover > .dropdown,
.has-dropdown.open > .dropdown,
.dropdown:focus-within {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown a {
  display: block;
  padding: 9px 12px;
  font-size: 14px;
  color: var(--text-body);
  border-radius: var(--radius-sm);
}
.dropdown a:hover {
  background: var(--bg-soft);
  color: var(--brand-dark);
}

/* Header right cluster */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

/* Search button — desktop (shown in nav-actions on >=861px) */
.search-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-body);
  transition: color var(--t-fast), background-color var(--t-fast);
}
.search-btn:hover {
  color: var(--brand-dark);
  background: var(--bg-soft);
}
.search-btn svg {
  width: 20px;
  height: 20px;
}

/* Search button — mobile (shown on <=860px, positioned at the far right
   of the header bar, next to the hamburger icon). */
.search-btn-mobile {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text);
  margin-left: auto;
}
.search-btn-mobile:hover {
  background: var(--bg-soft);
  color: var(--brand-dark);
}
.search-btn-mobile svg {
  width: 22px;
  height: 22px;
}

/* Social icons */
.social-icons {
  display: flex;
  align-items: center;
  gap: 10px;
}
.social-icons a {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
  transition: color var(--t-fast), background-color var(--t-fast),
    transform var(--t-fast);
}
.social-icons a:hover {
  color: #fff;
  background: var(--brand);
  transform: translateY(-2px);
}
.social-icons svg {
  width: 16px;
  height: 16px;
}

/* Theme toggle (LIGHT / DARK pill) */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
}
.theme-toggle button {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
  transition: all var(--t-fast);
}
.theme-toggle button svg {
  width: 16px;
  height: 16px;
}
.theme-toggle button.active {
  background: var(--brand);
  color: #fff;
}
.theme-toggle button:hover:not(.active) {
  color: var(--text);
  background: var(--bg-muted);
}

/* Auth buttons */
.btn-login {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: transparent;
}
.btn-login:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: var(--bg-soft);
}

/* --------------------------------------------------------------------------
   6. Mobile menu drawer
   -------------------------------------------------------------------------- */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 1500;
  visibility: hidden;
  pointer-events: none;
}
.mobile-menu.open {
  visibility: visible;
  pointer-events: auto;
}
.mobile-menu__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity var(--t);
}
.mobile-menu.open .mobile-menu__backdrop {
  opacity: 1;
}
.mobile-menu__panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(320px, 84vw);
  background: var(--bg);
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
  transition: transform var(--t-slow);
  display: flex;
  flex-direction: column;
  padding: 18px;
  overflow-y: auto;
}
.mobile-menu.open .mobile-menu__panel {
  transform: translateX(0);
}
.mobile-menu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.mobile-menu__close {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text);
}
.mobile-menu__close:hover {
  background: var(--bg-soft);
}
.mobile-menu__nav li {
  border-bottom: 1px solid var(--border-soft);
}
.mobile-menu__nav a,
.mobile-menu__nav .mm-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 4px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}
.mobile-menu__nav a:hover,
.mobile-menu__nav .mm-toggle:hover {
  color: var(--brand-dark);
}
.mobile-menu__sub {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--t);
}
.mobile-menu__sub.open {
  max-height: 400px;
}
.mobile-menu__sub a {
  padding-left: 16px;
  font-size: 14px;
  color: var(--text-muted);
}
.mobile-menu__foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 18px;
}

/* --------------------------------------------------------------------------
   6b. Search overlay (slides in from the left, overlapping the nav menu)
   -------------------------------------------------------------------------- */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 1600;
  visibility: hidden;
  pointer-events: none;
}
.search-overlay.open {
  visibility: visible;
  pointer-events: auto;
}
.search-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity var(--t);
}
.search-overlay.open .search-overlay__backdrop {
  opacity: 1;
}
/* Panel slides in from the LEFT — overlaps the nav menu bar. */
.search-overlay__panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(420px, 86vw);
  background: var(--bg);
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
  transition: transform var(--t-slow);
  display: flex;
  flex-direction: column;
  padding: 18px;
  overflow-y: auto;
}
.search-overlay.open .search-overlay__panel {
  transform: translateX(0);
}
.search-overlay__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.search-overlay__head .logo {
  font-size: 22px;
}
.search-overlay__close {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text);
}
.search-overlay__close:hover {
  background: var(--bg-soft);
  color: var(--brand-dark);
}
.search-overlay__close svg {
  width: 22px;
  height: 22px;
}
/* Search input */
.search-overlay__form {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px 4px 4px 18px;
  margin-bottom: 20px;
}
.search-overlay__form:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}
.search-overlay__form svg {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.search-overlay__input {
  flex: 1;
  height: 42px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
}
.search-overlay__input::placeholder {
  color: var(--placeholder);
}
.search-overlay__submit {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--t-fast);
}
.search-overlay__submit:hover {
  background: var(--brand-dark);
}
.search-overlay__submit svg {
  width: 18px;
  height: 18px;
}
/* Search section heading */
.search-overlay__section {
  margin-top: 14px;
}
.search-overlay__section h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.search-overlay__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.search-overlay__tags a {
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-muted);
  color: var(--text-body);
  border: 1px solid var(--border);
  transition: all var(--t-fast);
}
.search-overlay__tags a:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* --------------------------------------------------------------------------
   7. Breadcrumb
   -------------------------------------------------------------------------- */
.breadcrumb {
  padding: 18px 0;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.breadcrumb a:hover {
  color: var(--brand-dark);
}
.breadcrumb .sep {
  color: var(--text-faint);
}
.breadcrumb [aria-current="page"] {
  color: var(--text);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   8. Hero section
   --------------------------------------------------------------------------
   Hero = one gapped grid with 1 large card on the left and a 2x2 grid of
   4 small cards on the right. The grid uses 3 columns where col 1 is
   wider (1.5fr) for the large card and cols 2-3 are 1fr each for the 2x2.
   Gapped dividers: a vertical line between the left card and the right
   area, a vertical line between the two right columns, and a horizontal
   line between the two right rows — all with gaps at intersections and
   perimeter (no outer frame, no continuous crossings).
   -------------------------------------------------------------------------- */
.hero {
  padding: 36px 0 52px;
  border-bottom: 1px solid var(--border-soft);
}
.hero-grid {
  --col-gap: 24px;
  --row-gap: 24px;
  --dgap: 12px;
  --igap: 6px;
  --dcol: var(--divider);
  --cpad: 20px; /* container horizontal padding — the pseudo-elements span
                  the padding box, so divider positions must offset by this
                  to align with the content-box grid gaps. */
  /* Divider X-positions (centers of the two column gaps), in PADDING-BOX
     coordinates (what the ::before/::after pseudo-elements see as 100%).
     The grid columns live in the CONTENT box (padding-box minus 2*cpad).
     col1W = (1.5/3.5)*(100% - 2*cpad - 2*G) = (3/7)*(100% - 2*cpad - 2G)
     V1 = cpad + col1W + G/2
     V2 = cpad + col1W + G + col2W + G/2 = cpad + (5/7)*(100%-2*cpad-2G) + 3G/2 */
  --v1: calc(var(--cpad) + (100% - 2 * var(--cpad) - 2 * var(--col-gap)) * 3 / 7 + var(--col-gap) / 2);
  --v2: calc(var(--cpad) + (100% - 2 * var(--cpad) - 2 * var(--col-gap)) * 5 / 7 + var(--col-gap) * 3 / 2);
  position: relative;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: var(--row-gap) var(--col-gap);
  grid-auto-rows: 1fr;
}
/* Large featured card — spans col 1 and both rows. */
.hero-main {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
}
.hero-main .card-image {
  aspect-ratio: 16 / 9;
}
.hero-main .card-title {
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.22;
}
.hero-main .card-excerpt {
  font-size: 16px;
}
/* Hero side cards — the 4 small cards filling the right 2x2 area
   (cols 2-3, rows 1-2). */
.hero-side-card {
  display: flex;
  flex-direction: column;
}
.hero-side-card .card-image {
  aspect-ratio: 16 / 10;
}
.hero-side-card .card-title {
  font-size: 16px;
  line-height: 1.35;
}
.hero-side-card .card-body {
  padding: 12px 0 0;
}
.hero-side-card .card-meta {
  margin-top: 6px;
}
/* Cards sit above the divider pseudo-elements. */
.hero-grid > .card {
  position: relative;
  z-index: 1;
}

/* Hero gapped dividers.
   ::before = 2 vertical 1px lines (V1 between left card & right area;
   V2 between the two right columns), drawn full-height, then a Y-mask
   breaks each at 50% (gapped intersection) and erases the top/bottom
   --dgap (gapped perimeter).
   ::after = 1 horizontal 1px line at 50% height, drawn full-width, then
   an X-mask confines it to the right area (V1 → 100%) with a gap at V2
   (gapped intersection) and gaps at both ends (gapped perimeter). The
   horizontal line does NOT cross the left card (mask erases 0 → V1). */
.hero-grid.grid-dividers::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    /* V1 — 1px vertical line at --v1 */
    linear-gradient(
      to right,
      transparent calc(var(--v1) - 0.5px),
      var(--dcol) calc(var(--v1) - 0.5px),
      var(--dcol) calc(var(--v1) + 0.5px),
      transparent calc(var(--v1) + 0.5px)
    ),
    /* V2 — 1px vertical line at --v2 */
    linear-gradient(
      to right,
      transparent calc(var(--v2) - 0.5px),
      var(--dcol) calc(var(--v2) - 0.5px),
      var(--dcol) calc(var(--v2) + 0.5px),
      transparent calc(var(--v2) + 0.5px)
    );
  background-size: 100% 100%;
  background-position: 0 0;
  background-repeat: no-repeat;
  /* Y-mask: erase top dgap, show top segment, erase intersection
     (50% ± igap), show bottom segment, erase bottom dgap. Both vertical
     lines are broken simultaneously. */
  -webkit-mask: linear-gradient(
    to bottom,
    transparent 0,
    transparent var(--dgap),
    #000 var(--dgap),
    #000 calc(50% - var(--igap)),
    transparent calc(50% - var(--igap)),
    transparent calc(50% + var(--igap)),
    #000 calc(50% + var(--igap)),
    #000 calc(100% - var(--dgap)),
    transparent calc(100% - var(--dgap)),
    transparent 100%
  );
  mask: linear-gradient(
    to bottom,
    transparent 0,
    transparent var(--dgap),
    #000 var(--dgap),
    #000 calc(50% - var(--igap)),
    transparent calc(50% - var(--igap)),
    transparent calc(50% + var(--igap)),
    #000 calc(50% + var(--igap)),
    #000 calc(100% - var(--dgap)),
    transparent calc(100% - var(--dgap)),
    transparent 100%
  );
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}
.hero-grid.grid-dividers::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    /* Horizontal line at 50% — 1px tall, full width */
    linear-gradient(
      to bottom,
      transparent calc(50% - 0.5px),
      var(--dcol) calc(50% - 0.5px),
      var(--dcol) calc(50% + 0.5px),
      transparent calc(50% + 0.5px)
    );
  background-size: 100% 100%;
  background-position: 0 0;
  background-repeat: no-repeat;
  /* X-mask: erase 0 → V1+dgap (no line over left card + gapped left
     perimeter), show V1+dgap → V2-igap (left segment), erase V2-igap →
     V2+igap (gapped intersection), show V2+igap → 100%-dgap (right
     segment), erase 100%-dgap → 100% (gapped right perimeter). */
  -webkit-mask: linear-gradient(
    to right,
    transparent 0,
    transparent calc(var(--v1) + var(--dgap)),
    #000 calc(var(--v1) + var(--dgap)),
    #000 calc(var(--v2) - var(--igap)),
    transparent calc(var(--v2) - var(--igap)),
    transparent calc(var(--v2) + var(--igap)),
    #000 calc(var(--v2) + var(--igap)),
    #000 calc(100% - var(--dgap)),
    transparent calc(100% - var(--dgap)),
    transparent 100%
  );
  mask: linear-gradient(
    to right,
    transparent 0,
    transparent calc(var(--v1) + var(--dgap)),
    #000 calc(var(--v1) + var(--dgap)),
    #000 calc(var(--v2) - var(--igap)),
    transparent calc(var(--v2) - var(--igap)),
    transparent calc(var(--v2) + var(--igap)),
    #000 calc(var(--v2) + var(--igap)),
    #000 calc(100% - var(--dgap)),
    transparent calc(100% - var(--dgap)),
    transparent 100%
  );
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

/* --------------------------------------------------------------------------
   9. Cards (article)
   --------------------------------------------------------------------------
   Cards themselves are BORDERLESS. The grid provides the visual structure
   via gapped divider lines (see .grid-dividers in section 11). Each card
   keeps its rounded corners, surface background, hover lift, and image
   zoom — but no outline or pseudo-element borders.
   -------------------------------------------------------------------------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--t);
}
.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.card:hover {
  transform: translateY(-4px);
}
.card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-muted);
  background-image: repeating-linear-gradient(
      45deg,
      transparent,
      transparent 12px,
      rgba(0, 0, 0, 0.04) 12px,
      rgba(0, 0, 0, 0.04) 24px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 12px,
      rgba(0, 0, 0, 0.03) 12px,
      rgba(0, 0, 0, 0.03) 24px
    );
}
[data-theme="dark"] .card-image {
  background-image: repeating-linear-gradient(
      45deg,
      transparent,
      transparent 12px,
      rgba(255, 255, 255, 0.04) 12px,
      rgba(255, 255, 255, 0.04) 24px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 12px,
      rgba(255, 255, 255, 0.03) 12px,
      rgba(255, 255, 255, 0.03) 24px
    );
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow);
}
.card:hover .card-image img {
  transform: scale(1.04);
}

/* Category badge */
.cat-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--brand);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 6px rgba(34, 197, 94, 0.3);
}
.cat-badge.is-static {
  position: static;
  display: inline-block;
  margin-bottom: 10px;
}

.card-body {
  padding: 16px 4px 4px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.hero-main .card-body {
  padding: 20px 4px 4px;
}
.card-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.01em;
  transition: color var(--t-fast);
}
.card:hover .card-title {
  color: var(--brand-dark);
}
.card-meta {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.card-meta .dot {
  color: var(--text-faint);
}
.card-excerpt {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-body);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.read-more {
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-dark);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-end;
}
.read-more svg {
  width: 14px;
  height: 14px;
  transition: transform var(--t-fast);
}
.read-more:hover {
  color: var(--brand);
}
.read-more:hover svg {
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   10. Section header
   -------------------------------------------------------------------------- */
.section-head {
  text-align: center;
  margin: 56px 0 34px;
}
.section-head h2 {
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 700;
}
.section-head p {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 14px;
}
.section-head--left {
  text-align: left;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 40px 0 26px;
}
.section-head--left h2 {
  font-size: 24px;
}
.section-head--left a {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-dark);
}

/* --------------------------------------------------------------------------
   11. Stories grid (3-column)
   --------------------------------------------------------------------------
   Gapped grid dividers: thin 1px divider lines run inside the grid gaps
   ONLY (never around the perimeter, never on the cards). Horizontal and
   vertical divider lines CROSS continuously at intersections (like a
   table grid), but every line stops short of the grid perimeter by
   --dgap, so the outer frame stays open — matching the reference style.

   How it works:
   - The grid uses equal-width columns (1fr) and equal-height rows (1fr
     via grid-auto-rows), so each cell is the same size.
   - ::before draws vertical 1px lines, one centered in every column gap,
     using a repeating-linear-gradient whose period equals one column +
     one column-gap. background-size insets the lines vertically by
     --dgap so they stop short of the top & bottom perimeter.
   - ::after draws horizontal 1px lines, one centered in every row gap,
     using a repeating-linear-gradient whose period equals one row + one
     row-gap. background-size insets the lines horizontally by --dgap so
     they stop short of the left & right perimeter.
   - A mask trims the leading & trailing repeat so no line paints at
     x=0 / x=100% or y=0 / y=100% (no outer frame).
   - Because the vertical lines are inset top & bottom by --dgap and the
     horizontal lines are inset left & right by --dgap, the lines cross
     continuously in the inner area but never reach the perimeter.
   - Cards sit above the pseudo-elements (z-index:1).
   Add the `grid-dividers` class to any grid to enable it. Set --cols,
   --rows, --col-gap, --row-gap on the grid to match its layout.
   -------------------------------------------------------------------------- */
.grid-dividers {
  --dgap: 12px; /* how far each line stops short of the perimeter */
  --igap: 6px; /* half-width of the gap at every intersection (line breaks here) */
  --dcol: var(--divider); /* divider color */
  --cols: 3;
  --rows: 4;
  --col-gap: 24px;
  --row-gap: 28px;
  position: relative;
  /* Equal-height rows so the horizontal repeating gradient aligns with
     every row gap. */
  grid-auto-rows: 1fr;
}
/* Vertical divider lines, one centered in each column gap. Each vertical
   line is BROKEN at every row-gap center (gapped intersections) and stops
   short of the top & bottom perimeter (gapped perimeter). */
.grid-dividers::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  /* Period = one column + one column-gap = (100% + col-gap) / cols.
     Line sits at colW + col-gap/2 within each period, i.e. at
     period - col-gap/2. We draw a 1px line there. */
  background-image: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc((100% + var(--col-gap)) / var(--cols) - var(--col-gap) / 2 - 0.5px),
    var(--dcol) calc((100% + var(--col-gap)) / var(--cols) - var(--col-gap) / 2 - 0.5px),
    var(--dcol) calc((100% + var(--col-gap)) / var(--cols) - var(--col-gap) / 2 + 0.5px),
    transparent calc((100% + var(--col-gap)) / var(--cols) - var(--col-gap) / 2 + 0.5px),
    transparent calc((100% + var(--col-gap)) / var(--cols))
  );
  /* Inset vertically by --dgap so vertical lines stop short of the
     top & bottom perimeter (gapped perimeter). */
  background-size: 100% calc(100% - 2 * var(--dgap));
  background-position: 0 var(--dgap);
  background-repeat: no-repeat;
  /* Notch out a horizontal band (height = 2*--igap) at every row-gap
     center so each vertical line is BROKEN where it would cross a
     horizontal divider — producing gapped intersections. The notch
     center is at period - row-gap/2 within each repeating period. */
  -webkit-mask: repeating-linear-gradient(
    to bottom,
    #000 0,
    #000 calc((100% + var(--row-gap)) / var(--rows) - var(--row-gap) / 2 - var(--igap)),
    transparent calc((100% + var(--row-gap)) / var(--rows) - var(--row-gap) / 2 - var(--igap)),
    transparent calc((100% + var(--row-gap)) / var(--rows) - var(--row-gap) / 2 + var(--igap)),
    #000 calc((100% + var(--row-gap)) / var(--rows) - var(--row-gap) / 2 + var(--igap)),
    #000 calc((100% + var(--row-gap)) / var(--rows))
  );
  mask: repeating-linear-gradient(
    to bottom,
    #000 0,
    #000 calc((100% + var(--row-gap)) / var(--rows) - var(--row-gap) / 2 - var(--igap)),
    transparent calc((100% + var(--row-gap)) / var(--rows) - var(--row-gap) / 2 - var(--igap)),
    transparent calc((100% + var(--row-gap)) / var(--rows) - var(--row-gap) / 2 + var(--igap)),
    #000 calc((100% + var(--row-gap)) / var(--rows) - var(--row-gap) / 2 + var(--igap)),
    #000 calc((100% + var(--row-gap)) / var(--rows))
  );
}
/* Horizontal divider lines, one centered in each row gap. Each horizontal
   line is BROKEN at every column-gap center (gapped intersections) and
   stops short of the left & right perimeter (gapped perimeter). */
.grid-dividers::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc((100% + var(--row-gap)) / var(--rows) - var(--row-gap) / 2 - 0.5px),
    var(--dcol) calc((100% + var(--row-gap)) / var(--rows) - var(--row-gap) / 2 - 0.5px),
    var(--dcol) calc((100% + var(--row-gap)) / var(--rows) - var(--row-gap) / 2 + 0.5px),
    transparent calc((100% + var(--row-gap)) / var(--rows) - var(--row-gap) / 2 + 0.5px),
    transparent calc((100% + var(--row-gap)) / var(--rows))
  );
  /* Inset horizontally by --dgap so horizontal lines stop short of the
     left & right perimeter (gapped perimeter). */
  background-size: calc(100% - 2 * var(--dgap)) 100%;
  background-position: var(--dgap) 0;
  background-repeat: no-repeat;
  /* Notch out a vertical band (width = 2*--igap) at every column-gap
     center so each horizontal line is BROKEN where it would cross a
     vertical divider — producing gapped intersections. The notch
     center is at period - col-gap/2 within each repeating period. */
  -webkit-mask: repeating-linear-gradient(
    to right,
    #000 0,
    #000 calc((100% + var(--col-gap)) / var(--cols) - var(--col-gap) / 2 - var(--igap)),
    transparent calc((100% + var(--col-gap)) / var(--cols) - var(--col-gap) / 2 - var(--igap)),
    transparent calc((100% + var(--col-gap)) / var(--cols) - var(--col-gap) / 2 + var(--igap)),
    #000 calc((100% + var(--col-gap)) / var(--cols) - var(--col-gap) / 2 + var(--igap)),
    #000 calc((100% + var(--col-gap)) / var(--cols))
  );
  mask: repeating-linear-gradient(
    to right,
    #000 0,
    #000 calc((100% + var(--col-gap)) / var(--cols) - var(--col-gap) / 2 - var(--igap)),
    transparent calc((100% + var(--col-gap)) / var(--cols) - var(--col-gap) / 2 - var(--igap)),
    transparent calc((100% + var(--col-gap)) / var(--cols) - var(--col-gap) / 2 + var(--igap)),
    #000 calc((100% + var(--col-gap)) / var(--cols) - var(--col-gap) / 2 + var(--igap)),
    #000 calc((100% + var(--col-gap)) / var(--cols))
  );
}
/* Cards sit above the divider pseudo-elements. */
.grid-dividers > .card {
  position: relative;
  z-index: 1;
}

.stories {
  padding-bottom: 12px;
}
.stories-grid {
  --cols: 3;
  --rows: 4;
  --col-gap: 24px;
  --row-gap: 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--row-gap) var(--col-gap);
}
.stories-grid .card-excerpt {
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

/* Load more */
.load-more-wrap {
  text-align: center;
  margin: 48px 0 64px;
}

/* --------------------------------------------------------------------------
   12. Newsletter bar
   -------------------------------------------------------------------------- */
.newsletter {
  background: var(--bg-muted);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 44px 0;
}
.newsletter__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.newsletter__label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.newsletter__form {
  display: flex;
  gap: 10px;
  flex: 1;
  max-width: 480px;
}
.newsletter__input {
  flex: 1;
  height: 46px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.newsletter__input::placeholder {
  color: var(--placeholder);
}
.newsletter__input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}
.newsletter__msg {
  width: 100%;
  text-align: center;
  margin-top: 12px;
  font-size: 13px;
  color: var(--brand-dark);
  font-weight: 500;
  min-height: 18px;
}

/* --------------------------------------------------------------------------
   13. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  margin-top: auto;
  color: var(--text-body);
}
.footer-top {
  padding: 56px 0 44px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer-brand .logo {
  font-size: 24px;
  margin-bottom: 16px;
}
.footer-brand p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 320px;
}
.footer-social {
  margin-top: 20px;
  display: flex;
  gap: 12px;
}
.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-body);
  border: 1px solid var(--border);
  transition: all var(--t-fast);
}
.footer-social a:hover {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
  transform: translateY(-2px);
}
.footer-social svg {
  width: 16px;
  height: 16px;
}
.footer-col h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  margin-bottom: 16px;
}
.footer-col ul li {
  margin-bottom: 4px;
}
.footer-col ul a {
  display: inline-block;
  padding: 6px 0;
  font-size: 14px;
  color: var(--text-body);
}
.footer-col ul a:hover {
  color: var(--brand-dark);
  transform: translateX(3px);
}
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.footer-bottom p {
  font-size: 13px;
  color: var(--text-faint);
}
.footer-bottom-links {
  display: flex;
  gap: 18px;
}
.footer-bottom-links a {
  font-size: 13px;
  color: var(--text-muted);
}
.footer-bottom-links a:hover {
  color: var(--brand-dark);
}

/* --------------------------------------------------------------------------
   14. Single post page
   -------------------------------------------------------------------------- */
/* Main column wrapper: holds breadcrumb, hero, featured image, body,
   tags and author box so they all share the same left & right edges. */
.post-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.post-hero {
  padding: 8px 0 16px;
}
.post-hero .cat-badge {
  position: static;
  margin-bottom: 14px;
}
.post-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--text);
}
.post-excerpt {
  margin-top: 18px;
  font-size: 19px;
  line-height: 1.55;
  color: var(--text-body);
}
/* Featured image — aligned to the main column width */
.post-featured {
  margin-top: 4px;
}
.post-featured .card-image {
  aspect-ratio: 21 / 9;
  border-radius: var(--radius-lg);
}
.post-featured figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}
.post-meta-row {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.share-row--meta {
  flex-shrink: 0;
}
.share-row--meta a {
  width: 32px;
  height: 32px;
}
.author-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.author-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}
.author-name {
  font-weight: 600;
  color: var(--text);
}
.author-photo {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}
.author-chip .author-photo {
  width: 38px;
  height: 38px;
}
.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 48px;
  padding-bottom: 64px;
}
.post-content {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-body);
}
.post-content > * + * {
  margin-top: 22px;
}
.post-content h2 {
  font-size: 26px;
  margin-top: 36px;
  color: var(--text);
}
.post-content h3 {
  font-size: 21px;
  margin-top: 28px;
  color: var(--text);
}
.post-content p {
  color: var(--text-body);
}
.post-content a {
  color: var(--brand-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.post-content a:hover {
  color: var(--brand);
}
.post-content img {
  width: 100%;
  border-radius: var(--radius-lg);
  margin: 28px 0;
}
.post-content figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}
.post-content blockquote {
  border-left: 4px solid var(--brand);
  padding: 6px 0 6px 22px;
  font-size: 20px;
  line-height: 1.55;
  color: var(--text);
  font-style: italic;
}
.post-content ul,
.post-content ol {
  padding-left: 24px;
  list-style: disc;
}
.post-content ol {
  list-style: decimal;
}
.post-content li {
  margin-bottom: 8px;
}
.post-content li::marker {
  color: var(--brand);
}

/* Tags + share row */
.post-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: 36px;
}
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-muted);
  color: var(--text-body);
  border: 1px solid var(--border);
  transition: all var(--t-fast);
}
.tag:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.share-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.share-row span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.share-row a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  color: var(--text-body);
  transition: all var(--t-fast);
}
.share-row a:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* Author box */
.author-box {
  margin-top: 36px;
  display: flex;
  gap: 18px;
  padding: 24px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
}
.author-box .author-avatar,
.author-box .author-photo {
  width: 72px;
  height: 72px;
  font-size: 24px;
  flex-shrink: 0;
}
.author-box__label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.author-box h4 {
  font-size: 17px;
  margin-bottom: 4px;
}
.author-box p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}
.author-box__links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 10px;
}
.author-box__links a {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-dark);
}
.author-box__links a:hover {
  text-decoration: underline;
}

/* My Account page — account details fallback box */
.account-box {
  margin-top: 40px;
  padding: 24px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.account-box h2 {
  font-size: 18px;
  margin-bottom: 16px;
}
.account-box__row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.account-box__row img {
  border-radius: 50%;
  flex-shrink: 0;
}
.account-box__name {
  font-weight: 700;
  font-size: 15.5px;
  color: var(--text);
}
.account-box__email {
  font-size: 13.5px;
  color: var(--text-muted);
}
.account-box__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.widget h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--brand);
  display: inline-block;
}
.widget-list li {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
  align-items: flex-start;
}
.widget-list li:last-child {
  border-bottom: none;
}
/* Thumbnail image on the left — uses the same diagonal-stripe placeholder
   as the main cards. */
.widget-list .w-thumb {
  flex-shrink: 0;
  width: 84px;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-muted);
  background-image: repeating-linear-gradient(
      45deg,
      transparent,
      transparent 10px,
      rgba(0, 0, 0, 0.04) 10px,
      rgba(0, 0, 0, 0.04) 20px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 10px,
      rgba(0, 0, 0, 0.03) 10px,
      rgba(0, 0, 0, 0.03) 20px
    );
}
[data-theme="dark"] .widget-list .w-thumb {
  background-image: repeating-linear-gradient(
      45deg,
      transparent,
      transparent 10px,
      rgba(255, 255, 255, 0.04) 10px,
      rgba(255, 255, 255, 0.04) 20px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 10px,
      rgba(255, 255, 255, 0.03) 10px,
      rgba(255, 255, 255, 0.03) 20px
    );
}
.widget-list .w-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.widget-list .w-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  display: block;
}
.widget-list a:hover .w-title {
  color: var(--brand-dark);
}
.widget-categories li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
}
.widget-categories li:last-child {
  border-bottom: none;
}
.widget-categories a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-body);
}
.widget-categories a:hover {
  color: var(--brand-dark);
}
.widget-categories .count {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-muted);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
}

/* --------------------------------------------------------------------------
   15. Category archive / listing page
   -------------------------------------------------------------------------- */
/* Main column wrapper for archive: holds breadcrumb, page head, grid. */
.archive-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.page-head {
  padding: 8px 0 8px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 28px;
}
.page-head .cat-badge {
  position: static;
  margin-bottom: 12px;
}
.page-head h1 {
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.page-head p {
  margin-top: 12px;
  font-size: 16px;
  color: var(--text-muted);
  max-width: 640px;
}
.page-head__avatar {
  margin-bottom: 14px;
}
.page-head__avatar img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.archive-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 44px;
  padding-bottom: 60px;
}
.archive-grid {
  --cols: 2;
  --rows: 4;
  --col-gap: 24px;
  --row-gap: 28px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--row-gap) var(--col-gap);
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 48px;
}
.pagination a,
.pagination span {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-body);
  background: var(--surface);
  transition: all var(--t-fast);
}
.pagination a:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
}
.pagination .current {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.pagination .gap {
  border: none;
  background: transparent;
}

/* --------------------------------------------------------------------------
   16. Static pages (about / contact)
   -------------------------------------------------------------------------- */
.page-hero {
  padding: 48px 0 24px;
  text-align: center;
}
.page-hero h1 {
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 800;
  letter-spacing: -0.025em;
}
.page-hero p {
  margin-top: 14px;
  font-size: 18px;
  color: var(--text-muted);
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}
.prose {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 0 64px;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-body);
}
.prose > * + * {
  margin-top: 22px;
}
.prose h2 {
  font-size: 26px;
  margin-top: 36px;
}
.prose h3 {
  font-size: 21px;
  margin-top: 28px;
}
.prose a {
  color: var(--brand-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.prose ul {
  list-style: disc;
  padding-left: 24px;
}
.prose li {
  margin-bottom: 8px;
}
.prose li::marker {
  color: var(--brand);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 760px;
  margin: 40px auto 0;
}
.stat-card {
  text-align: center;
  padding: 24px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.stat-card .num {
  font-size: 32px;
  font-weight: 800;
  color: var(--brand);
  line-height: 1;
}
.stat-card .label {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 880px;
  margin: 36px auto 0;
}
.team-card {
  text-align: center;
  padding: 24px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.team-card .author-avatar {
  width: 72px;
  height: 72px;
  font-size: 26px;
  margin: 0 auto 14px;
}
.team-card h4 {
  font-size: 17px;
  margin-bottom: 2px;
}
.team-card .role {
  font-size: 13px;
  color: var(--brand-dark);
  font-weight: 600;
  margin-bottom: 10px;
}
.team-card p {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Contact */
.contact-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 0 64px;
}
.contact-form {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
}
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-control:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}
textarea.form-control {
  height: auto;
  padding: 12px 14px;
  resize: vertical;
  min-height: 140px;
}
.contact-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.info-card {
  padding: 22px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.info-card h4 {
  font-size: 15px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.info-card h4 svg {
  width: 18px;
  height: 18px;
  color: var(--brand);
}
.info-card p,
.info-card a {
  font-size: 14px;
  color: var(--text-body);
  line-height: 1.6;
}
.info-card a:hover {
  color: var(--brand-dark);
}

/* --------------------------------------------------------------------------
   16b. Auth / Login page
   -------------------------------------------------------------------------- */
.auth {
  padding: 48px 0 80px;
}
.auth-card {
  max-width: 460px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
}
.auth-card h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 6px;
}
.auth-card .auth-subtitle {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 28px;
}
/* Tabs to switch between Login and Sign Up */
.auth-tabs {
  display: flex;
  background: var(--bg-muted);
  border-radius: var(--radius-pill);
  padding: 4px;
  margin-bottom: 28px;
}
.auth-tabs button {
  flex: 1;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  transition: all var(--t-fast);
}
.auth-tabs button.active {
  background: var(--brand);
  color: #fff;
}
/* Social login buttons */
.auth-social {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}
.auth-social a {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  transition: all var(--t-fast);
}
.auth-social a:hover {
  border-color: var(--brand);
  background: var(--bg-soft);
}
.auth-social svg {
  width: 18px;
  height: 18px;
}
/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 22px;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
/* Form */
.auth-form .form-group {
  margin-bottom: 18px;
}
.auth-form .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.auth-form .form-control {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.auth-form .form-control:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}
.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  font-size: 13px;
}
.auth-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-body);
  cursor: pointer;
}
.auth-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}
.auth-row a {
  color: var(--brand-dark);
  font-weight: 600;
}
.auth-row a:hover {
  color: var(--brand);
}
.auth-form .btn-primary {
  width: 100%;
  height: 46px;
  font-size: 14px;
}
.auth-foot {
  text-align: center;
  margin-top: 22px;
  font-size: 14px;
  color: var(--text-muted);
}
.auth-foot a {
  color: var(--brand-dark);
  font-weight: 600;
}
/* Sign-up-specific fields hidden by default */
.auth-form.signup .signup-only {
  display: block;
}
.auth-form.login .signup-only {
  display: none;
}

/* --------------------------------------------------------------------------
   17. Toast (for newsletter/contact submit)
   -------------------------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text);
  color: var(--bg);
  padding: 14px 22px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  opacity: 0;
  transition: transform var(--t-slow), opacity var(--t-slow);
  max-width: 90vw;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* --------------------------------------------------------------------------
   18. Back-to-top button
   -------------------------------------------------------------------------- */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all var(--t);
  z-index: 900;
}
.to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.to-top:hover {
  background: var(--brand-dark);
  transform: translateY(-3px);
}
.to-top svg {
  width: 20px;
  height: 20px;
}

/* --------------------------------------------------------------------------
   19. Reveal-on-scroll animation (progressive enhancement)
   Only hidden when <html> has .js class (added by inline head script),
   so no-JS users and crawlers always see content.
   -------------------------------------------------------------------------- */
.js [data-reveal]:not(.revealed) {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js [data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
}
/* No JS / no .js class: content always visible */
[data-reveal] {
  opacity: 1;
}

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

/* --------------------------------------------------------------------------
   20. Responsive breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .hero-grid {
    /* Tablet: hero-main spans full width on row 1; the 4 side cards
       form a 2x2 grid on rows 2-3. */
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr 1fr;
    --col-gap: 22px;
    --row-gap: 24px;
  }
  .hero-main {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .hero-side-card .card-image {
    aspect-ratio: 16 / 9;
  }
  /* Tablet: the hero has 2 equal columns (cols 2-3 hold the 2x2 side
     cards). V1 (between col1/col2) = 50% - col-gap/2. The horizontal
     dividers sit between row1/row2 and row2/row3. We recompute the
     divider positions for the tablet layout. */
  .hero-grid {
    --v1: calc(50% - var(--col-gap) / 2);
    --v2: calc(50% + var(--col-gap) / 2);
  }
  .hero-grid.grid-dividers::before {
    /* One vertical line at V1 (between the two 2x2 columns), broken at
       both horizontal-divider crossings (between row1/row2 and row2/row3).
       With 3 rows (auto, 1fr, 1fr), the row-gap centers are at
       row1H + gap/2 and row1H + gap + row2H + gap/2. Since rows 2 and 3
       are equal (1fr each), row2H = row3H. The crossings are at roughly
       1/3 and 2/3 of the grid height (approximate). We use a repeating
       notch mask to break the line at both crossings. */
    background-image: linear-gradient(
      to right,
      transparent calc(var(--v1) - 0.5px),
      var(--dcol) calc(var(--v1) - 0.5px),
      var(--dcol) calc(var(--v1) + 0.5px),
      transparent calc(var(--v1) + 0.5px)
    );
    background-size: 100% calc(100% - 2 * var(--dgap));
    background-position: 0 var(--dgap);
    background-repeat: no-repeat;
    -webkit-mask: none;
    mask: none;
  }
  .hero-grid.grid-dividers::after {
    /* Two horizontal lines: between row1/row2 and row2/row3. With
       3 rows (auto + 1fr + 1fr), the gap centers are at
       h1 = row1H + gap/2 and h2 = row1H + gap + row2H + gap/2. Since
       row1 is auto and rows 2-3 are 1fr, we use the --row-gap variable
       and approximate the positions. */
    background-image:
      linear-gradient(
        to bottom,
        transparent calc(33% - 0.5px),
        var(--dcol) calc(33% - 0.5px),
        var(--dcol) calc(33% + 0.5px),
        transparent calc(33% + 0.5px)
      ),
      linear-gradient(
        to bottom,
        transparent calc(66% - 0.5px),
        var(--dcol) calc(66% - 0.5px),
        var(--dcol) calc(66% + 0.5px),
        transparent calc(66% + 0.5px)
      );
    background-size: 100% 100%, 100% 100%;
    background-position: 0 0, 0 0;
    background-repeat: no-repeat;
    -webkit-mask: none;
    mask: none;
  }
  .stories-grid {
    grid-template-columns: repeat(2, 1fr);
    --cols: 2;
  }
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
  .post-layout,
  .archive-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
  .contact-layout {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {
  .nav-menu,
  .nav-actions .btn-login,
  .nav-actions .btn-primary,
  .nav-actions .social-icons,
  .nav-actions .theme-toggle,
  .nav-actions .search-btn {
    display: none;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .search-btn-mobile {
    display: inline-flex;
  }
  .nav-actions {
    gap: 10px;
  }
  .mobile-theme-toggle {
    display: inline-flex;
  }
}

@media (min-width: 861px) {
  .mobile-theme-toggle {
    display: none;
  }
}

@media (max-width: 640px) {
  .container {
    padding-inline: 16px;
  }
  .hero {
    padding: 24px 0 36px;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    gap: 18px;
    --col-gap: 18px;
    --row-gap: 18px;
    /* On mobile the cards stack in a single column; let each card take
       its natural content height instead of stretching to equal 1fr
       rows (which created huge gaps between cards). */
    grid-auto-rows: auto;
  }
  .hero-main {
    grid-column: 1;
    grid-row: auto;
  }
  /* Mobile: single column. No vertical dividers (::before hidden). Only
     horizontal row dividers between the 5 stacked cards (::after). */
  .hero-grid.grid-dividers::before {
    content: none;
  }
  .hero-grid.grid-dividers::after {
    background-image: repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent calc((100% + var(--row-gap)) / 5 - var(--row-gap) / 2 - 0.5px),
      var(--dcol) calc((100% + var(--row-gap)) / 5 - var(--row-gap) / 2 - 0.5px),
      var(--dcol) calc((100% + var(--row-gap)) / 5 - var(--row-gap) / 2 + 0.5px),
      transparent calc((100% + var(--row-gap)) / 5 - var(--row-gap) / 2 + 0.5px),
      transparent calc((100% + var(--row-gap)) / 5)
    );
    background-size: 100% 100%;
    background-position: 0 0;
    background-repeat: no-repeat;
    -webkit-mask: none;
    mask: none;
  }
  .stories-grid {
    grid-template-columns: 1fr;
    gap: 22px;
    --cols: 1;
    --col-gap: 22px;
  }
  .archive-grid {
    grid-template-columns: 1fr;
    --cols: 1;
    --col-gap: 22px;
  }
  /* Single column: no vertical dividers (no internal column gaps),
     only horizontal row dividers between stacked cards. */
  .grid-dividers::before {
    content: none;
  }
  .section-head {
    margin: 36px 0 24px;
  }
  .newsletter {
    padding: 32px 0;
  }
  .newsletter__inner {
    flex-direction: column;
    text-align: center;
  }
  .newsletter__form {
    flex-direction: column;
    width: 100%;
    max-width: none;
  }
  .newsletter__input {
    width: 100%;
  }
  .footer-top {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 40px 0 32px;
  }
  .sidebar {
    grid-template-columns: 1fr;
  }
  .post-content,
  .post-excerpt {
    font-size: 16px;
  }
  .post-content {
    font-size: 16.5px;
  }
  /* Keep the post title large on mobile — only scale the clamp's lower
     bound down slightly so it fits narrow screens without becoming tiny. */
  .post-title {
    font-size: clamp(26px, 7vw, 34px);
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .team-grid {
    grid-template-columns: 1fr;
  }
  .author-box {
    flex-direction: column;
  }
  .post-meta-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .post-foot {
    flex-direction: column;
    align-items: flex-start;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

/* Print */
@media print {
  .site-header,
  .to-top,
  .newsletter,
  .share-row,
  .mobile-menu {
    display: none !important;
  }
  body {
    color: #000;
  }
}
