/* ============================================================
   Surf shared base - loaded before every theme's theme.css.
   Tokens, reset, typography and the reusable components (menus,
   media, attachments, calendar, search, shop, cards...). A theme
   only styles its frame (header, footer, home bands) and may
   override anything here, including the :root tokens.
   ============================================================ */
:root {
    --su-space-1: 0.5rem;
    --su-space-2: 0.75rem;
    --su-space-3: 1rem;
    --su-space-4: 1.5rem;
    --su-space-5: 2rem;
    --su-space-6: 3rem;
    --su-radius: 6px;
    --su-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --su-gray-900: #1a202c;
    --su-gray-600: #4a5568;
    --su-gray-500: #718096;
    --su-gray-200: #e2e8f0;
    --su-gray-100: #f7fafc;
    --su-border: #cbd5e0;
    /* taller than the other bands - the hero always shows landscape photos or video */
    --su-hero-height: clamp(400px, 70vh, 720px);
    --su-content-width: 960px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    margin: 0;
    font-family: var(--font-body, system-ui, sans-serif);
    color: var(--su-gray-900);
    line-height: 1.6;
    font-size: 1rem;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

h1, h2, h3 {
    font-family: var(--font-heading, system-ui, sans-serif);
    line-height: 1.25;
    margin: 0 0 var(--su-space-3);
}

h1 {
    font-size: 2rem;
}

/* an <h1> on the home page, a <p> elsewhere (one <h1> per page) - styled as a heading either way */
.surf-site-title {
    font-family: var(--font-heading, system-ui, sans-serif);
    font-weight: 700;
    line-height: 1.25;
}

h2 {
    font-size: 1.4rem;
}

h3 {
    font-size: 1.15rem;
}

a {
    color: var(--color-primary, #2c5282);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--color-accent, #ed8936);
    outline-offset: 2px;
}
main {
    max-width: var(--su-content-width);
    margin: 0 auto;
    padding: var(--su-space-5);
    flex: 1 0 auto;
    width: 100%;
}

/* 100vw includes the vertical scrollbar, which would otherwise add a sliver of
   horizontal scroll on Windows; clip (unlike hidden) doesn't break position: sticky */
body {
    overflow-x: clip;
}

.surf-badges {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
    align-items: center;
    gap: var(--su-space-3) var(--su-space-5);
    margin: 0;
    padding: 0;
}
.surf-badges img {
    display: block;
    height: 90px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}
.surf-badges a {
    display: block;
    transition: transform 0.15s ease;
}

.surf-badges a:hover {
    transform: scale(1.05);
}

@media (max-width: 640px) {
    .surf-badges img {
        height: 50px;
    }
}

.surf-broadcast.has-poster {
    display: flex;
    gap: var(--su-space-4);
    align-items: flex-start;
}

.surf-broadcast-poster {
    flex: 0 0 200px;
    display: block;
}

.surf-broadcast-poster img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--su-radius);
}

.surf-broadcast-text {
    flex: 1;
    min-width: 0;
}

.surf-broadcast-text p {
    margin: 0 0 var(--su-space-2);
}

.surf-broadcast-title {
    display: block;
    font-weight: bold;
    margin-bottom: 0.25rem;
    color: inherit;
    text-decoration: none;
}

.surf-broadcast-title:hover,
.surf-broadcast-more:hover {
    text-decoration: underline;
}

.surf-broadcast-more {
    color: inherit;
    font-weight: bold;
    text-decoration: none;
}

@media (max-width: 640px) {
    .surf-broadcast.has-poster {
        flex-direction: column;
    }

    .surf-broadcast-poster {
        flex-basis: auto;
        width: 100%;
    }
}

.surf-events-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--su-space-3);
    margin-bottom: var(--su-space-3);
}

.surf-events-widget-header h2 {
    margin: 0;
}

.surf-events-widget-more {
    flex-shrink: 0;
    padding: 0.5rem var(--su-space-3);
    background: var(--color-accent, #ed8936);
    color: #fff;
    border-radius: var(--su-radius);
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    transition: opacity 0.15s ease;
}

.surf-events-widget-more:hover {
    opacity: 0.9;
}

.surf-recent-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.surf-recent-post {
    display: flex;
    gap: var(--su-space-3);
    padding: var(--su-space-3) 0;
    border-top: 1px solid var(--su-gray-200);
}

.surf-recent-post-thumb {
    flex-shrink: 0;
    display: block;
    width: 100px;
    height: 100px;
}

.surf-recent-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--su-radius);
    display: block;
}

.surf-recent-post-body {
    flex: 1;
    min-width: 0;
}

.surf-recent-post-title {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--color-primary, #2c5282);
    text-decoration: none;
}

.surf-recent-post-title:hover {
    text-decoration: underline;
}

.surf-recent-post-date {
    display: block;
    font-size: 0.85rem;
    color: var(--su-gray-500);
    margin: 0.25rem 0;
}

.surf-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--su-space-5);
    flex-wrap: wrap;
    gap: var(--su-space-2);
}

.surf-pagination a {
    color: var(--color-primary, #2c5282);
    text-decoration: none;
    font-weight: bold;
}

.surf-pagination-status {
    color: var(--su-gray-500);
    font-size: 0.9rem;
}

.surf-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--su-space-2);
    margin: var(--su-space-4) 0;
}

.surf-gallery-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: var(--su-radius);
    display: block;
    box-shadow: var(--su-shadow);
}

.surf-video-embeds {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--su-space-4);
    margin: var(--su-space-4) 0;
}

.surf-video-embed {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    border-radius: var(--su-radius);
    overflow: hidden;
    box-shadow: var(--su-shadow);
}

/* 9:16 for Shorts / vertical videos - capped so it never outgrows the screen
   height; several sit side by side */
.surf-video-embed.is-portrait {
    width: min(360px, 100%, calc(80vh * 9 / 16));
    padding-top: 0;
    aspect-ratio: 9 / 16;
}

.surf-video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ---------- Bank buttons after the content body (partials/content-buttons.php) */

.surf-content-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--su-space-2) var(--su-space-3);
    margin: var(--su-space-4) 0;
}

