/* ============================================================
   MAX GRIMALDI — newsite.css
   ============================================================ */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Poppins", sans-serif;
    background-color: #EFE6D9;
    color: #3E2E24;
}

/* ============================================================
   HOME PAGE
   ============================================================ */

.page {
    display: flex;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.left-column {
    flex: 1 1 320px;
    min-width: 0;
}

.right-column {
    flex: 1 1 380px;
    min-width: 0;
}

/* ---------- TITLE ---------- */
.title-block {
    display: inline-block;
    background-color: #D9C6AE;
    padding: 24px 32px;
    margin: 40px 0 0 40px;
    max-width: calc(100% - 40px);
}

.title-block h1 {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    color: #3E2E24;
}

/* ---------- SIDEBAR ---------- */
.sidebar {
    padding: 20px 40px;
    max-width: 360px;
}

.sidebar-section {
    margin-bottom: 28px;
}

.sidebar-section h2 {
    display: inline-block;
    background-color: #D9C6AE;
    color: #3E2E24;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 6px 14px;
    margin: 0 0 12px;
}

.sidebar-section p {
    margin: 4px 0;
    font-size: 14px;
    color: #5A4A3E;
}

.sidebar-section ul {
    margin: 4px 0;
    padding-left: 18px;
}

.sidebar-section li {
    font-size: 14px;
    color: #5A4A3E;
    margin-bottom: 4px;
}

/* ---------- PHOTO ---------- */
.photo {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 460px;
    overflow: hidden;
    background-color: #B8A088;
}

.photo img {
    display: block;
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: bottom center;
}

/* ---------- EXPERIENCE PANEL ---------- */
.dark-panel {
    background-color: #3E2E24;
    color: #EDE4D8;
    padding: 28px 32px;
}

.dark-panel h2 {
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 18px;
}

.exp-item {
    margin-bottom: 18px;
}

.exp-item h3 {
    font-size: 16px;
    margin: 0 0 4px;
}

.exp-meta {
    font-size: 13px;
    color: #C9B8A6;
    margin: 0;
}

/* ---------- SUBJECTS I TEACH ---------- */
.subjects {
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px 40px 80px;
}

.subject-group {
    scroll-margin-top: 24px;
}

.subject-group + .subject-group {
    margin-top: 48px;
}

.subject-group h2 {
    display: inline-block;
    background-color: #D9C6AE;
    color: #3E2E24;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 6px 14px;
    margin: 0 0 20px;
}

.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 14px;
    align-items: start;
}

.class-box {
    min-width: 0;
    background-color: #F7F1E7;
    border: 2px solid #3E2E24;
}

.class-box summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 600;
    color: #3E2E24;
    cursor: pointer;
    list-style: none;
    transition: background-color 0.2s ease;
}

.class-box summary:hover {
    background-color: #E7DCCB;
}

.class-box summary::-webkit-details-marker {
    display: none;
}

.class-box summary::after {
    content: "+";
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.class-box[open] summary {
    background-color: #D9C6AE;
}

.class-box[open] summary::after {
    transform: rotate(45deg);
}

.class-box ul {
    margin: 0;
    padding: 12px 18px 14px;
    list-style: none;
    animation: dropIn 0.25s ease;
}

.class-box li {
    padding: 7px 0;
    font-size: 14px;
    color: #5A4A3E;
    border-bottom: 1px solid rgba(62, 46, 36, 0.15);
}

.class-box li:last-child {
    border-bottom: none;
}

.class-box li a {
    color: #3E2E24;
    text-decoration: none;
    border-bottom: 1px solid rgba(62, 46, 36, 0.35);
    transition: border-color 0.2s ease;
}

.class-box li a:hover {
    border-bottom-color: #3E2E24;
}

@keyframes dropIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- SITE MENU (home page) ---------- */
html {
    scroll-behavior: smooth;
}

.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 292px;
    overflow-y: auto;
    padding: 30px 0 40px;
    background-color: #2B2019;
    border-right: 1px solid #1E1611;
}

.nav-brand {
    display: block;
    margin: 0 22px 26px;
    font-size: 18px;
    font-weight: 700;
    color: #EDE4D8;
    text-decoration: none;
}

.nav-brand:hover {
    color: #F7F1E7;
}

.nav-tabs {
    list-style: none;
    margin: 0 0 26px;
    padding: 0;
}

.nav-tabs a {
    display: block;
    padding: 10px 22px;
    font-size: 13px;
    line-height: 1.45;
    color: #D6C7B4;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nav-tabs a:hover {
    background-color: #3E2E24;
    color: #F7F1E7;
}

.nav-tabs a.is-active {
    background-color: #3E2E24;
    color: #F7F1E7;
    border-left-color: #D9C6AE;
}

