/* MyRaceHub - 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: 24px 20px 48px;
}

.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
   ============================================================ */
.callout {
    background: var(--rs-bg-elevated);
    border-left: 4px solid var(--rs-accent);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
}

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

.tip {
    background: #f0faf0;
    border-left: 4px solid #34a853;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
}

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

/* 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 h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.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(251, 212, 14, 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 h3 {
    font-family: var(--font-display, 'Outfit', 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; }
    .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, 'Space Grotesk', system-ui, sans-serif);
    line-height: 1.78;
    color: var(--text-secondary, #5A6C7D);
    font-size: 1.05rem;
}

.article-body h2,
.article-body h3,
.article-body h4 {
    font-family: var(--font-display, 'Outfit', system-ui, sans-serif);
    font-weight: 700;
    color: var(--text-primary, #0A2540);
}

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

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

.article-body p,
.article-body li {
    line-height: 1.78;
}

.article-body a {
    color: var(--text-primary, #0A2540);
    text-decoration: underline;
    text-decoration-color: var(--ocean-bright, #1A7FA0);
    text-underline-offset: 2px;
    font-weight: 500;
}

.article-body a:hover {
    text-decoration-color: var(--text-primary, #0A2540);
}

.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, #FBD40E);
    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;
    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);
}

.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, #FBD40E);
}

.feature-article-title {
    font-family: var(--font-display, 'Outfit', 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, #FBD40E);
    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, #FBD40E);
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    align-self: flex-start;
}

.races-teaser-title {
    font-family: var(--font-display, 'Outfit', 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;
}

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

.archive-edition-title {
    font-family: var(--font-display, 'Outfit', sans-serif);
    font-weight: 700;
    font-size: 1rem;
    color: var(--rs-text);
    line-height: 1.3;
    margin: 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;
    }
}
