/* ==========================================================================
   Extra Hacks Baseball — Ghost theme
   Colors and type follow the Extra Hacks Brand Guidelines (Nov 2025).
   ========================================================================== */

/* 1. Tokens
   -------------------------------------------------------------------------- */
:root {
    /* Brand palette (guidelines p.6) */
    --eh-green: #1F4224;
    --eh-cream: #EEDEB4;
    --eh-white: #FFFFFF;
    --eh-black: #000000;
    --eh-deep: #1B2B1C;

    /* Type (guidelines p.8–10). Fixed to the brand fonts; Ghost's font setting is ignored on purpose. */
    --eh-font-display: "Bebas Neue", "Arial Narrow", sans-serif;
    --eh-font-body: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

    /* Layout */
    --eh-max: 1200px;
    --eh-narrow: 760px;
    --eh-wide: 1140px;
    --eh-gutter: clamp(20px, 4vw, 40px);
    --eh-header-h: 84px;
    --eh-radius: 6px;

    /* Light scheme (default) */
    --eh-bg: #FFFFFF;
    --eh-bg-alt: #FAF5E8;
    --eh-band: var(--eh-cream);
    --eh-ink: var(--eh-deep);
    --eh-ink-muted: #4C5A4D;
    --eh-accent: var(--eh-green);
    --eh-on-accent: #FFFFFF;
    --eh-line: rgba(27, 43, 28, 0.14);
    --eh-card: #FFFFFF;
    --eh-shadow: 0 1px 2px rgba(27, 43, 28, 0.06), 0 8px 24px rgba(27, 43, 28, 0.08);

    color-scheme: light;
}

/* Dark scheme: chosen explicitly, or following the device when set to "system" */
html[data-scheme="dark"] {
    --eh-bg: var(--eh-deep);
    --eh-bg-alt: #213523;
    --eh-band: var(--eh-green);
    --eh-ink: #FFFFFF;
    --eh-ink-muted: #CFC7AF;
    --eh-accent: var(--eh-cream);
    --eh-on-accent: var(--eh-green);
    --eh-line: rgba(238, 222, 180, 0.18);
    --eh-card: #213523;
    --eh-shadow: none;
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
    html[data-scheme="system"] {
        --eh-bg: var(--eh-deep);
        --eh-bg-alt: #213523;
        --eh-band: var(--eh-green);
        --eh-ink: #FFFFFF;
        --eh-ink-muted: #CFC7AF;
        --eh-accent: var(--eh-cream);
        --eh-on-accent: var(--eh-green);
        --eh-line: rgba(238, 222, 180, 0.18);
        --eh-card: #213523;
        --eh-shadow: none;
        color-scheme: dark;
    }
}

/* Swap artwork per scheme */
.eh-only-dark { display: none !important; }
html[data-scheme="dark"] .eh-only-light { display: none !important; }
html[data-scheme="dark"] .eh-only-dark { display: block !important; }
@media (prefers-color-scheme: dark) {
    html[data-scheme="system"] .eh-only-light { display: none !important; }
    html[data-scheme="system"] .eh-only-dark { display: block !important; }
}

/* 2. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--eh-header-h) + 16px); }

body {
    margin: 0;
    background: var(--eh-bg);
    color: var(--eh-ink);
    font-family: var(--eh-font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

[hidden] { display: none !important; }
img, svg, video { max-width: 100%; height: auto; }
img { display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--eh-cream); outline-offset: 2px; }
.eh-main :focus-visible { outline-color: var(--eh-accent); }

.eh-site { display: flex; flex-direction: column; min-height: 100vh; }
.eh-main { flex: 1 0 auto; }

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

.eh-skip {
    position: fixed; left: 12px; top: 12px; z-index: 200; transform: translateY(-200%);
    background: var(--eh-cream); color: var(--eh-green);
    padding: 10px 14px; border-radius: var(--eh-radius); font-weight: 700; text-decoration: none;
}
.eh-skip:focus { transform: none; }

/* 3. Type scale (guidelines p.9–10)
   -------------------------------------------------------------------------- */
/* Title — Bebas Neue 72/80: page titles, hero banners */
.eh-title {
    margin: 0;
    font-family: var(--eh-font-display);
    font-weight: 400;
    font-size: clamp(48px, 7vw, 72px);
    line-height: 1.111;
    letter-spacing: 0.01em;
    text-wrap: balance;
}
/* Heading two — Bebas Neue 48/56: section titles */
.eh-h2 {
    margin: 0;
    font-family: var(--eh-font-display);
    font-weight: 400;
    font-size: clamp(36px, 4.6vw, 48px);
    line-height: 1.167;
    letter-spacing: 0.01em;
    text-wrap: balance;
}
/* Heading three — Roboto Bold 32/40, title case */
.eh-h3 { margin: 0; font-weight: 700; font-size: clamp(24px, 3vw, 32px); line-height: 1.25; }
/* Heading four — Roboto Medium 24/32 */
.eh-h4 { margin: 0; font-weight: 500; font-size: 24px; line-height: 1.333; }
/* Metrics — Bebas Neue 20/28 */
.eh-metric { font-family: var(--eh-font-display); font-size: 20px; line-height: 1.4; letter-spacing: 0.04em; margin: 0; }
/* Eyebrow — Roboto Medium 12/18 uppercase */
.eh-eyebrow {
    display: inline-block;
    font-family: var(--eh-font-body);
    font-weight: 500;
    font-size: 12px;
    line-height: 1.5;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--eh-accent);
    text-decoration: none;
}
/* Body style 2 — Roboto 14/22 */
.eh-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0;
    margin: 0;
    font-size: 14px; line-height: 1.571;
    color: var(--eh-ink-muted);
}
.eh-meta > * + *::before { content: "•"; margin: 0 8px; opacity: 0.6; }

