/* ============================================================
   PACVS Research Summit — Education section
   Loaded after style.css on education pages only.
   ============================================================ */

:root {
    --g-established: #2D6A4F;  --g-established-bg: #D8F0E3;
    --g-supported:   #1B4965;  --g-supported-bg:   #DCEBF5;
    --g-emerging:    #8A5A00;  --g-emerging-bg:    #FBEFCF;
    --g-contested:   #A3312A;  --g-contested-bg:   #F9E0DE;
    --g-hypothesis:  #5B5B78;  --g-hypothesis-bg:  #ECECF3;
}

/* ── Education sub-navigation ── */
.edu-subnav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 63px;
    z-index: 90;
}
.edu-subnav ul {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    list-style: none;
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
}
.edu-subnav ul::-webkit-scrollbar { display: none; }
.edu-subnav li { margin: 0; flex: none; }
.edu-subnav a {
    display: block;
    padding: 0.85rem 0.9rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.edu-subnav a:hover { color: var(--primary); text-decoration: none; }
.edu-subnav a[aria-current="page"] { color: var(--primary); border-bottom-color: var(--accent); font-weight: 600; }

.page-header .eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.5rem;
}
.page-header p { max-width: 720px; }

.lede { font-size: 1.0625rem; line-height: 1.7; color: var(--text-secondary); max-width: 720px; }

.prose { max-width: 720px; }

/* ── Grades & chips ── */
.grade {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
    line-height: 1.6;
}
.grade::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.grade-established { color: var(--g-established); background: var(--g-established-bg); }
.grade-supported   { color: var(--g-supported);   background: var(--g-supported-bg); }
.grade-emerging    { color: var(--g-emerging);    background: var(--g-emerging-bg); }
.grade-contested   { color: var(--g-contested);   background: var(--g-contested-bg); }
.grade-hypothesis  { color: var(--g-hypothesis);  background: var(--g-hypothesis-bg); }

.chip {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    background: var(--grey-light);
    border: 1px solid var(--border);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
a.chip:hover { border-color: var(--accent); color: var(--primary); text-decoration: none; }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.chip-row li { margin: 0; }

.basis {
    font-size: 0.6875rem;
    color: var(--grey-mid);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.75rem 1.25rem;
    margin: 1.25rem 0 0;
    padding: 0;
    list-style: none;
}
.legend li { margin: 0; font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.5; }
.legend .grade { margin-bottom: 0.3rem; }

.note-box {
    background: var(--grey-light);
    border-left: 4px solid var(--accent);
    border-radius: 0 8px 8px 0;
    padding: 1rem 1.25rem;
    font-size: 0.9375rem;
    color: var(--text-secondary);
}
.note-box p:last-child { margin-bottom: 0; }

/* ── Hub ── */
.hub-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}
@media (max-width: 900px) { .hub-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .hub-grid { grid-template-columns: 1fr; } }
.hub-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.hub-card:hover { border-color: var(--accent); box-shadow: 0 6px 20px rgba(27,73,101,0.08); transform: translateY(-2px); text-decoration: none; }
.hub-card .hub-num { font-size: 0.75rem; font-weight: 600; color: var(--accent); letter-spacing: 0.08em; margin-bottom: 0.75rem; }
.hub-card h3 { color: var(--primary); font-size: 1.125rem; margin-bottom: 0.4rem; }
.hub-card p { font-size: 0.9rem; margin-bottom: 1rem; }
.hub-card .hub-meta { margin-top: auto; font-size: 0.8125rem; color: var(--primary-light); font-weight: 600; }

