/* ==========================================================================
   Shared "handbook" scaffold for every page except the homepage.
   Scoped under body.math-page so it overrides global.css's shared
   navbar/header rules only on the pages that opt in, without touching
   global.css itself. Page-specific component styles (coach roster,
   timeline, competition list, etc.) live in each page's own stylesheet
   and build on the classes defined here.
   ========================================================================== */

body.math-page {
    background-color: #fbfaf7;
    color: #22262e;
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
}

body.math-page html,
body.math-page {
    scroll-behavior: smooth;
}

/* ── Navbar override ── */
body.math-page .navbar {
    background-color: #fdfcfa;
    border-bottom: none;
}

body.math-page .navbar__container {
    border-bottom: 2px solid #1c4b3a;
}

body.math-page .navbar__logo-text {
    font-family: 'Lora', Georgia, serif;
    font-weight: 600;
    color: #1c4b3a;
    letter-spacing: 0.02em;
}

body.math-page .navbar__links {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #3a3f47;
}

body.math-page .navbar__links:hover {
    color: #1c4b3a;
    text-decoration: underline;
    text-underline-offset: 4px;
}

body.math-page .button {
    background: #ffffff;
    color: #1c4b3a;
    border: 1.5px solid #1c4b3a;
    border-radius: 3px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

body.math-page .button:hover {
    background: #1c4b3a;
    color: #ffffff;
    border: 1.5px solid #1c4b3a;
}

@media screen and (max-width: 1000px) {
    body.math-page .navbar__menu {
        background-color: #fdfcfa;
    }

    body.math-page .navbar__links {
        border-bottom: 0.5px solid rgba(28, 75, 58, 0.18);
    }

    body.math-page .button {
        border-radius: 3px;
    }
}

/* ── Document header ── */
body.math-page .header,
body.math-page .doc-header {
    background-color: #fbfaf7;
    background-image: none;
    border-bottom: 1px solid #d8d4c8;
    border-top: 4px solid #1c4b3a;
    padding: 5vh 6vw 4vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
}

body.math-page .doc-header__kicker {
    width: 100%;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #96751c;
}

body.math-page h1 {
    width: 100%;
    font-family: 'Lora', Georgia, serif;
    font-weight: 700;
    font-size: clamp(2.4rem, 6vw, 3.4rem);
    letter-spacing: 0;
    color: #1c4b3a;
    text-transform: none;
}

body.math-page .doc-header__desc {
    width: 100%;
    max-width: 46rem;
    font-size: clamp(0.9rem, 1.2vw, 1rem);
    line-height: 1.65;
    color: #4a4f57;
    font-style: italic;
}

/* ── Two-column document layout ── */
body.math-page .doc-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 0;
    align-items: start;
    max-width: 1200px;
    margin: 0 auto;
}

/* ── Table of contents sidebar ── */
body.math-page .toc {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    overflow-y: auto;
    padding: 3.5rem 1.75rem 2rem 2.5rem;
    border-right: 1px solid #d8d4c8;
}

body.math-page .toc__title {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #96751c;
    margin-bottom: 0.9rem;
}

body.math-page .toc__list,
body.math-page .toc__list ol {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

body.math-page .toc__list > li {
    margin-bottom: 0.65rem;
}

body.math-page .toc__list ol {
    margin: 0.35rem 0 0.65rem 0.9rem;
}

body.math-page .toc__list ol li {
    margin-bottom: 0.4rem;
}

body.math-page .toc a {
    display: block;
    font-family: 'Lora', Georgia, serif;
    font-size: 0.92rem;
    color: #33363d;
    text-decoration: none;
    line-height: 1.4;
    border-left: 2px solid transparent;
    padding-left: 0.6rem;
}

body.math-page .toc__list ol a {
    font-size: 0.85rem;
    color: #565a62;
}

body.math-page .toc a:hover {
    color: #96751c;
    border-left: 2px solid #96751c;
}

/* ── Main content column ── */
body.math-page .doc-content {
    padding: 3.5rem 4vw 6vh 3.5rem;
    max-width: 760px;
}

body.math-page .doc-section + .doc-section {
    margin-top: 3.5rem;
    padding-top: 3rem;
    border-top: 1px solid #d8d4c8;
}

body.math-page h2 {
    font-family: 'Lora', Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.7rem, 3vw, 2.1rem);
    letter-spacing: 0;
    color: #1c4b3a;
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #1c4b3a;
}