/* 4. Buttons, chips, badges
   -------------------------------------------------------------------------- */
.eh-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px;
    padding: 10px 20px;
    border: 2px solid transparent;
    border-radius: var(--eh-radius);
    font-family: var(--eh-font-body);
    font-weight: 700; font-size: 14px; line-height: 1;
    letter-spacing: 0.08em; text-transform: uppercase;
    text-decoration: none; white-space: nowrap; cursor: pointer;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
.eh-btn svg { width: 18px; height: 18px; }
.eh-btn:active { transform: translateY(1px); }
.eh-btn-lg { min-height: 52px; padding: 14px 26px; font-size: 15px; }

.eh-btn-primary { background: var(--eh-accent); color: var(--eh-on-accent); }
.eh-btn-primary:hover { background: color-mix(in srgb, var(--eh-accent) 86%, var(--eh-ink)); }

/* On green surfaces */
.eh-btn-cream { background: var(--eh-cream); color: var(--eh-green); }
.eh-btn-cream:hover { background: #FFFFFF; }
.eh-btn-outline-light { border-color: rgba(238, 222, 180, 0.7); color: var(--eh-cream); }
.eh-btn-outline-light:hover { border-color: var(--eh-cream); background: rgba(238, 222, 180, 0.08); }

.eh-btn-outline { border-color: var(--eh-line); color: var(--eh-ink); background: transparent; }
.eh-btn-outline:hover { border-color: var(--eh-accent); color: var(--eh-accent); }

.eh-icon-btn {
    display: inline-grid; place-items: center;
    width: 44px; height: 44px;
    padding: 0; border: 0; border-radius: 999px;
    background: transparent; color: inherit; cursor: pointer;
}
.eh-icon-btn:hover { background: rgba(238, 222, 180, 0.14); }

.eh-chip {
    display: inline-block; padding: 6px 14px;
    border: 1px solid var(--eh-line); border-radius: 999px;
    font-size: 14px; font-weight: 500; text-decoration: none; color: var(--eh-ink);
}
.eh-chip:hover { border-color: var(--eh-accent); color: var(--eh-accent); }

.eh-badge {
    position: absolute; left: 12px; top: 12px;
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 9px;
    border-radius: 4px;
    background: var(--eh-cream); color: var(--eh-green);
    font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; line-height: 1;
}
.eh-badge svg { width: 12px; height: 12px; stroke-width: 2.5; }
.eh-badge-inline { position: static; }

.eh-more {
    font-weight: 700; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase;
    text-decoration: none; color: var(--eh-ink);
    border-bottom: 2px solid var(--eh-accent); padding-bottom: 4px;
}
.eh-more:hover { color: var(--eh-accent); }

/* 5. Header + navigation (with submenus)
   -------------------------------------------------------------------------- */
.eh-header {
    position: sticky; top: 0; z-index: 100;
    background: var(--eh-deep);
    color: var(--eh-white);
    border-bottom: 1px solid rgba(238, 222, 180, 0.22);
}
.eh-header-bar { display: flex; align-items: center; gap: 24px; height: var(--eh-header-h); }

.eh-logo { flex-shrink: 0; display: block; }
.eh-logo img { height: 62px; width: auto; }

.eh-nav { flex: 1 1 auto; display: flex; align-items: center; min-width: 0; }
.eh-nav-list { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; }

/* Hide the raw list until main.js has grouped submenus (avoids a flash of "- Item" labels).
   The .js class comes from the inline script in default.hbs; without JavaScript the plain
   list shows, and eh-nav-timeout reveals it if main.js fails to load. */
.js:not(.eh-nav-timeout) .eh-nav:not(.is-ready) .eh-nav-list { visibility: hidden; }

.eh-nav-item { position: relative; display: flex; align-items: center; }
.eh-nav-link {
    display: inline-flex; align-items: center; gap: 6px;
    height: var(--eh-header-h);
    padding: 0 12px;
    border: 0; background: none; cursor: pointer;
    font-family: var(--eh-font-body);
    font-weight: 500; font-size: 15px; line-height: 1; letter-spacing: 0.01em;
    color: var(--eh-white);
    text-decoration: none;
    position: relative;
}
.eh-nav-link::after {
    content: ""; position: absolute; left: 12px; right: 12px; bottom: 26px; height: 2px;
    background: var(--eh-cream); transform: scaleX(0); transform-origin: left; transition: transform .18s ease;
}
.eh-nav-link:hover::after,
.eh-nav-item.is-current > .eh-nav-link::after,
.eh-nav-item.is-current-parent > .eh-nav-link::after { transform: scaleX(1); }
.eh-nav-link:hover, .eh-nav-item.is-current > .eh-nav-link { color: var(--eh-cream); }

.eh-nav-link svg, .eh-nav-caret svg { width: 16px; height: 16px; transition: transform .18s ease; }
.eh-nav-caret {
    display: inline-grid; place-items: center;
    width: 28px; height: 36px; margin-left: -10px; padding: 0;
    border: 0; background: none; color: var(--eh-white); cursor: pointer;
}
.has-submenu.is-open > .eh-nav-link svg,
.has-submenu.is-open > .eh-nav-caret svg { transform: rotate(180deg); }

.eh-submenu {
    position: absolute; top: calc(100% - 10px); left: 0;
    min-width: 240px;
    padding: 8px;
    border-radius: var(--eh-radius);
    background: var(--eh-white);
    color: var(--eh-deep);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
    border-top: 3px solid var(--eh-cream);
    opacity: 0; visibility: hidden; transform: translateY(6px);
    transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
}
.eh-submenu ul { margin: 0; padding: 0; list-style: none; }
.eh-submenu .eh-nav-link {
    display: block; height: auto; width: 100%;
    padding: 11px 14px; border-radius: 4px;
    font-family: var(--eh-font-body); font-size: 15px; font-weight: 500; letter-spacing: 0; line-height: 1.3;
    color: var(--eh-deep);
}
.eh-submenu .eh-nav-link::after { display: none; }
.eh-submenu .eh-nav-link:hover,
.eh-submenu .is-current > .eh-nav-link { background: #F6EEDA; color: var(--eh-green); }
.eh-submenu .is-current > .eh-nav-link { font-weight: 700; }

/* Open on hover (mouse) or when toggled (click / keyboard / touch) */
@media (hover: hover) and (min-width: 1025px) {
    .has-submenu:hover > .eh-submenu { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
}
.has-submenu.is-open > .eh-submenu { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

.eh-header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-shrink: 0; }
.eh-header-members { display: flex; align-items: center; gap: 14px; margin-left: 8px; }
.eh-signin { font-size: 14px; font-weight: 500; text-decoration: none; color: var(--eh-white); }
.eh-signin:hover { color: var(--eh-cream); }

.eh-scheme-icon { display: none; }
.eh-scheme-icon svg { display: block; }
html[data-scheme="light"] .eh-scheme-icon[data-for="light"],
html[data-scheme="dark"] .eh-scheme-icon[data-for="dark"],
html[data-scheme="system"] .eh-scheme-icon[data-for="system"] { display: block; }

.eh-nav-drawer-actions { display: none; }

.eh-burger { display: none; width: 44px; height: 44px; padding: 10px; border: 0; background: none; cursor: pointer; }
.eh-burger span { display: block; height: 2px; margin: 5px 0; background: var(--eh-white); transition: transform .2s ease, opacity .2s ease; }
.eh-header.is-menu-open .eh-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.eh-header.is-menu-open .eh-burger span:nth-child(2) { opacity: 0; }
.eh-header.is-menu-open .eh-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1024px) {
    :root { --eh-header-h: 68px; }
    .eh-logo img { height: 48px; }
    .eh-burger { display: block; }
    .eh-header-members { display: none; }

    .eh-nav {
        position: fixed; inset: var(--eh-header-h) 0 0 0;
        display: none; flex-direction: column; align-items: stretch;
        padding: 12px var(--eh-gutter) 32px;
        background: var(--eh-deep);
        overflow-y: auto; overscroll-behavior: contain;
    }
    .eh-header.is-menu-open .eh-nav { display: flex; }
    .eh-nav-list { flex-direction: column; align-items: stretch; gap: 0; }
    .eh-nav-item { flex-wrap: wrap; border-bottom: 1px solid rgba(238, 222, 180, 0.16); }
    .eh-nav-link { height: 56px; padding: 0 4px; font-size: 18px; flex: 1; justify-content: space-between; }
    .eh-nav-link::after { display: none; }
    .eh-nav-caret { width: 52px; height: 56px; margin: 0; }
    .eh-nav-toggle { padding-right: 15px; }
    .eh-nav-caret svg, .eh-nav-link svg { width: 22px; height: 22px; }

    .eh-submenu {
        position: static; flex-basis: 100%;
        display: none; min-width: 0;
        padding: 0 0 12px 12px;
        background: transparent; color: var(--eh-white);
        box-shadow: none; border: 0;
        opacity: 1; visibility: visible; transform: none;
    }
    .has-submenu.is-open > .eh-submenu { display: block; }
    .eh-submenu .eh-nav-link { color: var(--eh-white); font-size: 16px; font-weight: 400; padding: 12px; }
    .eh-submenu .eh-nav-link:hover, .eh-submenu .is-current > .eh-nav-link { background: rgba(238, 222, 180, 0.1); color: var(--eh-cream); }

    .eh-nav-drawer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; margin-top: 28px; }
    .eh-nav-drawer-actions .eh-btn { flex: 1 1 100%; min-height: 52px; }
    .eh-nav-drawer-actions .eh-signin { font-size: 16px; order: 2; }
    body.eh-menu-locked { overflow: hidden; }
}

/* 6. Hero
   -------------------------------------------------------------------------- */
.eh-hero, .eh-archive-hero {
    position: relative; overflow: hidden;
    background: var(--eh-green); color: var(--eh-white);
    isolation: isolate;
}
/* Thin cream rule near the bottom, like the guidelines cover */
.eh-hero::after {
    content: ""; position: absolute; left: var(--eh-gutter); right: var(--eh-gutter); bottom: 20px; height: 1px;
    background: rgba(238, 222, 180, 0.5);
}
.eh-hero .eh-eyebrow, .eh-archive-hero .eh-eyebrow { color: var(--eh-cream); }
.eh-hero-inner {
    display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: center; gap: 40px;
    padding-block: clamp(56px, 8vw, 104px) clamp(64px, 8vw, 112px);
}
.eh-hero .eh-title { font-size: clamp(56px, 8.4vw, 104px); line-height: 0.96; margin-top: 14px; }
.eh-hero-text { margin: 20px 0 0; max-width: 56ch; font-size: 18px; line-height: 1.556; color: rgba(255, 255, 255, 0.86); }
.eh-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.eh-hero-art { justify-self: center; width: min(100%, 420px); }
.eh-hero-art img { width: 100%; height: auto; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.25)); }

