/* RacesCanada - Guide Content Styles v4
   Content-only styles for guide, terms, privacy, and article pages
   Used alongside style.css + race-search.css
   ============================================================ */

/* ============================================================
   GUIDE CONTENT CONTAINER
   ============================================================ */
.guide-container {
    max-width: 800px;
    margin: 70px auto 0; /* Clear fixed header */
    padding: 40px 20px 48px;
    position: relative;
}
/* Phones: the fixed header is two rows (97px); at 70px the page title sat
   under it on /privacy, /terms and the guides (20 Oct 2026). */
@media (max-width: 768px) {
    .guide-container { margin-top: 97px; padding-top: 28px; }
}

/* Article pages carry a single .article-body. Give them a slightly wider
   shell than the 800px terms/privacy/index default - the gutter ad rails
   that used to flank the column were removed site-wide 2026-09 and 800px
   read as a skinny strip on a wide viewport. 880px keeps line length
   sane (~90 chars at this size). */
.guide-container:has(> .article-body) {
    max-width: 880px;
}

/* Standfirst on the guides index — gives the page prose of its own rather than
   just a list of article titles. */
.guides-intro {
    margin: 0 0 36px;
}

.guides-intro p {
    color: var(--rs-text-muted, #52606d);
    font-size: 1.125rem;
    line-height: 1.75;
    margin: 0 0 16px;
}

.guides-intro p:last-child {
    margin-bottom: 0;
}

.guide-container h1 {
    color: var(--rs-text);
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.guide-container .guide-meta {
    color: var(--rs-text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.guide-container .last-updated {
    color: var(--rs-text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.guide-container h2 {
    color: var(--rs-text);
    margin-top: 2.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--rs-accent);
}

.guide-container h3 {
    color: var(--rs-text);
    margin-top: 1.5rem;
}

.guide-container p,
.guide-container li {
    line-height: 1.8;
    color: var(--rs-text-secondary);
    font-size: 1.05rem;
}

.guide-container ul,
.guide-container ol {
    padding-left: 1.5rem;
}

.guide-container li {
    margin-bottom: 0.5rem;
}

.guide-container a {
    color: var(--rs-text);
    text-decoration: underline;
    text-decoration-color: var(--rs-accent);
    text-underline-offset: 2px;
    font-weight: 500;
}

.guide-container a:hover {
    text-decoration-color: var(--rs-text);
}

/* ============================================================
   CALLOUT & TIP BOXES
   ============================================================ */
/* Tinted panels with a hairline border (20 Oct 2026): they were 4px coloured
   side stripes, and .tip was an off-brand green. */
.callout {
    background: var(--rs-bg-elevated);
    border: 1px solid var(--rs-border);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: 12px;
}

.callout p:last-child { margin-bottom: 0; }

.tip {
    background: var(--rs-accent-light);
    border: 1px solid rgba(213,43,30, 0.55);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: 12px;
    color: var(--rs-text);
}

.tip p:last-child { margin-bottom: 0; }

/* ============================================================
   RESPONSIVE VIDEO EMBED (YouTube etc.)
   ============================================================ */
.video-embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 1.5rem 0;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
}
.video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ============================================================
   GUIDE DATA TABLE (wrapping cells, unlike .pace-table)
   ============================================================ */
.guide-table-wrapper {
    overflow-x: auto;
    margin: 1.25rem 0;
    border-radius: 8px;
    border: 1px solid var(--rs-border);
}
.guide-table {
    margin: 0;
    border: none;
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
}
.guide-table th,
.guide-table td {
    text-align: left;
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--rs-border);
    vertical-align: top;
    font-size: 0.95rem;
}
.guide-table th {
    background: var(--rs-bg-elevated);
    font-weight: 600;
    white-space: nowrap;
}
.guide-table tr:last-child td { border-bottom: 0; }
.guide-table td a { white-space: nowrap; font-weight: 600; }

/* Highlight box (terms/privacy) */
.highlight-box {
    background: var(--rs-bg-elevated);
    border-left: 4px solid var(--rs-accent);
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    border-radius: 0 8px 8px 0;
}

.highlight-box p { margin-bottom: 0.5rem; }
.highlight-box ul { margin-bottom: 0; }

/* ============================================================
   TABLE OF CONTENTS
   ============================================================ */
.toc {
    background: var(--rs-bg-elevated);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid var(--rs-border);
}

.toc :is(h2, h3) {
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 0.75rem;
    padding-bottom: 0;
    border-bottom: 0;
}

.toc ol { margin: 0; padding-left: 1.5rem; }
.toc a { color: var(--rs-text); text-decoration: underline; text-decoration-color: var(--rs-accent); text-underline-offset: 2px; }
.toc a:hover { text-decoration-color: var(--rs-text); }

/* ============================================================
   CTA BUTTONS
   ============================================================ */
.cta-link {
    display: inline-block;
    background: var(--rs-accent);
    color: var(--rs-accent-text) !important;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none !important;
    transition: all 0.2s ease;
    margin: 0.5rem 0.5rem 0.5rem 0;
}

.cta-link:hover {
    background: var(--rs-accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ============================================================
   TABLES
   ============================================================ */
.guide-container table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.95rem;
}

.guide-container th,
.guide-container td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border: 1px solid var(--rs-border);
}

.guide-container th {
    background: var(--rs-bg-elevated);
    font-weight: 600;
    color: var(--rs-text);
}

.guide-container tbody tr:hover {
    background: rgba(213,43,30, 0.06);
}

/* Pace table specific */
.pace-table-wrapper {
    overflow-x: auto;
    margin: 1rem 0;
    border-radius: 8px;
    border: 1px solid var(--rs-border);
}

.pace-table {
    margin: 0;
    border: none;
    min-width: 500px;
}

.pace-table th,
.pace-table td {
    text-align: center;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.pace-table th:first-child,
.pace-table td:first-child {
    text-align: left;
    font-weight: 600;
    background: var(--rs-bg-elevated);
}

/* ============================================================
   GUIDES LANDING PAGE - Card Grid
   ============================================================ */
.guides-intro {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--rs-text-secondary);
    margin-bottom: 2rem;
}

.guide-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin: 2rem 0;
}

.guide-card {
    background: var(--rs-bg-card);
    border: 1px solid var(--rs-border);
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none !important;
    color: inherit !important;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.guide-card:hover {
    border-color: var(--rs-accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.guide-card .card-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.guide-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
    color: var(--rs-text);
}

.guide-card p {
    color: var(--rs-text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
    flex-grow: 1;
}

.card-tag {
    display: inline-block;
    background: var(--rs-bg-elevated);
    color: var(--rs-text-muted);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 1rem;
    align-self: flex-start;
}

/* ============================================================
   BREADCRUMB & RELATED GUIDES
   ============================================================ */
.breadcrumb {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--rs-text-muted);
}

.breadcrumb a {
    color: var(--rs-text-muted) !important;
    font-weight: 400;
}

.breadcrumb a:hover {
    color: var(--rs-text) !important;
}

/* Article race CTA strip */
.article-race-cta {
    margin-top: 3rem;
    padding: 1.5rem;
    background: var(--rs-bg-elevated);
    border-radius: 12px;
    border: 1px solid var(--rs-border);
}

.article-race-cta :is(h2, h3) {
    font-family: var(--font-display, 'Varela Round', sans-serif);
    font-weight: 700;
    color: var(--rs-text);
    margin: 0 0 0.4rem;
    font-size: 1.2rem;
}

.article-race-cta p {
    color: var(--rs-text-muted);
    font-size: 0.95rem;
    margin: 0 0 1rem;
}

.related-guides {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--rs-border);
}

.related-guides h3 {
    margin-bottom: 1rem;
}

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .guide-container h1 { font-size: 1.8rem; }
    .guide-cards { grid-template-columns: 1fr; }
    .guide-container table { font-size: 0.85rem; }
    /* A bare table (legal pages, older guides) with no scroll wrapper: let it
       scroll inside its own box rather than run past the column and be clipped
       by body's overflow-x. Wrapped tables keep their wrapper's scroller. */
    .guide-container table:not(.guide-table):not(.pace-table) {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .guide-container th,
    .guide-container td { padding: 0.4rem 0.5rem; }

    /* Article body — mobile editorial treatment */
    .article-body figure {
        margin-left: -20px;
        margin-right: -20px;
    }
    .article-body figure img {
        border-radius: 0 !important;
    }
    .article-body h2 { font-size: 1.35rem; }
}

/* ============================================================
   ARTICLE BODY — Jinja template rendered content
   Uses design tokens from style.css
   ============================================================ */
.article-body {
    font-family: var(--font-body);
    line-height: 1.7;
    color: var(--rs-text-secondary);
    font-size: 1.125rem;
}

.article-body h2,
.article-body h3,
.article-body h4 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--rs-text);
}

.article-body h2 {
    margin-top: 2.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--rs-accent, var(--rs-accent));
}

