/* ==========================================================
   The School Companion - stylesheet
   Design direction: a calm, Google-homepage-style search
   experience that stays light and uncluttered, then settles
   into clear, card-based reading for profiles and guidance.
   ========================================================== */

:root {
    /* Warm Trust palette: teal for trust without corporate coldness,
       terracotta as a genuine warm accent, warm white background -
       replaces the original navy/khaki/cream palette derived from
       the logo's own colours (the logo itself keeps its original
       navy/khaki, since recolouring a fixed brand mark is a separate
       decision from the surrounding site palette). */
    --color-bg: #FAF6F0;
    --color-surface: #FFFFFF;
    --color-border: #E8DCCF;
    --color-text: #262B31;
    --color-text-muted: #7A7168;
    --color-primary: #2A6F77;        /* teal - headings, nav, buttons */
    --color-primary-dark: #1F565C;   /* darker teal for hover/active states */
    --color-accent: #E07856;         /* terracotta - CTAs, highlights */
    --color-accent-light: #F7DFD3;   /* pale terracotta for badges/chip backgrounds */
    --color-disabled: #AEB4B8;

    --font-heading: 'Trebuchet MS', 'Segoe UI', Verdana, sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    --radius: 10px;
    --shadow-card: 0 1px 3px rgba(38, 43, 49, 0.08);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    line-height: 1.55;
}

h1, h2, h3 {
    font-family: var(--font-heading);
    color: var(--color-primary-dark);
    line-height: 1.25;
    margin-top: 0;
}

a {
    color: var(--color-primary);
}

a:hover, a:focus {
    color: var(--color-primary-dark);
}

a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

/* ----------------------------------------------------------
   Site header / logo
   ---------------------------------------------------------- */
.site-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 16px 0;
}

.header-top-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
}

@media (max-width: 700px) {
    .header-top-row {
        display: flex;
        align-items: center;
        justify-content: flex-start;
    }

    .header-top-row .nav-toggle {
        flex: 0 0 44px;
        margin: 0;
    }

    .header-top-row .logo-wrap {
        flex: 1 1 auto;
        min-width: 0;
        margin-bottom: 0;
        margin-left: 20px;
    }

    .header-top-row .site-logo-shield {
        width: 52px;
    }

    /* Stacked across three explicit lines, not relying on natural
       word-wrap - wrap behavior depends on container width and
       wouldn't reliably give the same three-line structure on every
       phone size, so each part is forced onto its own line here. */
    .header-top-row .site-logo-name {
        display: block;
        white-space: normal;
        font-size: 1.55rem;
        line-height: 1.15;
        text-align: left;
    }

    .header-top-row .site-logo-name-line2 {
        display: block;
        white-space: nowrap;
    }

    .header-top-row .site-logo-name-tld {
        margin-left: 2px;
    }

    .header-top-row .site-logo-tagline {
        font-size: 0.68rem;
        margin-top: 3px;
        text-align: left;
    }
}

.logo-wrap {
    margin-bottom: 10px;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.site-logo-shield {
    width: 64px;
    height: auto;
    flex-shrink: 0;
}

.site-logo-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.site-logo-name {
    font-size: 1.7rem;
    line-height: 1.1;
    color: var(--color-primary-dark);
    white-space: nowrap;
}

.site-logo-name-the {
    font-weight: 400;
}

.site-logo-name-part1 {
    font-weight: 800;
}

.site-logo-name-part2 {
    font-weight: 800;
}

.site-logo-name-tld {
    font-weight: 400;
    font-size: 0.65em;
    margin-left: 3px;
}

.site-logo-tagline {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.main-nav {
    margin-bottom: 6px;
}

.nav-toggle {
    display: none;
    margin: 0 auto 10px;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 8px 14px;
    color: var(--color-primary-dark);
    cursor: pointer;
}

.nav-toggle-icon {
    width: 26px;
    height: 26px;
    display: block;
}

.main-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 28px;
    margin: 0;
    padding: 0;
}

@media (max-width: 700px) {
    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .main-nav ul {
        display: none;
        flex-direction: column;
        align-items: center;
        gap: 14px;
        padding: 12px 0 4px;
    }

    .main-nav.is-open ul {
        display: flex;
    }
}

.main-nav a {
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 6px 2px;
    border-bottom: 2px solid transparent;
    color: var(--color-primary);
}

.main-nav a:hover,
.main-nav a:focus {
    border-bottom-color: var(--color-accent);
    color: var(--color-primary-dark);
}

/* ----------------------------------------------------------
   Main content wrapper
   ---------------------------------------------------------- */
.site-main {
    max-width: 1040px;
    margin: 0 auto;
    padding: 8px 20px 64px;
}

/* ----------------------------------------------------------
   Homepage hero / search area
   Kept compact and top-aligned (not vertically centred) so the
   real page content starts as soon as possible on load.
   ---------------------------------------------------------- */
.home-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    padding: 4px 0 20px;
}