.surf-content-button {
    display: inline-block;
    padding: 0.7rem var(--su-space-4);
    background: var(--color-primary, #2c5282);
    color: #fff;
    border-radius: var(--su-radius);
    box-shadow: var(--su-shadow);
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    transition: filter 0.15s ease;
}

.surf-content-button.is-secondary {
    background: var(--color-secondary, #4a5568);
}

.surf-content-button.is-accent {
    background: var(--color-accent, #ed8936);
}

.surf-content-button:hover {
    filter: brightness(1.1);
}

@media (max-width: 640px) {
    .surf-content-button {
        flex: 1 1 100%;
    }
}

.surf-file-attachments-block {
    margin: var(--su-space-4) 0;
}

.surf-file-attachments-title {
    margin-bottom: 0.25rem;
}

.surf-file-attachments-instructions {
    margin: 0;
    color: var(--su-gray-600);
    font-size: 0.9rem;
}

.surf-file-attachments {
    list-style: none;
    padding: 0;
    margin: var(--su-space-2) 0 0;
}

.surf-file-attachments li {
    border-top: 1px solid var(--su-gray-200);
}

.surf-file-attachments a {
    display: flex;
    align-items: center;
    gap: var(--su-space-2);
    padding: var(--su-space-2) 0;
    text-decoration: none;
}

.surf-file-attachments a:hover .surf-file-name {
    text-decoration: underline;
}

.surf-file-name {
    flex: 1;
}

.surf-file-size {
    color: var(--su-gray-500);
    font-size: 0.85rem;
}

.surf-parent-link {
    margin: 0 0 var(--su-space-3);
}

.surf-parent-link a {
    font-weight: bold;
    text-decoration: none;
}

.surf-parent-link a:hover {
    text-decoration: underline;
}

.surf-further-reading-block {
    margin: var(--su-space-4) 0;
}

.surf-further-reading-title {
    margin-bottom: 0.25rem;
}

.surf-further-reading {
    list-style: none;
    padding: 0;
    margin: var(--su-space-2) 0 0;
}

.surf-further-reading li {
    border-top: 1px solid var(--su-gray-200);
}

.surf-further-reading a {
    display: block;
    padding: var(--su-space-2) 0;
    text-decoration: none;
}

.surf-further-reading a:hover {
    text-decoration: underline;
}

.surf-lightbox[hidden] {
    display: none;
}

.surf-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--su-space-5);
    cursor: zoom-out;
    z-index: 100;
}

.surf-lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: var(--su-radius);
}

.surf-lightbox-caption {
    color: #fff;
    margin-top: var(--su-space-2);
}

.surf-lightbox-close {
    position: absolute;
    top: var(--su-space-3);
    right: var(--su-space-4);
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
}

.surf-lightbox-prev,
.surf-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: none;
    font-size: 1.25rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.surf-lightbox-prev:hover,
.surf-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

.surf-lightbox-prev {
    left: var(--su-space-4);
}

.surf-lightbox-next {
    right: var(--su-space-4);
}

.surf-carousel {
    position: relative;
    padding: var(--su-space-3) var(--su-space-5);
}

.surf-carousel-track {
    display: flex;
    justify-content: center;
    justify-content: safe center;
    gap: var(--su-space-2);
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scroll-behavior: smooth;
    padding-bottom: 0.25rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.surf-carousel-track::-webkit-scrollbar {
    display: none;
}

.surf-carousel-item {
    flex: 0 0 auto;
    height: var(--su-hero-height);
    margin: 0;
    position: relative;
    scroll-snap-align: start;
}

.surf-carousel-item img {
    height: 100%;
    width: auto;
    max-width: none;
    display: block;
    border-radius: var(--su-radius);
}

.surf-carousel-item figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: var(--su-space-1) var(--su-space-2);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.8rem;
    border-radius: 0 0 var(--su-radius) var(--su-radius);
}

.surf-carousel-prev,
.surf-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
}

.surf-carousel-prev {
    left: var(--su-space-2);
}

.surf-carousel-next {
    right: var(--su-space-2);
}

.surf-welcome-body > *:first-child {
    margin-top: 0;
}

.surf-welcome-body > *:last-child {
    margin-bottom: 0;
}

.surf-nav-primary ul,
.surf-nav-utility ul,
.surf-nav-footer ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: var(--su-space-4);
    margin: 0;
    padding: 0;
}
.surf-nav-primary {
    display: flex;
    justify-content: center;
}

/* a short divider between top-level items - desktop only, phones use the accordion */
@media (min-width: 801px) {
    .surf-nav-primary > ul > li {
        position: relative;
    }

    .surf-nav-primary > ul > li + li::before {
        content: '';
        position: absolute;
        left: 0;
        top: 25%;
        bottom: 25%;
        border-left: 1px solid color-mix(in srgb, currentColor 40%, transparent);
        pointer-events: none;
    }
}
.surf-masthead-social,
.surf-footer-social {
    list-style: none;
    display: flex;
    gap: var(--su-space-2);
    margin: 0;
    padding: 0;
}

.surf-masthead-contact {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--su-space-2);
    margin: 0;
    padding: 0;
    font-size: 0.85rem;
    opacity: 0.85;
}

.surf-masthead-contact {
    margin-top: 0.2rem;
}

.surf-masthead-contact li + li::before {
    content: '\2022';
    margin-right: var(--su-space-2);
    opacity: 0.6;
}

.surf-masthead-contact a {
    color: inherit;
}

/* footer contact block (partials/footer-contact.php): details | map | form,
   as many equal columns as there are parts, stacked on phones/tablets */
.surf-footer-contact-block {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: var(--su-space-5);
    align-items: start;
    max-width: var(--su-content-width);
    margin: 0 auto var(--su-space-4);
    text-align: left;
    scroll-margin-top: var(--su-space-4);
}

@media (max-width: 800px) {
    .surf-footer-contact-block {
        grid-auto-flow: row;
    }
}

.surf-footer-contact-info .surf-footer-social {
    flex-wrap: wrap;
    margin-top: var(--su-space-3);
}

/* ---------- Contact form (partials/contact-form.php) - needs JS, so hidden without it */