.article-body h3 { margin-top: 1.5rem; }

/* style.css zeroes every margin, so paragraphs ran together (20 Oct 2026).
   18px set here too: .guide-container p (1.05rem) otherwise wins. */
.article-body p,
.article-body li {
    font-size: 1.125rem;
    line-height: 1.7;
}
.article-body p { margin: 0 0 1.1em; }
.article-body h2 { margin-bottom: 0.75rem; }
.article-body h3 { margin-bottom: 0.5rem; }

.article-body a {
    color: var(--rs-text);
    text-decoration: underline;
    text-decoration-color: var(--rs-text-secondary);
    text-underline-offset: 2px;
    font-weight: 500;
}

.article-body a:hover {
    text-decoration-color: var(--rs-text);
}

.article-body ul,
.article-body ol { padding-left: 1.5rem; }

.article-body li { margin-bottom: 0.5rem; }

/* Figure image — clickable race card with hover state */
.article-body figure {
    margin: 1.5rem 0;
    position: relative;
}

.article-body figure a {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.article-body figure a img {
    display: block;
    width: 100%;
    transition: transform 0.35s ease;
}

.article-body figure a:hover img {
    transform: scale(1.03);
}

.article-body figure a::after {
    content: 'View race →';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.2rem 1rem 0.8rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-align: right;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.article-body figure a:hover::after {
    opacity: 1;
}

/* Figcaption — more editorial presence */
.article-body figcaption {
    font-size: 0.82rem;
    color: var(--rs-text-muted);
    margin-top: 0.5rem;
    font-weight: 500;
    padding-left: 8px;
    border-left: 2px solid var(--rs-accent);
    line-height: 1.4;
}

/* ============================================================
   MAGAZINE FLOAT LAYOUT — text wraps around image
   ============================================================ */
.article-body figure.float-right {
    float: right;
    max-width: 280px;
    margin: 0.25rem 0 1.25rem 1.75rem;
    clear: right;
}
.article-body figure.float-left {
    float: left;
    max-width: 280px;
    margin: 0.25rem 1.75rem 1.25rem 0;
    clear: left;
}

/* Section separators always reset float context */
.article-body hr {
    clear: both;
}

/* Mobile: collapse floats to block layout */
@media (max-width: 640px) {
    .article-body figure.float-right,
    .article-body figure.float-left {
        float: none;
        max-width: 100%;
        margin: 1rem 0;
    }
}

/* Full-bleed figure — escapes the 800px column on desktop */
@media (min-width: 900px) {
    .article-body figure.full-bleed {
        margin-left: calc(-50vw + 400px);
        margin-right: calc(-50vw + 400px);
        max-width: 100vw;
    }
    .article-body figure.full-bleed a {
        border-radius: 0;
    }
    .article-body figure.full-bleed img {
        border-radius: 0 !important;
        max-height: 520px;
        object-fit: cover;
    }
}

/* Article hero — eyebrow back-link */
.article-hero-eyebrow {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.article-hero-eyebrow a {
    color: var(--rs-accent, #D52B1E);
    text-decoration: none;
}

.article-hero-eyebrow a:hover {
    text-decoration: underline;
}

/* Article hero author/reading-time badge */
.article-hero-meta {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 10px;
}

/* ============================================================
   GUIDE CARDS — image-first variant for DB-driven guides landing
   ============================================================ */
.guide-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    /* Grey while the image loads, not a blank white hole on a slow phone. */
    background: var(--rs-bg-elevated);
    border-radius: 8px 8px 0 0;
    margin: -1.5rem -1.5rem 1rem; /* bleed to card edges */
    width: calc(100% + 3rem);
}

.guide-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.guide-card:hover .guide-card-image img {
    transform: scale(1.04);
}

/* Diamond-tier homepage race cards (see /advertise) reuse .guide-card's
   visual family rather than a bespoke component - this badge is the only
   addition they need. */
.featured-race-card .guide-card-image {
    position: relative;
    aspect-ratio: 2 / 1;     /* race images are mostly 2:1; see fitRaceImage() */
    background: var(--rs-bg-elevated);
}
.featured-race-card .guide-card-image img.fit-contain {
    object-fit: contain;
    padding: 5%;
    box-sizing: border-box;
}
.featured-race-card:hover .guide-card-image img.fit-contain { transform: none; }

.guide-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* When there's no image, guide-card-body fills the full card */
.guide-card:not(:has(.guide-card-image)) .guide-card-body {
    flex: 1;
}

/* ============================================================
   GUIDES LANDING — hero clears fixed header (top padding)
   ============================================================ */
.guide-container {
    /* Already defined above — ensure consistent top spacing when hero is present */
}

/* Guides landing: hero + content need the same container top offset */
.search-hero + .guide-container {
    margin-top: 2rem;
}

/* ============================================================
   FEATURE ARTICLE CARD — monthly "What's On" editorial feature
   ============================================================ */
.feature-article-card {
    display: block;
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none !important;
    color: inherit;
    margin-bottom: 2.5rem;
    min-height: 260px;
    background: var(--rs-bg-card);
    border: 1px solid var(--rs-border);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.feature-article-card:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    transform: translateY(-2px);
}

.feature-article-image {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.feature-article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.feature-article-card:hover .feature-article-image img {
    transform: scale(1.03);
}

.feature-article-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.52) 50%, rgba(0,0,0,0.2) 100%);
}

.feature-article-body {
    position: relative;
    z-index: 1;
    padding: 2.5rem 2rem;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 260px;
    justify-content: center;
}

.feature-article-eyebrow {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--rs-accent, #D52B1E);
}

.feature-article-title {
    font-family: var(--font-display, 'Varela Round', sans-serif);
    font-weight: 700;
    font-size: clamp(1.25rem, 3vw, 1.8rem);
    color: #fff;
    line-height: 1.2;
    margin: 0;
    border: none;
    padding: 0;
}

.feature-article-subtitle {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.82);
    line-height: 1.5;
    margin: 0;
}