.search-area {
    width: 100%;
    max-width: 850px;
}

.dropdown-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
    gap: 16px;
    margin-bottom: 0;
}

.form-field {
    display: flex;
    flex-direction: column;
    text-align: left;
    min-width: 200px;
    flex: 1 1 200px;
}

.search-field {
    flex: 0 0 auto;
    min-width: 0;
}

.field-spacer {
    display: block;
    height: 20px;
    margin-bottom: 6px;
}

.form-field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.form-field select {
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background-color: var(--color-surface);
    color: var(--color-text);
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
}

.form-field select:disabled {
    color: var(--color-disabled);
    background-color: #F4F4F4;
}

.field-hint {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    margin: 6px 2px 0;
}

.btn-search {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background-color: var(--color-primary);
    border: none;
    border-radius: var(--radius);
    padding: 10px 32px;
    cursor: pointer;
    white-space: nowrap;
}

.btn-search:hover,
.btn-search:focus {
    background-color: var(--color-primary-dark);
}

/* ----------------------------------------------------------
   Generic content sections
   ---------------------------------------------------------- */
.page-intro {
    text-align: center;
    max-width: 720px;
    margin: 12px auto 40px;
}

.page-intro h1 {
    margin-bottom: 0;
}

.activity-borough-status {
    font-size: 0.85rem;
    color: #3F7D5C;
    margin-top: 4px;
    text-align: center;
}

.activity-borough-status strong {
    font-weight: 400;
}

.activity-borough-status summary {
    cursor: pointer;
    list-style: none;
    display: inline-block;
}

.activity-borough-status summary::-webkit-details-marker {
    display: none;
}

.activity-borough-change-link {
    text-decoration: underline;
    margin-left: 2px;
}

.activity-borough-selector {
    margin: 10px auto 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.activity-borough-selector label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
}

.legal-disclaimer-note {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin-top: 6px;
}

.info-section {
    max-width: 850px;
    margin: 0 auto 40px;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 28px 32px;
}

.placeholder-note {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    font-style: italic;
}

/* ----------------------------------------------------------
   School profile (two-column on desktop)
   ---------------------------------------------------------- */
.profile-columns {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.profile-column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (max-width: 760px) {
    .profile-columns {
        flex-direction: column;
        align-items: stretch;
    }
}

.profile-card-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.profile-card-toggle::after {
    content: "+";
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-text-muted);
    flex-shrink: 0;
    margin-left: 10px;
}

.profile-card.is-open .profile-card-toggle::after {
    content: "\2212";
}

.profile-card-body {
    display: none;
    margin-top: 10px;
}

.profile-card.is-open .profile-card-body {
    display: block;
}

.profile-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 20px 22px;
}

.profile-card h3 {
    font-size: 1.05rem;
    margin-bottom: 10px;
}

.profile-facts {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
    font-size: 0.92rem;
}

.profile-facts li {
    margin-bottom: 4px;
}

.ofsted-badge-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0 0 6px;
}

.ofsted-badge {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    color: #fff;
}