body.math-page h3 {
    font-family: 'Lora', Georgia, serif;
    font-weight: 600;
    font-size: 1.15rem;
    letter-spacing: 0;
    color: #22262e;
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin-top: 2rem;
    margin-bottom: 0.6rem;
}

body.math-page .sec-num {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    color: #96751c;
    flex-shrink: 0;
}

body.math-page h2 .sec-num {
    font-size: 1.1rem;
}

body.math-page h3 .sec-num {
    font-size: 0.85rem;
}

body.math-page .section-intro {
    color: #4a4f57;
    font-style: italic;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.7;
}

body.math-page p {
    font-size: 0.95rem;
    line-height: 1.75;
    color: #2c2f36;
}

body.math-page .doc-content a {
    color: #1c4b3a;
    text-decoration: underline;
    text-underline-offset: 2px;
}

body.math-page .doc-content a:hover {
    color: #96751c;
}

/* ── Callout box (notes, warnings, key info) ── */
body.math-page .note-box {
    border-left: 3px solid #96751c;
    background-color: #f7f1de;
    padding: 1rem 1.25rem;
    margin-top: 0.5rem;
}

body.math-page .note-box p {
    margin: 0;
}

/* ── Generic data table (roster, offerings, timeline, etc.) ── */
body.math-page .table-wrap {
    overflow-x: auto;
    margin-top: 1rem;
    border: 1px solid #d8d4c8;
}

body.math-page .doc-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
}

body.math-page .doc-table th {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: left;
    background-color: #1c4b3a;
    color: #f0e6c8;
    padding: 0.75rem 1rem;
}

body.math-page .doc-table td {
    padding: 1rem;
    font-size: 0.9rem;
    line-height: 1.65;
    vertical-align: top;
    border-top: 1px solid #d8d4c8;
}

body.math-page .doc-table tbody tr:nth-child(even) {
    background-color: #f8f4e6;
}

body.math-page .doc-table__label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    color: #96751c;
    white-space: nowrap;
}

body.math-page .doc-table__title {
    font-family: 'Lora', Georgia, serif;
    font-weight: 600;
    color: #1c4b3a;
    white-space: nowrap;
}

body.math-page .doc-table ul {
    margin: 0;
    padding-left: 1.1rem;
}

body.math-page .doc-table li + li {
    margin-top: 0.35rem;
}

/* ── Resource list (linked items: drive folders, slideshows, etc.) ── */
body.math-page .resource-list {
    list-style: none;
    margin-top: 1rem;
    padding: 0;
}

body.math-page .resource-list__item {
    padding: 1.1rem 0;
    border-bottom: 1px solid #d8d4c8;
}

body.math-page .resource-list__item:last-child {
    border-bottom: none;
}

body.math-page .resource-list__title {
    font-family: 'Lora', Georgia, serif;
    font-weight: 600;
    font-size: 1.05rem;
    color: #1c4b3a;
    margin-bottom: 0.35rem;
}

body.math-page .resource-list__desc {
    margin-bottom: 0.6rem;
}

body.math-page .resource-list__action {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #96751c;
    text-decoration: none;
}

body.math-page .resource-list__action:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
    color: #96751c;
}

/* ── Inline fact tags (dates, formats, eligibility) ── */
body.math-page .facts-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.9rem;
    margin-top: 0.6rem;
}

body.math-page .facts-row span {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.76rem;
    color: #5a5040;
    padding-left: 0.9rem;
    position: relative;
}

body.math-page .facts-row span:first-child {
    padding-left: 0;
}

body.math-page .facts-row span:not(:first-child)::before {
    content: '\00B7';
    position: absolute;
    left: 0;
    color: #96751c;
}

/* ── Responsive ── */
@media screen and (max-width: 900px) {
    body.math-page .doc-layout {
        grid-template-columns: 1fr;
    }

    body.math-page .toc {
        position: static;
        height: auto;
        overflow-y: visible;
        border-right: none;
        border-bottom: 1px solid #d8d4c8;
        padding: 1.75rem 6vw;
    }

    body.math-page .toc__list ol {
        margin-left: 1rem;
    }

    body.math-page .doc-content {
        padding: 2.5rem 6vw 5vh;
        max-width: 100%;
    }
}

@media screen and (max-width: 600px) {
    body.math-page h1 {
        font-size: clamp(2rem, 10vw, 2.6rem);
    }

    body.math-page h2 {
        font-size: 1.5rem;
    }
}