.eh-hero-bg { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; }
.has-image::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(90deg, rgba(27, 43, 28, 0.94) 0%, rgba(31, 66, 36, 0.78) 50%, rgba(31, 66, 36, 0.25) 100%);
}
.eh-hero.has-image .eh-hero-inner { grid-template-columns: minmax(0, 1fr); min-height: min(72vh, 640px); }

.eh-archive-hero .eh-container { padding-block: clamp(48px, 7vw, 88px); }
.eh-archive-hero .eh-title { margin-top: 10px; }
.eh-archive-hero .eh-metric { margin-top: 18px; color: var(--eh-cream); }

.eh-tag-inner.has-art { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 40px; }
.eh-tag-art { width: clamp(140px, 20vw, 260px); height: auto; max-height: 280px; object-fit: contain; }
@media (max-width: 640px) {
    .eh-tag-inner.has-art { grid-template-columns: 1fr; gap: 24px; }
    .eh-tag-art { order: -1; width: 140px; }
}

.eh-author-inner { display: flex; align-items: center; gap: 32px; }
.eh-author-photo {
    flex-shrink: 0; width: 132px; height: 132px; border-radius: 50%; object-fit: cover;
    border: 3px solid var(--eh-cream); background: var(--eh-deep);
}
span.eh-author-photo { display: grid; place-items: center; }
span.eh-author-photo img { width: 50%; }
.eh-author-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 16px 0 0; font-size: 14px; color: var(--eh-cream); }
.eh-author-links a { text-underline-offset: 3px; }