.ofsted-badge-positive { background-color: #3F7D5C; }
.ofsted-badge-good { background-color: #8BC34A; color: #2E4A16; }
.ofsted-badge-neutral { background-color: var(--color-primary); }
.ofsted-badge-caution { background-color: var(--color-accent); color: var(--color-primary-dark); }
.ofsted-badge-concern { background-color: #B25B4A; }

.behaviour-badge {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    color: #fff;
}

.behaviour-badge-top { background-color: #3F7D5C; }
.behaviour-badge-mid { background-color: #D98C34; }
.behaviour-badge-bottom { background-color: #E8A99A; color: #6B241A; }
.behaviour-badge-has_data_unranked { background-color: var(--color-primary); }
.behaviour-badge-has_data { background-color: var(--color-primary); }
.behaviour-badge-awaiting { background-color: #fff; color: var(--color-text-muted); border: 1px solid var(--color-border); }
.behaviour-badge-withheld { background-color: #6B241A; }

.ofsted-badge-year {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.ofsted-scheme-note {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    font-style: italic;
    margin: 0 0 10px;
}

/* ----------------------------------------------------------
   Parent Score thermometer (top of the right column, no card
   border/background - it deliberately isn't styled as a card, just
   sitting in the column's normal flow so only the right column
   shifts when its breakdown expands, never the left)
   ---------------------------------------------------------- */
.parent-score-cta {
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none;
    background-color: var(--color-primary);
    color: #fff;
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 4px;
}

.parent-score-cta-heading {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
}

.parent-score-cta-sub {
    display: block;
    font-size: 0.8rem;
    margin-top: 2px;
}

.parent-score-cta:hover,
.parent-score-cta:focus-visible {
    background-color: var(--color-primary-dark);
    color: #fff;
}

.parent-score-thermo {
    width: 100%;
    cursor: pointer;
}

.parent-score-thermo-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.parent-score-thermo-caption {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.parent-score-thermo-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-primary-dark);
}

.parent-score-thermo-track {
    height: 14px;
    border-radius: 7px;
    background-color: var(--color-border);
    overflow: hidden;
}

.parent-score-thermo-fill {
    height: 100%;
    border-radius: 7px;
    transition: width 0.2s ease;
}

.parent-score-thermo-positive { background-color: #3F7D5C; }
.parent-score-thermo-caution { background-color: var(--color-accent); }
.parent-score-thermo-concern { background-color: #B25B4A; }
.parent-score-thermo-neutral { background-color: var(--color-border); }

.parent-score-thermo-hint {
    font-size: 0.75rem;
    color: var(--color-primary);
    margin: 4px 0 0;
    text-align: right;
}

.parent-score-breakdown {
    display: none;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--color-border);
}
.parent-score-thermo.is-open .parent-score-breakdown {
    display: block;
}

.parent-score-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.parent-score-bar-label {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    width: 108px;
    flex-shrink: 0;
    text-align: left;
}

.parent-score-bar-track {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background-color: var(--color-border);
    overflow: hidden;
}

.parent-score-bar-fill {
    height: 100%;
    border-radius: 4px;
}

.parent-score-recommend-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.parent-score-recommend-votes {
    display: flex;
    align-items: center;
    gap: 16px;
}

.recommend-vote {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    font-weight: 600;
}

.recommend-vote-yes {
    color: #3F7D5C;
}

.recommend-vote-no {
    color: #B25B4A;
}

/* Disabled preview state for zero-review schools - shows the same
   rating controls a real school would have, deliberately greyed out
   so nothing here is mistaken for an actual score. */
.parent-score-thermo-disabled {
    background-color: var(--color-border);
}

.parent-score-thermo.is-preview {
    cursor: default;
    opacity: 0.85;
}

.parent-score-thermo.is-preview .parent-score-thermo-value,
.parent-score-thermo.is-preview .parent-score-bar-value {
    color: var(--color-text-muted);
}

.parent-score-recommend-row.is-preview .parent-score-bar-value {
    color: var(--color-text-muted);
}

/* The persistent "give your review" link - present at the bottom of
   the thermometer for every school, whether it already has reviews
   or not, visible regardless of whether the breakdown is currently
   expanded or collapsed. */
.parent-score-give-review {
    margin: 10px 0 0;
    padding-top: 10px;
    border-top: 1px solid var(--color-border);
    text-align: center;
    font-size: 0.85rem;
}

.parent-score-give-review a {
    font-weight: 600;
}

.parent-score-bar-value {
    font-size: 0.72rem;
    width: 32px;
    text-align: right;
    flex-shrink: 0;
}

.profile-subheading {
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-muted);
    margin: 16px 0 6px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}

.profile-subheading:first-of-type {
    margin-top: 14px;
}

.school-name-heading {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    margin: 0 0 12px;
}

/* ----------------------------------------------------------
   Leaderboard widget (Behaviour / Attainment / Environment)
   ---------------------------------------------------------- */
.leaderboard {
    position: relative;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
    cursor: pointer;
}

.leaderboard-caption {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin: 0 0 8px;
}

.leaderboard-mini {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.leaderboard-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    border-left: 4px solid transparent;
    background-color: var(--color-bg);
}

.leaderboard-row.tier-top {
    border-left-color: #3F7D5C;
}

.leaderboard-row.tier-mid {
    border-left-color: var(--color-accent);
}

.leaderboard-row.tier-bottom {
    border-left-color: #B25B4A;
}

.leaderboard-row.tier-withheld {
    border-left-color: #6B241A;
    background-color: #FBEAE7;
}

.leaderboard-row.is-current {
    background-color: var(--color-accent-light);
    font-weight: 700;
    box-shadow: inset 0 0 0 1px var(--color-primary);
}

/* Neutral leaderboards (e.g. per-pupil spend): no green/khaki/red
   "good vs bad" gradient by rank - every row gets the same plain
   border, and the current school is picked out with a fixed light
   yellow that has nothing to do with its position in the ranking. */
.leaderboard-neutral .leaderboard-row.tier-neutral {
    border-left-color: var(--color-border);
}

.leaderboard-neutral .leaderboard-row.is-current {
    background-color: #FFF6D6;
    box-shadow: inset 0 0 0 1px #E0C24A;
}

.leaderboard-position {
    width: 28px;
    flex-shrink: 0;
    font-weight: 700;
    color: var(--color-text-muted);
}

.leaderboard-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-score {
    font-weight: 700;
    color: var(--color-primary-dark);
}

.leaderboard-hint {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin: 8px 0 0;
}

/* Full table overlay: fixed positioning means it floats above the
   page without shifting any surrounding layout. Opens on hover,
   keyboard focus, or (via leaderboard.js) a tap/click toggle for
   touch devices that don't have hover at all. */
.leaderboard-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background-color: rgba(38, 43, 49, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
    z-index: 1000;
}

.leaderboard.is-open .leaderboard-overlay {
    opacity: 1;
    visibility: visible;
}

.leaderboard-overlay-inner {
    position: relative;
    background-color: var(--color-surface);
    border-radius: var(--radius);
    padding: 24px 28px;
    max-width: 480px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    cursor: default;
    text-align: left;
}

.leaderboard-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background-color: var(--color-accent-light);
    color: var(--color-primary-dark);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}

.leaderboard-close:hover,
.leaderboard-close:focus-visible {
    background-color: var(--color-accent);
}

.leaderboard-overlay-inner h4 {
    margin-top: 0;
    margin-bottom: 6px;
}

.leaderboard-full-list {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ----------------------------------------------------------
   Parent Score section
   ---------------------------------------------------------- */
.add-review-link {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}

.add-review-link a {
    font-weight: 600;
}

/* ----------------------------------------------------------
   Add-review form
   ---------------------------------------------------------- */
.review-form-field {
    display: flex;
    flex-direction: column;
    text-align: left;
    max-width: 420px;
    margin-bottom: 16px;
}

.rating-slider-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.rating-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--color-border);
    outline: none;
}

.rating-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px var(--color-border);
}

.rating-slider::-moz-range-thumb {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px var(--color-border);
}

.rating-slider[data-touched="false"]::-webkit-slider-thumb {
    background: var(--color-text-muted);
}

.rating-slider[data-touched="false"]::-moz-range-thumb {
    background: var(--color-text-muted);
}

.rating-slider-value {
    flex: 0 0 92px;
    text-align: right;
    font-weight: 700;
    color: var(--color-primary-dark);
    font-size: 0.85rem;
    white-space: nowrap;
}

.recommend-toggle {
    display: flex;
    gap: 10px;
}

.recommend-toggle-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background-color: var(--color-surface);
    color: var(--color-primary-dark);
    font-weight: 600;
    cursor: pointer;
}

.recommend-toggle-btn:hover,
.recommend-toggle-btn:focus-visible {
    border-color: var(--color-accent);
}

.recommend-toggle-btn.is-selected {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.review-form-field label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.review-form-field select,
.review-form-field input[type="email"],
.review-form-field textarea {
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background-color: var(--color-surface);
    color: var(--color-text);
}

.honeypot-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-error {
    color: #B25B4A;
    font-weight: 600;
    margin-bottom: 16px;
}

/* ----------------------------------------------------------
   Activity Inspiration page
   ---------------------------------------------------------- */
.activity-filters {
    max-width: 850px;
    margin: 0 auto 20px;
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.filter-tab {
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--color-primary);
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 8px 18px;
    cursor: pointer;
}

.filter-tab:hover {
    border-color: var(--color-primary);
}

.filter-tab.is-active {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-chip {
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text-muted);
    background-color: var(--color-accent-light);
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 5px 14px;
    cursor: pointer;
}

.filter-chip:hover {
    border-color: var(--color-accent);
}

.filter-chip.is-active {
    background-color: var(--color-accent);
    color: var(--color-primary-dark);
}

.ad-placeholder {
    max-width: 850px;
    margin: 0 auto 28px;
    border: 1px dashed var(--color-accent);
    border-radius: var(--radius);
    padding: 14px 20px;
    background-color: var(--color-accent-light);
    font-size: 0.88rem;
    color: var(--color-text-muted);
}

.ad-placeholder a {
    font-weight: 600;
}

.activity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.activity-card {
    position: relative;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
}

.activity-icon {
    width: 48px;
    height: 48px;
    display: block;
    margin-bottom: 10px;
}

.activity-card-image {
    display: block;
    width: calc(100% + 40px);
    height: auto;
    max-height: 160px;
    object-fit: contain;
    object-position: center top;
    background-color: var(--color-surface);
    margin: -18px -20px 12px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.activity-type-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.activity-card h3 {
    font-size: 1rem;
    margin-bottom: 6px;
}

.activity-cost {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    background-color: var(--color-accent-light);
    border-radius: 999px;
    padding: 3px 10px;
    margin-bottom: 8px;
}

.activity-resource-link {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--color-border);
}

.activity-resource-link a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}

.resource-link-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: var(--color-primary);
}

/* ----------------------------------------------------------
   Support for Parents page
   ---------------------------------------------------------- */
.resource-category {
    max-width: 850px;
    margin: 0 auto 40px;
}

.resource-category h2 {
    border-bottom: 2px solid var(--color-accent);
    display: inline-block;
    padding-bottom: 4px;
    margin-bottom: 16px;
}

.resource-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.resource-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px 24px;
}

.resource-card h3 {
    font-size: 1.1rem;
}

/* ----------------------------------------------------------
   Footer
   ---------------------------------------------------------- */
.site-footer {
    text-align: center;
    font-size: 0.82rem;
    color: var(--color-text-muted);
    padding: 24px 20px 40px;
}

/* ----------------------------------------------------------
   Responsive: mobile
   ---------------------------------------------------------- */
@media (max-width: 700px) {
    .dropdown-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .form-field {
        min-width: 0;
        margin-bottom: 0;
        flex: 0 1 auto;
    }

    .field-hint {
        margin-bottom: 4px;
    }

    .field-spacer {
        display: none;
    }

    .search-field .btn-search {
        width: 100%;
    }

    .home-hero {
        padding: 4px 0 16px;
    }
}

/* ----------------------------------------------------------
   Learning Resources page
   ---------------------------------------------------------- */
.section-heading-inline {
    font-size: 1.3rem;
    color: var(--color-primary-dark);
    margin: 0 0 14px;
}

.resource-featured-section {
    max-width: 1040px;
    margin: 0 auto 40px;
}

.resource-featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.resource-featured-card {
    background-color: var(--color-accent-light);
    border: 2px solid var(--color-accent);
    border-radius: var(--radius);
    padding: 18px 20px;
}

.resource-featured-tag {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-primary);
    margin-bottom: 6px;
}

.resource-featured-card h3 {
    font-size: 1.05rem;
    margin-bottom: 12px;
}

.year-group-block {
    max-width: 1040px;
    margin: 0 auto 36px;
}

.year-group-heading {
    font-size: 1.4rem;
    color: var(--color-primary-dark);
    border-bottom: 3px solid var(--color-primary);
    padding-bottom: 6px;
    margin-bottom: 18px;
}

.subject-block {
    margin-bottom: 24px;
}

.subject-heading {
    font-size: 1.05rem;
    color: var(--color-primary);
    background-color: var(--color-bg);
    display: inline-block;
    padding: 4px 14px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    margin-bottom: 12px;
}

.topic-resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
}

