/*
 * SDO Naga City: public site (mobile-first). Tokens and shared components are in tokens.css.
 * Structure follows the Government Website Template (D27): GOVPH bar, agency header, agency
 * footer and the standard government footer, styled with the SDO design system.
 */

body {
    background: var(--sdo-white);
}

/* ---- GOVPH top bar ---------------------------------------------------------------------- */

.govph-bar {
    background: var(--sdo-navy);
    color: var(--sdo-on-dark-muted);
    font-size: 0.8rem;
}

.govph-bar .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 1rem;
    min-height: 2.25rem;
}

.govph-bar a {
    color: var(--sdo-white);
    text-decoration: none;
}

.govph-bar a:hover,
.govph-bar a:focus-visible {
    text-decoration: underline;
}

.govph-mark {
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--sdo-gold) !important;
}

/* ---- Agency header ---------------------------------------------------------------------- */

.site-header {
    background: var(--sdo-white);
    border-bottom: 1px solid var(--sdo-border);
    box-shadow: var(--sdo-shadow-sm);
}

.site-header .navbar {
    padding-block: 0.625rem;
}

/* The brand shrinks (and wraps) so the menu button stays on the same row on phones. */
.site-header .navbar-brand {
    flex: 1 1 0;
    min-width: 0;
    margin-right: 0.75rem;
    white-space: normal;
}

@media (min-width: 992px) {
    .site-header .navbar-brand {
        flex: 0 1 auto;
    }
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.brand-eyebrow {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--sdo-red);
}

.brand-title {
    font-weight: 700;
    font-size: clamp(0.95rem, 3.6vw, 1.15rem);
    color: var(--sdo-navy);
}

.site-header .navbar-toggler {
    min-width: var(--sdo-touch);
    min-height: var(--sdo-touch);
    border-color: var(--sdo-border);
}

.site-header .nav-link {
    font-weight: 500;
    color: var(--sdo-text);
    border-radius: var(--sdo-radius-sm);
    padding: 0.625rem 0.875rem;
    min-height: var(--sdo-touch);
    display: flex;
    align-items: center;
}

.site-header .nav-link:hover {
    color: var(--sdo-blue);
    background: var(--sdo-surface);
}

.site-header .nav-link.active {
    color: var(--sdo-blue);
    background: var(--sdo-blue-soft);
}

@media (min-width: 992px) {
    .site-header .navbar-nav {
        gap: 0.25rem;
    }
}

/* ---- Main menu dropdowns (D43, D44) ----------------------------------------------------- */

.site-header .dropdown-toggle {
    background: none;
    border: 0;
    width: 100%;
    text-align: left;
}

.site-header .dropdown-menu {
    border: 1px solid var(--sdo-border);
    border-radius: var(--sdo-radius);
    box-shadow: var(--sdo-shadow);
    padding: 0.5rem;
    min-width: 15rem;
}

.site-header .dropdown-item {
    border-radius: var(--sdo-radius-sm);
    padding: 0.55rem 0.75rem;
    white-space: normal;
    min-height: var(--sdo-touch);
    display: flex;
    align-items: center;
}

.site-header .dropdown-item.active,
.site-header .dropdown-item:active {
    background: var(--sdo-blue-soft);
    color: var(--sdo-blue);
}

.site-header .dropdown-header {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sdo-muted);
    padding: 0.75rem 0.75rem 0.25rem;
}

/* Third level: listed under its parent, indented, inside the same dropdown. */
.dropdown-sublist {
    margin: 0 0 0.25rem 0.75rem;
    padding-left: 0.5rem;
    border-left: 2px solid var(--sdo-border);
}

.dropdown-sublist .dropdown-item {
    font-size: 0.925rem;
    min-height: 2.5rem;
}

/* Mega-menu: one column per sub-item, as wide as the header on desktop. */
.mega-heading {
    display: block;
    font-weight: 600;
    color: var(--sdo-navy);
    padding: 0.5rem 0.75rem;
    text-decoration: none;
}

a.mega-heading:hover {
    color: var(--sdo-blue);
}

.mega-overview {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0.25rem 0.75rem 0.75rem;
    font-weight: 600;
}

@media (min-width: 992px) {
    .site-header .dropdown-toggle {
        width: auto;
    }

    .site-header .nav-item.mega {
        position: static;
    }

    /* The mega-menu spans the content width, lined up with the page below. */
    .site-header .navbar > .container {
        position: relative;
    }

    .site-header .mega-menu {
        left: 0;
        right: 0;
        margin-top: 0;
        padding: 1.25rem;
        border-radius: 0 0 var(--sdo-radius-lg) var(--sdo-radius-lg);
    }
}

/* ---- Quick links (home page) -------------------------------------------------------------- */

.quick-links {
    display: grid;
    /* auto-fit: the boxes share the whole row instead of leaving empty columns on wide screens */
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    grid-auto-rows: 1fr; /* every row as tall as the tallest box, so all boxes match */
    gap: 0.75rem;
}

/* The link fills its grid cell, so a two-line label doesn't make one box taller than its neighbours. */
.quick-links > li {
    display: flex;
    min-width: 0;
}

/* Card: icon tile (kind of link) | label | arrow. Same card language as the folder sections. */
.quick-link {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-height: 4.5rem;
    padding: 0.9rem 1rem 0.9rem 0.9rem;
    border: 1px solid var(--sdo-border);
    border-radius: var(--sdo-radius-lg);
    background: var(--sdo-white);
    box-shadow: var(--sdo-shadow-sm);
    color: var(--sdo-navy);
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
    transition: border-color var(--sdo-transition), box-shadow 0.2s ease, transform 0.2s ease, color var(--sdo-transition);
}

.quick-link-icon {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--sdo-radius);
    background: var(--sdo-blue-soft);
    color: var(--sdo-blue);
    font-size: 1.25rem;
    transition: background-color var(--sdo-transition), color var(--sdo-transition);
}

.quick-link-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* The arrow, or the "opens in a new tab" icon menu_link() adds, sits at the right edge. */
.quick-link-go,
.quick-link > .bi-box-arrow-up-right {
    flex-shrink: 0;
    margin-left: auto;
    color: var(--sdo-muted);
    font-size: 1rem;
    transition: transform 0.2s ease, color var(--sdo-transition);
}

.quick-link:hover {
    border-color: rgba(0, 56, 168, 0.35);
    box-shadow: var(--sdo-shadow);
    transform: translateY(-2px);
    color: var(--sdo-blue);
}

.quick-link:focus-visible {
    outline: 3px solid rgba(0, 56, 168, 0.45);
    outline-offset: 2px;
    border-color: var(--sdo-blue);
    color: var(--sdo-blue);
}

.quick-link:active {
    transform: translateY(0);
    box-shadow: var(--sdo-shadow-sm);
}

.quick-link:hover .quick-link-icon,
.quick-link:focus-visible .quick-link-icon {
    background: var(--sdo-blue);
    color: var(--sdo-white);
}

.quick-link:hover .quick-link-go,
.quick-link:focus-visible .quick-link-go {
    color: var(--sdo-blue);
    transform: translateX(3px);
}

.quick-link:hover > .bi-box-arrow-up-right,
.quick-link:focus-visible > .bi-box-arrow-up-right {
    color: var(--sdo-blue);
    transform: translate(2px, -2px);
}

@media (prefers-reduced-motion: reduce) {
    .quick-link:hover,
    .quick-link:hover .quick-link-go,
    .quick-link:hover > .bi-box-arrow-up-right {
        transform: none;
    }
}

.footer-heading-link {
    color: inherit;
    text-decoration: none;
}

.footer-heading-link:hover {
    text-decoration: underline;
}

/* ---- Hero ------------------------------------------------------------------------------- */

.hero {
    position: relative;
    background: linear-gradient(135deg, var(--sdo-blue) 0%, var(--sdo-navy) 100%);
    color: var(--sdo-white);
    overflow: hidden;
}

/* Flag stripes along the bottom edge. */
.hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 4px;
    background: linear-gradient(90deg, var(--sdo-blue) 0 33%, var(--sdo-red) 33% 66%, var(--sdo-gold) 66% 100%);
}

.hero-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    color: var(--sdo-gold);
    font-weight: 600;
}

.hero-title {
    font-size: clamp(1.6rem, 5vw, 2.75rem);
    font-weight: 700;
}