@media (max-width: 860px) {
    .eh-hero-inner { grid-template-columns: 1fr; text-align: left; }
    .eh-hero-art { order: -1; width: 180px; justify-self: start; }
    .eh-author-inner { flex-direction: column; align-items: flex-start; gap: 20px; }
    .eh-author-photo { width: 96px; height: 96px; }
}

/* 7. Sections, topic rail
   -------------------------------------------------------------------------- */
.eh-section { padding-block: clamp(56px, 7vw, 96px); }
.eh-section-head {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
    margin-bottom: 32px;
}
.eh-section-head .eh-h2 { margin-top: 6px; }

.eh-topics { background: var(--eh-bg-alt); border-bottom: 1px solid var(--eh-line); }
.eh-rail-controls { display: flex; gap: 8px; }
.eh-rail-btn { border: 1px solid var(--eh-line); color: var(--eh-ink); }
.eh-rail-btn:hover { background: var(--eh-accent); color: var(--eh-on-accent); border-color: var(--eh-accent); }
.eh-rail-btn[disabled] { opacity: 0.35; pointer-events: none; }

.eh-rail {
    display: grid; grid-auto-flow: column; grid-auto-columns: 196px; gap: 16px;
    margin: 0; padding: 4px 2px 16px; list-style: none;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
    scrollbar-width: thin; scrollbar-color: var(--eh-line) transparent;
}
.eh-rail > li { scroll-snap-align: start; display: flex; }
.eh-topic {
    flex: 1; display: flex; flex-direction: column; gap: 6px;
    min-height: 160px; padding: 20px;
    border-radius: var(--eh-radius);
    background: var(--eh-card); border: 1px solid var(--eh-line);
    text-decoration: none; color: var(--eh-ink);
    transition: background-color .15s ease, color .15s ease, transform .15s ease, border-color .15s ease;
}
.eh-topic { position: relative; }
.eh-topic-art {
    position: absolute; top: 12px; right: 12px;
    width: 76px; height: 76px; object-fit: contain;
    transition: transform .2s ease;
}
.eh-topic:hover .eh-topic-art { transform: rotate(-4deg) scale(1.06); }
.eh-topic.has-art { min-height: 180px; }
/* Artwork is usually drawn in brand green, so cards with art keep their surface on hover */
.eh-topic.has-art:hover { background: var(--eh-card); color: var(--eh-ink); border-color: var(--eh-accent); box-shadow: inset 0 0 0 1px var(--eh-accent); }
.eh-topic.has-art:hover .eh-topic-count { color: var(--eh-accent); }
.eh-topic.has-art:hover .eh-topic-label { color: var(--eh-ink-muted); }
.eh-topic-count { font-family: var(--eh-font-display); font-size: 48px; line-height: 1; color: var(--eh-accent); }
.eh-topic-name { margin-top: auto; font-weight: 700; font-size: 18px; line-height: 1.3; }
.eh-topic-label { font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--eh-ink-muted); }
.eh-topic:hover { background: var(--eh-green); border-color: var(--eh-green); color: var(--eh-white); transform: translateY(-3px); }
.eh-topic:hover .eh-topic-count { color: var(--eh-cream); }
.eh-topic:hover .eh-topic-label { color: rgba(238, 222, 180, 0.8); }

