/* Site styles: colours, typography, controls and responsive page layouts. */

:root {
    --ink: #000;
    --paper: #fff;
    --accent: #743f73;
    --accent-dark: #563056;
    --soft: #f6f0f7;
    --line: #d9cdda;
    --warm: #a14d27;
    --max: 1220px;
}
* {
    box-sizing: border-box;
}
html {
    scroll-padding-top: 5rem;
}
body {
    margin: 0;
    color: #000;
    background: #fff;
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        sans-serif;
    font-size: 1rem;
    line-height: 1.55;
}
a {
    color: var(--accent-dark);
    text-underline-offset: 0.18em;
}
a:hover {
    text-decoration-thickness: 2px;
}
button,
input,
select {
    font: inherit;
    color: #000;
}
button,
.button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    border: 2px solid var(--accent);
    background: var(--accent);
    color: white;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
    line-height: 1.25;
}
button:hover,
.button:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}
button.secondary,
.button.secondary {
    background: #fff;
    color: #000;
    border-color: var(--line);
}
button.secondary:hover,
.button.secondary:hover {
    background: var(--soft);
    border-color: var(--accent);
}
.text-button {
    background: none !important;
    border: 0;
    color: var(--accent-dark);
    text-decoration: underline;
    text-align: left;
    padding: 0.25rem;
    min-height: 44px;
    font-weight: 500;
}
.small,
.source-line,
.metric-period {
    font-size: 0.875rem;
    color: #000;
}
.metric-period {
    display: block;
    font-weight: 400;
}
.source-line {
    margin: 1rem 0 0;
}
h1,
h2,
h3,
h4 {
    line-height: 1.2;
    color: #000;
}
h1 {
    font-size: clamp(2rem, 4.2vw, 3.75rem);
    letter-spacing: -0.045em;
    margin: 0.5rem 0 1.25rem;
    max-width: 1000px;
}
h2 {
    font-size: 1.75rem;
    letter-spacing: -0.025em;
}
h3 {
    font-size: 1.2rem;
}
h4 {
    font-size: 1rem;
}
p {
    margin: 0.65rem 0 1rem;
}
input[type='text'],
input:not([type]),
input[type='search'],
input[type='password'],
select {
    width: 100%;
    min-height: 48px;
    border: 1.5px solid #887b89;
    border-radius: 6px;
    background: white;
    padding: 0.7rem 0.85rem;
}
input::placeholder {
    color: #000;
    opacity: 1;
}
input[type='checkbox'],
input[type='radio'] {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    accent-color: var(--accent);
    margin-right: 0.35rem;
}
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'%3E%3Cpath d='m5 9 7 7 7-7' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    padding-right: 2.5rem;
}
fieldset {
    border: 0;
    margin: 1rem 0;
    padding: 0;
}
legend,
label {
    font-weight: 600;
}
label > input,
label > select {
    margin-top: 0.35rem;
}
.input-row {
    display: flex;
    gap: 0.6rem;
    align-items: stretch;
    margin-top: 0.5rem;
}
.input-row input {
    min-width: 0;
    flex: 1;
}
.input-row button {
    white-space: nowrap;
}
.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.875rem;
    font-weight: 750;
    margin-bottom: 1rem;
}
.lead {
    font-size: 1.15rem;
    max-width: 62ch;
}
.section {
    max-width: var(--max);
    margin: auto;
    padding: 2.25rem 1.5rem 4rem;
}
.narrow {
    max-width: 850px;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
.skip {
    position: absolute;
    top: -80px;
    background: white;
    z-index: 10000;
    padding: 0.8rem;
}
.skip:focus {
    top: 0;
}
:focus-visible {
    outline: 3px solid #bd5d2f;
    outline-offset: 4px;
}
/* Shared header and navigation. */
.site-header {
    border-bottom: 1px solid var(--line);
    background: white;
}
.header-inner {
    max-width: var(--max);
    margin: auto;
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1.15rem 1.5rem;
}
.brand {
    color: #000;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: -0.045em;
    line-height: 1.2;
    white-space: nowrap;
}
.brand > span {
    font-weight: 450;
    color: var(--accent-dark);
}
.brand small {
    display: block;
    font-size: 0.7rem;
    letter-spacing: 0.025em;
    font-weight: 500;
    margin-top: 0.35rem;
}
.header-search {
    display: flex;
    gap: 0.4rem;
    flex: 1;
    max-width: 410px;
    margin-left: auto;
}
.header-search input {
    min-width: 0;
}
.header-search button {
    padding: 0.5rem 0.8rem;
}
.desktop-nav {
    display: flex;
    gap: 1.3rem;
}
.desktop-nav a {
    color: #000;
    text-decoration: none;
    padding: 0.6rem 0;
}
.mobile-menu {
    display: none;
}
/* Home page search and illustration. */
.hero {
    max-width: var(--max);
    margin: auto;
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 3rem;
    padding: 4.5rem 1.5rem;
}
.hero h1 {
    font-size: clamp(2.5rem, 4.4vw, 4.1rem);
}
.large-search {
    background: var(--soft);
    border: 1px solid var(--line);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 2rem 0 1rem;
}
.large-search > label {
    font-size: 1.05rem;
}
.quick-phase {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 0;
}
.quick-phase legend {
    font-size: 0.875rem;
    margin-bottom: 0.6rem;
}
.quick-phase label {
    font-size: 0.875rem;
    min-height: 44px;
    display: flex;
    align-items: center;
}
.large-search .small {
    margin-bottom: 0;
}
.hero-art {
    min-height: 400px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(ellipse at 50% 40%, #f0e7f1 0%, #f0e7f1 55%, transparent 56%);
    border-radius: 40%;
}
.illustrated-school {
    position: relative;
    width: 84%;
    max-width: 350px;
}
.school-roof {
    height: 110px;
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    background: var(--accent);
    position: relative;
    z-index: 2;
}
.school-building {
    height: 175px;
    margin: 0 30px;
    position: relative;
    background: #e9d1b3;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 25px 30px;
}
.school-building span {
    width: 40px;
    height: 40px;
    background: #fff;
    border: 7px solid #b28c75;
}
.school-building span:nth-child(even) {
    justify-self: end;
}
.school-door {
    position: absolute;
    bottom: 0;
    left: 44%;
    background: #743f73;
    width: 36px;
    height: 62px;
    border-radius: 16px 16px 0 0;
}
.school-ground {
    height: 8px;
    background: #743f73;
    border-radius: 5px;
}
.art-label {
    position: absolute;
    bottom: 5%;
    left: 18%;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 12px 28px #743f7312;
    border-radius: 10px;
    padding: 0.85rem 1.2rem;
    font-size: 0.875rem;
    transform: rotate(-3deg);
}
.home-intro {
    max-width: var(--max);
    margin: auto;
    padding: 1rem 1.5rem 4.5rem;
}
.intro-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
}
.intro-grid article {
    border-top: 3px solid var(--line);
    padding-top: 0.7rem;
}
.browse-link {
    display: inline-block;
    padding: 0.6rem 0;
}
/* Search forms, filters and results. */
.search-filters {
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}
.choice-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.choice-row legend {
    margin-bottom: 0.6rem;
}
.choice-row label {
    display: flex;
    align-items: center;
    min-height: 44px;
    border: 1px solid var(--line);
    padding: 0.5rem 0.7rem;
    border-radius: 6px;
    background: white;
}
.choice-row button {
    padding: 0.5rem 0.8rem;
}
.more-filters {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 0;
}
.more-filters summary {
    min-height: 44px;
    cursor: pointer;
    display: list-item;
    padding: 0.6rem 0;
    font-weight: 600;
}
.filter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    align-items: center;
    padding: 1rem 0;
}
.filter-grid label {
    min-height: 44px;
}
.sort-row {
    display: flex;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
    margin-top: 1rem;
}
.sort-row label {
    min-width: 220px;
}
.sort-row a {
    padding: 0.7rem;
}
.results-heading {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-top: 2.5rem;
}
.results-heading p {
    font-size: 0.875rem;
    max-width: 450px;
}
.cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.15rem;
    margin: 1.5rem 0;
}
/* School cards and their published figures. */
.school-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.35rem;
    background: white;
}
.card-heading {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
}
.phase-badge {
    display: inline-block;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.2rem 0.6rem;
    font-size: 0.875rem;
    font-weight: 700;
}
.school-card h2 {
    font-size: 1.35rem;
    margin: 0.9rem 0 0.55rem;
}
.school-card h2 a {
    color: #000;
}
.card-subtitle {
    font-size: 0.875rem;
}
.card-facts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    border-top: 1px solid var(--line);
    margin: 1rem 0 0.5rem;
    padding-top: 1rem;
}
.card-facts dt {
    font-size: 0.875rem;
    line-height: 1.35;
}
.card-facts dd {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0.25rem 0;
}
.card-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}
.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    list-style: none;
    padding: 0;
}
.badges li {
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 0.15rem 0.6rem;
    font-size: 0.875rem;
}
.notice,
.explanation {
    background: var(--soft);
    padding: 1.1rem 1.3rem;
    border-left: 4px solid var(--accent);
    border-radius: 0 8px 8px 0;
    margin: 1.3rem 0;
}
.notice {
    font-weight: 550;
}
/* Map layout and accessible controls. */
.map-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.map-toolbar p {
    font-weight: 650;
}
.map-toolbar span {
    display: block;
    font-weight: 400;
}
.map-layout {
    display: flex;
    border-radius: 12px;
    overflow: hidden;
}
.school-map {
    height: 350px;
    flex: 1;
    min-width: 0;
}
.map-list {
    margin: 0;
    width: 260px;
    max-height: 350px;
    overflow: auto;
    background: var(--soft);
    padding: 1rem 1rem 1rem 2rem;
    font-size: 0.875rem;
}
.map-list a {
    display: inline-block;
    padding: 0.35rem 0;
}
.map-section.expanded .school-map {
    height: 70vh;
}
.map-section.expanded .map-list {
    max-height: 70vh;
}
.phase-marker {
    background: var(--accent);
    border: 2px solid #fff;
    border-radius: 50%;
    color: #fff;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font: bold 12px system-ui;
    box-shadow: 0 1px 5px #0005;
}
.phase-marker.primary {
    background: #814f08;
}
.phase-marker.secondary {
    background: #553674;
}
.phase-marker.special {
    background: #954137;
}
.phase-marker.middle {
    background: #244e6b;
}
.phase-marker.home {
    background: #000;
}
.marker-cluster {
    background: var(--soft);
    border: 2px solid var(--accent);
    border-radius: 50%;
    text-align: center;
    font-weight: 700;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.marker-cluster div {
    width: 100%;
}
.marker-cluster span {
    line-height: 36px;
}
.leaflet-container {
    font: 14px system-ui !important;
    color: #000 !important;
}
.leaflet-control-attribution a {
    color: #000 !important;
}
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}
.breadcrumbs {
    font-size: 0.875rem;
    margin-bottom: 2rem;
}
/* Long school profiles and the section menu. */
.school-title {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1.5rem;
}
.school-title h1 {
    font-size: clamp(2rem, 4vw, 3.25rem);
}
.jump-nav {
    position: sticky;
    top: 0;
    background: white;
    z-index: 500;
    display: flex;
    overflow-x: auto;
    gap: 1.4rem;
    border-bottom: 1px solid var(--line);
    padding: 0.65rem 0;
}
.jump-nav a {
    white-space: nowrap;
    display: inline-block;
    padding: 0.5rem 0.1rem;
}
.profile-section {
    border-bottom: 1px solid var(--line);
    padding: 1.5rem 0 2rem;
}
.fact-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}
.fact-grid > div {
    border-top: 1px solid var(--line);
    padding-top: 0.8rem;
}
.fact-grid dt {
    font-size: 0.875rem;
}
.fact-grid dd {
    margin: 0.35rem 0 0;
    font-size: 1.12rem;
    font-weight: 650;
    overflow-wrap: anywhere;
}
.explanation h3 {
    font-size: 1rem;
    margin: 0.3rem 0;
}
.explanation p:last-child {
    margin-bottom: 0.25rem;
}
address {
    font-style: normal;
}
/* Comparison table and device-only shortlist tray. */
.compare-scroll {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
}
.compare-table {
    border-collapse: separate;
    border-spacing: 0;
    min-width: 100%;
    font-size: 0.875rem;
}
.compare-table caption {
    text-align: left;
    padding: 1rem;
    background: var(--soft);
    font-weight: 650;
}
.compare-table th,
.compare-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--line);
    border-right: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    min-width: 210px;
    max-width: 270px;
}
.compare-table th:first-child {
    position: sticky;
    left: 0;
    background: #fff;
    min-width: 185px;
    z-index: 1;
}
.compare-table thead th {
    background: var(--soft);
    font-size: 1rem;
}
.compare-table .table-section th {
    background: var(--soft);
    font-size: 1rem;
}
.phone-scroll {
    font-size: 0.875rem;
}
.compare-tray {
    position: sticky;
    bottom: 0;
    z-index: 600;
    background: #fff;
    border-top: 2px solid var(--accent);
    box-shadow: 0 -5px 24px #0001;
    padding: 1rem max(1.5rem, calc((100% - 1172px) / 2));
    display: flex;
    gap: 1.5rem;
    align-items: center;
    justify-content: space-between;
}
.compare-tray > div > span {
    display: block;
    font-size: 0.875rem;
}
.site-footer {
    background: var(--soft);
    border-top: 1px solid var(--line);
    margin-top: 1rem;
}
.footer-inner {
    max-width: var(--max);
    margin: auto;
    padding: 2.5rem 1.5rem;
}
.footer-inner p {
    font-size: 0.875rem;
    max-width: 95ch;
}
.footer-inner nav {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}
.footer-inner nav a {
    padding: 0.4rem 0;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.data-table th,
.data-table td {
    border: 1px solid var(--line);
    padding: 0.8rem;
    text-align: left;
}
.data-table th {
    background: var(--soft);
}
[hidden] {
    display: none !important;
}
/* Responsive adjustments for narrower screens. */
@media (max-width: 1000px) {
    .header-inner {
        gap: 1rem;
    }
    .header-search {
        max-width: 310px;
    }
    .desktop-nav {
        gap: 0.8rem;
    }
    .hero {
        gap: 1rem;
    }
    .hero-art {
        min-height: 320px;
    }
    .school-building {
        margin: 0 20px;
        padding: 22px;
    }
    .school-roof {
        height: 90px;
    }
}
@media (max-width: 760px) {
    .header-inner {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 0.7rem;
    }
    .brand {
        font-size: 1.4rem;
    }
    .brand small {
        font-size: 0.65rem;
    }
    .header-search {
        order: 3;
        max-width: none;
        flex-basis: 100%;
    }
    .desktop-nav {
        display: none;
    }
    .mobile-menu {
        display: block;
        margin-left: auto;
    }
    .mobile-menu summary {
        min-height: 44px;
        padding: 0.6rem;
        cursor: pointer;
    }
    .mobile-menu nav {
        position: absolute;
        right: 1rem;
        top: 68px;
        background: white;
        padding: 1rem;
        box-shadow: 0 5px 20px #0002;
        border: 1px solid var(--line);
        z-index: 1000;
        display: grid;
        min-width: 180px;
    }
    .mobile-menu nav a {
        padding: 0.65rem;
    }
    .hero {
        display: block;
        padding: 2.5rem 1rem 2rem;
    }
    .hero-art {
        display: none;
    }
    .hero h1 {
        font-size: 2.75rem;
    }
    .large-search {
        padding: 1rem;
        margin: 1.5rem 0 1rem;
    }
    .input-row {
        gap: 0.5rem;
    }
    .input-row button {
        padding: 0.65rem 0.7rem;
    }
    .quick-phase {
        gap: 0.5rem 1rem;
    }
    .home-intro {
        padding: 1rem 1rem 2rem;
    }
    .intro-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .section {
        padding: 1.75rem 1rem 2.5rem;
    }
    .search-filters {
        padding: 1rem;
    }
    .filter-grid {
        grid-template-columns: 1fr;
    }
    .sort-row label {
        min-width: 170px;
        flex: 1;
    }
    .results-heading {
        display: block;
    }
    .cards {
        grid-template-columns: 1fr;
    }
    .school-card {
        padding: 1rem;
    }
    .card-facts dd {
        font-size: 1.1rem;
    }
    .card-facts dt {
        font-size: 0.875rem;
    }
    .map-layout {
        display: block;
    }
    .school-map {
        height: 280px;
        max-height: 48vh;
    }
    .map-list {
        display: none !important;
    }
    .map-section.expanded .school-map {
        height: 70vh;
        max-height: none;
    }
    .school-title {
        display: block;
    }
    .school-title .shortlist-form {
        margin: 1rem 0;
    }
    .fact-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }
    .compare-tray {
        padding: 0.7rem 1rem;
        gap: 0.6rem;
        flex-wrap: wrap;
        font-size: 0.875rem;
    }
    .compare-tray > div {
        flex: 1;
    }
    .compare-tray > div > span {
        display: none;
    }
    .compare-tray .button {
        padding: 0.6rem 0.7rem;
    }
    .compare-table th:first-child {
        min-width: 145px;
        max-width: 145px;
    }
    .compare-table th,
    .compare-table td {
        min-width: 220px;
        padding: 0.8rem;
    }
    .footer-inner {
        padding: 2rem 1rem;
    }
    .footer-inner nav {
        gap: 1rem;
    }
    .map-toolbar {
        align-items: start;
    }
    .map-toolbar button {
        font-size: 0.875rem;
    }
    .data-table {
        display: block;
        overflow: auto;
    }
    .choice-row button {
        min-width: 65px;
    }
    .source-line {
        overflow-wrap: anywhere;
    }
}
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

#import-status pre,
pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.leaflet-control-attribution {
    color: #000 !important;
}
.leaflet-control-zoom a {
    width: 44px !important;
    height: 44px !important;
    line-height: 44px !important;
}
.map-list a {
    min-height: 44px;
}
.map-button {
    min-height: 44px;
}