.surf-contact-form {
    display: flex;
    flex-direction: column;
    gap: var(--su-space-2);
}

html:not(.surf-js) .surf-contact-form {
    display: none;
}

.surf-contact-form-title {
    margin: 0;
    font-size: 1.15rem;
}

.surf-contact-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.9rem;
}

.surf-contact-field input,
.surf-contact-field textarea {
    padding: 0.5rem;
    border: 1px solid var(--su-border);
    border-radius: var(--su-radius);
    background: #fff;
    color: var(--su-gray-900);
    font: inherit;
}

.surf-contact-field textarea {
    min-height: 6rem;
    resize: vertical;
}

.surf-contact-optional {
    font-size: 0.85em;
    opacity: 0.75;
}

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

.surf-contact-send {
    align-self: flex-start;
    padding: 0.6rem var(--su-space-4);
    border: 0;
    border-radius: var(--su-radius);
    background: var(--color-accent, #ed8936);
    color: #fff;
    font: inherit;
    font-weight: bold;
    cursor: pointer;
}

.surf-contact-send:hover {
    filter: brightness(1.1);
}

.surf-contact-send:disabled {
    opacity: 0.6;
    cursor: wait;
}

.surf-contact-status {
    font-size: 0.9rem;
}

.surf-contact-status:empty {
    display: none;
}

.surf-contact-status.is-error {
    font-weight: bold;
}

.surf-footer-map img {
    display: block;
    width: 280px;
    max-width: 100%;
    height: auto;
    border-radius: var(--su-radius);
    box-shadow: var(--su-shadow);
}

.surf-footer-map a {
    display: block;
    transition: opacity 0.15s ease;
}

.surf-footer-map a:hover {
    opacity: 0.9;
}

.surf-footer-details {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--su-space-1);
}

.surf-footer-details li {
    display: flex;
    align-items: baseline;
    gap: var(--su-space-2);
}

.surf-footer-details i {
    width: 1.1em;
    text-align: center;
    opacity: 0.75;
}

.surf-footer-details a,
.surf-footer p a {
    color: inherit;
}

/* each platform's own colours on a white disc, so they read on any school palette */
.surf-masthead-social a,
.surf-footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2em;
    height: 2em;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--su-shadow);
    color: var(--su-gray-900);
    font-size: 1.1rem;
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.surf-masthead-social a:hover,
.surf-footer-social a:hover {
    opacity: 0.8;
}

.surf-masthead-social .surf-social-facebook,
.surf-footer-social .surf-social-facebook {
    color: #1877f2;
}

.surf-masthead-social .surf-social-twitter,
.surf-footer-social .surf-social-twitter {
    color: #1d9bf0;
}

.surf-masthead-social .surf-social-youtube,
.surf-footer-social .surf-social-youtube {
    color: #ff0000;
}

.surf-masthead-social .surf-social-instagram i,
.surf-footer-social .surf-social-instagram i {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ============================================================ Menus (partials/nav-menu.php + assets/nav.js) */

.surf-nav-primary a,
.surf-nav-utility a,
.surf-nav-footer a {
    color: inherit;
    text-decoration: none;
}

.surf-nav-primary a:hover,
.surf-nav-utility a:hover,
.surf-nav-footer a:hover {
    text-decoration: underline;
}

/* ---------- Toggles: rendered [hidden], revealed here once <html> has .surf-js */

.surf-nav-toggle,
.surf-subnav-toggle {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.surf-js .surf-nav-primary .surf-subnav-toggle,
.surf-js .surf-nav-utility .surf-subnav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: var(--su-radius);
    font-size: 0.7rem;
    opacity: 0.8;
}

.surf-subnav-toggle:hover {
    opacity: 1;
    background: color-mix(in srgb, currentColor 15%, transparent);
}

.surf-subnav-toggle i {
    transition: transform 0.15s ease;
}

li.is-open > .surf-subnav-toggle i {
    transform: rotate(180deg);
}

/* ---------- Desktop: dropdowns (hover for mouse, chevron for touch/keyboard) */

.surf-nav-primary li.has-children,
.surf-nav-utility li.has-children {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.surf-nav-primary li.has-children > ul,
.surf-nav-utility li.has-children > ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    flex-direction: column;
    gap: 0;
    min-width: 12rem;
    padding: var(--su-space-1) 0;
    border-radius: 0 0 var(--su-radius) var(--su-radius);
    box-shadow: var(--su-shadow);
    z-index: 10;
}

.surf-nav-primary li.has-children.is-open > ul,
.surf-nav-utility li.has-children.is-open > ul {
    display: flex;
}

/* real pointers at desktop width only - touch screens would get sticky hovers */
@media (hover: hover) and (min-width: 801px) {
    .surf-nav-primary li.has-children:hover > ul,
    .surf-nav-utility li.has-children:hover > ul {
        display: flex;
    }
}

.surf-nav-primary li.has-children > ul li,
.surf-nav-utility li.has-children > ul li {
    display: flex;
    align-items: center;
}

.surf-nav-primary li.has-children > ul a,
.surf-nav-utility li.has-children > ul a {
    flex: 1;
    display: block;
    padding: 0.4rem var(--su-space-3);
}

.surf-nav-primary li.has-children > ul .surf-subnav-toggle,
.surf-nav-utility li.has-children > ul .surf-subnav-toggle {
    margin-right: var(--su-space-1);
}

/* third level flies out to the right */
.surf-nav-primary li.has-children > ul li.has-children > ul,
.surf-nav-utility li.has-children > ul li.has-children > ul {
    top: 0;
    left: 100%;
    border-radius: var(--su-radius);
}

/* ---------- Footer: top-level items as column headings, sub-items listed beneath */

.surf-nav-footer > ul {
    justify-content: center;
    align-items: flex-start;
    gap: var(--su-space-3) var(--su-space-5);
    margin-top: var(--su-space-3);
}

.surf-nav-footer > ul > li > a {
    font-weight: bold;
}

.surf-nav-footer li.has-children {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.surf-nav-footer li.has-children > ul {
    flex-direction: column;
    gap: 0.2rem;
    margin-top: 0.35rem;
    font-size: 0.9rem;
    opacity: 0.85;
}

.surf-nav-footer ul ul ul {
    margin-top: 0.2rem;
    padding-left: var(--su-space-2);
}

/* ---------- Phones/tablets: Menu / Quick links toggles, accordion submenus */

@media (max-width: 800px) {
    .surf-nav-primary,
    .surf-nav-utility {
        display: block;
    }

    .surf-js .surf-nav-toggle {
        display: flex;
        align-items: center;
        gap: var(--su-space-1);
        width: 100%;
        padding: var(--su-space-2) 0;
        font-weight: bold;
    }

    .surf-nav-toggle i {
        width: 1.1em;
        text-align: center;
    }

    .surf-js .surf-nav-primary:not(.is-open) > ul,
    .surf-js .surf-nav-utility:not(.is-open) > ul {
        display: none;
    }

    .surf-nav-primary.is-open > ul {
        padding-bottom: var(--su-space-2);
    }

    .surf-nav-primary ul,
    .surf-nav-utility ul {
        flex-direction: column;
        gap: 0;
    }

    .surf-nav-primary li,
    .surf-nav-utility li,
    .surf-nav-primary li.has-children > ul li,
    .surf-nav-utility li.has-children > ul li {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        border-top: 1px solid color-mix(in srgb, currentColor 15%, transparent);
    }

    .surf-nav-primary a,
    .surf-nav-utility a,
    .surf-nav-primary li.has-children > ul a,
    .surf-nav-utility li.has-children > ul a {
        flex: 1;
        display: block;
        padding: 0.65rem var(--su-space-2);
    }

    /* full-size touch targets */
    .surf-js .surf-nav-primary .surf-subnav-toggle,
    .surf-js .surf-nav-utility .surf-subnav-toggle {
        width: 2.75rem;
        height: 2.75rem;
        margin: 0;
        font-size: 0.85rem;
    }

    /* submenus open in place, indented, below their parent's row */
    .surf-nav-primary li.has-children > ul,
    .surf-nav-utility li.has-children > ul {
        display: none;
        position: static;
        flex-basis: 100%;
        min-width: 0;
        padding: 0 0 0 var(--su-space-3);
        border-radius: 0;
        box-shadow: none;
        background: color-mix(in srgb, currentColor 6%, transparent);
        color: inherit;
    }

    .surf-nav-primary li.has-children > ul li.has-children > ul,
    .surf-nav-utility li.has-children > ul li.has-children > ul {
        border-radius: 0;
        background: color-mix(in srgb, currentColor 6%, transparent);
        color: inherit;
    }

    .surf-nav-primary li.has-children.is-open > ul,
    .surf-nav-utility li.has-children.is-open > ul,
    html:not(.surf-js) .surf-nav-primary li.has-children > ul,
    html:not(.surf-js) .surf-nav-utility li.has-children > ul {
        display: flex;
    }

}

.surf-events-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--su-space-3);
}