/* 8. Post cards + grid
   -------------------------------------------------------------------------- */
.eh-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }

.eh-card { position: relative; display: flex; }
.eh-card-link {
    display: flex; flex-direction: column; width: 100%;
    text-decoration: none; color: inherit;
    background: var(--eh-card);
    border-radius: var(--eh-radius);
    box-shadow: 0 0 0 1px var(--eh-line);
    transition: box-shadow .2s ease, transform .2s ease;
}
/* Hover: lift the whole card with a soft shadow */
.eh-card-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 0 1px rgba(27, 43, 28, 0.06), 0 16px 36px rgba(27, 43, 28, 0.18);
}
html[data-scheme="dark"] .eh-card-link:hover { box-shadow: 0 0 0 1px rgba(238, 222, 180, 0.35), 0 16px 36px rgba(0, 0, 0, 0.5); }
@media (prefers-color-scheme: dark) {
    html[data-scheme="system"] .eh-card-link:hover { box-shadow: 0 0 0 1px rgba(238, 222, 180, 0.35), 0 16px 36px rgba(0, 0, 0, 0.5); }
}
.eh-card-media {
    position: relative; overflow: hidden;
    aspect-ratio: 16 / 10;
    border-radius: var(--eh-radius) var(--eh-radius) 0 0;
    background: var(--eh-green);
}
.eh-card-media > img { width: 100%; height: 100%; object-fit: cover; }
.eh-card-placeholder { position: absolute; inset: 0; display: grid; place-items: center; background: var(--eh-green); }
.eh-card-placeholder img { width: 22%; max-width: 90px; opacity: 0.9; }

.eh-card-body { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 22px; }
.eh-card-title {
    margin: 0;
    font-family: var(--eh-font-body); font-weight: 700;
    font-size: 21px; line-height: 1.33;
    text-wrap: pretty;
    transition: color .15s ease;
}
.eh-card-link:hover .eh-card-title { color: var(--eh-accent); }
.eh-card-excerpt { margin: 0; color: var(--eh-ink-muted); font-size: 16px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.eh-card .eh-meta { margin-top: auto; padding-top: 4px; }

/* Featured (latest) post spans the row */
.eh-card-feature { grid-column: 1 / -1; }
.eh-card-feature .eh-card-link {
    display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    align-items: center; gap: 0;
    background: var(--eh-band); box-shadow: none; overflow: hidden;
}
/* Photo fills the left column at 3:2. The width is pinned to the column so a long title
   can only make the photo a bit taller, never wider (which would cover the text). */
.eh-card-feature .eh-card-media { width: 100%; min-width: 0; height: 100%; aspect-ratio: 3 / 2; align-self: stretch; border-radius: 0; }
.eh-card-feature .eh-card-media > img { position: absolute; inset: 0; }
.eh-card-feature .eh-card-body { padding: clamp(24px, 4vw, 48px); gap: 14px; }
.eh-card-feature .eh-card-title { font-family: var(--eh-font-display); font-weight: 400; font-size: clamp(34px, 3.8vw, 48px); line-height: 1.1; letter-spacing: 0.01em; }
.eh-card-feature .eh-card-tag { color: var(--eh-green); }
.eh-card-feature .eh-card-excerpt { font-size: 18px; line-height: 1.556; -webkit-line-clamp: 3; color: var(--eh-deep); opacity: 0.85; }
.eh-card-feature .eh-meta { color: var(--eh-deep); opacity: 0.8; }
.eh-card-feature .eh-card-link:hover .eh-card-title { color: var(--eh-green); }
html[data-scheme="dark"] .eh-card-feature .eh-card-tag,
html[data-scheme="dark"] .eh-card-feature .eh-card-link:hover .eh-card-title { color: var(--eh-cream); }
html[data-scheme="dark"] .eh-card-feature .eh-card-excerpt,
html[data-scheme="dark"] .eh-card-feature .eh-meta { color: rgba(255, 255, 255, 0.85); }
@media (prefers-color-scheme: dark) {
    html[data-scheme="system"] .eh-card-feature .eh-card-tag,
    html[data-scheme="system"] .eh-card-feature .eh-card-link:hover .eh-card-title { color: var(--eh-cream); }
    html[data-scheme="system"] .eh-card-feature .eh-card-excerpt,
    html[data-scheme="system"] .eh-card-feature .eh-meta { color: rgba(255, 255, 255, 0.85); }
}

@media (max-width: 1000px) {
    .eh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .eh-card-feature .eh-card-link { grid-template-columns: 1fr; }
    .eh-card-feature .eh-card-media { aspect-ratio: 16 / 9; height: auto; }
}
@media (max-width: 640px) {
    .eh-grid { grid-template-columns: 1fr; gap: 36px; }
    .eh-section-head { flex-wrap: wrap; }
    .eh-rail { grid-auto-columns: calc((100% - 32px) / 2.35); }
    .eh-rail-controls { display: none; }
}

/* Pagination */
.eh-pagination {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
    margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--eh-line);
}
.eh-pagination > :last-child { justify-self: end; }
.eh-pagination-count { font-family: var(--eh-font-display); font-size: 20px; letter-spacing: 0.04em; color: var(--eh-ink-muted); }
@media (max-width: 560px) {
    .eh-pagination { grid-template-columns: 1fr 1fr; }
    .eh-pagination-count { grid-column: 1 / -1; grid-row: 1; text-align: center; }
}