.site-main {
    margin-left: 292px;
}

@media (max-width: 900px) {
    .site-nav {
        position: static;
        width: auto;
        padding: 18px 0 6px;
        border-right: none;
        border-bottom: 1px solid #1E1611;
    }

    .nav-brand {
        margin-bottom: 14px;
    }

    .nav-label {
        margin-bottom: 6px;
        border-bottom: none;
    }

    .nav-tabs {
        display: flex;
        flex-wrap: wrap;
        margin-bottom: 10px;
        padding: 0 12px;
    }

    .nav-tabs a {
        padding: 8px 10px;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    .nav-tabs a.is-active {
        border-bottom-color: #D9C6AE;
    }

    .site-main {
        margin-left: 0;
    }
}

/* ============================================================
   FORMULA SHEET PAGES
   Google Doc proportions: 8.5in page = 816px, 1in margin = 78px
   ============================================================ */

.stats-page {
    background-color: #EFE6D9;
}

.doc-shell {
    display: block;
}

/* radios drive the tabs; keep them reachable but invisible */
.doc-shell > input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* ---------- FIXED TAB RAIL ---------- */
.tab-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 292px;
    overflow-y: auto;
    padding: 30px 0 40px;
    background-color: #2B2019;
    border-right: 1px solid #1E1611;
}

.nav-home {
    margin: 0 0 26px;
    padding: 0 22px;
    font-size: 13px;
}

.nav-home a {
    color: #A08D78;
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-home a:hover {
    color: #EDE4D8;
}

.nav-label {
    margin: 0 0 14px;
    padding: 0 22px 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #7A6754;
    border-bottom: 1px solid #3E2E24;
}

.tab-nav label {
    display: block;
    padding: 9px 22px;
    font-size: 13px;
    line-height: 1.45;
    color: #D6C7B4;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tab-nav label:hover {
    background-color: #3E2E24;
    color: #F7F1E7;
}

.nav-solo {
    margin: 0;
}

.nav-group {
    margin: 0;
}

.nav-group > summary {
    display: flex;
    align-items: center;
    list-style: none;
    cursor: pointer;
}

.nav-group > summary::-webkit-details-marker {
    display: none;
}

.nav-arrow {
    flex-shrink: 0;
    width: 22px;
    padding-left: 10px;
    font-size: 9px;
    color: #7A6754;
    transition: transform 0.2s ease;
}

.nav-arrow::before {
    content: "\25B6";
}

.nav-group[open] > summary .nav-arrow {
    transform: rotate(90deg);
}

.nav-group > summary label {
    flex: 1;
    padding-left: 0;
    font-weight: 600;
    color: #EDE4D8;
    letter-spacing: 0.2px;
}

.nav-group ul {
    list-style: none;
    margin: 0 0 6px;
    padding: 0;
}

.nav-group ul label {
    padding-left: 44px;
    font-size: 12.5px;
    color: #B9A793;
}

/* ---------- CONTENT AREA ---------- */
.doc-main {
    margin-left: 292px;
    padding: 46px 40px 90px;
}

.doc-page {
    max-width: 816px;
    margin: 0 auto;
    padding: 62px;
    background-color: #FBF7EF;
    border: 1px solid #E2D6C3;
}

/* ---------- TAB PANELS ---------- */
.tab-panel {
    display: none;
}

.doc-title {
    margin: 0 0 6px;
    font-size: 30px;
    font-weight: 700;
}

.doc-subtitle {
    margin: 0 0 44px;
    padding-bottom: 20px;
    font-size: 14px;
    color: #8A7A6B;
    border-bottom: 2px solid #D9C6AE;
}

/* ---------- SECTION ---------- */
.doc-section {
    margin-bottom: 52px;
}

.doc-section > h2 {
    background-color: #3E2E24;
    color: #EDE4D8;
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    padding: 12px 18px;
    margin: 0 0 20px;
}

.doc-section > h3 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #8A7A6B;
    margin: 32px 0 12px;
}

.doc-note {
    margin: 0 0 14px;
    font-size: 14px;
    line-height: 1.75;
    color: #5A4A3E;
}

.doc-note strong {
    color: #3E2E24;
}

.doc-note.center {
    text-align: center;
    font-size: 16px;
    padding: 14px 12px;
    background-color: #F2EADC;
}

/* ---------- CALLOUT ---------- */
.doc-flag {
    margin: 0 0 20px;
    padding: 12px 16px;
    background-color: #F2EADC;
    border-left: 4px solid #B8A088;
    font-size: 13px;
    line-height: 1.7;
    color: #5A4A3E;
}

.doc-flag strong {
    color: #3E2E24;
}

/* ---------- DOC TABLE ---------- */
.doc-table {
    display: grid;
    margin-bottom: 24px;
}