.surf-event {
    padding: var(--su-space-3);
    padding-left: calc(var(--su-space-3) + 4px);
    background: #fff;
    border-left: 4px solid var(--color-accent, #ed8936);
    border-radius: var(--su-radius);
    box-shadow: var(--su-shadow);
}

.surf-event-date {
    display: block;
    font-weight: bold;
    color: var(--color-primary, #2c5282);
}

.surf-event-title {
    display: block;
}

.surf-event-content {
    margin: 0.25rem 0 0;
    color: var(--su-gray-600);
}

.surf-calendar-events-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.surf-calendar-event {
    padding: var(--su-space-3) 0;
    border-bottom: 1px solid var(--su-gray-200);
}

.surf-calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--su-space-3);
    flex-wrap: wrap;
}

.surf-calendar-nav h1 {
    margin: 0;
    font-size: 1.4rem;
}

.surf-calendar-note {
    margin-top: var(--su-space-4);
    padding-top: var(--su-space-3);
    border-top: 1px solid var(--su-gray-200);
    font-size: 0.9em;
    color: var(--su-gray-600);
}

/* ---------- Schools: academic calendar PDFs + month grid (CalendarController) */

.surf-calendar-downloads {
    display: flex;
    flex-wrap: wrap;
    gap: var(--su-space-2);
    margin: 0 0 var(--su-space-4);
}

