/* ============================================================
   notes-page.css
   Stylesheet for individual topic landing pages (/notes/<slug>/)
   Shares the same design tokens as the main site's styles.css
   so these pages feel native, not bolted on.
   ============================================================ */

:root {
    --bbc-red: #BB1919;
    --bbc-dark: #222222;
    --bbc-black: #1a1a1a;
    --bbc-white: #ffffff;
    --bbc-gray: #6e6e6e;
    --bbc-light-gray: #f2f2f2;
    --bbc-border: #d5d5d5;
    --bbc-hover: #e8e8e8;
}

* { box-sizing: border-box; }

body.notes-page {
    margin: 0;
    font-family: 'Inter', -apple-system, Helvetica, Arial, sans-serif;
    color: var(--bbc-dark);
    background: var(--bbc-white);
    line-height: 1.6;
}

.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Header / nav (matches site header) --- */
.site-header {
    background: var(--bbc-black);
    border-bottom: 4px solid var(--bbc-red);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    font-family: 'Source Serif 4', 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 800;
    color: var(--bbc-white);
    text-decoration: none;
}
.logo span { color: var(--bbc-red); }

.site-nav { display: flex; gap: 24px; }
.site-nav a {
    color: var(--bbc-white);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
    border-bottom-color: var(--bbc-red);
}

.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--bbc-white);
    border-radius: 4px;
    padding: 6px 10px;
    color: var(--bbc-white);
    font-size: 13px;
    cursor: pointer;
}

@media (max-width: 720px) {
    .site-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bbc-black);
        flex-direction: column;
        gap: 0;
        padding: 8px 20px 16px;
        border-bottom: 3px solid var(--bbc-red);
    }
    .site-nav.open { display: flex; }
    .site-nav a { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.1); }
    .menu-toggle { display: inline-block; }
}

/* --- Breadcrumb --- */
.breadcrumb {
    font-size: 13px;
    color: var(--bbc-gray);
    padding: 16px 0 0;
}
.breadcrumb a { color: var(--bbc-gray); text-decoration: none; }
.breadcrumb a:hover { color: var(--bbc-red); text-decoration: underline; }

/* --- Topic header --- */
.topic-header { padding: 12px 0 20px; border-bottom: 1px solid var(--bbc-border); }

.topic-kicker {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: var(--bbc-red);
    background: rgba(187,25,25,0.08);
    padding: 4px 10px;
    border-radius: 3px;
    margin-bottom: 12px;
}

.topic-header h1 {
    font-family: 'Source Serif 4', 'Playfair Display', serif;
    font-size: 36px;
    line-height: 1.15;
    margin: 0 0 12px;
    color: var(--bbc-black);
}

.topic-dek {
    font-size: 17px;
    color: var(--bbc-gray);
    max-width: 65ch;
    margin: 0 0 20px;
}

.topic-hero-image {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: 8px;
    margin: 0 0 20px;
    background: var(--bbc-light-gray);
}

@media (max-width: 600px) {
    .topic-hero-image { max-height: 240px; border-radius: 6px; }
}

.topic-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--bbc-gray);
}

/* --- Download button --- */
.pdf-download-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin: 20px 0 8px;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bbc-red);
    color: var(--bbc-white);
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    padding: 12px 22px;
    border-radius: 4px;
    border: 2px solid var(--bbc-red);
    transition: background 0.15s ease, color 0.15s ease;
}
.btn-download:hover { background: var(--bbc-black); border-color: var(--bbc-black); }
.btn-download svg { flex-shrink: 0; }

.btn-take-test {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bbc-white);
    color: var(--bbc-black);
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    padding: 12px 22px;
    border-radius: 4px;
    border: 2px solid var(--bbc-black);
    transition: background 0.15s ease, color 0.15s ease;
}
.btn-take-test:hover { background: var(--bbc-black); color: var(--bbc-white); }
.btn-take-test svg { flex-shrink: 0; }

.file-note {
    font-size: 13px;
    color: var(--bbc-gray);
}