.feature-article-cta {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--rs-accent, #D52B1E);
    letter-spacing: 0.04em;
}

/* Override .guide-container h2/p specificity inside the feature card */
.guide-container .feature-article-card h2,
.guide-container .feature-article-title {
    color: #fff;
    border: none;
    border-bottom: none;
    margin: 0;
    padding: 0;
    font-size: clamp(1.25rem, 3vw, 1.8rem);
    line-height: 1.2;
}
.guide-container .feature-article-subtitle {
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

/* ============================================================
   WHAT'S ON SECTION — promoted position on landing page
   Sits between coverage stats and dashboard section
   ============================================================ */
.whats-on-section {
    padding: 0 20px 0;
    max-width: 860px;
    margin: 0 auto;
}

.whats-on-inner {
    max-width: 820px;
    margin: 0 auto;
}

.whats-on-feature-card {
    min-height: 280px;
    margin-bottom: 0;
}

.whats-on-feature-card .feature-article-body {
    min-height: 280px;
    max-width: 560px;
}

.whats-on-feature-card .feature-article-title {
    font-size: clamp(1.4rem, 3.5vw, 2rem);
}

@media (max-width: 768px) {
    .whats-on-feature-card {
        min-height: 220px;
    }
    .whats-on-feature-card .feature-article-body {
        min-height: 220px;
    }
}

/* ============================================================
   RACES PAGE ARTICLE TEASER — horizontal editorial strip
   Shows title + hook text + thumbnail beside race listing
   ============================================================ */
.races-article-teaser {
    margin-bottom: 1.5rem;
}

.races-article-teaser-link {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    text-decoration: none !important;
    background: var(--rs-bg-card);
    border: 1px solid var(--rs-border);
    border-left: 3px solid var(--rs-accent);
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    color: inherit;
}

.races-article-teaser-link:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    transform: translateY(-1px);
}