.surf-calendar-download {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem var(--su-space-3);
    background: var(--color-accent, #ed8936);
    color: #fff;
    border-radius: var(--su-radius);
    font-size: 0.9rem;
    font-weight: bold;
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.surf-calendar-download:hover {
    opacity: 0.9;
}

.surf-calendar-grid {
    width: 100%;
    margin: var(--su-space-3) 0 var(--su-space-2);
    border-collapse: collapse;
    table-layout: fixed;
}

.surf-calendar-grid th {
    padding: 0.4rem;
    color: var(--su-gray-600);
    font-size: 0.8rem;
    text-align: left;
    text-transform: uppercase;
}

.surf-calendar-grid abbr {
    text-decoration: none;
}

.surf-calendar-grid td {
    height: 6rem;
    padding: 0.3rem;
    border: 1px solid var(--su-gray-200);
    background: #fff;
    vertical-align: top;
}

.surf-calendar-grid td.is-outside {
    background: var(--su-gray-100);
}

.surf-calendar-grid td.is-open,
.surf-calendar-legend-swatch {
    background: color-mix(in srgb, var(--color-primary, #2c5282) 12%, #fff);
}

.surf-calendar-day {
    display: inline-block;
    min-width: 1.6rem;
    border-radius: 999px;
    color: var(--su-gray-600);
    font-size: 0.85rem;
    font-weight: bold;
    text-align: center;
}

.surf-calendar-grid td.is-today .surf-calendar-day {
    background: var(--color-accent, #ed8936);
    color: #fff;
}

.surf-calendar-day-events {
    list-style: none;
    margin: 0.2rem 0 0;
    padding: 0;
}

.surf-calendar-day-events li {
    margin-top: 0.15rem;
    padding: 0.1rem 0.3rem;
    border-left: 3px solid var(--color-accent, #ed8936);
    border-radius: 2px;
    background: var(--su-gray-100);
    font-size: 0.75rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.surf-calendar-legend {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 var(--su-space-3);
    color: var(--su-gray-600);
    font-size: 0.85rem;
}

.surf-calendar-legend-swatch {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 1px solid var(--su-gray-200);
}

/* the grid carries the events on wider screens; the list is for phones */
.surf-calendar.has-grid .surf-calendar-events-list,
.surf-calendar.has-grid .surf-calendar-no-events {
    display: none;
}

@media (max-width: 640px) {
    .surf-calendar-grid th {
        padding: 0.2rem 0;
        font-size: 0.7rem;
        text-align: center;
    }

    .surf-calendar-grid td {
        height: 3rem;
        padding: 0.2rem 0;
        text-align: center;
    }

    /* event titles move to the list below; a dot marks the day */
    .surf-calendar-day-events {
        display: none;
    }

    .surf-calendar-grid td.has-events .surf-calendar-day::after {
        content: '';
        display: block;
        width: 0.4rem;
        height: 0.4rem;
        margin: 0.2rem auto 0;
        border-radius: 50%;
        background: var(--color-accent, #ed8936);
    }

    .surf-calendar-grid td.is-today.has-events .surf-calendar-day::after {
        background: #fff;
    }

    .surf-calendar.has-grid .surf-calendar-events-list,
    .surf-calendar.has-grid .surf-calendar-no-events {
        display: block;
    }
}

.surf-search-form,
.surf-masthead-search {
    display: flex;
    gap: var(--su-space-1);
}

.surf-search-form {
    margin: var(--su-space-3) 0 var(--su-space-4);
}

.surf-masthead-search {
    margin-top: 0;
}

.surf-search-form input[type="text"],
.surf-masthead-search input[type="text"] {
    padding: 0.5rem var(--su-space-2);
    border: 1px solid var(--su-border);
    border-radius: var(--su-radius);
    font: inherit;
}

.surf-masthead-search input[type="text"] {
    border: none;
    width: 12rem;
}

.surf-search-form input[type="text"] {
    flex: 1;
}

.surf-search-form button,
.surf-masthead-search button {
    padding: 0.5rem var(--su-space-3);
    background: var(--color-accent, #ed8936);
    color: #fff;
    border: none;
    border-radius: var(--su-radius);
    cursor: pointer;
    font: inherit;
    transition: opacity 0.15s ease;
}

.surf-search-form button:hover,
.surf-masthead-search button:hover {
    opacity: 0.9;
}

.surf-search-type {
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--color-accent, #ed8936);
    font-weight: bold;
    margin-right: var(--su-space-1);
}

.surf-search-count {
    color: var(--su-gray-500);
    font-size: 0.9rem;
}

.surf-cookie-policy table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--su-space-2) 0 var(--su-space-4);
}

.surf-cookie-policy th,
.surf-cookie-policy td {
    padding: var(--su-space-2);
    border-bottom: 1px solid var(--su-gray-200);
    text-align: left;
    vertical-align: top;
}

.surf-cookie-policy-updated {
    color: var(--su-gray-500);
    font-size: 0.9rem;
}

/* ============================================================ Shop */

.surf-shop-categories {
    display: flex;
    flex-wrap: wrap;
    gap: var(--su-space-1);
    margin-bottom: var(--su-space-4);
}

.surf-shop-categories a {
    padding: 0.35rem 0.9rem;
    border: 1px solid var(--su-border);
    border-radius: 999px;
    color: var(--su-gray-600);
    text-decoration: none;
    font-size: 0.95rem;
}

.surf-shop-categories a:hover,
.surf-shop-categories a.is-current {
    background: var(--color-primary, #2c5282);
    border-color: var(--color-primary, #2c5282);
    color: #fff;
}

.surf-shop-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--su-space-4);
}

.surf-shop-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.surf-shop-card-image {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    border-radius: var(--su-radius);
    overflow: hidden;
    background: var(--su-gray-100);
}

.surf-shop-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.surf-shop-card.is-sold-out .surf-shop-card-image img {
    opacity: 0.5;
}

.surf-shop-card-noimage {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 200px;
    font-size: 3rem;
    color: var(--su-border);
}

.surf-shop-badge {
    position: absolute;
    top: var(--su-space-1);
    left: var(--su-space-1);
    background: var(--su-gray-900);
    color: #fff;
    font-size: 0.8rem;
    font-weight: bold;
    padding: 0.2rem 0.6rem;
    border-radius: var(--su-radius);
}

.surf-shop-card-title {
    font-weight: bold;
    color: var(--color-primary, #2c5282);
    text-decoration: none;
}

.surf-shop-card-title:hover {
    text-decoration: underline;
}

.surf-shop-card-price {
    color: var(--su-gray-900);
}

.surf-shop-card-multibuy {
    display: block;
    font-size: 0.8rem;
    color: var(--color-accent, #ed8936);
    font-weight: bold;
}

.surf-shop-breadcrumb {
    font-size: 0.9rem;
    color: var(--su-gray-500);
    margin: 0 0 var(--su-space-3);
}

.surf-shop-breadcrumb a {
    color: var(--color-primary, #2c5282);
}

.surf-shop-item-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--su-space-5);
    align-items: start;
}

.surf-shop-item-image img {
    width: 100%;
    border-radius: var(--su-radius);
    box-shadow: var(--su-shadow);
    display: block;
}

.surf-shop-item-image .surf-shop-card-noimage {
    background: var(--su-gray-100);
    border-radius: var(--su-radius);
    aspect-ratio: 1 / 1;
}

.surf-shop-item-info h1 {
    margin-bottom: var(--su-space-1);
}

.surf-shop-item-price {
    font-size: 1.6rem;
    font-weight: bold;
    margin: 0 0 var(--su-space-2);
}

.surf-shop-item-tiers {
    list-style: none;
    margin: 0 0 var(--su-space-1);
    padding: 0;
}

.surf-shop-item-tiers li {
    padding: 0.2rem 0;
    color: var(--color-accent, #ed8936);
}

.surf-shop-item-tiers span {
    color: var(--su-gray-500);
    font-size: 0.9rem;
}

.surf-shop-item-note {
    font-size: 0.9rem;
    color: var(--su-gray-600);
    margin: 0 0 var(--su-space-2);
}

.surf-shop-add {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: var(--su-space-2);
    margin: var(--su-space-3) 0 var(--su-space-1);
}

.surf-shop-add label {
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    color: var(--su-gray-600);
}

.surf-shop-qty {
    width: 5rem;
    padding: 0.5rem;
    font-size: 1rem;
    border: 1px solid var(--su-border);
    border-radius: var(--su-radius);
}

.surf-shop-add-btn {
    padding: 0.6rem 1.4rem;
    font-size: 1rem;
    font-weight: bold;
    color: #fff;
    background: var(--color-primary, #2c5282);
    border: 0;
    border-radius: var(--su-radius);
    cursor: pointer;
}

.surf-shop-add-btn:hover {
    filter: brightness(1.1);
}

.surf-shop-item-lowstock {
    color: var(--color-accent, #ed8936);
    font-weight: bold;
    margin: 0 0 var(--su-space-3);
}

.surf-shop-item-soldout {
    display: inline-block;
    background: var(--su-gray-900);
    color: #fff;
    font-weight: bold;
    padding: 0.4rem 1rem;
    border-radius: var(--su-radius);
    margin: var(--su-space-3) 0;
}

.surf-shop-item-description {
    margin-top: var(--su-space-4);
    padding-top: var(--su-space-3);
    border-top: 1px solid var(--su-gray-200);
}

/* ---------- Shop basket + checkout ---------- */

.surf-shop-basket {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.9rem;
    color: #fff;
    background: var(--color-accent, #ed8936);
    border-radius: var(--su-radius);
    font-weight: bold;
    text-decoration: none;
}

.surf-shop-basket[hidden] {
    display: none;
}

.surf-shop-cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--su-space-4);
}

.surf-shop-cart-table th,
.surf-shop-cart-table td {
    padding: var(--su-space-2);
    border-bottom: 1px solid var(--su-gray-200);
    text-align: left;
    vertical-align: top;
}

.surf-shop-cart-table tfoot td {
    font-weight: bold;
    border-bottom: 0;
}

.surf-shop-cart-table .surf-shop-cart-amount {
    text-align: right;
    white-space: nowrap;
}

.surf-shop-cart-total-row td {
    font-size: 1.15rem;
    border-top: 2px solid var(--su-gray-900);
}

.surf-shop-cart-breakdown {
    font-size: 0.85rem;
    color: var(--su-gray-600);
}

.surf-shop-line-remove {
    background: none;
    border: 0;
    color: var(--su-gray-600);
    cursor: pointer;
    font-size: 1rem;
}

.surf-shop-cart-message {
    margin: var(--su-space-3) 0;
    padding: var(--su-space-2) var(--su-space-3);
    border-left: 4px solid var(--color-accent, #ed8936);
    background: var(--su-gray-100, #f7fafc);
}

.surf-shop-checkout {
    max-width: 32rem;
}

.surf-shop-checkout h2 {
    font-size: 1.15rem;
    margin: var(--su-space-4) 0 var(--su-space-2);
}

.surf-shop-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: var(--su-space-2);
}

.surf-shop-field[hidden] {
    display: none;
}

.surf-shop-field input,
.surf-shop-field select {
    padding: 0.5rem;
    font-size: 1rem;
    border: 1px solid var(--su-border);
    border-radius: var(--su-radius);
}

.surf-shop-choice {
    display: block;
    margin-bottom: var(--su-space-1);
}

.surf-shop-collection-note {
    margin: var(--su-space-2) 0;
    padding: var(--su-space-2);
    background: var(--su-gray-100, #f7fafc);
}

.surf-shop-pay-btn {
    margin-top: var(--su-space-3);
}

.surf-shop-pay-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

@media (max-width: 640px) {
    .surf-shop-item-layout {
        grid-template-columns: 1fr;
    }

    .surf-shop-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--su-space-3);
    }

    main {
        padding: var(--su-space-4) var(--su-space-3);
    }

    .surf-masthead-search input[type="text"] {
        width: 100%;
    }

    .surf-calendar-nav {
        justify-content: flex-start;
    }

    .surf-pagination {
        justify-content: center;
        text-align: center;
    }

    /* news archive / recent news: thumbnail becomes a band across the top */
    .surf-recent-post {
        flex-direction: column;
        gap: var(--su-space-2);
    }

    .surf-recent-post-thumb {
        width: 100%;
        height: 160px;
    }

    .surf-carousel-item {
        height: 220px;
    }

    .surf-poster-left,
    .surf-poster-right {
        float: none;
        width: 100%;
        margin: 0 0 1em;
    }
}

.surf-poster {
    margin: 0 0 1.5em;
}

.surf-poster img {
    width: 100%;
    height: auto;
    display: block;
}

.surf-poster figcaption {
    margin-top: 0.4em;
    font-size: 0.85em;
    color: var(--su-gray-600);
}

.surf-poster-top {
    width: 100%;
}

.surf-poster-left {
    float: left;
    width: 50%;
    margin-right: 1.5em;
}

.surf-poster-right {
    float: right;
    width: 50%;
    margin-left: 1.5em;
}

.surf-content-body::after {
    content: '';
    display: table;
    clear: both;
}

.surf-content-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--su-space-2) var(--su-space-4);
    margin: 0;
    font-size: 0.7em;
    color: var(--su-gray-600);
}
.surf-content-meta i {
    font-size: 0.8em;
}
.surf-content-meta a {
    color: inherit;
}

.surf-content-meta a:hover {
    color: var(--color-primary);
}
.surf-recent-post-excerpt {
    margin: 0;
    text-align: justify;
}
.surf-list-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--su-space-2) var(--su-space-4);
    margin-bottom: var(--su-space-4);
}

.surf-list-filter {
    display: flex;
    flex-direction: column;
    gap: 0.25em;
    font-size: 0.85em;
    color: var(--su-gray-600);
}

.surf-list-filter select {
    min-width: 12em;
    padding: 0.4em 0.5em;
    border: 1px solid var(--su-gray-300, #cbd5e0);
    border-radius: var(--su-radius);
    background: #fff;
    font: inherit;
    font-size: 1.1em;
    color: inherit;
}

.surf-list-filters.has-js .surf-list-filters-apply {
    display: none;
}

.surf-list-filters-clear {
    padding-bottom: 0.45em;
    font-size: 0.85em;
}

@media (max-width: 600px) {
    .surf-list-filter {
        flex: 1 1 100%;
    }

    .surf-list-filter select {
        width: 100%;
    }
}

/* ============================================================ Home: highlighted stream (cards) */

.surf-stream-highlight-inner {
    max-width: calc(var(--su-content-width) - 2 * var(--su-space-5));
    margin: 0 auto;
}
.surf-stream-highlight-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--su-space-2);
    margin-bottom: var(--su-space-3);
}

.surf-stream-highlight-header h2 {
    margin: 0;
}

.surf-stream-cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--su-space-3);
}

.surf-stream-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border-radius: var(--su-radius);
    box-shadow: var(--su-shadow);
    color: var(--su-gray-900);
}

.surf-stream-card-thumb {
    display: block;
    aspect-ratio: 16 / 10;
    background: color-mix(in srgb, var(--color-primary, #2c5282) 15%, #fff);
}

.surf-stream-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.surf-stream-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: var(--su-space-2) var(--su-space-3) var(--su-space-3);
}

.surf-stream-card-title {
    font-weight: bold;
    line-height: 1.3;
    color: var(--color-primary, #2c5282);
    text-decoration: none;
}

.surf-stream-card-title:hover {
    text-decoration: underline;
}

.surf-stream-card-date {
    font-size: 0.8rem;
    color: var(--su-gray-500);
}

/* clamped so cards stay a similar height whatever the excerpt length */
.surf-stream-card-excerpt {
    margin: 0;
    font-size: 0.9rem;
    color: var(--su-gray-600);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* phones: one swipeable row rather than a tall stack */
@media (max-width: 640px) {

    .surf-stream-cards {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: var(--su-space-1);
    }

    .surf-stream-card {
        flex: 0 0 75%;
        scroll-snap-align: start;
    }
}

.surf-preview-banner {
    background: var(--red-alert, #E84C4C);
    color: #fff;
    font-weight: bold;
    text-align: center;
    padding: var(--su-space-2) var(--su-space-3);
    border-radius: var(--su-radius);
    margin-bottom: var(--su-space-4);
}

/* ============================================================ Home page sections (views/home.php) */

/* The home page's <main> spans the window: banner sections run edge to edge,
   .surf-home-content groups hold the others at the usual content width. */
main.surf-home {
    max-width: none;
    padding: 0;
}

.surf-home-content {
    max-width: var(--su-content-width);
    margin: 0 auto;
    padding: var(--su-space-5);
}

.surf-home-welcome {
    margin-bottom: var(--su-space-5);
}

.surf-home-welcome.has-poster {
    display: flex;
    gap: var(--su-space-4);
    align-items: flex-start;
}

.surf-home-welcome-poster {
    flex: 0 0 40%;
    display: block;
}

.surf-home-welcome-poster img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--su-radius);
}

.surf-home-welcome-text {
    flex: 1;
    min-width: 0;
}

.surf-home-welcome-text h2 a {
    color: inherit;
    text-decoration: none;
}

.surf-home-welcome-text p {
    margin: 0 0 var(--su-space-2);
}

.surf-home-welcome-more {
    font-weight: bold;
    text-decoration: none;
}

.surf-home-welcome-text h2 a:hover,
.surf-home-welcome-more:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .surf-home-content {
        padding: var(--su-space-4) var(--su-space-3);
    }

    .surf-home-welcome.has-poster {
        flex-direction: column;
    }

    .surf-home-welcome-poster {
        flex-basis: auto;
        width: 100%;
    }
}

/* ---------- Quick links tiles (partials/home-quicklinks.php)
   Sized by the section's Small / Medium / Large (.is-*), through these
   variables - a theme restyles medium by setting them on .surf-quicklinks */

.surf-quicklinks {
    --ql-min: 9rem;
    --ql-pad: var(--su-space-4) var(--su-space-2);
    --ql-font: 1rem;
    --ql-icon: 2rem;
    --ql-image-height: 9rem;
    --ql-phone-cols: 2;
    margin-bottom: var(--su-space-5);
}

.surf-quicklinks.is-small {
    --ql-min: 7rem;
    --ql-pad: var(--su-space-2) var(--su-space-1);
    --ql-font: 0.85rem;
    --ql-icon: 1.4rem;
    --ql-image-height: 6rem;
    --ql-phone-cols: 3;
}

.surf-quicklinks.is-large {
    --ql-min: 13rem;
    --ql-pad: var(--su-space-6) var(--su-space-3);
    --ql-font: 1.2rem;
    --ql-icon: 3rem;
    --ql-image-height: 13rem;
    --ql-phone-cols: 1;
}

.surf-quicklinks ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(var(--ql-min), 1fr));
    gap: var(--su-space-3);
}

.surf-quicklinks a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--su-space-2);
    height: 100%;
    padding: var(--ql-pad);
    background: var(--color-primary, #2c5282);
    color: #fff;
    border-radius: var(--su-radius);
    box-shadow: var(--su-shadow);
    font-size: var(--ql-font);
    font-weight: bold;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    transition: filter 0.15s ease;
}