/* 9. Newsletter sign-up band
   -------------------------------------------------------------------------- */
.eh-signup { background: var(--eh-band); color: var(--eh-deep); }
.eh-signup-inner {
    display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: center; gap: 48px;
    padding-block: clamp(48px, 6vw, 80px);
}
.eh-signup-art img { width: 100%; height: auto; }
.eh-signup .eh-eyebrow { color: var(--eh-green); }
.eh-signup .eh-h2 { margin: 6px 0 12px; }
.eh-signup p { margin: 0 0 24px; font-size: 18px; line-height: 1.556; max-width: 52ch; }
.eh-signup .eh-btn-primary { background: var(--eh-green); color: var(--eh-white); }
.eh-signup .eh-btn-primary:hover { background: var(--eh-deep); }
html[data-scheme="dark"] .eh-signup { color: var(--eh-white); }
html[data-scheme="dark"] .eh-signup .eh-eyebrow { color: var(--eh-cream); }
html[data-scheme="dark"] .eh-signup .eh-btn-primary { background: var(--eh-cream); color: var(--eh-green); }
@media (prefers-color-scheme: dark) {
    html[data-scheme="system"] .eh-signup { color: var(--eh-white); }
    html[data-scheme="system"] .eh-signup .eh-eyebrow { color: var(--eh-cream); }
    html[data-scheme="system"] .eh-signup .eh-btn-primary { background: var(--eh-cream); color: var(--eh-green); }
}
@media (max-width: 720px) {
    .eh-signup-inner { grid-template-columns: 1fr; gap: 24px; }
    .eh-signup-art { width: 140px; }
}

/* 10. Footer
   -------------------------------------------------------------------------- */
.eh-footer { background: var(--eh-deep); color: rgba(255, 255, 255, 0.8); font-size: 15px; }
html[data-scheme="dark"] .eh-footer { background: #142015; }
@media (prefers-color-scheme: dark) { html[data-scheme="system"] .eh-footer { background: #142015; } }

.eh-footer-top {
    display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 48px;
    padding-block: 64px 48px;
}
.eh-footer-logo img { width: 190px; height: auto; }
.eh-footer-tagline { margin: 18px 0 0; color: var(--eh-cream); }
.eh-social { display: flex; gap: 6px; margin-top: 16px; margin-left: -10px; }
.eh-social a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; color: var(--eh-cream); }
.eh-social a:hover { background: rgba(238, 222, 180, 0.12); }

.eh-footer .eh-nav-item { display: block; }
.eh-footer .eh-nav-link {
    display: inline; height: auto; padding: 0;
    font-family: var(--eh-font-body); font-size: 15px; letter-spacing: 0; line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
}
.eh-footer .eh-nav-link::after { display: none; }
.eh-footer .eh-nav-item.is-current > .eh-nav-link { color: var(--eh-cream); }
/* Without JavaScript the menus still stack as vertical lists */
.eh-footer-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 32px; }
.eh-footer-nav .eh-nav-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.eh-footer-nav > .eh-footer-cols { grid-column: 1 / -1; }
.eh-footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 32px; }
.eh-footer-col h2 {
    margin: 0 0 14px;
    font-family: var(--eh-font-display); font-weight: 400; font-size: 22px; letter-spacing: 0.05em; line-height: 1.2;
    color: var(--eh-cream);
}
.eh-footer-col h2 a { text-decoration: none; }
.eh-footer-col ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.eh-footer a { text-decoration: none; }
.eh-footer-nav a:hover, .eh-footer-bottom a:hover { color: var(--eh-white); text-decoration: underline; text-underline-offset: 3px; }

.eh-footer-bottom {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px;
    padding-block: 24px 32px;
    border-top: 1px solid rgba(238, 222, 180, 0.16);
    font-size: 13px; color: rgba(255, 255, 255, 0.6);
}
.eh-footer-bottom p { margin: 0; }

