/* The Schools section (schools/*.html, scripts/generate_school_pages.py).
   Builds on styles.css (business-page, landing-page, tag, filter-pill,
   detail-row...) and only adds what those don't have. */

.sch-page .business-section p a, .sch-page .business-section li a, .sch-list-page p a {
    color: var(--primary-strong); font-weight: 600; text-decoration: none;
}
.sch-page .business-section p a:hover, .sch-page .business-section li a:hover, .sch-list-page p a:hover { text-decoration: underline; }
.sch-aka { color: var(--text-muted); font-size: 0.9rem; margin: -0.25rem 0 0.5rem; }
.sch-address, .sch-contact { font-size: 0.95rem; color: var(--text-dark); margin: 0.5rem 0; overflow-wrap: anywhere; }
.sch-contact a { color: var(--primary-strong); font-weight: 600; text-decoration: none; }
.sch-actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: center; margin: 0.75rem 0 1rem; }
.sch-report-link { font-size: 0.9rem; color: var(--primary-strong); font-weight: 600; }
.sch-compare-btn[aria-pressed="true"] { background: var(--secondary); border-color: var(--secondary); color: #fff; }
.sch-compare-small {
    margin-top: 0.6rem; padding: 0.35rem 0.8rem; border: 1px solid var(--border); border-radius: 9999px;
    background: #fff; font: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text-dark); cursor: pointer;
}

.sch-tabs {
    position: sticky; top: 0; z-index: 5; display: flex; gap: 0.25rem; overflow-x: auto; margin: 0 -0.25rem 0.5rem;
    padding: 0.5rem 0.25rem; background: #fff; border-bottom: 1px solid var(--border); scrollbar-width: none;
}
.sch-tabs::-webkit-scrollbar { display: none; }
.sch-tabs a {
    flex: 0 0 auto; padding: 0.4rem 0.8rem; border-radius: 9999px; font-size: 0.875rem; font-weight: 600;
    color: var(--text-dark); text-decoration: none; background: var(--bg-page);
}
.sch-tabs a:hover, .sch-tabs a:focus-visible { background: #EEF0EA; }
.sch-page section[id] { scroll-margin-top: 4rem; }

.sch-subhead { font-size: 1rem; margin: 1.25rem 0 0.5rem; }
.sch-note { font-size: 0.85rem; color: var(--text-muted); line-height: 1.55; margin: 0.5rem 0; }
.sch-caution { color: #7A4B00; }
.sch-muted-text { color: var(--text-muted); font-size: 0.85rem; }
.sch-list { margin: 0.25rem 0 0.75rem; padding-left: 1.1rem; font-size: 0.9rem; line-height: 1.6; }
.sch-list li { margin-bottom: 0.3rem; }
.sch-stops li { margin-bottom: 0.55rem; }
.sch-details { margin: 0.75rem 0; font-size: 0.9rem; }
.sch-details summary { cursor: pointer; font-weight: 600; color: var(--primary-strong); }

/* Enrolment chart: bars as boxes, numbers on top, school years under. */
.sch-chart { margin: 1rem 0 0.5rem; }
.sch-bars { display: flex; align-items: flex-end; gap: 4px; height: 170px; padding-top: 1.25rem; border-bottom: 1px solid var(--border); }
.sch-bar { position: relative; flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.sch-bar-fill { width: 100%; max-width: 44px; background: var(--secondary); border-radius: 4px 4px 0 0; }
.sch-bar:last-child .sch-bar-fill { background: var(--primary-strong); }
.sch-bar-val { font-size: 0.7rem; font-weight: 700; color: var(--text-dark); margin-bottom: 2px; white-space: nowrap; }
.sch-bar-label { position: absolute; bottom: -1.3rem; font-size: 0.65rem; color: var(--text-muted); white-space: nowrap; }
.sch-bar-sub { position: absolute; bottom: -2.45rem; font-size: 0.65rem; color: var(--text-muted); white-space: nowrap; }
.sch-chart figcaption { margin-top: 2.8rem; font-size: 0.8rem; color: var(--text-muted); }

.sch-minis { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 0.5rem; }
.sch-mini { background: var(--bg-page); border-radius: 8px; padding: 0.5rem; text-align: center; }
.sch-mini-num { display: block; font-size: 1.1rem; font-weight: 700; }
.sch-mini-label { display: block; font-size: 0.75rem; color: var(--text-muted); }

/* Survey: one bar per either-or question, the first answer in teal. */
.sch-prefs { margin: 0.5rem 0 1rem; }
.sch-pref { margin-bottom: 0.6rem; }
.sch-pref-labels { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.25rem; }
.sch-pref-bar { height: 12px; border-radius: 6px; background: var(--accent); overflow: hidden; }
.sch-pref-a { display: block; height: 100%; background: var(--secondary); }
.sch-muted .sch-pref-bar { opacity: 0.45; }
.sch-muted .sch-pref-labels { color: var(--text-muted); }

/* Key figures on county and area pages. */
.sch-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.75rem; margin: 0 0 1.5rem; }
.sch-kpi { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 0.9rem 1rem; }
.sch-kpi-num { display: block; font-family: var(--font-heading); font-size: 1.5rem; font-weight: 700; }
.sch-kpi-label { display: block; font-size: 0.9rem; font-weight: 600; }
.sch-kpi-sub { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 0.15rem; }

.sch-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.6rem; font-size: 0.85rem; color: var(--text-muted); margin: 0 0 0.5rem; }
.sch-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); }
.sch-dot-p { background: #0F6E6E; }
.sch-dot-s { background: #C0432A; }
.sch-dot-x { background: #8A5A00; }
.sch-map { height: 320px; }

/* <body> is a flex container and .landing-page centres itself with auto
   margins, so without a set width it grows to its widest child: a wide table
   pushed phones to 750-850px of layout instead of scrolling inside its box. */
.sch-list-page { width: 100%; min-width: 0; box-sizing: border-box; }

.sch-table-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 1.5rem 0 0.5rem; }
.sch-table-tools label { font-weight: 600; font-size: 0.9rem; }
.sch-table-tools input, .sch-search input {
    flex: 1 1 220px; min-width: 0; padding: 0.6rem 0.9rem; border: 1px solid var(--border); border-radius: 9999px;
    font: inherit; font-size: 1rem; background: #fff;
}
.sch-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: 12px; background: #fff; margin-bottom: 1.5rem; }
.sch-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.sch-table th, .sch-table td { padding: 0.55rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.sch-table thead th { background: var(--bg-page); font-weight: 700; white-space: nowrap; }
.sch-sortable th[data-sort] { cursor: pointer; }
.sch-sortable th[aria-sort="ascending"]::after { content: " ▲"; font-size: 0.7em; }
.sch-sortable th[aria-sort="descending"]::after { content: " ▼"; font-size: 0.7em; }
.sch-table tr[hidden] { display: none; }
.sch-table a { color: var(--primary-strong); font-weight: 600; text-decoration: none; }

.sch-area-survey { margin: 1rem 0 2rem; max-width: 760px; }
.sch-area-survey h2 { font-size: 1.2rem; }

/* Hub */
.sch-search { margin: 0 0 1rem; }
.sch-search-label { display: block; font-weight: 700; margin-bottom: 0.4rem; }
.sch-search-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.sch-near-me { white-space: nowrap; }
.sch-status { font-size: 0.9rem; color: var(--text-muted); margin: 0.5rem 0; min-height: 1.3em; }
.sch-chip { cursor: pointer; font: inherit; font-size: 0.875rem; }
.sch-chip-count { color: var(--text-muted); font-weight: 500; }
.sch-results { margin-top: 1rem; }
.sch-card h3 a { color: var(--text-dark); text-decoration: none; }
.sch-card h3 a:hover { color: var(--primary-strong); text-decoration: underline; }
.sch-more { margin: 0 auto 2rem; display: block; }
.sch-soon { padding: 0.35rem 0.75rem; font-size: 0.875rem; color: var(--text-muted); }
.sch-counties a .sch-muted-text { margin-left: 0.2rem; }

/* Compare */
.sch-compare-table th[scope="col"] { min-width: 170px; vertical-align: bottom; }
.sch-compare-table th[scope="row"] { font-weight: 600; color: var(--text-muted); white-space: nowrap; background: var(--bg-page); }
.sch-remove { display: block; margin-top: 0.35rem; padding: 0; border: 0; background: none; font: inherit; font-size: 0.8rem; color: var(--text-muted); text-decoration: underline; cursor: pointer; }
.sch-share { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0 0 1.5rem; }
.sch-copy { cursor: pointer; }

.sch-compare-tray {
    position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 50; display: flex; align-items: center;
    gap: 0.75rem; max-width: calc(100% - 2rem); padding: 0.6rem 0.75rem 0.6rem 1rem; background: #fff;
    border: 1px solid var(--border); border-radius: 9999px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12); font-size: 0.9rem;
}
.sch-compare-tray[hidden] { display: none; }
.sch-compare-tray .button { padding: 0.45rem 0.9rem; white-space: nowrap; }
.sch-tray-clear { border: 0; background: none; font: inherit; font-size: 0.85rem; color: var(--text-muted); text-decoration: underline; cursor: pointer; }
.sch-list-note { max-width: 760px; margin-top: 2rem; }

@media (max-width: 600px) {
    .sch-bars { height: 140px; gap: 2px; }
    .sch-bar-val { font-size: 0.6rem; transform: rotate(-45deg); transform-origin: bottom center; margin-bottom: 6px; }
    .sch-bar-label, .sch-bar-sub { font-size: 0.55rem; }
    .sch-compare-tray { flex-wrap: wrap; justify-content: center; border-radius: 16px; }
}