.hero-lead {
    max-width: 40rem;
    color: rgba(255, 255, 255, 0.88);
}

/* ---- Cards ------------------------------------------------------------------------------ */

.feature-card {
    border: 1px solid var(--sdo-border);
    border-radius: var(--sdo-radius);
    transition: box-shadow var(--sdo-transition), transform var(--sdo-transition);
}

a.feature-card:hover,
a.feature-card:focus-visible {
    box-shadow: var(--sdo-shadow);
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 1.75rem;
    color: var(--sdo-blue);
}

/* ---- Footer (agency footer + standard government footer) ------------------------------- */

.site-footer {
    background: var(--sdo-navy);
    color: var(--sdo-on-dark-muted);
    font-size: 0.9rem;
}

.site-footer a {
    color: var(--sdo-white);
    text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
    text-decoration: underline;
}

.footer-title {
    color: var(--sdo-white);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.footer-heading {
    color: var(--sdo-gold);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.5rem;
}

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

.footer-links li + li {
    margin-top: 0.35rem;
}

.gov-footer {
    background: #00163f; /* white text 17:1, muted text 10:1 */
    border-top: 3px solid var(--sdo-gold);
    font-size: 0.85rem;
}

/* Seal of the Republic of the Philippines (public domain), on a white disc so its blue ring
   stays visible on the dark footer. */
.gov-footer .gov-seal {
    width: 3.5rem;
    height: 3.5rem;
    padding: 2px;
    border-radius: 50%;
    background: #fff;
    flex-shrink: 0;
}

/* ---- Error page ------------------------------------------------------------------------- */

.error-page {
    background: var(--sdo-surface);
}

.error-code {
    font-size: clamp(3rem, 12vw, 6rem);
    font-weight: 800;
    color: var(--sdo-blue);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.error-debug {
    max-height: 50vh;
    overflow: auto;
    font-size: 0.75rem;
    background: var(--sdo-white);
    border: 1px solid var(--sdo-border);
    border-radius: var(--sdo-radius);
    padding: 1rem;
}

/* ---- Content pages ---------------------------------------------------------------------- */

.prose {
    max-width: 46rem; /* about 70 characters per line in Poppins */
}

.prose h2 {
    font-size: var(--sdo-h2);
    margin-top: 2rem;
}

.prose kbd {
    background: var(--sdo-navy);
}

/* Page bodies written in the editor (D28). Only the classes HtmlSanitizer allows are styled. */
.page-content {
    overflow-wrap: break-word;
}

.page-content::after { /* contain floated images */
    content: "";
    display: table;
    clear: both;
}

.page-content h3 {
    font-size: var(--sdo-h3, 1.2rem);
    margin-top: 1.5rem;
}

.page-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--sdo-radius-sm);
}

.page-content figure {
    margin: 1.5rem 0;
}

.page-content figcaption {
    font-size: 0.875rem;
    color: var(--sdo-muted);
    margin-top: 0.5rem;
}

.page-content .align-center {
    display: block;
    margin-inline: auto;
    text-align: center;
}

/* Floats only where there is room; on phones images stay full width. */
@media (min-width: 576px) {
    .page-content .align-left {
        float: left;
        max-width: 50%;
        margin: 0.25rem 1.5rem 1rem 0;
    }

    .page-content .align-right {
        float: right;
        max-width: 50%;
        margin: 0.25rem 0 1rem 1.5rem;
    }
}

.page-content .text-justify {
    text-align: justify;
    hyphens: auto;
}

.page-content blockquote {
    border-left: 4px solid var(--sdo-gold);
    padding: 0.25rem 0 0.25rem 1rem;
    color: var(--sdo-muted);
}

.page-content table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
}

.page-content th,
.page-content td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--sdo-border);
    vertical-align: top;
}

.page-content .table-bordered th,
.page-content .table-bordered td {
    border: 1px solid var(--sdo-border);
}

.page-content .table-striped tbody tr:nth-child(odd) {
    background: var(--sdo-surface);
}

/* Tables scroll sideways inside their own box on small screens (wrapped by site JS-free markup). */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.page-content.full-width {
    max-width: none;
}

/* Section menu of the "sidebar" page template */
.section-nav {
    border: 1px solid var(--sdo-border);
    border-radius: var(--sdo-radius);
    padding: 1rem;
    background: var(--sdo-white);
}

.section-nav .nav-link {
    padding: 0.5rem 0.75rem;
    border-radius: var(--sdo-radius-sm);
    color: var(--sdo-text);
    min-height: var(--sdo-touch);
    display: flex;
    align-items: center;
}

.section-nav .nav-link:hover {
    background: var(--sdo-surface);
}

.section-nav .nav-link.active {
    background: var(--sdo-blue-soft);
    color: var(--sdo-blue);
    font-weight: 600;
}

.preview-bar {
    background: var(--sdo-gold);
    color: var(--sdo-navy);
    font-size: 0.875rem;
}

/* Inner page header */
.page-header {
    background: var(--sdo-surface);
    border-bottom: 1px solid var(--sdo-border);
}

.page-header .breadcrumb {
    font-size: 0.85rem;
}

.page-title {
    font-size: clamp(1.4rem, 4vw, 2rem);
    font-weight: 700;
    color: var(--sdo-navy);
}

.memo-page-title {
    font-size: clamp(1.2rem, 3.5vw, 1.75rem);
    overflow-wrap: anywhere;
}

.page-lead {
    color: var(--sdo-muted);
    max-width: 48rem;
}

/* Memo list (mobile first: stacked, actions below the text) */
.memo-filters {
    background: #fff;
    border: 1px solid var(--sdo-border);
    border-radius: var(--sdo-radius);
    padding: 1rem;
}

.memo-list {
    display: grid;
    gap: 0.75rem;
}

.memo-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 0.875rem;
    background: #fff;
    border: 1px solid var(--sdo-border);
    border-radius: var(--sdo-radius);
    padding: 1rem;
}

.memo-item-featured {
    border-color: var(--sdo-blue);
    box-shadow: inset 4px 0 0 var(--sdo-blue);
}

.memo-icon {
    font-size: 1.5rem;
    line-height: 1;
    color: #c0392b;
    padding-top: 0.15rem;
}

.memo-body {
    min-width: 0;
}

.memo-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    align-items: center;
    margin-bottom: 0.25rem;
}

.memo-ref {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--sdo-blue);
    background: var(--sdo-blue-soft);
    border-radius: 999px;
    padding: 0.125rem 0.625rem;
}

.memo-type {
    font-size: 0.8rem;
    color: var(--sdo-muted);
}

.memo-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
    overflow-wrap: anywhere;
}

.memo-title a {
    color: var(--sdo-text);
    text-decoration: none;
}

.memo-title a:hover,
.memo-title a:focus-visible {
    color: var(--sdo-blue);
    text-decoration: underline;
}

.memo-sub {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    font-size: 0.8rem;
    color: var(--sdo-muted);
    margin: 0;
}

.memo-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.memo-actions .btn {
    flex: 1 1 auto;
    min-height: 2.5rem;
}

@media (min-width: 768px) {
    .memo-item {
        grid-template-columns: auto 1fr auto;
        align-items: center;
    }

    .memo-actions {
        grid-column: auto;
        justify-content: flex-end;
    }

    .memo-actions .btn {
        flex: 0 0 auto;
    }
}

/* Google Drive preview frame */
.memo-frame-wrap {
    background: var(--sdo-surface);
}

.memo-frame {
    display: block;
    width: 100%;
    height: 80vh;
    border: 0;
}

.memo-frame-page {
    border: 1px solid var(--sdo-border);
    border-radius: var(--sdo-radius);
    overflow: hidden;
}

@media (max-width: 767.98px) {
    .memo-frame {
        height: calc(100vh - 8rem);
    }
}

/* ---- Site settings (Phase 5A): logo, notice banner, footer contacts ------------------------ */

.brand-logo {
    height: 2.75rem;
    width: auto;
    max-width: 8rem;
    object-fit: contain;
    flex-shrink: 0;
}

.site-notice {
    font-size: 0.9rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid transparent;
}

.site-notice-info {
    background: var(--sdo-blue-soft);
    color: var(--sdo-navy);
    border-color: #cdd9f0;
}

.site-notice-warning {
    background: #fff6d6;
    color: #4d3d00;              /* 10:1 on the yellow */
    border-color: #f2df8c;
}