/* ── Mechanism overview tiles ── */
.mech-index {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.mech-index li { margin: 0; }
.mech-index a {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 0.75rem;
    height: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.9rem 1rem;
    color: inherit;
}
.mech-index a:hover { border-color: var(--accent); text-decoration: none; }
.mech-num {
    grid-row: span 2;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.mech-index .t { font-weight: 600; color: var(--text-primary); font-size: 0.9375rem; line-height: 1.35; }
.mech-index .g { display: flex; gap: 0.35rem 0.75rem; flex-wrap: wrap; align-items: center; font-size: 0.6875rem; color: var(--grey-mid); font-weight: 600; }
.mech-index .g > span { white-space: nowrap; display: inline-flex; align-items: center; gap: 0.3rem; }
.mech-index .d { font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.45; }

/* ── Network diagram ── */
.net-figure {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    margin: 0;
}
.net-figure svg { width: 100%; height: auto; display: block; max-width: 640px; margin: 0 auto; }
.net-figure figcaption { font-size: 0.8125rem; color: var(--text-secondary); margin-top: 0.75rem; text-align: center; }
.net-edge { stroke: #B8C4D0; stroke-width: 1.4; fill: none; transition: stroke 0.15s, opacity 0.15s; }
.net-node circle { fill: var(--surface); stroke: var(--primary); stroke-width: 2; transition: fill 0.15s; }
.net-node text { font-family: inherit; font-size: 12px; fill: var(--text-primary); font-weight: 600; }
.net-node .n { fill: var(--primary); font-size: 13px; font-weight: 700; }
.net-node { cursor: pointer; }
.net-node:hover circle, .net-node:focus circle { fill: var(--primary); }
.net-node:hover .n, .net-node:focus .n { fill: #fff; }
.net.is-hover .net-edge { opacity: 0.15; }
.net.is-hover .net-edge.on { opacity: 1; stroke: var(--accent); stroke-width: 2.2; }
.net-key { display: flex; justify-content: center; gap: 1.25rem; font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.5rem; flex-wrap: wrap; }

/* ── Mechanism section ── */
.mech {
    scroll-margin-top: 120px;
    padding: 3rem 0;
    border-top: 1px solid var(--border);
}
.mech-head { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 0.75rem; }
.mech-head .mech-num { width: 40px; height: 40px; font-size: 1rem; flex: none; grid-row: auto; }
.mech-head h2 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.mech-tagline { font-size: 1.0625rem; color: var(--text-primary); font-weight: 500; margin-bottom: 0.25rem; }
.mech-summary { max-width: 760px; }

.cond-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.5rem 0; }
@media (max-width: 700px) { .cond-grid { grid-template-columns: 1fr; } }
.cond {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.15rem;
}
.cond-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.cond-name { font-size: 0.8125rem; font-weight: 700; color: var(--primary); letter-spacing: 0.02em; }
.cond p { font-size: 0.875rem; margin: 0; }

.sub-h {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--grey-mid);
    margin: 1.75rem 0 0.75rem;
}

.comp-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.comp-list li { margin: 0; padding: 0.9rem 1.15rem; border-top: 1px solid var(--border); }
.comp-list li:first-child { border-top: 0; }
.comp-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin-bottom: 0.25rem; }
.comp-name { font-weight: 600; color: var(--text-primary); font-size: 0.9375rem; }
.comp-list p { font-size: 0.875rem; margin: 0; }

.tri { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
@media (max-width: 800px) { .tri { grid-template-columns: 1fr; } }
.tri ul { margin: 0; padding: 0; list-style: none; }
.tri li { font-size: 0.875rem; color: var(--text-secondary); padding: 0.35rem 0; border-bottom: 1px dashed var(--border); margin: 0; }
.tri li:last-child { border-bottom: 0; }
.tri .kind { font-size: 0.6875rem; color: var(--grey-mid); text-transform: uppercase; letter-spacing: 0.04em; margin-left: 0.25rem; }
.status { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--grey-mid); margin-left: 0.3rem; white-space: nowrap; }
.status-in-use { color: var(--g-established); }
.status-in-trials { color: var(--g-supported); }

.questions { margin: 0; padding-left: 1.25rem; }
.questions li { font-size: 0.9rem; }

sup.ref { font-size: 0.7em; line-height: 0; margin-left: 1px; }
sup.ref a { color: var(--primary-light); font-weight: 600; }

/* ── Figures from articles ── */
.article-fig {
    margin: 1.75rem 0 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.article-fig a.zoom { display: block; background: #fff; }
.article-fig img { display: block; width: 100%; height: auto; max-height: 560px; object-fit: contain; }
.article-fig figcaption { padding: 0.9rem 1.15rem; border-top: 1px solid var(--border); font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.55; }
.article-fig .credit { display: block; margin-top: 0.35rem; font-size: 0.75rem; color: var(--grey-mid); }

/* ── References ── */
.refs { counter-reset: none; margin: 0; padding-left: 1.75rem; }
.refs li { font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.55; margin-bottom: 0.6rem; scroll-margin-top: 120px; }
.refs li:target { background: var(--warning-bg); border-radius: 4px; }
.refs .flag { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; padding: 0.05rem 0.4rem; border-radius: 4px; margin-left: 0.35rem; }
.refs .flag-contra { color: var(--g-contested); background: var(--g-contested-bg); }
.refs .flag-pre { color: var(--g-emerging); background: var(--g-emerging-bg); }

/* ── Endotypes ── */
.endo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
@media (max-width: 760px) { .endo-grid { grid-template-columns: 1fr; } }
.endo {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 4px solid var(--accent);
    border-radius: 8px;
    padding: 1.4rem 1.5rem;
    scroll-margin-top: 120px;
}
.endo h3 { color: var(--primary); font-size: 1.1875rem; margin-bottom: 0.4rem; }
.endo > p { font-size: 0.9rem; }
.endo dl { margin: 0; display: grid; gap: 0.85rem; }
.endo dt { font-size: 0.6875rem; font-weight: 700; color: var(--grey-mid); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.3rem; }
.endo dd { margin: 0; font-size: 0.875rem; color: var(--text-secondary); }
.endo dd ul { margin: 0; padding-left: 1.1rem; }
.endo dd li { margin-bottom: 0.15rem; }

.implications { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (max-width: 700px) { .implications { grid-template-columns: 1fr; } }
.implication { border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.15rem; background: var(--surface); }
.implication h3 { font-size: 0.9375rem; color: var(--text-primary); margin-bottom: 0.3rem; }
.implication p { font-size: 0.875rem; margin: 0; }
.implication.warning { border-left: 4px solid var(--warning); }

/* ── Data tables ── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th { text-align: left; font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--grey-mid); font-weight: 700; padding: 0.75rem 1rem; background: var(--grey-light); border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--text-secondary); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td:first-child { font-weight: 600; color: var(--text-primary); }
.dir { font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.dir-up { color: var(--g-contested); }
.dir-down { color: var(--g-supported); }
.dir-mixed, .dir-present { color: var(--g-emerging); }

.filter-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }
.filter-bar input[type="search"] {
    flex: 1 1 220px;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font: inherit;
    font-size: 0.9rem;
    background: var(--surface);
    color: var(--text-primary);
}
.filter-bar input[type="search"]:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.filter-btn {
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    font: inherit;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    cursor: pointer;
}
.filter-btn[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ── Supplements ── */
.supp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
@media (max-width: 760px) { .supp-grid { grid-template-columns: 1fr; } }
.supp {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.35rem 1.5rem;
    scroll-margin-top: 120px;
}
.supp-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.25rem; }
.supp h3 { color: var(--primary); font-size: 1.125rem; margin: 0; }
.supp .cls { font-size: 0.8125rem; color: var(--grey-mid); margin-bottom: 0.75rem; }
.supp p { font-size: 0.875rem; }
.supp dl { margin: 0; display: grid; gap: 0.7rem; }
.supp dt { font-size: 0.6875rem; font-weight: 700; color: var(--grey-mid); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.2rem; }
.supp dd { margin: 0; font-size: 0.875rem; color: var(--text-secondary); }
.supp dd ul { margin: 0; padding-left: 1.1rem; }
.supp-more { margin-top: 1rem; border-top: 1px solid var(--border); padding-top: 0.75rem; }
.supp-more summary { cursor: pointer; font-size: 0.8125rem; font-weight: 600; color: var(--primary-light); list-style-position: outside; }
.supp-more summary:hover { color: var(--primary); }
.supp-more[open] summary { margin-bottom: 0.85rem; }
.supp-refs { margin: 0.85rem 0 0; font-size: 0.75rem; color: var(--grey-mid); }

.section-intro { max-width: 720px; margin-bottom: 1.75rem; }
.section-intro p:last-child { margin-bottom: 0; }

.disclaimer { font-size: 0.8125rem; color: var(--grey-mid); max-width: 760px; }

@media print {
    .edu-subnav, .filter-bar, .net-figure { display: none !important; }
    .mech, .endo, .supp { break-inside: avoid; }
}

/* ── Treatments per mechanism ── */
.tri-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 800px) { .tri-2 { grid-template-columns: 1fr; } }
.tx-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.tx-list > li { margin: 0; padding: 0.9rem 1.15rem; border-top: 1px solid var(--border); }
.tx-list > li:first-child { border-top: 0; }
.tx-list .status { margin-left: 0; }
.tx-verdict { font-size: 0.875rem; margin: 0 0 0.4rem; color: var(--text-primary); }
.tx-ex { margin: 0; padding-left: 1.1rem; }
.tx-ex li { font-size: 0.85rem; color: var(--text-secondary); margin: 0.3rem 0; }
.tx-ex-name { font-weight: 600; color: var(--text-primary); }