.doc-table.cols-2 {
    grid-template-columns: 1fr 1fr;
}

.doc-table.cols-1 {
    grid-template-columns: 1fr;
}

.doc-head {
    background-color: #D9C6AE;
    border: 2px solid #3E2E24;
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #3E2E24;
}

.doc-head span {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: #6B5847;
}

.doc-cell {
    background-color: #FFFDF8;
    border: 2px solid #3E2E24;
    border-top: none;
    padding: 18px 16px;
}

/* halve the shared vertical border in 2-column tables */
.cols-2 .doc-head:nth-child(odd),
.cols-2 .doc-cell:nth-child(odd) {
    border-right-width: 1px;
}

.cols-2 .doc-head:nth-child(even),
.cols-2 .doc-cell:nth-child(even) {
    border-left-width: 1px;
}

/* ---------- INSIDE A CELL ---------- */
.cell-title {
    text-align: center;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.5;
    color: #3E2E24;
    margin: 0 0 16px;
}

.eq {
    text-align: center;
    font-size: 16px;
    line-height: 2.4;
    color: #3E2E24;
    margin: 0 0 20px;
}

.eq.small {
    font-size: 14px;
    line-height: 2.2;
    margin-bottom: 12px;
}

.doc-cell h4 {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: #3E2E24;
    margin: 20px 0 10px;
    padding-bottom: 3px;
    border-bottom: 1px solid #3E2E24;
}

.doc-cell h4:first-child {
    margin-top: 0;
}

.doc-cell ol {
    margin: 0;
    padding-left: 18px;
}

.doc-cell ol li {
    font-size: 13px;
    line-height: 1.8;
    color: #5A4A3E;
    padding: 1px 0;
}

.var-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.var-list li {
    font-size: 13px;
    line-height: 1.8;
    color: #5A4A3E;
    padding: 5px 0;
    border-bottom: 1px solid #F2EADC;
}

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

.var-list .sym {
    font-weight: 600;
    color: #3E2E24;
}

.note-sm {
    font-size: 12px;
    line-height: 1.7;
    color: #8A7A6B;
    margin: 12px 0 0;
}

/* ---------- FLOWCHART ---------- */
.flow {
    margin: 20px 0;
}

.flow svg {
    display: block;
    width: 100%;
    height: auto;
    background-color: #FFFDF8;
    border: 2px solid #3E2E24;
}

.flow figcaption {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.6;
    color: #8A7A6B;
}

/* ---------- FIGURES ---------- */
.fig {
    margin: 20px 0;
}

.fig img {
    display: block;
    width: 100%;
    height: auto;
    background-color: #FBF7EF;
    border: 1px solid #E2D6C3;
}

.fig figcaption {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.6;
    color: #8A7A6B;
}

.doc-cell .fig {
    margin: 0 0 16px;
}

.doc-cell .fig:last-child {
    margin-bottom: 0;
}

/* ---------- FRACTIONS ---------- */
.frac {
    display: inline-flex;
    flex-direction: column;
    vertical-align: middle;
    text-align: center;
    margin: 0 3px;
}

.frac .num {
    border-bottom: 1.5px solid currentColor;
    padding: 0 6px 2px;
}

.frac .den {
    padding: 2px 6px 0;
}

/* ---------- RADICALS ---------- */
.sqrt {
    display: inline-flex;
    align-items: stretch;
    vertical-align: middle;
}

.sqrt .rad {
    font-size: 1.15em;
    line-height: 1;
    align-self: flex-end;
}

.sqrt .under {
    border-top: 1.5px solid currentColor;
    padding: 3px 5px 0;
}

/* ---------- NARROW SCREENS ---------- */
@media (max-width: 900px) {
    .tab-nav {
        position: static;
        width: auto;
        max-height: 300px;
        padding: 22px 0;
        border-right: none;
    }

    .doc-main {
        margin-left: 0;
        padding: 24px 0 60px;
    }

    .doc-page {
        padding: 32px 22px;
        border: none;
    }

    .doc-title {
        font-size: 24px;
    }

    .doc-table.cols-2 {
        grid-template-columns: 1fr;
    }

    .cols-2 .doc-head,
    .cols-2 .doc-cell {
        border-left-width: 2px;
        border-right-width: 2px;
    }

    .cols-2 .doc-head {
        border-top-width: 2px;
    }
}

@media (max-width: 820px) {
    .title-block {
        margin: 24px 0 0 24px;
        padding: 18px 24px;
    }

    .title-block h1 {
        font-size: 26px;
    }

    .sidebar {
        padding: 20px 24px;
        max-width: 100%;
    }

    .dark-panel {
        padding: 24px;
    }

    .subjects {
        padding: 36px 24px 60px;
    }
}