.site-notice-danger {
    background: #fde8ea;
    color: #7a0a17;              /* 8.9:1 on the pink */
    border-color: #f5c2c8;
}

.site-notice-link {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    white-space: nowrap;
}

.footer-contact li {
    display: flex;
    gap: 0.6rem;
    align-items: baseline;
    margin-bottom: 0.4rem;
}

.footer-contact .bi {
    color: var(--sdo-gold);
    flex-shrink: 0;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--sdo-touch);
    height: var(--sdo-touch);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    font-size: 1.1rem;
}

.footer-social a:hover,
.footer-social a:focus-visible {
    background: rgba(255, 255, 255, 0.18);
    text-decoration: none;
}

.footer-gov-links li {
    margin-bottom: 0.35rem;
}

/* ---- Drive folder pages (Phase 5B): subfolder sections ---------------------------------- */

.folder-sections {
    display: grid;
    /* Same rule as the quick links: equal columns, and every row as tall as the tallest box, so the
       boxes stay the same size even when a long folder name wraps. */
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    grid-auto-rows: 1fr;
    gap: 0.75rem;
}

.folder-sections > li {
    display: flex;
    min-width: 0;
}

/* Card: icon tile | name over a file-count pill | arrow. */
.folder-section {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "icon name go" "icon count go";
    align-content: center;
    align-items: center;
    column-gap: 0.85rem;
    row-gap: 0.35rem;
    min-height: var(--sdo-touch);
    padding: 1rem 1rem 1rem 0.9rem;
    background: var(--sdo-white);
    border: 1px solid var(--sdo-border);
    border-radius: var(--sdo-radius-lg);
    box-shadow: var(--sdo-shadow-sm);
    color: var(--sdo-text);
    text-decoration: none;
    transition: border-color var(--sdo-transition), box-shadow 0.2s ease, transform 0.2s ease;
}

.folder-section:hover {
    border-color: rgba(0, 56, 168, 0.35);
    box-shadow: var(--sdo-shadow);
    transform: translateY(-2px);
    color: var(--sdo-text);
}

.folder-section:focus-visible {
    outline: 3px solid rgba(0, 56, 168, 0.45);
    outline-offset: 2px;
    border-color: var(--sdo-blue);
}

.folder-section:active {
    transform: translateY(0);
    box-shadow: var(--sdo-shadow-sm);
}

/* Icon tile: gold-tinted folder that turns into an open blue folder on hover. */
.folder-section-icon {
    grid-area: icon;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--sdo-radius);
    background: #fff7d6;
    color: var(--sdo-gold-text);
    font-size: 1.3rem;
    transition: background-color var(--sdo-transition), color var(--sdo-transition);
}

.folder-section-icon .icon-open {
    display: none;
}

.folder-section:hover .folder-section-icon,
.folder-section:focus-visible .folder-section-icon {
    background: var(--sdo-blue-soft);
    color: var(--sdo-blue);
}

.folder-section:hover .icon-closed,
.folder-section:focus-visible .icon-closed {
    display: none;
}

.folder-section:hover .icon-open,
.folder-section:focus-visible .icon-open {
    display: inline;
}

/* Name: always shown in full; equal row heights keep the cards the same size. */
.folder-section-name {
    grid-area: name;
    align-self: end;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
    transition: color var(--sdo-transition);
}

.folder-section:hover .folder-section-name,
.folder-section:focus-visible .folder-section-name {
    color: var(--sdo-blue);
}

.folder-section-count {
    grid-area: count;
    justify-self: start;
    align-self: start;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    background: var(--sdo-surface);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--sdo-muted);
    white-space: nowrap;
}

/* Arrow: muted until hover, then slides right in the brand blue. */
.folder-section-go {
    grid-area: go;
    color: var(--sdo-muted);
    font-size: 1rem;
    transition: transform 0.2s ease, color var(--sdo-transition);
}

.folder-section:hover .folder-section-go,
.folder-section:focus-visible .folder-section-go {
    color: var(--sdo-blue);
    transform: translateX(3px);
}

/* Wide screens: a stacked card (icon and arrow on top, then the name across the full width, then
   the count), so long names wrap less. Phones keep the compact row above. */
@media (min-width: 992px) {
    .folder-section {
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas: "icon . go" "name name name" "count count count";
        grid-template-rows: auto 1fr auto;
        align-content: stretch;
        row-gap: 0.6rem;
        padding: 1.1rem 1.1rem 1rem;
    }

    .folder-section-name {
        align-self: start;
    }

    .folder-section-go {
        align-self: start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .folder-section:hover,
    .folder-section:hover .folder-section-go {
        transform: none;
    }
}

/* ---- Homepage sections (Phase 5C, D54-D57) ------------------------------------------------ */

.home-section {
    padding-top: 3rem;
}

.home-end {
    padding-bottom: 3rem;
}

.home-section-tint {
    margin-top: 3rem;
    padding-block: 2.5rem;
    background: var(--sdo-surface);
}

.home-section-tint + .home-section {
    padding-top: 3rem;
}

.home-heading {
    margin-bottom: 1rem;
    font-size: clamp(1.3rem, 2.5vw, 1.6rem);
    font-weight: 700;
    color: var(--sdo-navy);
}

.home-heading-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.25rem 1rem;
    margin-bottom: 1rem;
}

.home-heading-row .home-heading {
    margin-bottom: 0;
}

.home-more {
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.home-more:hover,
.home-more:focus-visible {
    text-decoration: underline;
}

.home-intro {
    max-width: 48rem;
    margin-top: -0.25rem;
    margin-bottom: 1.25rem;
    color: var(--sdo-muted);
}

/* Staff preview of the draft */
.home-preview-bar {
    position: sticky;
    top: 0;
    z-index: 1030;
    padding: 0.5rem 0;
    background: var(--sdo-gold);
    color: var(--sdo-navy);
    font-size: 0.9rem;
}

/* ---- Big header (hero) ---- */

.hero {
    display: flex;
    align-items: center;
}

.hero-medium {
    min-height: 15rem;
}

.hero-large {
    min-height: 24rem;
}

.hero-inner {
    position: relative;
    z-index: 2;
    padding-block: 3rem;
}

.hero::after {
    z-index: 2;
}

/* A real <img> behind the text, darkened by a navy veil so the text keeps its contrast. */
.hero-image {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-has-image::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(90deg, rgba(0, 31, 92, 0.92) 0%, rgba(0, 31, 92, 0.75) 55%, rgba(0, 31, 92, 0.45) 100%);
}

.hero-center.hero-has-image::before {
    background: rgba(0, 31, 92, 0.72);
}

.hero-center .hero-inner {
    text-align: center;
}

.hero-center .hero-lead {
    margin-inline: auto;
}

.hero-center .hero-actions {
    justify-content: center;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn-hero-primary,
.btn-hero-secondary {
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--sdo-radius);
}

.btn-hero-primary {
    border: 1px solid var(--sdo-gold);
    background: var(--sdo-gold);
    color: var(--sdo-navy);
}

.btn-hero-primary:hover,
.btn-hero-primary:focus-visible {
    border-color: #ffe066;
    background: #ffe066;
    color: var(--sdo-navy);
}

.btn-hero-secondary {
    border: 1px solid rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.08);
    color: var(--sdo-white);
}

.btn-hero-secondary:hover,
.btn-hero-secondary:focus-visible {
    background: rgba(255, 255, 255, 0.2);
    color: var(--sdo-white);
}

.btn-hero-primary:focus-visible,
.btn-hero-secondary:focus-visible {
    outline: 3px solid var(--sdo-white);
    outline-offset: 2px;
}

@media (max-width: 575.98px) {
    .hero-actions .btn {
        flex: 1 1 100%;
    }
}

@media (min-width: 992px) {
    .hero-medium {
        min-height: 20rem;
    }

    .hero-large {
        min-height: 32rem;
    }

    .hero-inner {
        padding-block: 4rem;
    }
}

/* ---- Picture carousel ---- */

.home-carousel {
    overflow: hidden;
    border-radius: var(--sdo-radius-lg);
    background: var(--sdo-navy);
    box-shadow: var(--sdo-shadow);
}

.home-carousel-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.home-carousel-caption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 3.5rem 1.25rem 2.5rem;
    background: linear-gradient(180deg, rgba(0, 20, 60, 0) 0%, rgba(0, 20, 60, 0.88) 55%);
    color: var(--sdo-white);
}