@media (max-width: 760px) {
    .eh-footer-top { grid-template-columns: 1fr; gap: 36px; padding-block: 48px 36px; }
    .eh-footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 11. Article
   -------------------------------------------------------------------------- */
.eh-article-header { padding-top: clamp(40px, 6vw, 80px); }
.eh-article-kicker { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.eh-article-kicker .eh-eyebrow:hover { text-decoration: underline; text-underline-offset: 3px; }
.eh-article-title { font-size: clamp(44px, 6.4vw, 72px); }
.eh-article-excerpt { margin: 18px 0 0; font-size: 20px; line-height: 1.5; color: var(--eh-ink-muted); }
.eh-article-byline { display: flex; align-items: center; gap: 14px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--eh-line); }
.eh-avatars { display: flex; }
.eh-avatar { display: block; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; border: 2px solid var(--eh-bg); background: var(--eh-green); }
.eh-avatar + .eh-avatar { margin-left: -12px; }
.eh-avatar img { width: 100%; height: 100%; object-fit: cover; }
.eh-avatar-empty { display: grid; place-items: center; }
.eh-avatar-empty img { width: 55%; height: auto; object-fit: contain; }
.eh-byline-names { font-weight: 700; color: var(--eh-ink); }
.eh-byline-names a { text-decoration: none; }
.eh-byline-names a:hover { text-decoration: underline; }

.eh-article-image { margin: 40px auto 0; }
.eh-article-image img { width: 100%; border-radius: var(--eh-radius); }
.eh-article-image figcaption, .eh-content figcaption {
    margin-top: 10px; font-size: 14px; line-height: 1.571; color: var(--eh-ink-muted); text-align: center;
}

.eh-article-tags { display: flex; flex-wrap: wrap; gap: 10px; padding-block: 8px 24px; }
.eh-comments { padding-block: 24px 48px; }
.eh-related { background: var(--eh-bg-alt); border-top: 1px solid var(--eh-line); }

/* 12. Post content (Ghost editor output)
   -------------------------------------------------------------------------- */
.eh-content {
    display: grid;
    grid-template-columns:
        [full-start] minmax(var(--eh-gutter), 1fr)
        [wide-start] minmax(0, calc((var(--eh-wide) - var(--eh-narrow)) / 2))
        [main-start] min(var(--eh-narrow), calc(100% - var(--eh-gutter) * 2))
        [main-end] minmax(0, calc((var(--eh-wide) - var(--eh-narrow)) / 2))
        [wide-end] minmax(var(--eh-gutter), 1fr) [full-end];
    padding-block: 40px 48px;
    font-size: 18px; line-height: 1.556; /* Body style 1: 18/28 */
}
.eh-content > * { grid-column: main-start / main-end; margin: 0; }
.eh-content > * + * { margin-top: 1.4em; }
.eh-content > .kg-width-wide { grid-column: wide-start / wide-end; }
.eh-content > .kg-width-full { grid-column: full-start / full-end; }
.eh-content > .kg-width-full img { border-radius: 0; }

.eh-content h2 {
    font-family: var(--eh-font-display); font-weight: 400;
    font-size: clamp(34px, 4vw, 48px); line-height: 1.167; letter-spacing: 0.01em;
}
.eh-content h3 { font-weight: 700; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.25; }
.eh-content h4 { font-weight: 500; font-size: 24px; line-height: 1.333; }
.eh-content h5, .eh-content h6 { font-weight: 700; font-size: 18px; }
.eh-content > :is(h2, h3, h4, h5, h6) { margin-top: 1.9em; }
.eh-content > :is(h2, h3, h4) + * { margin-top: 0.7em; }

.eh-content a { color: var(--eh-accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
html[data-scheme="dark"] .eh-content a { color: var(--eh-cream); }
.eh-content a:hover { text-decoration-thickness: 2px; }
.eh-content strong { font-weight: 700; }
.eh-content ul, .eh-content ol { padding-left: 1.3em; }
.eh-content li + li { margin-top: 0.5em; }
.eh-content li::marker { color: var(--eh-accent); }
.eh-content hr { width: 100%; height: 0; border: 0; border-top: 1px solid var(--eh-line); margin-block: 2.4em; }
.eh-content blockquote:not([class]) {
    padding: 4px 0 4px 24px; border-left: 4px solid var(--eh-accent);
    font-size: 21px; line-height: 1.5; font-style: italic;
}
.eh-content blockquote.kg-blockquote-alt {
    text-align: center; padding: 0 2em;
    font-family: var(--eh-font-display); font-size: clamp(30px, 3.4vw, 40px); line-height: 1.2; font-style: normal; color: var(--eh-accent);
}
.eh-content img { border-radius: var(--eh-radius); }
.eh-content code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; background: var(--eh-bg-alt); padding: 0.15em 0.4em; border-radius: 4px; }
.eh-content pre { overflow-x: auto; padding: 20px; border-radius: var(--eh-radius); background: var(--eh-deep); color: #F6F1E3; font-size: 15px; line-height: 1.6; }
.eh-content pre code { background: none; padding: 0; color: inherit; }
.eh-content table { width: 100%; border-collapse: collapse; font-size: 16px; }
.eh-content th { text-align: left; font-weight: 500; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--eh-ink-muted); }
.eh-content th, .eh-content td { padding: 10px 12px; border-bottom: 1px solid var(--eh-line); }
.eh-content iframe { max-width: 100%; }

/* Ghost cards — keep them on brand */
.eh-content .kg-callout-card { border-radius: var(--eh-radius); }
.eh-content .kg-callout-card-accent { background: var(--eh-green); color: var(--eh-white); }
.eh-content .kg-btn-accent, .eh-content .kg-header-card-button { font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.eh-content .kg-bookmark-card a { color: inherit; text-decoration: none; }
.eh-content .kg-bookmark-container { border-radius: var(--eh-radius); }
.eh-content .kg-toggle-card { border-radius: var(--eh-radius); }

/* Forms pasted into an HTML card (e.g. Register to Hit).
   :where() keeps these low-priority, so any styles inside the form's own code still win. */
:where(.eh-content) form {
    padding: clamp(20px, 4vw, 36px);
    border: 1px solid var(--eh-line);
    border-radius: var(--eh-radius);
    background: var(--eh-bg-alt);
    font-size: 16px; line-height: 1.5;
}
:where(.eh-content form) label,
:where(.eh-content form) legend {
    display: block;
    margin: 0 0 6px;
    font-weight: 500; font-size: 15px; color: var(--eh-ink);
}
:where(.eh-content form) fieldset { margin: 0 0 20px; padding: 0; border: 0; min-width: 0; }
:where(.eh-content form) :is(
    input:not([type]), input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
    input[type="date"], input[type="url"], input[type="password"], input[type="search"], select, textarea
) {
    display: block; width: 100%;
    min-height: 48px; margin: 0 0 20px;
    padding: 11px 14px;
    border: 1px solid color-mix(in srgb, var(--eh-ink) 28%, transparent);
    border-radius: var(--eh-radius);
    background: var(--eh-bg); color: var(--eh-ink);
    font: inherit; font-size: 16px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
:where(.eh-content form) textarea { min-height: 130px; resize: vertical; }
:where(.eh-content form) select {
    appearance: none; -webkit-appearance: none;
    padding-right: 44px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234C5A4D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; background-size: 18px;
}
:where(.eh-content form) :is(input, select, textarea):focus {
    outline: none;
    border-color: var(--eh-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--eh-accent) 25%, transparent);
}
:where(.eh-content form) ::placeholder { color: var(--eh-ink-muted); opacity: 0.8; }
:where(.eh-content form) :is(input[type="radio"], input[type="checkbox"]) {
    width: 18px; height: 18px; margin: 0 8px 0 0; vertical-align: -3px;
    accent-color: var(--eh-accent);
}
:where(.eh-content form) :is(input[type="radio"], input[type="checkbox"]) + label,
:where(.eh-content form) label:has(> :is(input[type="radio"], input[type="checkbox"])) {
    display: inline-flex; align-items: center; margin: 0 22px 12px 0; font-weight: 400;
}
:where(.eh-content form) label:has(> :is(input[type="radio"], input[type="checkbox"])) > input { margin-bottom: 0; }
:where(.eh-content form) :is(button, input[type="submit"], input[type="button"]) {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 52px; margin-top: 6px; padding: 14px 32px;
    border: 0; border-radius: var(--eh-radius);
    background: var(--eh-accent); color: var(--eh-on-accent);
    font: 700 15px/1 var(--eh-font-body); letter-spacing: 0.08em; text-transform: uppercase;
    cursor: pointer;
}
:where(.eh-content form) :is(button, input[type="submit"], input[type="button"]):hover {
    background: color-mix(in srgb, var(--eh-accent) 86%, var(--eh-ink));
}
:where(.eh-content form) br + br { display: none; }

/* Paywall / sign-up box Ghost inserts into members-only posts */
.eh-content .gh-post-upgrade-cta-content {
    border-radius: var(--eh-radius); padding: 40px 32px !important;
    background: var(--eh-green) !important; color: var(--eh-white);
}
.eh-content .gh-post-upgrade-cta h2 { color: var(--eh-white); font-size: 36px; }
.eh-content .gh-post-upgrade-cta a.gh-btn {
    background: var(--eh-cream) !important; color: var(--eh-green) !important;
    border-radius: var(--eh-radius); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.eh-content .gh-post-upgrade-cta p a { color: var(--eh-cream); }

/* 13. Error pages
   -------------------------------------------------------------------------- */
.eh-error {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px;
    max-width: 640px; margin: 0 auto; padding: clamp(56px, 10vw, 120px) var(--eh-gutter);
}
.eh-error p { margin: 0; color: var(--eh-ink-muted); font-size: 18px; }
.eh-error .eh-btn { margin-top: 14px; }
.eh-error-code { font-family: var(--eh-font-display); font-size: clamp(96px, 16vw, 160px) !important; line-height: 0.9; color: var(--eh-accent) !important; }
.eh-error-mascot { width: 140px; height: auto; }
.eh-error-page { background: var(--eh-green); color: var(--eh-white); min-height: 100vh; display: grid; place-items: center; }
.eh-error-page .eh-error-code { color: var(--eh-cream) !important; }
.eh-error-logo { width: 200px; height: auto; margin-bottom: 20px; }

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