.races-teaser-body {
    flex: 1;
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.races-teaser-eyebrow {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #7a6200;
    background: var(--rs-accent, #D52B1E);
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    align-self: flex-start;
}

.races-teaser-title {
    font-family: var(--font-display, 'Varela Round', sans-serif);
    font-weight: 700;
    font-size: clamp(0.95rem, 2.2vw, 1.15rem);
    color: var(--rs-text);
    line-height: 1.25;
    margin: 0;
}

.races-teaser-hook {
    font-size: 0.87rem;
    color: var(--rs-text-muted);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.races-teaser-cta {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--rs-text-muted);
    margin-top: 0.15rem;
}

.races-teaser-image {
    width: 180px;
    flex-shrink: 0;
    overflow: hidden;
}

.races-teaser-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.races-article-teaser-link:hover .races-teaser-image img {
    transform: scale(1.04);
}

@media (max-width: 600px) {
    .races-teaser-image { width: 110px; }
    .races-teaser-hook { display: none; }
    .races-teaser-body { padding: 0.9rem 1rem; }
}

/* ============================================================
   WHAT'S ON NAVIGATION STRIP — prev edition + archive link
   Shown at bottom of the whats-on article
   ============================================================ */
.whats-on-nav-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-top: 1.5rem;
    border-top: 1px solid var(--rs-border);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.whats-on-nav-strip a {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--rs-text-muted) !important;
    text-decoration: none !important;
}

.whats-on-nav-strip a:hover {
    color: var(--rs-text) !important;
}

/* Archive link on guides landing page */
.whats-on-archive-prompt {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rs-border);
}