.home-carousel-title {
    margin-bottom: 0.25rem;
    font-size: clamp(1.05rem, 2.5vw, 1.4rem);
    font-weight: 700;
    color: var(--sdo-white);
}

.home-carousel .carousel-control-prev,
.home-carousel .carousel-control-next {
    display: none;
    width: 4.5rem;
    opacity: 1;
}

.home-carousel-arrow {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--sdo-navy);
    font-size: 1.1rem;
    box-shadow: var(--sdo-shadow);
    transition: transform 0.2s ease, background-color var(--sdo-transition);
}

.home-carousel .carousel-control-prev:hover .home-carousel-arrow,
.home-carousel .carousel-control-next:hover .home-carousel-arrow {
    background: var(--sdo-white);
    transform: scale(1.06);
}

.home-carousel .carousel-control-prev:focus-visible .home-carousel-arrow,
.home-carousel .carousel-control-next:focus-visible .home-carousel-arrow,
.home-carousel-pause:focus-visible {
    outline: 3px solid var(--sdo-gold);
    outline-offset: 2px;
}

/* Dots: small to look at, 28px tall to tap (transparent borders). */
.home-carousel .carousel-indicators {
    z-index: 3;
    margin-bottom: 0.4rem;
}

.home-carousel .carousel-indicators [data-bs-target] {
    box-sizing: content-box;
    width: 0.5rem;
    height: 0.5rem;
    margin-inline: 0.2rem;
    border: 0;
    border-block: 10px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
    opacity: 0.55;
    transition: width 0.2s ease, opacity var(--sdo-transition);
}

.home-carousel .carousel-indicators .active {
    width: 1.5rem;
    opacity: 1;
}

.home-carousel-pause {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 20, 60, 0.7);
    color: var(--sdo-white);
    font-size: 1.1rem;
}

.home-carousel-pause:hover {
    background: rgba(0, 20, 60, 0.9);
}

@media (min-width: 768px) {
    .home-carousel-image {
        aspect-ratio: 21 / 9;
    }

    .home-carousel-caption {
        padding: 4rem 5rem 2.75rem;
    }

    .home-carousel .carousel-control-prev,
    .home-carousel .carousel-control-next {
        display: flex;
    }
}

/* ---- Announcements ---- */

.home-announcements {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
    gap: 0.75rem;
}

.home-announcement {
    position: relative;
    display: flex;
    gap: 0.9rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--sdo-border);
    border-left: 4px solid var(--sdo-gold);
    border-radius: var(--sdo-radius-lg);
    background: var(--sdo-white);
    box-shadow: var(--sdo-shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.home-announcement:has(.stretched-link):hover {
    box-shadow: var(--sdo-shadow);
    transform: translateY(-2px);
}

.home-announcement:has(.stretched-link:focus-visible) {
    outline: 3px solid rgba(0, 56, 168, 0.45);
    outline-offset: 2px;
}

.home-announcement .stretched-link:focus-visible {
    outline: none;
}

.home-announcement-icon {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--sdo-radius);
    background: #fff7d6;
    color: var(--sdo-gold-text);
}

.home-announcement-body {
    min-width: 0;
}

.home-announcement-body p {
    font-size: 0.9rem;
    color: var(--sdo-muted);
}

.home-announcement-date {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--sdo-blue);
}

.home-announcement-title {
    margin: 0.1rem 0 0.25rem;
    font-size: 1rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.home-announcement-title a {
    color: var(--sdo-navy);
    text-decoration: none;
}

.home-announcement:hover .home-announcement-title a {
    color: var(--sdo-blue);
}

.home-announcement-go {
    align-self: center;
    margin-left: auto;
    color: var(--sdo-muted);
    transition: transform 0.2s ease, color var(--sdo-transition);
}

.home-announcement:hover .home-announcement-go {
    color: var(--sdo-blue);
    transform: translateX(3px);
}

/* ---- Icon cards ---- */

.home-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    grid-auto-rows: 1fr;
    gap: 1rem;
}

.home-cards > li {
    display: flex;
    min-width: 0;
}

.home-card {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    padding: 1.4rem;
    border: 1px solid var(--sdo-border);
    border-radius: var(--sdo-radius-lg);
    background: var(--sdo-white);
    box-shadow: var(--sdo-shadow-sm);
    color: var(--sdo-text);
    text-decoration: none;
    transition: border-color var(--sdo-transition), box-shadow 0.2s ease, transform 0.2s ease;
}

a.home-card:hover {
    border-color: rgba(0, 56, 168, 0.35);
    box-shadow: var(--sdo-shadow);
    transform: translateY(-2px);
    color: var(--sdo-text);
}

a.home-card:focus-visible {
    outline: 3px solid rgba(0, 56, 168, 0.45);
    outline-offset: 2px;
}

.home-card-icon {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
    border-radius: var(--sdo-radius);
    background: var(--sdo-blue-soft);
    color: var(--sdo-blue);
    font-size: 1.4rem;
    transition: background-color var(--sdo-transition), color var(--sdo-transition);
}

a.home-card:hover .home-card-icon,
a.home-card:focus-visible .home-card-icon {
    background: var(--sdo-blue);
    color: var(--sdo-white);
}

.home-card-title {
    margin-bottom: 0.35rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--sdo-navy);
    overflow-wrap: anywhere;
}

.home-card-text {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--sdo-muted);
}

.home-card-go {
    margin-top: auto;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--sdo-blue);
}

.home-card-go i {
    display: inline-block;
    transition: transform 0.2s ease;
}

a.home-card:hover .home-card-go i {
    transform: translateX(3px);
}

/* ---- Text ---- */

.home-text {
    display: grid;
    gap: 2rem;
    align-items: center;
}

.home-text-body {
    max-width: 46rem;
}

.home-text-body p {
    line-height: 1.75;
}

.home-text-image {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--sdo-radius-lg);
    box-shadow: var(--sdo-shadow);
}

@media (min-width: 992px) {
    .home-text-with-image {
        grid-template-columns: 1.25fr 1fr;
    }
}

/* ---- Call to action ---- */

.home-cta {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 2rem 1.5rem;
    border-radius: var(--sdo-radius-lg);
}

.home-cta-title {
    margin-bottom: 0.35rem;
    font-size: clamp(1.25rem, 3vw, 1.6rem);
    font-weight: 700;
    color: inherit;
}

.home-cta-button {
    flex-shrink: 0;
    align-self: flex-start;
    font-size: 1rem;
    font-weight: 600;
    border: 0;
    border-radius: var(--sdo-radius);
}

.home-cta-button:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 3px;
}

.home-cta-blue {
    background: linear-gradient(135deg, var(--sdo-blue) 0%, var(--sdo-navy) 100%);
    color: var(--sdo-white);
}

.home-cta-blue .home-cta-button {
    background: var(--sdo-gold);
    color: var(--sdo-navy);
}

.home-cta-blue .home-cta-button:hover {
    background: #ffe066;
}

.home-cta-gold {
    background: var(--sdo-gold);
    color: var(--sdo-navy);
}

.home-cta-gold .home-cta-button {
    background: var(--sdo-navy);
    color: var(--sdo-white);
}

.home-cta-gold .home-cta-button:hover {
    background: var(--sdo-blue-dark);
}

.home-cta-light {
    border: 1px solid #d3def3;
    background: var(--sdo-blue-soft);
    color: var(--sdo-navy);
}

.home-cta-light .home-cta-button {
    background: var(--sdo-blue);
    color: var(--sdo-white);
}

.home-cta-light .home-cta-button:hover {
    background: var(--sdo-blue-dark);
}

@media (min-width: 768px) {
    .home-cta {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 2.25rem 2.5rem;
    }

    .home-cta-button {
        align-self: center;
    }
}

/* ---- Numbers ---- */

.home-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
    gap: 1rem;
}

/* <dt> (label) comes first in the markup; the number is shown above it. */
.home-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem;
    border: 1px solid var(--sdo-border);
    border-radius: var(--sdo-radius-lg);
    background: var(--sdo-white);
    text-align: center;
}

.home-stat-icon {
    order: 0;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    color: var(--sdo-gold-text);
}

.home-stat-value {
    order: 1;
    margin: 0;
    font-size: clamp(1.75rem, 4vw, 2.4rem);
    font-weight: 700;
    line-height: 1.1;
    color: var(--sdo-blue);
}