/* --- Article body --- */
.topic-body {
    padding: 32px 0 8px;
    font-size: 16px;
    max-width: 70ch;
}

.topic-body h2 {
    font-family: 'Source Serif 4', 'Playfair Display', serif;
    font-size: 24px;
    margin: 36px 0 12px;
    padding-bottom: 8px;
    border-bottom: 3px solid var(--bbc-red);
    display: inline-block;
}

.topic-body h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 22px 0 8px;
    color: var(--bbc-black);
}

.topic-body p { margin: 0 0 14px; }

.topic-body ul,
.topic-body ol {
    margin: 0 0 16px;
    padding-left: 22px;
}
.topic-body li { margin-bottom: 6px; }

.key-points {
    background: var(--bbc-light-gray);
    border-left: 4px solid var(--bbc-red);
    padding: 16px 20px;
    margin: 20px 0;
    border-radius: 0 4px 4px 0;
}
.key-points p:last-child { margin-bottom: 0; }

/* --- PDF viewer --- */
.pdf-viewer-section {
    margin: 36px 0;
    padding-top: 28px;
    border-top: 1px solid var(--bbc-border);
}

.pdf-viewer-section h2 {
    font-family: 'Source Serif 4', 'Playfair Display', serif;
    font-size: 22px;
    margin: 0 0 14px;
}

.read-online-card {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: inherit;
    background: var(--bbc-light-gray);
    border: 1px solid var(--bbc-border);
    border-radius: 8px;
    padding: 20px;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.read-online-card:hover { border-color: var(--bbc-red); background: #ffffff; }
.roc-icon { font-size: 32px; flex-shrink: 0; }
.roc-text { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.roc-title { font-weight: 800; font-size: 17px; color: var(--bbc-black); }
.roc-sub { font-size: 13px; color: var(--bbc-gray); line-height: 1.4; }
.roc-arrow { font-size: 22px; color: var(--bbc-red); flex-shrink: 0; }

@media (max-width: 600px) {
    .read-online-card { padding: 16px; gap: 12px; }
    .roc-icon { font-size: 26px; }
    .roc-title { font-size: 15px; }
    .roc-sub { font-size: 12px; }
    .topic-header h1 { font-size: 27px; }
}

/* --- Related notes --- */
.related-notes {
    margin: 44px 0 20px;
    padding-top: 28px;
    border-top: 1px solid var(--bbc-border);
}
.related-notes h2 {
    font-family: 'Source Serif 4', 'Playfair Display', serif;
    font-size: 20px;
    margin: 0 0 16px;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}
.related-card {
    display: block;
    border: 1px solid var(--bbc-border);
    border-radius: 5px;
    padding: 14px 16px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, transform 0.1s ease;
}
.related-card:hover { border-color: var(--bbc-red); }
.related-card .rc-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--bbc-red);
    display: block;
    margin-bottom: 4px;
}
.related-card .rc-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--bbc-black);
}

.next-chapter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 18px;
    padding: 16px 18px;
    background: var(--bbc-black);
    border-radius: 5px;
}
.next-chapter a {
    color: var(--bbc-white);
    text-decoration: none;
    font-weight: 700;
}
.next-chapter a:hover { color: var(--bbc-red); }
.next-chapter .nc-label {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    letter-spacing: 0.04em;
}