.surf-quicklinks a:hover {
    filter: brightness(1.1);
}

.surf-quicklinks i {
    font-size: var(--ql-icon);
}

/* background image (set inline): taller tile, darkened beneath the icon and label */
.surf-quicklinks a.has-image {
    position: relative;
    isolation: isolate;
    min-height: var(--ql-image-height);
    background-size: cover;
    background-position: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.surf-quicklinks a.has-image::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: rgba(0, 0, 0, 0.5);
    transition: background 0.15s ease;
}

.surf-quicklinks a.has-image:hover::before {
    background: rgba(0, 0, 0, 0.35);
}

@media (max-width: 640px) {
    .surf-quicklinks ul {
        grid-template-columns: repeat(var(--ql-phone-cols), minmax(0, 1fr));
    }
}

/* ---------- Hero video (partials/home-hero.php) */

.surf-hero-carousel {
    position: relative;
}

/* once the video is actually playing the images step aside; until then
   (or if it never plays) the images show, or the video's still without them */
.surf-hero-carousel.is-playing .surf-carousel,
.surf-hero-carousel.has-carousel:not(.is-playing) .surf-hero-video {
    display: none;
}

.surf-hero-video {
    display: block;
    width: 100%;
    height: var(--su-hero-height);
    object-fit: cover;
    border-radius: var(--su-radius);
    background: #000;
}