.topic-resource-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 14px 16px;
}

.topic-resource-card h4 {
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: var(--color-text);
}

.resource-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.resource-pill {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--color-primary-dark);
    background-color: var(--color-accent-light);
    border-radius: 999px;
    padding: 4px 12px;
}

.resource-pill:hover,
.resource-pill:focus {
    background-color: var(--color-accent);
}

.resource-pill-featured {
    background-color: #FFFFFF;
    border: 1px solid var(--color-accent);
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
    }
}

/* ----------------------------------------------------------
   Petitions page
   ---------------------------------------------------------- */
.petitions-list {
    max-width: 760px;
    margin: 0 auto 40px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.petition-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 18px 22px;
}

.petition-card h3 {
    margin-bottom: 8px;
}

.petition-meta {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 10px;
}

/* ----------------------------------------------------------
   Homepage hero statement
   ---------------------------------------------------------- */
.hero-statement-line {
    font-size: 1.5rem;
    line-height: 1.4;
    color: var(--color-text);
    margin: 0 0 20px;
    text-align: left;
}

.hero-statement-line-emphasis {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    margin-bottom: 0;
}

/* ----------------------------------------------------------
   Homepage showcase sections (Activity Inspiration, Learning
   Resources) - alternating text/cards layout
   ---------------------------------------------------------- */
