/* ==========================================================================
   article.css - long-form editorial pages (guides, about)
   Loaded only on content pages. Extends .content-card from components.css
   with the elements long articles need: breadcrumbs, bylines, tables,
   ordered lists, pull quotes, key-point callouts, CTA and related lists.
   ========================================================================== */

/* ----- Breadcrumb ----- */
.breadcrumb {
    max-width: 900px;
    margin: 88px auto 12px;
    padding: 0 4px;
    font-size: var(--text-sm);
    color: var(--on-surface-muted);
    line-height: 1.6;
}

.breadcrumb a {
    color: var(--on-surface-muted);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.breadcrumb a:hover {
    color: var(--primary-600);
    border-bottom-color: currentColor;
}

.breadcrumb span[aria-current] {
    color: var(--on-surface-variant);
}

body.dark-mode .breadcrumb a:hover {
    color: var(--primary-300, #a5b4fc);
}

/* ----- Byline ----- */
.article-byline {
    font-size: var(--text-sm) !important;
    color: var(--on-surface-muted) !important;
    margin: -12px 0 24px !important;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--neutral-200);
    line-height: 1.9;
}

.article-byline strong {
    color: var(--on-surface-variant);
    font-weight: 600;
}

.byline-sep {
    margin: 0 8px;
    opacity: 0.6;
}

body.dark-mode .article-byline {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

/* ----- Standfirst / lede ----- */
.content-card .standfirst {
    font-size: var(--text-lg);
    line-height: 1.7;
    color: var(--on-surface-variant);
    margin-bottom: 22px;
}

/* ----- Table of contents ----- */
.toc {
    background: var(--surface-variant, rgba(102, 126, 234, 0.06));
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    padding: 18px 22px;
    margin: 0 0 28px;
}

.toc h2 {
    font-size: var(--text-base) !important;
    margin: 0 0 8px !important;
    color: var(--on-surface) !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.toc ul {
    margin: 0;
    padding-left: 20px;
}

.toc li {
    margin-bottom: 5px;
    font-size: var(--text-sm);
}

body.dark-mode .toc {
    background: rgba(129, 140, 248, 0.1);
    border-color: rgba(255, 255, 255, 0.08);
}

/* ----- Ordered lists ----- */
.content-card ol {
    margin: 14px 0;
    padding-left: 24px;
}

.content-card ol li {
    font-size: var(--text-base);
    color: var(--on-surface-variant);
    margin-bottom: 10px;
    line-height: 1.6;
}

/* ----- Tables ----- */
.table-wrap {
    overflow-x: auto;
    margin: 18px 0 22px;
    -webkit-overflow-scrolling: touch;
}

.content-card table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

/* Column floors. Without these, a narrow viewport squeezes the long explanatory
   column to ~100px, and its wrapped text sets a row height the other columns
   fill with blank space. Floors force a modest horizontal scroll instead, which
   .table-wrap already handles. */
.content-card th,
.content-card td {
    min-width: 88px;
}

.content-card td:last-child,
.content-card th:last-child {
    min-width: 260px;
}

.content-card tr > td:only-child,
.content-card tr > th:only-child {
    min-width: 0;
}

.content-card th,
.content-card td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--neutral-200);
    color: var(--on-surface-variant);
    vertical-align: top;
    line-height: 1.5;
}

.content-card th {
    color: var(--on-surface);
    font-weight: 700;
    background: rgba(102, 126, 234, 0.07);
    white-space: nowrap;
}

.content-card tbody tr:last-child td {
    border-bottom: none;
}

body.dark-mode .content-card th,
body.dark-mode .content-card td {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .content-card th {
    background: rgba(129, 140, 248, 0.12);
}

/* ----- Callout ----- */
.callout {
    border-left: 4px solid var(--primary-500);
    background: rgba(102, 126, 234, 0.07);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 14px 18px;
    margin: 20px 0;
}

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

.callout .callout-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--primary-600);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

body.dark-mode .callout {
    background: rgba(129, 140, 248, 0.12);
    border-left-color: #a5b4fc;
}

body.dark-mode .callout .callout-label {
    color: #a5b4fc;
}

/* ----- Pull quote ----- */
.content-card blockquote {
    margin: 20px 0;
    padding: 4px 0 4px 20px;
    border-left: 3px solid var(--neutral-300, #d4d4d8);
    font-style: italic;
    color: var(--on-surface-variant);
}

.content-card blockquote cite {
    display: block;
    margin-top: 6px;
    font-style: normal;
    font-size: var(--text-sm);
    color: var(--on-surface-muted);
}

body.dark-mode .content-card blockquote {
    border-left-color: rgba(255, 255, 255, 0.18);
}

/* ----- Play CTA ----- */
.play-cta {
    margin: 32px 0 8px;
    padding: 22px 24px;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12), rgba(118, 75, 162, 0.12));
    border: 1px solid var(--neutral-200);
}