@media (max-width: 640px) {
    .surf-hero-video {
        height: 220px;
    }
}

.surf-hero-video-toggle {
    position: absolute;
    right: var(--su-space-2);
    bottom: var(--su-space-2);
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.35em 0.8em;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font: inherit;
    font-size: 0.8rem;
    cursor: pointer;
}

.surf-hero-video-toggle[hidden] {
    display: none;
}

.surf-hero-video-toggle:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* ---------- Hero events (partials/hero-events.php) - stacked; the list
   scrolls inside the hero height, the calendar link stays at the bottom */

.surf-hero-events {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: var(--su-hero-height);
}

.surf-hero-events h2 {
    flex: 0 0 auto;
}

.surf-hero-events-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: rgba(255, 255, 255, 0.4) transparent;
    list-style: none;
    margin: 0;
    padding: 0 var(--su-space-1) 0 0;
    display: flex;
    flex-direction: column;
    gap: var(--su-space-2);
}

.surf-hero-event {
    flex: 0 0 auto;
    padding: var(--su-space-2) var(--su-space-3);
    border-left: 4px solid var(--color-accent, #ed8936);
    border-radius: var(--su-radius);
    background: rgba(255, 255, 255, 0.1);
}

.surf-hero-event-date {
    display: block;
    font-size: 0.85rem;
    font-weight: bold;
}

.surf-hero-event-title {
    display: block;
}

.surf-hero-event-content {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    opacity: 0.85;
}

.surf-hero-events-more {
    flex: 0 0 auto;
    align-self: flex-start;
    margin-top: var(--su-space-3);
    color: inherit;
    font-weight: bold;
}

@media (max-width: 640px) {
    .surf-hero-events {
        height: auto;
    }

    .surf-hero-events-list {
        max-height: 20rem;
    }
}

/* ---------- Feature bands (partials/home-feature.php) */

.surf-feature-band {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 360px;
    overflow: hidden;
    background: var(--color-primary, #2c5282);
    color: #fff;
}

.surf-feature-band-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* darkest behind the text, so it stays readable on any photo */
.surf-feature-band.has-image::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.45) 50%, rgba(0, 0, 0, 0.1) 100%);
}