.homepage-showcase {
    max-width: 1100px;
    margin: 0 auto 64px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 48px;
    flex-wrap: wrap;
}

.homepage-showcase-reverse {
    flex-direction: row-reverse;
}

.homepage-showcase-featured {
    flex-direction: column;
    align-items: stretch;
    max-width: 1100px;
}

.homepage-showcase-featured .homepage-showcase-text {
    flex: 1 1 auto;
    width: 100%;
}

.homepage-showcase-featured .homepage-showcase-cards {
    flex-direction: row;
    flex-wrap: nowrap;
    width: 100%;
}

.homepage-showcase-featured .homepage-showcase-card {
    flex: 1 1 0;
    min-width: 0;
}

@media (max-width: 760px) {
    .homepage-showcase-featured .homepage-showcase-cards {
        flex-direction: column;
    }
}

.homepage-showcase-text {
    flex: 1 1 340px;
}

.hero-stat-grid {
    flex: 1 1 300px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.hero-stat-box {
    flex: 1 1 calc(50% - 8px);
    box-sizing: border-box;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100px;
}

.hero-stat-box-link {
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hero-stat-box-link:hover,
.hero-stat-box-link:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
}

.hero-stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    line-height: 1.1;
}

.hero-stat-number-small {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    line-height: 1.3;
}