.home-stat-label {
    order: 2;
    margin-top: 0.35rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--sdo-muted);
}

/* ---- Search box ---- */

.home-search {
    padding: 1.75rem 1.25rem;
    border-radius: var(--sdo-radius-lg);
    background: var(--sdo-blue-soft);
}

.home-search-hint {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--sdo-muted);
}

.home-search-form {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.home-search-form .form-control {
    flex: 1 1 16rem;
    min-height: 3.25rem;
    padding-left: 2.75rem;
    border-radius: var(--sdo-radius);
}

.home-search-icon {
    position: absolute;
    top: 1.625rem;
    left: 1rem;
    z-index: 1;
    color: var(--sdo-muted);
    pointer-events: none;
    transform: translateY(-50%);
}

.home-search-form .btn {
    flex: 0 0 auto;
    min-height: 3.25rem;
    padding-inline: 1.75rem;
    border-radius: var(--sdo-radius);
}

@media (max-width: 575.98px) {
    .home-search-form .btn {
        flex: 1 1 100%;
    }
}

@media (min-width: 768px) {
    .home-search {
        padding: 2.25rem 2.5rem;
    }
}

/* ---- Video ---- */

.home-video {
    max-width: 56rem;
}

.home-video .ratio {
    overflow: hidden;
    border-radius: var(--sdo-radius-lg);
    background: #000;
    box-shadow: var(--sdo-shadow);
}

.home-video-caption {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--sdo-muted);
}

/* ---- Map and contact ---- */

.home-map {
    display: grid;
    gap: 1.25rem;
}

.home-map-frame {
    overflow: hidden;
    min-height: 18rem;
    border: 1px solid var(--sdo-border);
    border-radius: var(--sdo-radius-lg);
}

.home-map-frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 18rem;
    border: 0;
}

.home-map-contact {
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--sdo-border);
    border-radius: var(--sdo-radius-lg);
    background: var(--sdo-white);
    box-shadow: var(--sdo-shadow-sm);
}

.home-contact li {
    display: flex;
    gap: 0.85rem;
    padding-block: 0.7rem;
    overflow-wrap: anywhere;
}

.home-contact li + li {
    border-top: 1px solid var(--sdo-border);
}

.home-contact-icon {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--sdo-radius);
    background: var(--sdo-blue-soft);
    color: var(--sdo-blue);
}

.home-contact-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--sdo-muted);
}

@media (min-width: 992px) {
    .home-map-with-contact {
        grid-template-columns: 1.6fr 1fr;
    }

    .home-map-frame,
    .home-map-frame iframe {
        min-height: 24rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    a.home-card:hover,
    .home-announcement:has(.stretched-link):hover {
        transform: none;
    }
}

/* ---- News and announcements (Phase 6A) ------------------------------------------------------ */

.news-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.news-chips {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scrollbar-width: thin;
}

.news-chip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    min-height: var(--sdo-touch);
    padding: 0 1rem;
    border: 1px solid var(--sdo-border);
    border-radius: 999px;
    background: var(--sdo-white);
    color: var(--sdo-navy);
    font-weight: 500;
    font-size: 0.9375rem;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color var(--sdo-transition), background-color var(--sdo-transition), color var(--sdo-transition);
}

.news-chip:hover {
    border-color: rgba(0, 56, 168, 0.35);
    color: var(--sdo-blue);
}

.news-chip:focus-visible {
    outline: 3px solid rgba(0, 56, 168, 0.45);
    outline-offset: 2px;
}

.news-chip.active {
    border-color: var(--sdo-blue);
    background: var(--sdo-blue);
    color: var(--sdo-white);
}

@media (min-width: 768px) {
    .news-toolbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .news-search {
        flex: 0 0 20rem;
    }
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
    gap: 1.25rem;
}

.news-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--sdo-border);
    border-radius: var(--sdo-radius-lg);
    background: var(--sdo-white);
    box-shadow: var(--sdo-shadow-sm);
    transition: border-color var(--sdo-transition), box-shadow 0.2s ease, transform 0.2s ease;
}

.news-card:hover {
    border-color: rgba(0, 56, 168, 0.35);
    box-shadow: var(--sdo-shadow);
    transform: translateY(-2px);
}

.news-card:focus-within {
    outline: 3px solid rgba(0, 56, 168, 0.45);
    outline-offset: 2px;
}

.news-card-media {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--sdo-surface);
}

.news-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-card:hover .news-card-media img {
    transform: scale(1.03);
}

/* Without a picture, a tinted band keeps the cards in a row looking related. */
.news-card.no-image {
    border-top: 4px solid var(--sdo-blue);
}

.news-card-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 1.125rem 1.125rem;
}

.news-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.news-card-category {
    color: var(--sdo-blue);
}

.news-card-pin {
    color: var(--sdo-red);
}

.news-card-title {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.news-card-title a {
    color: var(--sdo-navy);
    text-decoration: none;
}

.news-card-title a:focus-visible {
    outline: none; /* the whole card shows the focus ring */
}

.news-card:hover .news-card-title a {
    color: var(--sdo-blue);
}

.news-card-excerpt {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--sdo-muted);
    font-size: 0.9375rem;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.news-card-date {
    margin-top: auto;
    padding-top: 0.25rem;
    color: var(--sdo-muted);
    font-size: 0.8125rem;
}

.news-article-header .page-title {
    max-width: 52rem;
}

.news-byline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    color: var(--sdo-muted);
    font-size: 0.9375rem;
}

.news-article {
    max-width: 52rem;
}

.news-hero-image {
    margin: 0 0 2rem;
}

.news-hero-image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 32rem;
    object-fit: cover;
    border-radius: var(--sdo-radius-lg);
}

.news-related {
    padding-top: 2rem;
    border-top: 1px solid var(--sdo-border);
}

@media (prefers-reduced-motion: reduce) {
    .news-card,
    .news-card-media img {
        transition: none;
    }

    .news-card:hover,
    .news-card:hover .news-card-media img {
        transform: none;
    }
}

/* ---- Google Drive folder blocks in pages and news posts (D64-D67) ---------------------------- */

.drive-block {
    clear: both;
    margin: 2rem 0;
    padding: 1rem;
    border: 1px solid var(--sdo-border);
    border-radius: var(--sdo-radius-lg);
    background: var(--sdo-surface);
}

@media (min-width: 576px) {
    .drive-block {
        padding: 1.25rem 1.5rem 1.5rem;
    }
}

.drive-block-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.drive-block-icon {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--sdo-radius);
    background: var(--sdo-blue-soft);
    color: var(--sdo-blue);
    font-size: 1.3rem;
}