.surf-feature-band-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: var(--su-content-width);
    margin: 0 auto;
    padding: var(--su-space-6) var(--su-space-5);
}

.surf-feature-band-text {
    max-width: 34rem;
}

.surf-feature-band-text h2 a {
    color: inherit;
    text-decoration: none;
}

.surf-feature-band-text h2 a:hover {
    text-decoration: underline;
}

.surf-feature-band-text p {
    margin: 0 0 var(--su-space-2);
}

.surf-feature-band-more {
    display: inline-block;
    margin-top: var(--su-space-2);
    padding: 0.6rem var(--su-space-4);
    border: 2px solid #fff;
    border-radius: var(--su-radius);
    color: #fff;
    font-weight: bold;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.surf-feature-band-more:hover {
    background: #fff;
    color: var(--color-primary, #2c5282);
}

/* one attachment: everything centred */
.surf-feature-band.is-single {
    text-align: center;
}

.surf-feature-band.is-single .surf-feature-band-text,
.surf-feature-band.is-single .surf-feature-band-text h2 {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.surf-feature-band.is-single.has-image::before {
    background: rgba(0, 0, 0, 0.45);
}

/* a video, download or button: a light band, so the item stands out */
.surf-feature-band.is-plain {
    min-height: 0;
    background: var(--su-gray-100);
    color: var(--su-gray-900);
}

.surf-feature-band.is-plain h2 {
    color: var(--color-primary, #2c5282);
}

.surf-feature-band.is-plain .surf-feature-band-more {
    border-color: var(--color-primary, #2c5282);
    color: var(--color-primary, #2c5282);
}

.surf-feature-band.is-plain .surf-feature-band-more:hover {
    background: var(--color-primary, #2c5282);
    color: #fff;
}

.surf-feature-band .surf-content-buttons {
    justify-content: center;
}

.surf-feature-download {
    margin: var(--su-space-4) 0 0;
}

/* one tile, centred - specific enough to beat any theme's quick-link grid */
.surf-feature-band .surf-feature-download ul {
    grid-template-columns: minmax(0, 16rem);
    justify-content: center;
}

.surf-feature-download small {
    font-weight: normal;
    opacity: 0.85;
}

@media (max-width: 640px) {
    .surf-feature-band {
        min-height: 280px;
    }

    .surf-feature-band.is-plain {
        min-height: 0;
    }

    .surf-feature-band-inner {
        padding: var(--su-space-5) var(--su-space-3);
    }

    .surf-feature-band.has-image::before {
        background: rgba(0, 0, 0, 0.55);
    }
}

/* Bilingual sites (Surf\Lang): headings and sentences get the English on its own line beneath;
   short labels get ' / English' inline, a little lighter */
.surf-bi-en {
    display: block;
    font-size: 0.6em;
    font-weight: normal;
    opacity: 0.8;
    margin-top: 0.15em;
}

.surf-bi-en.surf-bi-en-text {
    font-size: 0.9em;
    margin-top: 0.1em;
}

.surf-bi-en-inline {
    font-weight: normal;
    opacity: 0.75;
}

/* Bilingual cookie policy: the English version follows the Irish */
.surf-cookie-policy-en {
    margin-top: var(--su-space-5, 2rem);
    padding-top: var(--su-space-4, 1.5rem);
    border-top: 1px solid rgba(0, 0, 0, 0.15);
}