.hero-stat-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 4px;
}

@media (max-width: 700px) {
    .hero-stat-box {
        flex: 1 1 calc(50% - 8px);
        min-height: 90px;
        padding: 14px 10px;
    }

    .hero-stat-number {
        font-size: 1.6rem;
    }
}

.homepage-showcase-text h2 {
    font-size: 1.7rem;
    color: var(--color-primary-dark);
    margin: 0 0 14px;
}

.homepage-showcase-text p {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--color-text);
    margin: 0 0 18px;
}

.homepage-showcase-link {
    display: inline-block;
    background-color: var(--color-primary);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: var(--radius);
}

.homepage-showcase-link:hover,
.homepage-showcase-link:focus-visible {
    background-color: var(--color-primary-dark);
}

.homepage-showcase-cards {
    flex: 1 1 420px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.homepage-showcase-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
}

.homepage-showcase-card-image {
    display: block;
    width: calc(100% + 40px);
    height: 140px;
    object-fit: contain;
    object-position: center top;
    background-color: var(--color-surface);
    margin: -18px -20px 12px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.homepage-showcase-card-icon {
    width: 32px;
    height: 32px;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.homepage-showcase-card h3 {
    font-size: 1.05rem;
    margin: 0 0 6px;
    color: var(--color-primary-dark);
}

.homepage-showcase-card p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin: 0 0 8px;
    line-height: 1.5;
}

.homepage-showcase-card-cost {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-primary);
    align-self: flex-start;
    background-color: var(--color-accent-light);
    padding: 3px 10px;
    border-radius: 999px;
}

/* ----------------------------------------------------------
   Scroll-reveal: sections fade/slide up into view as the user
   scrolls, rather than all appearing at once. The hidden starting
   state only applies once .js-enabled is present on <html> (set by
   a tiny inline script, before scroll-reveal.js itself runs) - so
   if JavaScript never runs at all, content is simply visible
   immediately rather than stuck at opacity:0 forever. See
   scroll-reveal.js, which adds .is-visible via IntersectionObserver.
   ---------------------------------------------------------- */
.js-enabled .reveal-section {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.js-enabled .reveal-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 760px) {
    .homepage-showcase,
    .homepage-showcase-reverse {
        flex-direction: column;
    }

    .homepage-showcase-text,
    .hero-stat-grid {
        flex: 0 1 auto;
    }

    .hero-statement-line {
        font-size: 1.25rem;
    }

    .hero-statement-line-emphasis {
        font-size: 1.4rem;
    }
}

/* ----------------------------------------------------------
   Learning Resources: year-group filter bar
   ---------------------------------------------------------- */
.year-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    max-width: 1040px;
    margin: 0 auto 32px;
}

.year-filter-btn {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-primary-dark);
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 7px 18px;
    cursor: pointer;
}

.year-filter-btn:hover,
.year-filter-btn:focus-visible {
    border-color: var(--color-accent);
}

.year-filter-btn.is-active {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

/* ----------------------------------------------------------
   Support for Parents: category filter bar
   ---------------------------------------------------------- */
.category-filter-intro {
    text-align: center;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin: 0 0 12px;
}

.category-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    max-width: 1040px;
    margin: 0 auto 32px;
}

.category-filter-btn {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-primary-dark);
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 7px 18px;
    cursor: pointer;
}

.category-filter-btn:hover,
.category-filter-btn:focus-visible {
    border-color: var(--color-accent);
}

.category-filter-btn.is-active {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

/* ----------------------------------------------------------
   Generic info popup (used for "why this helps" on Learning
   Resources - reusable elsewhere via the same data-popup pattern)
   ---------------------------------------------------------- */
.info-popup-trigger-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background-color: var(--color-surface);
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    vertical-align: middle;
    margin-left: 4px;
}

.info-popup-trigger-icon:hover,
.info-popup-trigger-icon:focus-visible {
    border-color: var(--color-accent);
    color: var(--color-primary-dark);
}

.info-popup-trigger {
    display: inline-block;
    margin-top: 10px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    background: none;
    border: none;
    padding: 0;
    text-decoration: underline;
    text-decoration-color: var(--color-accent);
    text-underline-offset: 3px;
    cursor: pointer;
}

.info-popup-trigger:hover,
.info-popup-trigger:focus-visible {
    color: var(--color-primary);
}