/* --- Footer --- */
.site-footer {
    margin-top: 48px;
    padding: 28px 0;
    background: var(--bbc-black);
    color: rgba(255,255,255,0.7);
    font-size: 13px;
}
.site-footer a { color: rgba(255,255,255,0.85); }
.site-footer .footer-inner {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.topic-figure { margin: 22px 0; }
.topic-figure img { display: block; width: 100%; height: auto; border-radius: 8px; background: var(--bbc-light-gray); }
.topic-figure figcaption { margin-top: 8px; font-size: 14px; color: #666; text-align: center; }

/* ============================================================
   Modern refresh (matches /modern.css on the main site)
   ============================================================ */
:root {
    --mc-ink: #0f172a; --mc-ink-2: #334155; --mc-muted: #64748b; --mc-bg: #f6f7fb; --mc-surface: #ffffff;
    --mc-line: #e5e8f0; --mc-accent: #c8102e; --mc-accent-d: #a50d26; --mc-accent-soft: #fdecef;
    --mc-shadow: 0 1px 2px rgba(15,23,42,.05), 0 8px 24px rgba(15,23,42,.06);
    --mc-navy: #0f1b3d;
    --mc-accent-rgb: 200,16,46; --mc-deep: #7c1d3a; --mc-navy-2: #1e2f63; --mc-glow-rgb: 59,91,219;
    --mc-t1a: #d6213f; --mc-t1b: #a50d26; --mc-t2a: #1e2f63; --mc-t2b: #0f1b3d; --mc-t3a: #3b5bdb; --mc-t3b: #2a43a8;
    --bbc-red: var(--mc-accent); --bbc-dark: var(--mc-ink); --bbc-black: var(--mc-navy); --bbc-white: var(--mc-surface);
    --bbc-gray: var(--mc-muted); --bbc-light-gray: #f1f4f9; --bbc-border: var(--mc-line); --bbc-hover: #eef1f7;
}
html[data-theme="dark"] {
    --mc-ink: #e8ecf7; --mc-ink-2: #c3cce0; --mc-muted: #94a0bd; --mc-bg: #0b1120; --mc-surface: #131b2e;
    --mc-line: #26304a; --mc-accent: #ef4a63; --mc-accent-d: #d93a53; --mc-accent-soft: #2a1620;
    --mc-shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    --bbc-black: #0b1120; --bbc-light-gray: #19223a; --bbc-hover: #1d2742; color-scheme: dark;
}
body.notes-page { background: var(--mc-bg); color: var(--mc-ink); -webkit-font-smoothing: antialiased; }
.site-header {
    background: color-mix(in srgb, var(--mc-surface) 88%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--mc-line); position: sticky; top: 0; z-index: 50;
}
.logo { font-family: 'Inter', sans-serif; font-weight: 800; letter-spacing: -0.03em; color: var(--mc-ink); display: inline-flex; align-items: center; }
.logo::before {
    content: 'MC'; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin-right: 10px;
    background: linear-gradient(135deg, var(--mc-accent), var(--mc-deep)); color: #fff; border-radius: 9px; font-size: 13px; font-weight: 800; letter-spacing: 0;
}
.site-nav a { color: var(--mc-ink-2); border: none; padding: 8px 14px; border-radius: 999px; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--mc-accent-soft); color: var(--mc-accent); border: none; }
.menu-toggle { border-color: var(--mc-line); color: var(--mc-ink); border-radius: 10px; }
@media (max-width: 720px) {
    .site-nav { background: var(--mc-surface); border-bottom: 1px solid var(--mc-line); box-shadow: 0 16px 32px rgba(15,23,42,.12); }
    .site-nav a { border-bottom: none; border-radius: 12px; }
}
.container.main, main.container { padding-top: 4px; }
.breadcrumb a { color: var(--mc-muted); }
.topic-header {
    background: var(--mc-surface); border: 1px solid var(--mc-line); border-radius: 20px; box-shadow: var(--mc-shadow);
    padding: 28px 28px 24px; margin-top: 14px;
}
.topic-header h1, .topic-body h2, .pdf-viewer-section h2, .related-notes h2 { font-family: 'Inter', sans-serif; font-weight: 800; letter-spacing: -0.025em; color: var(--mc-ink); }
.topic-kicker { background: var(--mc-accent-soft); color: var(--mc-accent); border-radius: 999px; padding: 5px 12px; letter-spacing: .05em; }
.topic-dek { color: var(--mc-muted); }
.topic-hero-image { border-radius: 14px; }
.topic-meta { color: var(--mc-muted); }
.btn-download, .btn-take-test {
    border-radius: 999px; font-weight: 600; transition: transform .12s, background .15s, box-shadow .15s;
}
.btn-download { background: var(--mc-accent); color: #fff; box-shadow: 0 6px 16px rgba(var(--mc-accent-rgb),.25); }
.btn-download:hover { background: var(--mc-accent-d); transform: translateY(-1px); }
.topic-body { background: var(--mc-surface); border: 1px solid var(--mc-line); border-radius: 20px; padding: 8px 28px 20px; margin-top: 20px; box-shadow: var(--mc-shadow); }
.topic-body p, .topic-body li { color: var(--mc-ink-2); line-height: 1.8; }
.topic-figure img { border-radius: 14px; }
.read-online-card, .related-card, .next-chapter {
    background: var(--mc-surface); border: 1px solid var(--mc-line); border-radius: 16px; box-shadow: var(--mc-shadow);
    transition: transform .18s, box-shadow .18s, border-color .18s;
}
.read-online-card:hover, .related-card:hover, .next-chapter:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--mc-accent) 35%, var(--mc-line)); }
.site-footer { background: var(--mc-navy); color: rgba(255,255,255,.6); border: none; }
.site-footer a { color: rgba(255,255,255,.85); }
html[data-theme="dark"] .site-footer { background: #080d19; }
.theme-toggle {
    width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--mc-line); background: transparent; color: var(--mc-ink-2);
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; margin-left: 8px;
}
.theme-toggle:hover { background: var(--bbc-hover); }
@media (max-width: 600px) { .topic-header, .topic-body { padding-left: 18px; padding-right: 18px; border-radius: 16px; } }