.drive-block-titles {
    flex: 1 1 12rem;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.drive-block-parent {
    color: var(--sdo-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.prose .drive-block-title,
.drive-block-title {
    margin: 0;
    color: var(--sdo-navy);
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.drive-block-count {
    color: var(--sdo-muted);
    font-size: 0.8125rem;
}

.drive-block-open,
.drive-block-more {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: var(--sdo-touch);
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
}

.drive-block-open:hover,
.drive-block-more:hover {
    text-decoration: underline;
}

.drive-block-more {
    margin-top: 0.75rem;
}

.drive-block .memo-list {
    margin: 0;
}

/* Inside a page body, file titles keep the memo list's size (not the body's h3 style). */
.page-content .drive-block .memo-title {
    margin-top: 0;
    font-size: 1rem;
}

/* ==========================================================================
   Events calendar (Phase 6B)
   ========================================================================== */

.events-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Phones: three equal tabs across the width; wider screens: as wide as their labels. */
.events-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: 999px;
    background: var(--sdo-surface);
}

.events-tab {
    display: inline-flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-width: 0;
    min-height: var(--sdo-touch);
    padding: 0 0.75rem;
    border-radius: 999px;
    color: var(--sdo-navy);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color var(--sdo-transition), color var(--sdo-transition);
}

.events-tab:hover {
    color: var(--sdo-blue);
}

.events-tab:focus-visible {
    outline: 3px solid rgba(0, 56, 168, 0.45);
    outline-offset: 1px;
}

.events-tab.active {
    background: var(--sdo-white);
    box-shadow: var(--sdo-shadow-sm);
    color: var(--sdo-blue);
    font-weight: 600;
}

@media (min-width: 768px) {
    .events-toolbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .events-tab {
        flex: 0 0 auto;
        padding: 0 1rem;
    }
}

.event-group-heading {
    margin: 2rem 0 0.75rem;
    color: var(--sdo-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.event-list {
    display: grid;
    gap: 0.75rem;
}

@media (min-width: 992px) {
    .event-list-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.event-item {
    position: relative;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--sdo-border);
    border-radius: var(--sdo-radius-lg);
    background: var(--sdo-white);
    box-shadow: var(--sdo-shadow-sm);
    transition: border-color var(--sdo-transition), box-shadow 0.2s ease;
}

.event-item:hover {
    border-color: rgba(0, 56, 168, 0.35);
    box-shadow: var(--sdo-shadow);
}

.event-item:focus-within {
    outline: 3px solid rgba(0, 56, 168, 0.45);
    outline-offset: 2px;
}

.event-item.is-over {
    background: var(--sdo-surface);
}

.event-date {
    display: flex;
    flex: 0 0 3.5rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 3.75rem;
    border-radius: var(--sdo-radius);
    background: var(--sdo-blue-soft);
    color: var(--sdo-blue);
    line-height: 1.1;
}

.event-item.is-over .event-date {
    background: var(--sdo-border);
    color: var(--sdo-muted);
}

.event-date-month {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.event-date-day {
    font-size: 1.5rem;
    font-weight: 700;
}

.event-item-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.event-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.event-item-category {
    color: var(--sdo-blue);
}

.event-item-online {
    color: var(--sdo-gold-text);
}

.event-item-title {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.event-item-title a {
    color: var(--sdo-navy);
    text-decoration: none;
}

.event-item-title a:focus-visible {
    outline: none; /* the whole item shows the focus ring */
}

.event-item:hover .event-item-title a {
    color: var(--sdo-blue);
}

.event-item-line {
    display: flex;
    gap: 0.4rem;
    margin: 0;
    color: var(--sdo-muted);
    font-size: 0.875rem;
    overflow-wrap: anywhere;
}

/* Month view */
.month-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.month-nav .btn-light {
    min-width: var(--sdo-touch);
    min-height: var(--sdo-touch);
}

.month-title {
    min-width: 10rem;
    margin: 0;
    font-size: var(--sdo-h2);
    font-weight: 600;
    text-align: center;
}

.event-month {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--sdo-border);
    border-radius: var(--sdo-radius-lg);
    overflow: hidden;
    background: var(--sdo-white);
}

.event-month th {
    padding: 0.5rem 0.25rem;
    background: var(--sdo-surface);
    color: var(--sdo-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
}

.event-month abbr {
    text-decoration: none;
}

.event-month td {
    position: relative;
    height: 3.25rem;
    padding: 0.35rem;
    border-top: 1px solid var(--sdo-border);
    vertical-align: top;
    text-align: center;
}

.event-month td + td {
    border-left: 1px solid var(--sdo-border);
}

.event-month td.is-outside {
    background: var(--sdo-surface);
    color: var(--sdo-muted); /* still readable (5.5:1); the grey background marks other months */
}

.event-month-day {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 500;
}

.event-month td.is-today .event-month-day {
    background: var(--sdo-blue);
    color: var(--sdo-white);
    font-weight: 600;
}

.event-month-dot {
    display: block;
    width: 0.4rem;
    height: 0.4rem;
    margin: 0.15rem auto 0;
    border-radius: 50%;
    background: var(--sdo-red);
}

/* Phones: dots only; the list under the grid has the details. */
.event-month-list {
    display: none;
}

@media (min-width: 768px) {
    .event-month td {
        height: 7rem;
        text-align: left;
    }

    .event-month-dot {
        display: none;
    }

    .event-month-list {
        display: grid;
        grid-template-columns: minmax(0, 1fr); /* long names are cut with an ellipsis, not widen the day */
        gap: 0.2rem;
        margin: 0.25rem 0 0;
        padding: 0;
        list-style: none;
    }

    .event-month-list a {
        display: block;
        overflow: hidden;
        padding: 0.1rem 0.4rem;
        border-left: 3px solid var(--sdo-blue);
        border-radius: 0.25rem;
        background: var(--sdo-blue-soft);
        color: var(--sdo-navy);
        font-size: 0.75rem;
        line-height: 1.5;
        text-decoration: none;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .event-month-list a:hover {
        background: #d6e1f5;
    }

    .event-month-more {
        padding-left: 0.4rem;
        color: var(--sdo-muted);
        font-size: 0.75rem;
    }
}

/* Event page */
.event-layout {
    display: grid;
    gap: 2rem;
}

@media (min-width: 992px) {
    .event-layout {
        grid-template-columns: minmax(0, 1fr) 20rem;
        align-items: start;
    }

    .event-facts {
        position: sticky;
        top: 1.5rem;
        order: 2;
    }
}

.event-main {
    max-width: 52rem;
    min-width: 0;
}

.event-facts {
    padding: 1.25rem;
    border: 1px solid var(--sdo-border);
    border-radius: var(--sdo-radius-lg);
    background: var(--sdo-white);
    box-shadow: var(--sdo-shadow-sm);
}

.event-over {
    margin: 0 0 1rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--sdo-radius-sm);
    background: var(--sdo-surface);
    color: var(--sdo-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.event-facts-list {
    display: grid;
    gap: 0.75rem;
    margin: 0;
}

.event-facts-list > div {
    display: flex;
    gap: 0.75rem;
}

.event-facts-list dt {
    flex: 0 0 1.25rem;
    color: var(--sdo-blue);
    font-size: 1.1rem;
    line-height: 1.4;
}

.event-facts-list dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 500;
}

.event-actions {
    display: grid;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.event-actions:empty {
    display: none;
}

.event-actions .btn {
    min-height: var(--sdo-touch);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.event-link-note {
    margin: 0.75rem 0 0;
    color: var(--sdo-muted);
    font-size: 0.8125rem;
}

/* ==========================================================================
   Embeds from other websites (D62, D63)
   ========================================================================== */

.embed-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.embed-open {
    margin-left: auto;
    font-weight: 500;
}

/* Several embeds (D115): tabs that look like the filter chips; long names are shortened. */
.embed-tabs {
    margin-bottom: 0.75rem;
}

.embed-tab {
    display: inline-block;
    max-width: 18rem;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: var(--sdo-touch);
}

.embed-frame {
    overflow: hidden;
    border: 1px solid var(--sdo-border);
    border-radius: var(--sdo-radius-lg);
    background: var(--sdo-white);
}

.embed-frame iframe {
    display: block;
    width: 100%;
    max-height: 85vh;
    border: 0;
}

.embed-source {
    margin: 0.5rem 0 0;
    color: var(--sdo-muted);
    font-size: 0.8125rem;
}

@media (prefers-reduced-motion: reduce) {
    .event-item,
    .events-tab {
        transition: none;
    }
}

/* ---- Schools directory (Phase 6C, D75) ------------------------------------------------------ */

.school-directory {
    display: grid;
    gap: 1.25rem;
}

/* Phones: the map above the list. Wide screens: the list beside a map that stays in view. */
@media (min-width: 992px) {
    .school-directory {
        grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
        align-items: start;
    }

    .school-map-wrap {
        position: sticky;
        top: 1rem;
        order: 2;
    }

    .school-directory .school-map {
        height: calc(100vh - 2rem);
        max-height: 44rem;
    }
}

.school-map {
    position: relative;
    z-index: 0; /* keeps Leaflet's panes under the site header and dialogs */
    height: 18rem;
    border: 1px solid var(--sdo-border);
    border-radius: var(--sdo-radius-lg);
    background: var(--sdo-surface);
    overflow: hidden;
}

@media (min-width: 576px) {
    .school-map {
        height: 24rem;
    }
}

.school-map-small {
    height: 16rem;
}

.school-map-note {
    margin: 0;
    padding: 1rem;
    color: var(--sdo-muted);
    font-size: 0.875rem;
}

.school-map-empty {
    display: grid;
    place-items: center;
    gap: 0.5rem;
    min-height: 10rem;
    padding: 1.5rem;
    border: 1px dashed var(--sdo-border);
    border-radius: var(--sdo-radius-lg);
    color: var(--sdo-muted);
    text-align: center;
}

.school-map-empty .bi {
    font-size: 1.75rem;
}

.school-map .leaflet-container,
.school-map.leaflet-container {
    font-family: inherit;
}

.school-map .leaflet-control-attribution {
    font-size: 0.7rem;
}

.school-map .leaflet-control-attribution a {
    color: var(--sdo-blue);
}

/* Map pin: a blue teardrop with a white dot; red for the school picked in the list. */
.school-pin {
    background: none;
    border: 0;
}

.school-pin-dot {
    display: block;
    width: 28px;
    height: 28px;
    border-radius: 50% 50% 50% 0;
    background: var(--sdo-blue);
    border: 2px solid var(--sdo-white);
    box-shadow: 0 2px 6px rgba(0, 31, 92, 0.35);
    transform: rotate(-45deg);
}

.school-pin-dot::after {
    content: "";
    position: absolute;
    top: 8px;
    left: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sdo-white);
}

.school-pin:focus-visible {
    outline: none;
}

.school-pin:focus-visible .school-pin-dot,
.leaflet-marker-icon.school-pin:hover .school-pin-dot {
    background: var(--sdo-red);
}

.school-pin:focus-visible .school-pin-dot {
    box-shadow: 0 0 0 3px var(--sdo-gold), 0 2px 6px rgba(0, 31, 92, 0.35);
}

.school-popup {
    display: grid;
    gap: 0.2rem;
    font-family: inherit;
}

.school-popup-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.school-popup-line {
    color: var(--sdo-muted);
    font-size: 0.8rem;
}

.school-list {
    display: grid;
    gap: 0.75rem;
    min-width: 0;
}

@media (min-width: 768px) {
    .school-list-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .school-list-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.school-item {
    display: flex;
    gap: 0.875rem;
    align-items: flex-start;
    padding: 0.875rem;
    border: 1px solid var(--sdo-border);
    border-radius: var(--sdo-radius);
    background: var(--sdo-white);
    box-shadow: var(--sdo-shadow-sm);
    scroll-margin-top: 1rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.school-item.is-active {
    border-color: var(--sdo-blue);
    box-shadow: 0 0 0 2px var(--sdo-blue-soft);
}

.school-item-photo {
    flex: 0 0 auto;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: var(--sdo-radius-sm);
    object-fit: cover;
    background: var(--sdo-surface);
}

.school-item-icon {
    display: grid;
    place-items: center;
    color: var(--sdo-blue);
    font-size: 1.5rem;
    background: var(--sdo-blue-soft);
}

.school-item-body {
    min-width: 0;
    flex: 1 1 auto;
}

.school-item-title {
    margin: 0 0 0.15rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
}

.school-item-title a {
    color: var(--sdo-navy);
    text-decoration: none;
}

.school-item-title a:hover,
.school-item-title a:focus-visible {
    color: var(--sdo-blue);
    text-decoration: underline;
}

.school-item-meta,
.school-item-address {
    margin: 0 0 0.25rem;
    color: var(--sdo-muted);
    font-size: 0.85rem;
}

.school-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin: 0.35rem 0;
    padding: 0;
    list-style: none;
}

.school-chips li {
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: var(--sdo-blue-soft);
    color: var(--sdo-blue-dark);
    font-size: 0.75rem;
    font-weight: 500;
}

.school-chips-lg li {
    padding: 0;
    font-size: 0.875rem;
}

.school-chips-lg a {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    color: inherit;
    text-decoration: none;
}

.school-chips-lg a:hover,
.school-chips-lg a:focus-visible {
    background: var(--sdo-blue);
    color: var(--sdo-white);
}

.school-locate {
    font-size: 0.85rem;
    text-decoration: none;
}

.school-layout {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 992px) {
    .school-layout {
        grid-template-columns: minmax(0, 1fr) 22rem;
        align-items: start;
    }

    .school-side {
        position: sticky;
        top: 1.5rem;
    }
}

.school-main {
    min-width: 0;
}

.school-photo {
    margin: 0 0 1.5rem;
}

.school-photo img {
    width: 100%;
    max-height: 26rem;
    object-fit: cover;
    border-radius: var(--sdo-radius-lg);
}

.school-facts {
    padding: 1.25rem;
    border: 1px solid var(--sdo-border);
    border-radius: var(--sdo-radius-lg);
    background: var(--sdo-white);
    box-shadow: var(--sdo-shadow-sm);
}

.school-facts dl {
    display: grid;
    gap: 0.75rem;
    margin: 0;
}

.school-facts dl > div {
    display: grid;
    gap: 0.1rem;
}

@media (min-width: 576px) {
    .school-facts dl > div {
        grid-template-columns: 9rem minmax(0, 1fr);
        gap: 1rem;
    }
}

.school-facts dt {
    color: var(--sdo-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.school-facts dd {
    margin: 0;
    min-width: 0;
}

@media (prefers-reduced-motion: reduce) {
    .school-item {
        transition: none;
    }
}

/* ---- Officials and offices directory (Phase 6D, D79) --------------------------------------- */

.person-photo {
    flex: none;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    object-fit: cover;
    background: var(--sdo-blue-soft);
    color: var(--sdo-blue);
    font-weight: 600;
}

.person-photo-sm {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.85rem;
}

.person-photo-md {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1rem;
}

.person-photo-lg {
    width: 8.5rem;
    height: 8.5rem;
    font-size: 2rem;
    border: 4px solid var(--sdo-white);
    box-shadow: var(--sdo-shadow);
}

/* Officials: photo cards, one column on phones, up to four on wide screens. */
.official-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
}

.official-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    padding: 1.75rem 1.25rem 1.5rem;
    border: 1px solid var(--sdo-border);
    border-radius: var(--sdo-radius-lg);
    background: var(--sdo-white);
    box-shadow: var(--sdo-shadow-sm);
    text-align: center;
}

.official-body {
    display: grid;
    gap: 0.25rem;
}

.official-name {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--sdo-navy);
}

.official-position {
    margin: 0;
    color: var(--sdo-text);
    font-size: 0.9rem;
}

.official-office {
    color: var(--sdo-muted);
    font-size: 0.8rem;
}

a.official-office {
    color: var(--sdo-blue);
}

/* Offices: grouped by division; cards of contacts and people. */
.office-division + .office-division {
    margin-top: 2.5rem;
}

.office-division {
    scroll-margin-top: 1rem;
}

.office-division-title {
    margin-bottom: 1rem;
    font-size: var(--sdo-h2);
    color: var(--sdo-navy);
}

.office-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
}

.office-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem;
    border: 1px solid var(--sdo-border);
    border-radius: var(--sdo-radius-lg);
    background: var(--sdo-white);
    box-shadow: var(--sdo-shadow-sm);
    min-width: 0;
}

.office-name {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.office-name a {
    color: var(--sdo-navy);
    text-decoration: none;
}

.office-name a:hover,
.office-name a:focus-visible {
    color: var(--sdo-blue);
    text-decoration: underline;
}

.office-contacts {
    display: grid;
    gap: 0.35rem;
    margin: 0;
    font-size: 0.875rem;
}

.office-contacts li {
    display: flex;
    gap: 0.5rem;
    min-width: 0;
}

.office-contacts .bi {
    color: var(--sdo-muted);
}

.office-people {
    display: grid;
    gap: 0.6rem;
    margin: 0;
    padding-top: 0.75rem;
    border-top: 1px solid var(--sdo-border);
}

.office-people li,
.person-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.office-person-name {
    display: block;
    font-weight: 500;
    line-height: 1.3;
}

.office-person-position {
    display: block;
    color: var(--sdo-muted);
    font-size: 0.8rem;
}

.office-more {
    margin-top: auto;
    font-size: 0.875rem;
    font-weight: 500;
}

.office-layout {
    display: grid;
    gap: 2rem;
}

@media (min-width: 992px) {
    .office-layout {
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
        align-items: start;
    }
}

.office-services {
    display: grid;
    gap: 0.4rem;
    padding-left: 1.25rem;
}

.people-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
}

.person-card {
    padding: 0.85rem 1rem;
    border: 1px solid var(--sdo-border);
    border-radius: var(--sdo-radius);
    background: var(--sdo-white);
}

/* ---- Site search (Phase 7, D84) ------------------------------------------------------------ */

.header-search {
    display: inline-grid;
    place-items: center;
    width: var(--sdo-touch);
    height: var(--sdo-touch);
    margin-right: 0.5rem;
    border-radius: 50%;
    color: var(--sdo-navy);
    font-size: 1.15rem;
    text-decoration: none;
    transition: background-color var(--sdo-transition), color var(--sdo-transition);
}

.header-search:hover,
.header-search:focus-visible {
    background: var(--sdo-blue-soft);
    color: var(--sdo-blue);
}

.header-search:focus-visible {
    outline: 3px solid rgba(0, 56, 168, 0.45);
    outline-offset: 2px;
}

@media (min-width: 992px) {
    .header-search {
        margin-right: 0;
    }
}

.search-form {
    max-width: 44rem;
}

.search-group + .search-group {
    margin-top: 2rem;
}

.search-group {
    scroll-margin-top: 1rem;
}

.search-group-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    color: var(--sdo-navy);
}

.search-group-count {
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    background: var(--sdo-blue-soft);
    color: var(--sdo-blue);
    font-size: 0.8rem;
    font-weight: 500;
}

.search-results {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.search-result {
    display: grid;
    gap: 0.2rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--sdo-border);
    border-radius: var(--sdo-radius);
    background: var(--sdo-white);
    min-width: 0;
    overflow-wrap: anywhere;
}

.search-result-title {
    font-weight: 600;
}

.search-result-meta {
    color: var(--sdo-muted);
    font-size: 0.8rem;
}

.search-result-snippet {
    margin: 0;
    color: var(--sdo-text);
    font-size: 0.9rem;
}

.search-result mark {
    padding: 0 0.1em;
    border-radius: 0.2em;
    background: #fff3b0;
    color: inherit;
}

.search-more {
    font-size: 0.9rem;
    font-weight: 500;
}

/* ---- Contact page (Phase 7, D85) ---------------------------------------------------------- */
.contact-layout {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 992px) {
    .contact-layout {
        grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
        align-items: start;
    }
}

.contact-details .school-facts dl {
    margin-bottom: 1rem;
}

.contact-details .school-facts dl > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.1rem;
}

.contact-form-card {
    padding: 1.25rem;
    border: 1px solid var(--sdo-border);
    border-radius: var(--sdo-radius-lg);
    background: var(--sdo-white);
    box-shadow: var(--sdo-shadow-sm);
}

@media (min-width: 576px) {
    .contact-form-card {
        padding: 1.75rem;
    }
}

.contact-form-card .btn-primary {
    min-height: var(--sdo-touch);
}

/* Honeypot: off screen for people, still in the form for bots. */
.contact-hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.office-aside .school-facts .btn {
    margin-top: 1rem;
}

/* ---- Visit counting notice (D111) ----------------------------------------------------------------
   Shown only to browsers that ask not to be tracked. It blocks nothing: a small card in a corner. */
.stats-consent {
    position: fixed;
    z-index: 1040; /* above the page, below Bootstrap dialogs */
    inset: auto 0.75rem 0.75rem 0.75rem;
    max-width: 26rem;
    padding: 1rem 1.25rem 1.1rem;
    background: var(--sdo-white);
    color: var(--sdo-text);
    border: 1px solid var(--sdo-border);
    border-top: 3px solid var(--sdo-blue);
    border-radius: var(--sdo-radius);
    box-shadow: var(--sdo-shadow-lg);
    font-size: 0.9rem;
}

@media (min-width: 576px) {
    .stats-consent {
        inset: auto auto 1.25rem 1.25rem;
    }
}

.stats-consent-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 2rem 0.4rem 0;
    color: var(--sdo-navy);
}

.stats-consent-title:focus {
    outline: none;
}

.stats-consent-text,
.stats-consent-state {
    margin-bottom: 0.75rem;
}

.stats-consent-state {
    color: var(--sdo-muted);
}

.stats-consent-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

/* Allow and No thanks are the same size and style on purpose: neither answer is pushed. */
.stats-consent-actions .btn {
    min-width: 7rem;
    min-height: var(--sdo-touch);
}

.stats-consent-more {
    color: var(--sdo-blue);
    padding: 0.5rem 0.25rem;
}

.stats-consent-close {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    width: var(--sdo-touch);
    height: var(--sdo-touch);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--sdo-radius-sm);
    background: transparent;
    color: var(--sdo-muted);
}

.stats-consent-close:hover,
.stats-consent-close:focus-visible {
    background: var(--sdo-surface);
    color: var(--sdo-text);
}

.footer-consent-link {
    display: inline;
    margin-left: 0.5rem;
    padding: 0.25rem 0;
    border: 0;
    background: none;
    color: var(--sdo-white);
    font: inherit;
    text-decoration: underline;
}

.footer-consent-link[hidden] {
    display: none;
}

@media print {
    .stats-consent,
    .footer-consent-link {
        display: none !important;
    }
}

/* ---- Mobile bottom bar (D113) --------------------------------------------------------------------
   Phones and small tablets (below the "lg" width where the main menu folds away). Fixed to the
   bottom, clear of the iPhone home indicator; the page gets matching room at the bottom. */
.mobile-bar {
    position: fixed;
    z-index: 1030; /* like Bootstrap's fixed bars: below dialogs and the visit-counting notice */
    inset: auto 0 0 0;
    background: var(--sdo-white);
    border-top: 1px solid var(--sdo-border);
    box-shadow: 0 -0.25rem 1rem rgba(0, 31, 92, 0.08);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-bar-list {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mobile-bar-list > li {
    flex: 1 1 0;
    min-width: 0;
}

.mobile-bar-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    width: 100%;
    min-height: 3.5rem;
    padding: 0.4rem 0.25rem;
    border: 0;
    background: none;
    color: var(--sdo-muted);
    font: inherit;
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.1;
    text-decoration: none;
    transition: color var(--sdo-transition);
    position: relative;
}

.mobile-bar-link .bi {
    font-size: 1.3rem;
    line-height: 1;
}

.mobile-bar-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-bar-link:hover,
.mobile-bar-link:focus-visible {
    color: var(--sdo-blue);
}

.mobile-bar-link:focus-visible {
    outline: 2px solid var(--sdo-blue);
    outline-offset: -4px;
    border-radius: var(--sdo-radius-sm);
}

.mobile-bar-link.is-current {
    color: var(--sdo-blue);
    font-weight: 600;
}

/* The current page: a short bar along the top edge, so it is not shown by colour alone. */
.mobile-bar-link.is-current::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 1.75rem;
    height: 3px;
    transform: translateX(-50%);
    border-radius: 0 0 3px 3px;
    background: var(--sdo-blue);
}

@media (max-width: 991.98px) {
    body.has-mobile-bar {
        padding-bottom: calc(3.5rem + env(safe-area-inset-bottom, 0));
    }

    body.has-mobile-bar .stats-consent {
        bottom: calc(4.25rem + env(safe-area-inset-bottom, 0));
    }
}

@media (prefers-reduced-motion: reduce) {
    .mobile-bar-link {
        transition: none;
    }
}

@media print {
    .mobile-bar {
        display: none !important;
    }

    body.has-mobile-bar {
        padding-bottom: 0;
    }
}

/* ---- Embeds from other websites in page bodies (D114) --------------------------------------------
   Shapes are classes (the CSP forbids inline styles): ratios scale with the screen, fixed heights
   suit documents and forms. */
.content-embed-block {
    margin: 1.5rem 0;
}

.content-embed-frame {
    position: relative;
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--sdo-border);
    border-radius: var(--sdo-radius);
    background: var(--sdo-surface);
}

.content-embed-frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.embed-16x9 { aspect-ratio: 16 / 9; }
.embed-4x3 { aspect-ratio: 4 / 3; }
.embed-1x1 { aspect-ratio: 1 / 1; max-width: 40rem; margin-inline: auto; }
.embed-9x16 { aspect-ratio: 9 / 16; max-width: 22rem; margin-inline: auto; }
.embed-h450 { height: 450px; }
.embed-h600 { height: 600px; }
.embed-h800 { height: 800px; }
.embed-h1000 { height: 1000px; }

/* Very tall fixed heights would be most of a phone screen: keep them within the window. */
@media (max-width: 575.98px) {
    .embed-h800,
    .embed-h1000 {
        height: 85vh;
    }
}

.content-embed-caption {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.25rem 1rem;
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: var(--sdo-muted);
}

.content-embed-caption a {
    padding-block: 0.25rem;
}

@media print {
    .content-embed-frame {
        display: none;
    }
}