.info-popup-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background-color: rgba(38, 43, 49, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
    z-index: 1000;
}

.info-popup.is-open .info-popup-overlay {
    opacity: 1;
    visibility: visible;
}

.info-popup-inner {
    position: relative;
    background-color: var(--color-surface);
    border-radius: var(--radius);
    padding: 26px 30px;
    max-width: 560px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: left;
}

.info-popup-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background-color: var(--color-accent-light);
    color: var(--color-primary-dark);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}

.info-popup-close:hover,
.info-popup-close:focus-visible {
    background-color: var(--color-accent);
}

.info-popup-inner h2 {
    margin-top: 0;
}

/* ----------------------------------------------------------
   MTC (Times Tables) Practice
   ---------------------------------------------------------- */
.mtc-app {
    max-width: 480px;
    margin: 0 auto 60px;
}

.mtc-panel-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 32px 28px;
    text-align: center;
}

.mtc-panel-card h2 {
    margin-bottom: 10px;
}

.mtc-start-btn {
    margin-top: 18px;
    padding: 12px 40px;
    font-size: 1.05rem;
}

.mtc-progress-row {
    margin-bottom: 20px;
}

#mtc-progress-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 8px;
}

.mtc-timer-track {
    width: 100%;
    height: 8px;
    background-color: var(--color-border);
    border-radius: 999px;
    overflow: hidden;
}

.mtc-timer-bar {
    height: 100%;
    width: 100%;
    background-color: var(--color-accent);
    border-radius: 999px;
}

.mtc-timer-bar-gap {
    background-color: var(--color-text-muted);
}

.mtc-question-text {
    font-size: 2.6rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    margin: 20px 0 24px;
}

.mtc-question-text.mtc-feedback-correct,
.mtc-question-text.mtc-feedback-incorrect {
    font-size: 1.5rem;
}

.mtc-question-text.mtc-feedback-correct {
    color: #3F7D5C;
}

.mtc-question-text.mtc-feedback-incorrect {
    color: var(--color-accent);
}

.mtc-answer-input {
    width: 100%;
    font-size: 1.8rem;
    text-align: center;
    padding: 12px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-family: var(--font-body);
}

.mtc-answer-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.mtc-numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.mtc-numpad-key {
    font-family: var(--font-body);
    font-size: 1.3rem;
    font-weight: 600;
    padding: 16px 0;
    border: 1px solid var(--color-border);
    background-color: var(--color-bg);
    color: var(--color-text);
    border-radius: var(--radius);
    cursor: pointer;
}

.mtc-numpad-key:hover,
.mtc-numpad-key:focus-visible {
    background-color: var(--color-accent-light);
}

.mtc-numpad-clear {
    font-size: 0.95rem;
    color: var(--color-text-muted);
}

.mtc-numpad-go {
    background-color: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.mtc-numpad-go:hover,
.mtc-numpad-go:focus-visible {
    background-color: var(--color-primary-dark);
}

.mtc-results-score {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    margin: 12px 0;
}

@media (min-width: 561px) {
    .mtc-numpad {
        display: none;
    }
}

@media (max-width: 560px) {
    .mtc-question-text {
        font-size: 2rem;
    }
}

/* ----------------------------------------------------------
   Compare Schools
   ---------------------------------------------------------- */
.compare-search {
    max-width: 700px;
    margin: 0 auto 30px;
    padding: 0 16px;
}

.compare-search-row {
    margin-bottom: 16px;
}

.compare-area-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.compare-area-input-group select {
    flex: 1 1 200px;
    align-self: center;
    height: auto;
}

.btn-search-secondary {
    background: none;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    border-radius: var(--radius);
    padding: 9px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
}

.btn-search-secondary:hover {
    background-color: var(--color-accent-light);
}

.location-status {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin: 6px 0 0;
    min-height: 1.2em;
}

.compare-search-types {
    border: none;
    padding: 0;
    margin: 0 0 18px;
}

.compare-search-types legend {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text);
    margin-bottom: 8px;
    padding: 0;
}

.compare-type-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 16px 8px 0;
    font-size: 0.9rem;
}

.compare-results {
    max-width: 700px;
    margin: 0 auto 40px;
    padding: 0 16px;
}

.compare-results-count {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 10px;
}

.compare-results-list {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.compare-result-item {
    border-bottom: 1px solid var(--color-border);
}

.compare-result-item:last-child {
    border-bottom: none;
}

.compare-result-item label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
}

.compare-result-item label:hover {
    background-color: var(--color-bg);
}

.compare-result-item input[type="checkbox"]:disabled + .compare-result-name {
    color: var(--color-text-muted);
}

.compare-result-name {
    font-weight: 600;
    flex: 1 1 auto;
}