/* dark-mode safe text colours and consistent widths */
.btn-take-test { color: var(--mc-ink); border-color: var(--mc-ink-2); background: transparent; }
.btn-take-test:hover { background: var(--mc-ink); color: var(--mc-surface); }
.roc-title, .related-card .rc-title { color: var(--mc-ink); }
.topic-body { max-width: none; }
.topic-body > * { max-width: 70ch; }
.topic-body > .topic-figure { max-width: 100%; }
.topic-body h3 { color: var(--mc-ink); }
.next-chapter { background: var(--mc-navy); border-color: var(--mc-navy); }
html[data-theme="dark"] .next-chapter { background: var(--mc-surface); border: 1px solid var(--mc-line); }


/* ---------- Colour palettes: classic (default) / emerald / royal ----------
   Preview any of them with  ?palette=emerald  or  ?palette=royal  on any page
   (the choice is remembered in that browser).  ?palette=classic goes back. */
html[data-palette="emerald"] {
    --mc-accent: #0f8a5f; --mc-accent-d: #0b6e4c; --mc-accent-soft: #e6f6ef; --mc-accent-rgb: 15,138,95;
    --mc-deep: #064e3b; --mc-navy: #07281f; --mc-navy-2: #0f4a39; --mc-glow-rgb: 14,165,164;
    --mc-t1a: #14a374; --mc-t1b: #0b6e4c; --mc-t2a: #0f4a39; --mc-t2b: #07281f; --mc-t3a: #0ea5a4; --mc-t3b: #0b7c7b;
}
html:not([data-palette="classic"]):not([data-palette="emerald"]) {
    --mc-accent: #6d28d9; --mc-accent-d: #5b21b6; --mc-accent-soft: #f1eafe; --mc-accent-rgb: 109,40,217;
    --mc-deep: #3b0764; --mc-navy: #1a1038; --mc-navy-2: #2e1a66; --mc-glow-rgb: 219,39,119;
    --mc-t1a: #7c3aed; --mc-t1b: #5b21b6; --mc-t2a: #2e1a66; --mc-t2b: #1a1038; --mc-t3a: #db2777; --mc-t3b: #a21caf;
}
html[data-theme="dark"][data-palette="emerald"] { --mc-accent: #34d399; --mc-accent-d: #22b883; --mc-accent-soft: #0f2a22; --mc-accent-rgb: 52,211,153; --mc-navy: #0b1120; }
html[data-theme="dark"]:not([data-palette="classic"]):not([data-palette="emerald"]) { --mc-accent: #a78bfa; --mc-accent-d: #8b6cf0; --mc-accent-soft: #231a40; --mc-accent-rgb: 167,139,250; --mc-navy: #0b1120; }