.whats-on-archive-prompt a {
    font-size: 0.9rem;
    color: var(--rs-text-muted) !important;
    text-decoration: none !important;
    font-weight: 500;
}

.whats-on-archive-prompt a:hover {
    color: var(--rs-text) !important;
}

/* ============================================================
   WHAT'S ON ARCHIVE PAGE — edition card list
   ============================================================ */
.archive-edition-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.archive-edition-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    text-decoration: none !important;
    color: inherit;
    background: var(--rs-bg-card);
    border: 1px solid var(--rs-border);
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.archive-edition-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transform: translateY(-1px);
    border-color: var(--rs-accent);
}

.archive-edition-image {
    width: 160px;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--rs-bg-elevated);
}

.archive-edition-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.archive-edition-card:hover .archive-edition-image img {
    transform: scale(1.04);
}

.archive-edition-body {
    flex: 1;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.archive-edition-month {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--rs-text-muted);
}

/* h2 since the page title became the h1 (20 Oct 2026); undo .guide-container h2. */
.archive-edition-title,
.guide-container .archive-edition-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    color: var(--rs-text);
    line-height: 1.3;
    margin: 0;
    padding: 0;
    border: 0;
}

.archive-edition-desc {
    font-size: 0.87rem;
    color: var(--rs-text-muted);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.archive-edition-cta {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--rs-text-muted);
    margin-top: auto;
    padding-top: 0.25rem;
}

@media (max-width: 600px) {
    .archive-edition-image { width: 100px; }
    .archive-edition-desc { display: none; }
    .archive-edition-body { padding: 0.85rem 1rem; }
}

/* Landing page variant — slightly shorter */
.landing-feature-card {
    min-height: 220px;
    margin-bottom: 1.5rem;
}

.landing-feature-card .feature-article-body {
    min-height: 220px;
    padding: 2rem 1.75rem;
}

.landing-feature-card .feature-article-title {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
}

@media (max-width: 768px) {
    .feature-article-overlay {
        background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.72) 100%);
    }
    .feature-article-body {
        padding: 1.5rem 1.25rem;
        max-width: 100%;
        justify-content: flex-end;
        min-height: 200px;
    }
}

/* ============================================================
   AD CONTAINERS — guides articles and homepage
   .ad-container's base rule lives in race-search.css, which both pages
   load first.
   ============================================================ */

/* Homepage unit. Google's data-ad-status doc: "If ad units aren't initially visible on
   the page, we may not execute the ad request" - and a height:0 /
   overflow:hidden box at push time counts as not visible. So: a small
   reserved band until AdSense answers (Google's own CLS advice), grow to
   the fill, and remove the container on a reported no-fill. */
.ad-homepage {
    /* Inside the ~1100px content column like every other homepage section,
       not full-bleed across a 1440px screen. */
    max-width: 1100px;
    margin: 0 auto;
    padding: 0;
    height: var(--ad-reserve);   /* see tokens.css */
    overflow: hidden;
}

.ad-homepage ins.adsbygoogle {
    min-height: var(--ad-reserve);
}
.ad-homepage ins.adsbygoogle[data-ad-status] {
    min-height: 0;
}

.ad-homepage:has(ins[data-ad-status="filled"]) {
    height: auto;
    overflow: visible;
}

.ad-homepage:has(ins[data-ad-status="unfilled"]) {
    display: none;
}

/* In-article units: data-ad-format="fluid" / in-article. Google's data-ad-status doc: "If ad units aren't initially visible on
   the page, we may not execute the ad request" - and a height:0 /
   overflow:hidden box at push time counts as not visible. So: a small
   reserved band until AdSense answers (Google's own CLS advice), grow to
   the fill, and remove the container on a reported no-fill.
   Briefly collapsed to height:0 on 2026-09-16, which stopped them
   requesting - the same finding as August's note here. */
