/* ============================================================
   Modern theme - image-forward, one bold school colour on big
   areas, quick links up front, a calm stack of full-width bands.
   Shared components live in /surf/assets/base.css (loaded first);
   this file styles the frame and the home bands, and restyles a
   few shared components to suit.
   ============================================================ */

:root {
    --su-content-width: 1140px;
    --su-radius: 10px;
    --su-hero-height: clamp(400px, 70vh, 720px);
    --mo-band-alt: #f3f4f6;
    --mo-primary-dark: color-mix(in srgb, var(--color-primary, #1d4e89) 75%, #000);
}

h1, h2, h3 {
    font-weight: 800;
}

h1 {
    color: var(--color-primary, #1d4e89);
}

main {
    padding: var(--su-space-6) var(--su-space-5);
}

/* ============================================================ Header */

.surf-header {
    background: #fff;
    color: var(--su-gray-900);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 20;
}

.surf-masthead-top {
    max-width: var(--su-content-width);
    margin: 0 auto;
    padding: var(--su-space-4) var(--su-space-5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: var(--su-space-2) var(--su-space-4);
}

.surf-masthead-brand {
    display: flex;
    align-items: center;
    gap: var(--su-space-3);
}

.surf-crest {
    display: block;
    height: 5.5rem;
    width: auto;
}

.surf-site-title {
    margin: 0;
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--color-primary, #1d4e89);
}

.surf-site-title a {
    color: inherit;
    text-decoration: none;
}

.surf-site-blurb {
    margin: 0.2rem 0 0;
    color: var(--su-gray-600);
}

/* contact details on top; basket, social icons and search beneath. Brand and
   tools share one row on desktop - long contact details wrap within the column */
.surf-masthead-brand,
.surf-masthead-tools {
    min-width: 0;
}

.surf-masthead-tools {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--su-space-3);
    margin-left: auto;
}

/* wrap-reverse: if the row runs out of room, the socials (and basket) drop
   beneath the search rather than pushing it down */
.surf-masthead-actions {
    display: flex;
    flex-wrap: wrap-reverse;
    justify-content: flex-end;
    align-items: center;
    gap: var(--su-space-2) var(--su-space-3);
}

.surf-masthead-contact {
    justify-content: flex-end;
    gap: 0 var(--su-space-4);
    margin: 0;
    font-size: 0.9rem;
    opacity: 1;
    color: var(--color-primary, #1d4e89);
}

/* icons instead of the shared bullets (phone and email links only) */
.surf-masthead-contact li + li::before {
    content: none;
}

.surf-masthead-contact a[href^="tel:"]::before,
.surf-masthead-contact a[href^="mailto:"]::before {
    margin-right: 0.4em;
    font-family: "Font Awesome 5 Pro";
    font-weight: 900;
}

.surf-masthead-contact a[href^="tel:"]::before {
    content: "\f095";
}

.surf-masthead-contact a[href^="mailto:"]::before {
    content: "\f0e0";
}

.surf-masthead-social a {
    color: var(--color-primary, #1d4e89);
    font-size: 1.4rem;
}

.surf-masthead-search input[type="text"] {
    width: 13rem;
    border: 1px solid var(--su-border);
    border-radius: 999px;
    padding-left: var(--su-space-3);
}

.surf-masthead-search button {
    border-radius: 999px;
    background: var(--color-primary, #1d4e89);
}

.surf-shop-basket {
    color: var(--color-primary, #1d4e89);
    font-weight: bold;
    text-decoration: none;
}

/* ---------- Utility menu: a light grey band (partials/utility-bar.php) */

.surf-utility-bar {
    background: var(--mo-band-alt);
    border-top: 1px solid var(--su-gray-200);
    border-bottom: 1px solid var(--su-gray-200);
    padding: 0.75rem var(--su-space-5);
}

.surf-utility-bar-inner {
    max-width: var(--su-content-width);
    margin: 0 auto;
}

.surf-utility-bar .surf-nav-utility {
    margin: 0;
    font-weight: 600;
}

.surf-utility-bar .surf-nav-utility ul {
    justify-content: center;
    gap: var(--su-space-4);
}

.surf-utility-bar .surf-nav-utility a {
    color: var(--color-primary, #1d4e89);
}

/* ---------- Main menu: a full-width bar in the school colour */

.surf-nav-primary {
    background: var(--color-primary, #1d4e89);
    color: #fff;
    font-family: var(--font-heading, system-ui, sans-serif);
    font-weight: 700;
}

.surf-nav-primary > ul {
    gap: 0;
}

.surf-nav-primary > ul > li > a {
    display: block;
    padding: 0.9rem var(--su-space-3);
}

.surf-nav-primary > ul > li:hover,
.surf-nav-primary > ul > li.is-open {
    background: var(--mo-primary-dark);
}

.surf-nav-primary a:hover {
    text-decoration: none;
}

.surf-nav-primary > ul > li.has-children {
    padding-right: var(--su-space-1);
}

.surf-nav-primary > ul > li.has-children > a {
    padding-right: 0.25rem;
}

/* dropdown colours - desktop only, phones use base.css's in-place accordion */
@media (min-width: 801px) {
    .surf-nav-primary li.has-children > ul {
        background: var(--mo-primary-dark);
        color: #fff;
        font-weight: 600;
    }

    .surf-nav-primary li.has-children > ul a:hover {
        background: rgba(255, 255, 255, 0.12);
    }

    .surf-nav-utility li.has-children > ul {
        min-width: 15rem;
        background: #fff;
        color: var(--su-gray-900);
    }
    .surf-nav-primary li.has-children > ul li.has-children > ul {
        background: var(--color-secondary, #13294b);
        color: #fff;
    }
    .surf-nav-utility li.has-children > ul li.has-children > ul {
        background: var(--su-gray-600);
        color: #fff;
    }
    .surf-nav-utility li.has-children > ul li.has-children > ul a {
        color: #fff;
    }
}

@media (max-width: 800px) {
    .surf-nav-primary {
        padding: 0 var(--su-space-3);
    }

    .surf-nav-primary > ul > li > a {
        padding: 0.65rem var(--su-space-2);
    }

    .surf-nav-primary > ul > li:hover {
        background: none;
    }

    .surf-masthead-top {
        flex-wrap: wrap;
    }

    .surf-utility-bar {
        padding: 0 var(--su-space-3);
    }
}

/* ============================================================ Home: bands (views/home.php) */

.surf-band {
    background: #fff;
}

.surf-band.is-alt {
    background: var(--mo-band-alt);
}

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

.surf-band-inner > * {
    margin-bottom: 0;
}

.surf-band h2,
.surf-stream-highlight h2,
.surf-feature-band h2 {
    font-size: 2rem;
}

.surf-band h2 {
    color: var(--color-primary, #1d4e89);
}

/* ---------- Hero (partials/home-hero.php + carousel.php) */

.surf-hero {
    background: var(--su-gray-900);
}

.surf-hero-carousel {
    height: var(--su-hero-height);
    overflow: hidden;
}

.surf-hero .surf-carousel,
.surf-hero .surf-hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border-radius: 0;
}

.surf-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.surf-slide.is-active {
    opacity: 1;
}

.surf-slides-controls {
    position: absolute;
    right: var(--su-space-4);
    bottom: var(--su-space-4);
    z-index: 3;
    display: flex;
    align-items: center;
    gap: var(--su-space-1);
}

.surf-slides-pause {
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.75rem;
    cursor: pointer;
}

.surf-slides-dot {
    width: 0.8rem;
    height: 0.8rem;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

.surf-slides-dot[aria-current="true"] {
    background: #fff;
}

/* welcome alongside: photos left, the welcome message right in the school colour */
.surf-hero.is-split {
    display: grid;
    grid-template-columns: 3fr 2fr;
    grid-template-rows: var(--su-hero-height);
}

.surf-hero-welcome {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 0;
    padding: var(--su-space-6) var(--su-space-5);
    background: var(--color-secondary);
    color: #fff;
}
.surf-hero-welcome h2 {
    flex: 0 0 auto;
    font-size: 2rem;
}

/* cut to fit, fading out above "Read more" */
.surf-hero-welcome-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent);
    mask-image: linear-gradient(to bottom, #000 70%, transparent);
}

.surf-hero-welcome-body a {
    color: inherit;
}

.surf-hero-welcome-more,
.surf-hero-events-more,
.surf-home-welcome-more {
    flex: 0 0 auto;
    display: inline-block;
    margin-top: var(--su-space-3);
    padding: 0.6rem var(--su-space-4);
    border: 2px solid #fff;
    border-radius: 999px;
    color: #fff;
    font-weight: bold;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.surf-hero-welcome-more:hover,
.surf-hero-events-more:hover {
    background: #fff;
    color: var(--color-primary, #1d4e89);
}

/* events alongside: the same school-colour panel, events stacked and scrolling.
   The grid row sets the height, so the panel stretches to it */
.surf-hero-events {
    height: auto;
    padding: var(--su-space-3) var(--su-space-5) var(--su-space-6);
    background: var(--color-secondary);
    color: #fff;
}
.surf-hero-events h2 {
    font-size: 2rem;
}

.surf-hero.is-text-only .surf-hero-events {
    align-items: center;
}

.surf-hero.is-text-only .surf-hero-events-list {
    width: 100%;
    max-width: 46rem;
    max-height: 24rem;
}

.surf-hero.is-text-only .surf-hero-events-more {
    align-self: center;
}

/* welcome with no photos: the panel alone, centred */
.surf-hero.is-text-only .surf-hero-welcome {
    align-items: center;
    text-align: center;
}

.surf-hero.is-text-only .surf-hero-welcome-body {
    max-width: 46rem;
    max-height: 16em;
    text-align: left;
}

/* ---------- Quick links */

/* medium tiles - small and large come from base.css */
.surf-quicklinks {
    --ql-pad: var(--su-space-5) var(--su-space-3);
    --ql-font: 1.1rem;
    --ql-icon: 2.4rem;
    margin-bottom: 0;
}

.surf-quicklinks ul {
    gap: var(--su-space-4);
}

.surf-quicklinks a {
    font-family: var(--font-heading, system-ui, sans-serif);
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.surf-quicklinks a:hover {
    filter: none;
    background-color: var(--mo-primary-dark);
    transform: translateY(-3px);
}

/* ---------- Welcome (standalone) */

.surf-home-welcome {
    margin-bottom: 0;
    align-items: center;
}

.surf-home-welcome.has-poster {
    gap: var(--su-space-6);
}

.surf-home-welcome-poster {
    flex-basis: 45%;
}

.surf-home-welcome-text h2 a {
    color: var(--color-primary, #1d4e89);
}

.surf-home-welcome-more {
    background: var(--color-primary, #1d4e89);
    border-color: var(--color-primary, #1d4e89);
}

.surf-home-welcome-more:hover {
    background: var(--mo-primary-dark);
    border-color: var(--mo-primary-dark);
    text-decoration: none;
}

/* ---------- Broadcast: an unmissable notice card */

.surf-broadcast {
    padding: var(--su-space-4) var(--su-space-5);
    background: #fff;
    border-left: 6px solid var(--color-accent, #f2a900);
    border-radius: var(--su-radius);
    box-shadow: var(--su-shadow);
}

.surf-broadcast-title {
    font-family: var(--font-heading, system-ui, sans-serif);
    font-size: 1.4rem;
    color: var(--color-primary, #1d4e89);
}

/* ---------- Recent news: a grid of cards */

.surf-recent-posts-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--su-space-4);
}

.surf-recent-post {
    flex-direction: column;
    gap: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: var(--su-radius);
    background: #fff;
    box-shadow: var(--su-shadow);
}

.surf-recent-post-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
}

.surf-recent-post-thumb img {
    border-radius: 0;
}

.surf-recent-post-body {
    padding: var(--su-space-3);
}

.surf-recent-post-excerpt {
    margin: var(--su-space-1) 0 0;
    font-size: 0.9rem;
    color: var(--su-gray-600);
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- Events */

.surf-events-widget-more {
    border-radius: 999px;
    color: var(--su-gray-900);
}

/* ---------- Highlighted stream: a band in the school colour */

.surf-stream-highlight {
    padding: var(--su-space-6) var(--su-space-5);
    background: var(--color-primary, #1d4e89);
    color: #fff;
}

.surf-stream-highlight-more {
    color: #fff;
    font-weight: bold;
    text-decoration: none;
}

.surf-stream-highlight-more:hover {
    text-decoration: underline;
}

.surf-stream-highlight-inner {
    max-width: var(--su-content-width);
}

/* ---------- Feature bands */

.surf-feature-band {
    min-height: 560px;
}

.surf-feature-band-more {
    border-radius: 999px;
}

/* ============================================================ Footer */

.surf-footer {
    flex-shrink: 0;
    background: var(--color-primary, #1d4e89);
    color: #fff;
}

.surf-footer-badges {
    padding: var(--su-space-4) var(--su-space-5);
    background: #fff;
    border-top: 1px solid var(--su-gray-200);
}

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

.surf-footer-title {
    display: flex;
    align-items: center;
    gap: var(--su-space-2);
    margin: 0 0 var(--su-space-3);
    font-family: var(--font-heading, system-ui, sans-serif);
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.2;
}

.surf-footer-title img {
    height: 3rem;
    width: auto;
}

.surf-footer-contact-block {
    margin-bottom: 0;
}

.surf-footer-bottom {
    background: var(--mo-primary-dark);
    font-size: 0.85rem;
}

.surf-footer-bottom-inner {
    max-width: var(--su-content-width);
    margin: 0 auto;
    padding: var(--su-space-2) var(--su-space-5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--su-space-2) var(--su-space-4);
}

.surf-footer-bottom p {
    margin: 0;
    opacity: 0.9;
}

/* ============================================================ Phones */

@media (max-width: 640px) {
    main {
        padding: var(--su-space-4) var(--su-space-3);
    }

    .surf-masthead-top {
        padding: var(--su-space-3);
    }

    /* stacked under the brand on phones, so the details read left to right */
    .surf-masthead-tools {
        align-items: flex-start;
    }

    .surf-masthead-contact {
        justify-content: flex-start;
        gap: var(--su-space-1) var(--su-space-3);
        font-size: 0.85rem;
    }

    .surf-crest {
        height: 3.5rem;
    }

    .surf-site-title {
        font-size: 1.5rem;
    }

    .surf-masthead-tools,
    .surf-masthead-actions {
        width: 100%;
    }

    .surf-masthead-search {
        flex: 1;
    }

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

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

    .surf-band h2,
    .surf-stream-highlight h2,
    .surf-feature-band h2,
    .surf-hero-welcome h2 {
        font-size: 1.5rem;
    }

    .surf-hero {
        --su-hero-height: 260px;
    }

    .surf-hero.is-split {
        grid-template-columns: 1fr;
        grid-template-rows: var(--su-hero-height) auto;
    }

    .surf-hero-welcome,
    .surf-hero-events {
        padding: var(--su-space-4) var(--su-space-3);
    }

    .surf-hero-events h2 {
        font-size: 1.5rem;
    }

    .surf-hero-welcome-body {
        max-height: 14em;
    }

    .surf-slides-controls {
        right: var(--su-space-3);
        bottom: var(--su-space-2);
    }

    .surf-quicklinks ul {
        gap: var(--su-space-2);
    }

    .surf-quicklinks:not(.is-small):not(.is-large) {
        --ql-pad: var(--su-space-4) var(--su-space-2);
        --ql-font: 1rem;
        --ql-icon: 1.9rem;
    }

    .surf-home-welcome.has-poster {
        gap: var(--su-space-3);
    }

    .surf-broadcast {
        padding: var(--su-space-3);
    }

    .surf-footer-main {
        padding: var(--su-space-5) var(--su-space-3);
    }

    .surf-footer-bottom-inner {
        padding: var(--su-space-2) var(--su-space-3);
    }
}