.compare-result-meta {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.compare-matrix-wrap {
    max-width: 1000px;
    margin: 0 auto 60px;
    padding: 0 16px;
}

.compare-note {
    background-color: var(--color-accent-light);
    border: 1px solid var(--color-accent);
    border-radius: var(--radius);
    padding: 14px 18px;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.compare-note-warning {
    background-color: #FBEAE7;
    border: 1px solid #B25B4A;
    border-radius: var(--radius);
    padding: 14px 18px;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.compare-table-scroll {
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--color-surface);
}

.compare-table th,
.compare-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

.compare-table thead th {
    background-color: var(--color-primary);
    color: #fff;
    font-size: 0.95rem;
}

.compare-table thead th a {
    color: #fff;
    text-decoration: underline;
}

.compare-row-label {
    font-weight: 600;
    color: var(--color-text);
    background-color: var(--color-bg);
    position: sticky;
    left: 0;
}

.compare-row-highlight td {
    background-color: var(--color-accent-light);
}

.compare-not-applicable {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* Visually hidden but still reachable by screen readers - used to
   keep "Yes"/"No" as real text behind the tick/cross icons, so the
   meaning isn't carried by colour and shape alone. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.compare-icon-yes,
.compare-icon-no {
    display: inline-block;
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1;
}

.compare-icon-yes {
    color: #3F7D5C;
}

.compare-icon-no {
    color: #B25B4A;
}

.compare-row-sublabel {
    display: block;
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Hidden on desktop, where the full label reads fine on one line;
   becomes a real line break on phones (portrait or landscape) so a
   single long label doesn't force the whole comparison table wider
   than it needs to be. */
.mobile-only-break {
    display: none;
}

@media (max-width: 900px) {
    .mobile-only-break {
        display: block;
    }
}

/* Attainment 8 traffic light - a small coloured dot next to the raw
   score, plus the plain-language legend explaining what each colour
   means, since the number alone isn't meaningful to most parents. */
.attainment8-tier {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.attainment8-tier-above {
    background-color: #3F7D5C;
}

.attainment8-tier-average {
    background-color: #C9A227;
}

.attainment8-tier-below {
    background-color: #B25B4A;
}

.attainment8-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin-bottom: 16px;
}

.attainment8-legend span {
    display: inline-flex;
    align-items: center;
}

@media (max-width: 700px) {
    .compare-area-input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .compare-area-input-group select {
        flex: 1 1 auto;
    }
}

.profile-facts-subjects {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
}

.profile-facts-subjects li {
    background-color: var(--color-accent-light);
    color: #A34424;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
}

/* Gentle attention pulse for the Parent Score CTA, triggered by JS
   after genuine reading time on a school's page - a few cycles then
   stops, not an endless loop, since the point is to draw the eye
   once, not nag indefinitely. */
@keyframes parent-score-cta-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.035); }
}

.parent-score-cta-attention {
    animation: parent-score-cta-pulse 1.6s ease-in-out 3;
}

/* Suggests landscape orientation for the comparison table on narrow
   portrait screens, where even a sticky label column leaves too
   little room per school to read comfortably. Hidden by default;
   shown only when both conditions genuinely apply, and disappears
   automatically the moment the phone is rotated - no JavaScript or
   dismiss button needed, since the media query itself re-evaluates
   live on orientation change. */
.compare-rotate-hint {
    display: none;
}

@media (max-width: 700px) and (orientation: portrait) {
    .compare-rotate-hint {
        display: flex;
        align-items: center;
        gap: 8px;
        background-color: var(--color-accent-light);
        border: 1px solid var(--color-accent);
        border-radius: var(--radius);
        padding: 10px 14px;
        font-size: 0.85rem;
        margin-bottom: 12px;
    }

    .compare-rotate-hint span {
        font-size: 1.2rem;
        flex-shrink: 0;
    }
}

/* Cookie consent banner - deliberately light-touch: a slim bar at
   the bottom of the screen, not a full overlay that blocks the
   page, and easy to dismiss either way with one click. */
.cookie-consent-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background-color: var(--color-surface);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.cookie-consent-banner p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-text);
    flex: 1 1 320px;
}

.cookie-consent-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.cookie-consent-actions button {
    font-size: 0.85rem;
    padding: 7px 16px;
    border-radius: var(--radius);
    cursor: pointer;
}

.cookie-consent-decline {
    background: none;
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.cookie-consent-accept {
    background-color: var(--color-primary);
    border: 1px solid var(--color-primary);
    color: #fff;
    font-weight: 600;
}

@media (max-width: 500px) {
    .cookie-consent-banner {
        display: block;
        text-align: center;
    }
    .cookie-consent-banner p {
        margin-bottom: 10px;
    }
    .cookie-consent-actions {
        display: flex;
        justify-content: center;
    }
}