.ad-article {
    margin: 0;
    padding: 0;
    height: var(--ad-reserve);   /* see tokens.css */
    overflow: hidden;
}

.ad-article ins.adsbygoogle,
.ad-article ins.adsbygoogle-lazy {
    min-height: var(--ad-reserve);
}
.ad-article ins.adsbygoogle[data-ad-status] {
    min-height: 0;
}

.ad-article:has(ins[data-ad-status="filled"]) {
    height: auto;
    overflow: visible;
    margin: 32px auto;
    max-width: 100%;
}

.ad-article:has(ins[data-ad-status="unfilled"]) {
    display: none;
}

/* The guides/clubs index tail units use the shared .ad-tail in
   side-rails.css, which carries the divider and gap. */

/* Homepage sections are full-bleed; keep the unit inside the same gutter the
   editorial copy below it uses. */
.ad-homepage:has(ins[data-ad-status="filled"]) {
    margin: 8px auto 40px;
    max-width: 1100px;
    padding: 0 24px;
}

/* ============================================================
   PHONES: guide tables as cards, full-bleed in-article ads
   (23 Sep 2026, reported on /guides/5k-foam-fest-australia)
   ============================================================ */
@media (max-width: 600px) {
    /* A 4-column .guide-table has a 480px min-width inside a 350px column,
       so the last column - the "Details & entry" link, the one thing the
       table is for - sat off-screen behind a scroller nobody noticed. Each
       row becomes a card; cells are labelled from their column heading
       (data-label, set by article.html), the first cell is the card title. */
    .guide-table-wrapper {
        overflow: visible;
        border: 0;
        border-radius: 0;
    }
    .guide-table,
    .guide-table tbody,
    .guide-table tr,
    .guide-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }
    .guide-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
    .guide-table tr {
        background: var(--rs-bg-card);
        border: 1px solid var(--rs-border);
        border-radius: 12px;
        padding: 12px 14px;
        margin-bottom: 10px;
    }
    .guide-table td,
    .guide-table tr:last-child td {
        border: 0;
        padding: 2px 0;
        font-size: 0.95rem;
    }
    .guide-table td:first-child {
        font-weight: 700;
        font-size: 1.02rem;
        padding-bottom: 4px;
    }
    .guide-table td:not(:first-child)[data-label]::before {
        content: attr(data-label) ": ";
        color: var(--rs-text-muted);
        font-weight: 500;
    }
    .guide-table td a {
        white-space: normal;
    }
    /* A cell that is only a link is the row's call to action: full tap height. */
    .guide-table td.guide-table-cta a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }

    /* AdSense widens in-article (fluid) creatives to the full screen width on
       phones, but from the column's left edge - so the ad ran 20px past the
       right side. Make the container itself full-bleed: a full-width creative
       then fits exactly, a narrower one is centred. !important because
       AdSense writes an inline width:100% onto the container at push. */
    .ad-article,
    .ad-article:has(ins[data-ad-status="filled"]) {
        width: 100vw !important;
        max-width: none;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
    }
}

/* Articles: the article plus Journey's sidebar from 1100px (20 Oct 2026).
   Article column ~770px (Journey: 728-1024), sidebar 320px. */
.guide-container.article-layout { max-width: 880px; }
@media (min-width: 1100px) {
    .guide-container.article-layout {
        max-width: 1180px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) 320px;
        gap: 48px;
        align-items: start;
    }
}
.article-main { min-width: 0; }

/* Article page head (8 Nov 2026, style.css PAGE FRAME): breadcrumb, the table of
   contents and the opening paragraph span the page above the article and
   Journey's sidebar (app.py split_article_head). */
.article-head-body { font-family: var(--font-body); color: var(--rs-text-secondary); }
.article-head-body > p { font-size: 1.2rem; line-height: 1.65; color: var(--rs-text); max-width: 68ch; margin: 0 0 1.5rem; }
.article-head-body .toc { margin-bottom: 1.75rem; }
.article-head-body .toc li { margin-bottom: 0.35rem; font-size: 1.05rem; line-height: 1.5; }
@media (min-width: 1100px) {
    .article-head-body .toc ol { column-count: 2; column-gap: 48px; }
    .article-head-body .toc li { break-inside: avoid; }
}