.play-cta .play-cta-title {
    font-size: var(--text-lg) !important;
    margin: 0 0 6px !important;
    color: var(--on-surface) !important;
}

.play-cta p {
    margin-bottom: 10px;
}

.play-cta-link {
    display: inline-block;
    padding: 10px 22px;
    border-radius: var(--radius-full, 999px);
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700, #5b21b6));
    color: #fff !important;
    font-weight: 600;
    text-decoration: none !important;
    min-height: 44px;
    line-height: 24px;
}

.play-cta-link:hover {
    filter: brightness(1.08);
    color: #fff !important;
}

body.dark-mode .play-cta {
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .play-cta-link {
    background: linear-gradient(135deg, #818cf8, #a5b4fc);
    color: #171a3a !important;
}

body.dark-mode .play-cta-link:hover {
    color: #171a3a !important;
}

/* ----- Related list ----- */
.related-list {
    list-style: none;
    padding-left: 0 !important;
}

.related-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--neutral-200);
}

.related-list li:last-child {
    border-bottom: none;
}

.related-list a {
    font-weight: 600;
}

.related-blurb {
    display: block;
    margin-top: 3px;
    font-size: var(--text-sm);
    color: var(--on-surface-muted);
    line-height: 1.5;
}

body.dark-mode .related-list li {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

/* ----- Foot links ----- */
.article-foot {
    margin-top: 28px !important;
    padding-top: 18px;
    border-top: 1px solid var(--neutral-200);
    font-size: var(--text-sm) !important;
}

.article-foot span {
    margin: 0 6px;
    opacity: 0.5;
}

body.dark-mode .article-foot {
    border-top-color: rgba(255, 255, 255, 0.08);
}

/* ----- Guide index cards ----- */
.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin: 18px 0 8px;
}

.guide-card {
    display: block;
    padding: 18px 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--neutral-200);
    background: var(--surface);
    text-decoration: none !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

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

.guide-card .guide-kicker {
    display: block;
    font-size: var(--text-xs, 12px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--primary-600);
    margin-bottom: 6px;
}

.guide-card .guide-title {
    display: block;
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--on-surface);
    line-height: 1.4;
    margin-bottom: 6px;
}

.guide-card .guide-blurb {
    display: block;
    font-size: var(--text-sm);
    color: var(--on-surface-variant);
    line-height: 1.55;
}

.guide-card .guide-meta {
    display: block;
    margin-top: 8px;
    font-size: var(--text-xs, 12px);
    color: var(--on-surface-muted);
}

body.dark-mode .guide-card {
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .guide-card .guide-kicker {
    color: #a5b4fc;
}

@media (max-width: 768px) {
    .breadcrumb {
        margin-top: 72px;
        font-size: var(--text-xs, 12px);
    }

    /* Stack each row instead of scrolling a 4-column table sideways on a phone.
       Every td carries data-label with its column header, so the value is still
       identifiable once the header row is gone. */
    .table-wrap {
        overflow-x: visible;
    }

    .content-card table,
    .content-card tbody,
    .content-card tr,
    .content-card td {
        display: block;
        width: auto;
        min-width: 0;
    }

    .content-card thead {
        display: none;
    }

    .content-card tr {
        padding: 12px 0;
        border-bottom: 1px solid var(--neutral-200);
    }

    .content-card tbody tr:last-child {
        border-bottom: none;
    }

    .content-card td {
        border-bottom: none;
        padding: 3px 0;
    }

    .content-card td[data-label]::before {
        content: attr(data-label) ": ";
        font-weight: 700;
        color: var(--on-surface);
    }

    .content-card td:first-child {
        font-weight: 700;
        color: var(--on-surface);
        font-size: var(--text-base);
        padding-bottom: 5px;
    }

    .content-card td:first-child[data-label]::before {
        content: none;
    }

    body.dark-mode .content-card tr {
        border-bottom-color: rgba(255, 255, 255, 0.08);
    }

    .play-cta {
        padding: 18px;
    }
}
