:root {
    /* Content sits in a centred column no wider than --content-max; on smaller
       screens the gutter takes over. Text inside the column stays left-aligned. */
    --content-max: 1200px;
    --section-gutter: max(140px, 7%, calc((100% - var(--content-max)) / 2));

    /* Site palette — taken from the home page; use these on every page */
    --color-navy: #04113B;
    --color-primary: #0F3C7A;
    --color-accent: #0389E1;
    --color-text: #333333;
    --color-muted: #6B7280;
    --color-border: #E2E5EA;
    --color-surface: #F4F6F9;
}

@media (max-width: 991px) {
    :root {
        --section-gutter: max(60px, 6%);
    }
}

@media (max-width: 575px) {
    :root {
        --section-gutter: max(20px, 5%);
    }
}

body {
    font-family: 'Public Sans', sans-serif;
}

/*Misc*/
.btn:not(.btn-outline-dark) {
    background-color: #0F3C7A;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 24px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.btn:hover,
.btn:focus{
    background-color: #0389E1;
    color: white;
}

.btn-primary {
    padding: 11px 26px;
    border-radius: 7px;
    font-size: 15px;
}

.btn-outline-dark{
    border-radius: 6px;
    padding: 9px 22px;
    font-weight: 500;
}

/* Ghost button: transparent with an outline, fills in on hover.
   The outline is an inset shadow rather than a border, so it adds no height
   and the button always matches .btn-primary. */
.btn.btn-ghost {
    background-color: transparent;
    color: #0F3C7A;
    border: none;
    box-shadow: inset 0 0 0 2px #0F3C7A;
    border-radius: 7px;
    padding: 11px 18px;
    font-size: 15px;
    line-height: 1.5;
    white-space: nowrap;
}

.btn.btn-ghost:hover,
.btn.btn-ghost:focus {
    background-color: #0F3C7A;
    color: white;
}

/* Services hero buttons: keep each label on one line so both buttons share a height;
   if the row runs out of space, the whole button drops to the next line instead. */
.hero-wheel .btn-group {
    flex-wrap: wrap;
}

.hero-wheel .btn-primary {
    padding-left: 18px;
    padding-right: 18px;
    line-height: 1.5;
    white-space: nowrap;
}

@media (max-width: 575px) {
    .btn {
        padding: 8px 18px;
        font-size: 14px;
    }

    .btn-primary {
        padding: 9px 20px;
        font-size: 15px;
    }

    .btn.btn-ghost {
        padding: 9px 14px;
    }

    .hero-wheel .btn-primary {
        padding-left: 14px;
        padding-right: 14px;
    }
}

/* Navbar */
.navbar {
    background-color: #04113B;
    color: white;
    font-size: 14px;
}

.navbar .nav-link {
    color: white;
}

.navbar .nav-link:hover {
    color: #0389E1;
}

.navbar-toggler:focus {
    box-shadow: none;
    outline: none;
}

/* Announcements under the navbar, posted on staff/announcements.php */
.site-announcement {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px var(--section-gutter);
    background-color: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 14px;
}

.site-announcement-icon {
    margin-top: 1px;
    color: var(--color-accent);
    font-size: 17px;
}

.site-announcement-text {
    flex: 1;
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.site-announcement-text strong {
    margin-right: 6px;
    color: var(--color-navy);
}

.site-announcement-text a {
    margin-left: 6px;
    color: var(--color-primary);
    font-weight: 500;
}

.site-announcement-text a:hover {
    color: var(--color-accent);
}

.site-announcement-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--color-muted);
}

.site-announcement-close:hover {
    background-color: var(--color-border);
    color: var(--color-text);
}

.logo {
    height: 40px;
    width: 40px;
    object-fit: contain;
    margin-right: 0.5rem;
}

.company-name {
    font-weight: 400;
    font-size: 16px;
    line-height: 1.2;
}

/* Smaller "by ..." line under a sub-brand name, such as Cyber Young Minds */
.company-name.company-subtitle {
    font-size: 11px;
    letter-spacing: 0.02em;
    opacity: 0.75;
}

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

.footer-link:hover {
    color: #0389E1;
}

.footer-link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

/*footer top section contains the company logo and website page links*/
/* Same navy as the navbar, so the page is framed by one colour top and bottom. */
.footer-top{
    background-color: var(--color-navy);
    color: white;
    font-size: 12px;
}

/* Full logo with the company name; the rounded corners soften the edge of its dark background. */
.footer-logo {
    display: block;
    width: 100%;
    max-width: 240px;
    height: auto;
    border-radius: 6px;
}

.footer-section-heading{
    opacity: 50%;
    color: white;
}

.footer-top ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

/*footer columns section contains the company logo and website page links*/
.footer-columns {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2rem;
}

/* Same gutter as the page sections so the footer lines up with the content */
.footer-top {
    padding-left: var(--section-gutter);
    padding-right: var(--section-gutter);
}

@media (max-width: 991px) {
    .footer-columns {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575px) {
    .footer-columns {
        grid-template-columns: 1fr;
    }
}

/*footer bottom section contains the copyright information*/
.footer-bottom{
    background-color:white;
    color: #0F3C7A;
    text-align: center;
    font-size: 12px;
}

.logo-sm {
    height: 25px;
    width: 25px;
    object-fit: contain;
    margin-right: 0.5rem;
}

/* Home Page Styles */

.section-title {
    font-size: 20px;
    font-weight: 400;
    color: #0F3C7A;
    text-align: left;
    padding-left: var(--section-gutter);
}

/* Hero Section */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 100px;
    padding-left: var(--section-gutter);
    padding-right: var(--section-gutter);
    padding-top: 72px;
    padding-bottom: 72px;
    box-sizing: border-box;
}

.hero-content {
    flex: 1 1 40%;
}

.hero-image {
    flex: 1 1 80%;
    max-width: 80%;
    margin-left: auto;
}

.hero-image img {
    width: 100%;
    height: auto;
    display: block;
}

@media (min-width: 992px) and (max-width: 1400px) {
    .hero {
        gap: 60px;
    }
}

@media (max-width: 991px) {
    .hero {
        gap: 48px;
    }
}

@media (max-width: 575px) {
    .hero {
        flex-wrap: wrap;
        gap: 24px;
    }

    .hero-image {
        flex: 1 1 100%;
        max-width: 100%;
        margin-left: 0;
    }
}

/* Services Section — bento grid: one featured tile, four beside it */
.service-bento {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    grid-auto-rows: minmax(250px, auto);
    gap: 20px;
    padding-left: var(--section-gutter);
    padding-right: var(--section-gutter);
    margin-bottom: 1.5rem;
}

.service-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 28px;
    padding: 30px;
    border-radius: 8px;
    background-color: #0389E1;
    color: white;
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.25s ease, background-color 0.25s ease;
}

.service-tile:hover,
.service-tile:focus-visible {
    color: white;
    transform: translateY(-4px);
}

.service-tile-icon {
    font-size: 28px;
    line-height: 1;
}

.service-tile-body {
    position: relative;
    z-index: 1;
}

.service-tile-eyebrow {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
}

.service-tile-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
}

.service-tile-description {
    font-size: 14px;
    font-weight: 300;
    line-height: 1.6;
    margin-bottom: 18px;
}

.service-tile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0 0 22px;
}

.service-tile-tags li {
    font-size: 14px;
    padding: 6px 14px;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.2);
}

.service-tile-link {
    font-size: 14px;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.service-tile:hover .service-tile-link,
.service-tile:focus-visible .service-tile-link {
    color: #0F3C7A;
}

/* Smaller tiles switch to the site's dark blue on hover; the link stays white so it doesn't disappear */
.service-tile:not(.is-featured):hover,
.service-tile:not(.is-featured):focus-visible {
    background-color: #0F3C7A;
}

.service-tile:not(.is-featured):hover .service-tile-link,
.service-tile:not(.is-featured):focus-visible .service-tile-link {
    color: white;
}

/* Featured tile: larger type and a soft ring in the corner */
.service-tile.is-featured {
    grid-row: span 2;
    padding: 40px;
}

.service-tile.is-featured::after {
    content: "";
    position: absolute;
    right: -120px;
    bottom: -160px;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    border: 48px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.service-tile.is-featured .service-tile-icon {
    font-size: 44px;
}

.service-tile.is-featured .service-tile-title {
    font-size: clamp(26px, 3vw, 36px);
}

.service-tile.is-featured .service-tile-description {
    font-size: 17px;
    max-width: 440px;
}

.service-tile.is-featured .service-tile-link {
    font-size: 16px;
}

@media (max-width: 991px) {
    .service-bento {
        grid-template-columns: 1fr 1fr;
    }

    .service-tile.is-featured {
        grid-column: span 2;
        grid-row: auto;
        min-height: 340px;
    }
}

@media (max-width: 575px) {
    .service-bento {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        gap: 16px;
    }

    .service-tile.is-featured {
        grid-column: auto;
        min-height: 300px;
        padding: 30px;
    }
}

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

    .service-tile:hover {
        transform: none;
    }
}

/* About Us Section */
/* text on the left, mission card on the right */
.about-container {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
    gap: 56px;
    width: 100%;
    padding-left: var(--section-gutter);
    padding-right: var(--section-gutter);
    box-sizing: border-box;
}

.about-content > div:not(.about-mission) p {
    margin: 0 0 0.25rem;
    color: var(--color-muted);
    font-size: 15px;
    line-height: 1.7;
}

/* first paragraph reads as the lead line */
.about-content > div:not(.about-mission) p:first-child {
    color: var(--color-navy);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.55;
}

/* mission card, navy like the stats card on cym.php */
.about-mission {
    position: relative;
    overflow: hidden;
    padding: 36px 36px 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-navy));
    color: #ffffff;
    box-shadow: 0 12px 30px rgba(4, 17, 59, 0.18);
}

/* large faded quote mark in the corner */
.about-mission i {
    position: absolute;
    top: -18px;
    right: 18px;
    font-size: 120px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.08);
}

.about-mission-label {
    display: block;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-accent);
}

.about-mission p {
    position: relative;
    margin: 0;
    font-size: 21px;
    font-weight: 500;
    line-height: 1.5;
}

/* team photo beside the mission and text */
.about-team-image {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 520px;
    align-self: stretch;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(4, 17, 59, 0.12);
}

/* profile button centred under the cards */
.about-actions {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    padding: 0 var(--section-gutter);
}

/* three cards in a row under the text and mission */
.about-points {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin: 2.5rem 0 0;
    padding: 0 var(--section-gutter);
    list-style: none;
}

.about-point {
    padding: 24px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background-color: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.about-point:hover {
    border-color: var(--color-accent);
    box-shadow: 0 6px 18px rgba(4, 17, 59, 0.08);
}

/* icon sits in a soft round badge */
.about-point i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: 14px;
    border-radius: 50%;
    background-color: rgba(3, 137, 225, 0.1);
    color: var(--color-accent);
    font-size: 18px;
}

.about-point h3 {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 600;
    color: var(--color-primary);
}

.about-point p {
    margin: 0;
    color: var(--color-text);
    font-size: 15px;
    line-height: 1.55;
}

.about-point a {
    color: var(--color-primary);
    font-weight: 500;
}

@media (max-width: 991px) {
    .about-points {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    /* on smaller screens the icon sits beside the text to keep the cards short */
    .about-point {
        display: grid;
        grid-template-columns: 40px 1fr;
        column-gap: 16px;
        padding: 18px 20px;
    }

    .about-point i {
        grid-row: span 2;
        margin-bottom: 0;
    }
}

/* Partners Section (homepage teaser strip)
   Scrolling logo ribbon, moves like the programme banner on cym.php */
.partner-banner {
    overflow: hidden;
    position: relative;
}

/* Logos fade into the page at both edges as they scroll in and out */
.partner-banner::before,
.partner-banner::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 10%;
    z-index: 1;
    pointer-events: none;
}

.partner-banner::before {
    left: 0;
    background: linear-gradient(90deg, #ffffff, transparent);
}

.partner-banner::after {
    right: 0;
    background: linear-gradient(270deg, #ffffff, transparent);
}

.partner-track {
    display: flex;
    align-items: center;
    width: max-content;
    min-width: 100%;
    will-change: transform;
    animation: banner-scroll 45s linear infinite;
}

/* Each group ends with the same gap it uses between logos so the loop has no jump */
.partner-group {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 1.5rem;
    padding-right: 1.5rem;
}

.partner-logo,
.partner-placeholder {
    flex: 0 0 210px;
    width: 210px;
    height: 160px;
}

.partner-logo {
    object-fit: contain;
}

/* Pause so visitors can look at a logo */
.partner-banner:hover .partner-track {
    animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
    .partner-track {
        animation-duration: 70s;
    }
}

@media (max-width: 767px) {
    .partner-logo,
    .partner-placeholder {
        flex-basis: 125px;
        width: 125px;
        height: 120px;
    }
}

.partner-placeholder {
    background-color: #E9ECEF;
    border: 1px dashed #B0B8C1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8A94A6;
    font-size: 12px;
}

.partner-placeholder::after {
    content: "Logo";
}

.partner-actions {
    width: 100%;
    padding-left: var(--section-gutter);
    box-sizing: border-box;
}

@media (max-width: 991px) {
    .about-container {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

@media (max-width: 575px) {
    .about-mission {
        padding: 28px 24px 30px;
    }

    .about-mission p {
        font-size: 18px;
    }
}

/* =========================================
   Shared inner-page layout
   Every page follows the home page pattern: a .hero at the top,
   <hr> between sections, and .page-section blocks on the same gutter.
   ========================================= */

/* Hero without an image — keeps the text column from stretching full width */
.hero-text-only .hero-content {
    max-width: 720px;
}

.page-section {
    width: 100%;
    padding: 1.5rem var(--section-gutter) 3rem;
    box-sizing: border-box;
}

/* .section-title already carries the gutter on the home page; inside a
   .page-section the section itself provides it */
.page-section .section-title {
    padding-left: 0;
    margin: 0 0 1.5rem;
    font-weight: 400;
    line-height: 1.3;
}

.section-intro {
    max-width: 720px;
    margin: -0.75rem 0 2rem;
    color: var(--color-text);
    line-height: 1.6;
}

/* centred hero, text and buttons in the middle with any image stacked under it */
.hero.hero-centered {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 32px;
    padding-top: 56px;
    padding-bottom: 56px;
}

.hero.hero-centered .hero-content {
    flex: 0 1 auto;
    max-width: 760px;
}

.hero-centered .hero-content p {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    color: var(--color-text);
    line-height: 1.6;
}

.hero-centered .btn-group {
    justify-content: center;
    flex-wrap: wrap;
}

.hero.hero-centered .hero-image {
    flex: 0 1 auto;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
}

.hero-centered .services-wheel-wrap {
    margin: 0 auto;
}

/* home keeps its logo small and above the text */
.hero-home .hero-content {
    order: 1;
}

.hero-home .hero-content p {
    margin-bottom: 0;
}

.hero.hero-home .hero-image {
    max-width: 420px;
}

/* cym hero: video on the left, intro in the middle, photos on the right, each panel holds a stat card in a notch */
.hero.cym-hero {
    display: block;
    padding-top: 48px;
    padding-bottom: 56px;
}

.cym-hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr) minmax(0, 1fr);
    align-items: center;
    gap: 40px;
    max-width: 1240px;
    margin: 0 auto;
}

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

.cym-hero-text h1 {
    margin: 0 0 1rem;
}

.cym-hero-text p {
    margin: 0 0 1.5rem;
    color: var(--color-text);
    line-height: 1.6;
}

/* every card size below is a share of the panel, so the notches in the svg clip paths stay lined up */
.cym-hero-panel {
    position: relative;
    height: clamp(380px, 31vw, 440px);
}

.cym-hero-frame {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background-color: var(--color-navy);
}

.cym-hero-video {
    clip-path: url(#cymShapeVideo);
}

.cym-hero-photos {
    clip-path: url(#cymShapePhotos);
}

.cym-hero-video video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* the whole video is the button, with a round play icon in the open part above the notch */
.cym-video-play {
    position: absolute;
    inset: 0 0 30% 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.cym-video-play::before {
    content: "";
    position: absolute;
    inset: 0 0 -50% 0;
    background: rgba(4, 17, 59, 0.2);
}

.cym-video-play-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: rgba(4, 17, 59, 0.55);
    color: #ffffff;
    font-size: 32px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.cym-video-play:hover .cym-video-play-icon,
.cym-video-play:focus-visible .cym-video-play-icon {
    background: var(--color-primary);
    transform: scale(1.08);
}

.cym-video-play:focus-visible {
    outline: none;
}

.cym-video-play:focus-visible .cym-video-play-icon {
    outline: 3px solid var(--color-accent);
    outline-offset: 3px;
}

/* carousel fills the panel instead of keeping its usual 4:3 shape */
.cym-hero-photos .photo-carousel,
.cym-hero-photos .carousel-inner,
.cym-hero-photos .carousel-item {
    height: 100%;
    border-radius: 0;
    box-shadow: none;
}

.cym-hero-photos .photo-carousel .carousel-item img {
    height: 100%;
    aspect-ratio: auto;
}

/* stat cards sitting in the notches */
.cym-hero-stat {
    position: absolute;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: calc(50% - 12px);
    height: calc(30% - 12px);
    padding: 14px 18px;
    box-sizing: border-box;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background-color: #ffffff;
    box-shadow: 0 12px 30px rgba(4, 17, 59, 0.1);
    text-align: left;
}

.cym-hero-panel-video .cym-hero-stat {
    right: 0;
    bottom: 0;
}

.cym-hero-panel-photos .cym-hero-stat {
    top: 0;
    left: 0;
}

.cym-hero-stat-number {
    color: var(--color-navy);
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.1;
}

.cym-hero-stat-label {
    color: var(--color-muted);
    font-size: 13px;
    line-height: 1.35;
}

/* programme names as pills above the button */
.cym-hero-programmes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0 0 1.75rem;
    padding: 0;
    list-style: none;
}

.cym-hero-programmes li {
    padding: 6px 14px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background-color: var(--color-surface);
    color: var(--color-navy);
    font-size: 13px;
    font-weight: 500;
}

.cym-hero-shapes {
    position: absolute;
}

/* full video popup */
.cym-video-modal {
    width: min(1100px, 92vw);
    max-width: none;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: #000000;
    overflow: visible;
}

.cym-video-modal::backdrop {
    background: rgba(4, 17, 59, 0.85);
}

.cym-video-modal video {
    display: block;
    width: 100%;
    max-height: 85vh;
    border-radius: 12px;
    background: #000000;
}

.cym-video-close {
    position: absolute;
    top: -48px;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
}

.cym-video-close:hover,
.cym-video-close:focus-visible {
    background: rgba(255, 255, 255, 0.3);
}

@media (prefers-reduced-motion: reduce) {
    .cym-video-play-icon {
        transition: none;
    }
}

/* smaller laptops: tighter gaps so the middle column keeps room for the heading */
@media (max-width: 1199px) {
    .cym-hero-layout {
        gap: 28px;
    }

    .cym-hero-stat {
        padding: 12px 14px;
    }

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

    .cym-hero-stat-label {
        font-size: 12px;
    }
}

/* tablets: intro on top, video and photos side by side under it */
@media (max-width: 991px) {
    .cym-hero-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }

    .cym-hero-text {
        grid-column: 1 / -1;
        order: -1;
        max-width: 640px;
        margin: 0 auto 12px;
    }

    .cym-hero-panel {
        height: 400px;
    }
}

/* phones: everything stacked */
@media (max-width: 575px) {
    .cym-hero-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .cym-hero-panel {
        height: 360px;
    }
}

/* centred section titles with a short accent line */
.section-centered .section-title,
.section-title.section-centered,
.section-centered .gallery-heading h2 {
    text-align: center;
    padding-left: 0;
    font-size: 22px;
    font-weight: 500;
}

.section-centered .section-title::after,
.section-title.section-centered::after,
.section-centered .gallery-heading h2::after {
    content: "";
    display: block;
    width: 40px;
    height: 3px;
    margin: 10px auto 0;
    border-radius: 2px;
    background-color: var(--color-accent);
}

.section-centered .section-intro {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.section-centered .gallery-heading {
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 30px;
}

/* card grids under a centred title keep their cards in the middle when there are only one or two */
@media (min-width: 992px) {
    .section-centered .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 360px));
        justify-content: center;
    }
}

/* privacy text sits in the middle under its title */
.section-centered .privacy-page-content {
    margin-left: auto;
    margin-right: auto;
}

/* Shared inner-page layout end */

/* Partners Page — card-grid version (kept for reference / unused now that
   the list layout below is in use; harmless to leave in place) */
.partners-grid {
    max-width: 1300px;
    margin: 0 auto;
}

.partners-grid .card {
    max-width: 300px;
}

.partner-card-logo {
    background-color: white;
    border-radius: 6px;
    padding: 10px;
    max-height: 80px;
    width: 100%;
    object-fit: contain;
    margin-bottom: 1rem;
}

/* Partners Page — hero logo cluster */
/* Tiles drift gently at staggered timings so the cluster feels alive without pulling focus from the heading */
.partners-hero-logos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 460px;
    padding: 12px;
}

.partners-hero-tile {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18%;
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(4, 17, 59, 0.08);
    animation: partners-tile-float 6s ease-in-out infinite;
    animation-delay: calc(var(--i) * -1.1s);
}

/* Offsets the middle column so the grid reads as a cluster rather than a table */
.partners-hero-tile:nth-child(3n + 2) {
    transform: translateY(28px);
    animation-name: partners-tile-float-offset;
}

.partners-hero-logos.is-two-col {
    grid-template-columns: repeat(2, 1fr);
    max-width: 360px;
}

.partners-hero-logos.is-two-col .partners-hero-tile:nth-child(3n + 2) {
    transform: none;
    animation-name: partners-tile-float;
}

.partners-hero-logos.is-two-col .partners-hero-tile:nth-child(even) {
    transform: translateY(28px);
    animation-name: partners-tile-float-offset;
}

.partners-hero-tile img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

@keyframes partners-tile-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}

@keyframes partners-tile-float-offset {
    0%, 100% { transform: translateY(28px); }
    50%      { transform: translateY(20px); }
}

@media (prefers-reduced-motion: reduce) {
    .partners-hero-tile {
        animation: none;
    }
}

@media (max-width: 991px) {
    .partners-hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 40px;
    }

    .partners-hero .hero-image {
        max-width: 100%;
        margin-left: 0;
    }

    .partners-hero-logos {
        width: 100%;
        max-width: 420px;
    }
}

@media (max-width: 575px) {
    .partners-hero-logos,
    .partners-hero-logos.is-two-col {
        gap: 12px;
        max-width: 260px;
        padding: 0 0 20px;
    }

    .partners-hero-tile {
        border-radius: 12px;
    }

    .partners-hero-tile:nth-child(3n + 2),
    .partners-hero-logos.is-two-col .partners-hero-tile:nth-child(even) {
        transform: translateY(16px);
        animation-name: partners-tile-float;
    }
}

/* Partners Page — cards */
.partners-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 320px));
    justify-content: center;
    gap: 24px;
}

.partner-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.partner-card:hover,
.partner-card:focus-within {
    transform: translateY(-4px);
    border-color: transparent;
    box-shadow: 0 16px 36px rgba(4, 17, 59, 0.12);
}

/* Accent bar that grows across the top on hover */
.partner-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--color-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
    z-index: 1;
}

.partner-card:hover::before,
.partner-card:focus-within::before {
    transform: scaleX(1);
}

.partner-card-media {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    /* white so logos supplied on a white background blend into the panel */
    background-color: #ffffff;
    border-bottom: 1px solid var(--color-border);
}

.partner-card-media img {
    max-width: 70%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.partner-card:hover .partner-card-media img {
    transform: scale(1.05);
}

.partner-card-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 22px 24px 24px;
}

.partner-name {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-navy);
}

.partner-description {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-muted);
}

/* margin-top: auto keeps the link on the card's bottom edge whatever the description length */
.partner-link {
    margin-top: auto;
    padding-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-primary);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(15, 60, 122, 0.3);
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    transition: color 0.2s ease, text-decoration-color 0.2s ease, text-underline-offset 0.2s ease;
}

/* Stretches the link's click area over the whole card */
.partner-link::after {
    content: "";
    position: absolute;
    inset: 0;
}

.partner-link:focus-visible {
    outline: none;
}

.partner-card:has(.partner-link:focus-visible) {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
}

.partner-card:hover .partner-link,
.partner-card:focus-within .partner-link {
    color: var(--color-accent);
    text-decoration-color: currentColor;
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
}

@media (max-width: 575px) {
    .partners-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .partner-card-media {
        height: 130px;
        padding: 24px;
    }

    .partner-card-body {
        padding: 18px 20px 20px;
    }
}

/* Gallery & Events page */

.gallery-section {
    width: 100%;
    padding: 1.5rem var(--section-gutter) 3rem;
    box-sizing: border-box;
}

.gallery-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 30px;
}

.gallery-heading h2 {
    margin: 0 0 8px;
    color: var(--color-primary);
    font-size: 20px;
    font-weight: 400;
}

.gallery-heading p {
    margin: 0;
    color: var(--color-text);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.event-card {
    min-width: 0;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background-color: #fff;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.event-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.11);
}

.event-card-button {
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.event-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background-color: #E9ECEF;
}

.event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.event-card:hover .event-image img {
    transform: scale(1.04);
}

.event-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 18px;
}

.event-content h3 {
    margin: 0 0 8px;
    color: var(--color-primary);
    font-size: 18px;
    line-height: 1.25;
}

.event-content p {
    margin-bottom: 12px;
}

.event-content p:last-of-type {
    margin-bottom: 14px;
}

.event-content .event-date {
    margin-bottom: 6px;
    color: var(--color-accent);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.event-content .event-description {
    color: var(--color-text);
    font-size: 14px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gallery-empty {
    margin: 0;
    padding: 32px;
    border: 1px dashed var(--color-border);
    border-radius: 8px;
    background-color: var(--color-surface);
    color: var(--color-text);
    text-align: center;
}

.event-card-link {
    margin-top: auto;
    color: var(--color-accent);
    font-weight: 600;
}

.event-card-button:focus-visible {
    outline: 3px solid rgba(3, 137, 225, 0.35);
    outline-offset: -3px;
}

.gallery-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 32px;
}

.gallery-pagination .btn {
    min-width: 42px;
    text-align: center;
}

.gallery-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1050;
    padding: 24px;
    align-items: center;
    justify-content: center;
    background-color: rgba(4, 17, 59, 0.75);
}

.gallery-modal-dialog {
    position: relative;
    width: min(850px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
}

/* Photo viewer: the whole photo is shown (no cropping); a blurred copy of it fills the space around it. */
.gallery-modal-media {
    position: relative;
    background-color: #04113B;
}

.gallery-viewer {
    position: relative;
    height: min(62vh, 520px);
    overflow: hidden;
    cursor: zoom-in;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.gallery-viewer.is-zoomed {
    cursor: grab;
}

.gallery-viewer.is-zoomed:active {
    cursor: grabbing;
}

.gallery-viewer-backdrop {
    position: absolute;
    inset: -40px;
    background-position: center;
    background-size: cover;
    filter: blur(28px) brightness(0.6);
    transform: scale(1.1);
}

.gallery-modal-image {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform-origin: center;
    will-change: transform;
    -webkit-user-drag: none;
}

.gallery-modal-image.is-animating {
    transition: transform 0.25s ease;
}

/*
 * Previous / next arrows over the photo: light, see-through circles.
 * With a mouse they stay hidden until the cursor nears that edge
 * (.near-prev / .near-next, set in components/eventModal.php).
 * On touch screens, which have no hover, they stay faintly visible.
 */
.gallery-viewer-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 20px;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0.6;
    transform: translateY(-50%);
    transition: opacity 0.2s ease, background-color 0.15s ease;
}

.gallery-viewer-nav:hover {
    background-color: rgba(255, 255, 255, 0.32);
}

@media (hover: hover) and (pointer: fine) {
    .gallery-viewer-nav {
        opacity: 0;
    }

    .gallery-modal-media.near-prev .gallery-viewer-prev,
    .gallery-modal-media.near-next .gallery-viewer-next,
    .gallery-viewer-nav:focus-visible {
        opacity: 1;
    }
}

.gallery-viewer-nav[hidden] {
    display: none;
}

.gallery-viewer-prev {
    left: 14px;
}

.gallery-viewer-next {
    right: 14px;
}

/* Photo counter in the bottom corner of the photo. */
.gallery-viewer-counter {
    position: absolute;
    left: 14px;
    bottom: 14px;
    z-index: 2;
    padding: 4px 12px;
    border-radius: 999px;
    background-color: rgba(4, 17, 59, 0.75);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.gallery-viewer-nav:focus-visible {
    outline: 3px solid #0389E1;
    outline-offset: 2px;
}

/* "5 photos" label on event cards with more than one photo. */
.event-image {
    position: relative;
}

.event-photo-count {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background-color: rgba(4, 17, 59, 0.8);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.gallery-modal-body {
    padding: 28px 30px 32px;
}

.gallery-modal-body h2 {
    margin: 0 0 10px;
    color: var(--color-primary);
    font-size: 30px;
}

.gallery-modal-body p:last-child {
    margin-bottom: 0;
}

.gallery-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    border: 5px solid #04113B;
    /* Sits on the dark photo area, so it gets a light backing. */
    background-color: #fff;
}

body.gallery-modal-open {
    overflow: hidden;
}

@media (max-width: 991px) {
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .gallery-heading {
        align-items: flex-start;
        flex-direction: column;
    }

}

@media (max-width: 575px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-modal {
        padding: 12px;
    }

    .gallery-modal-body {
        padding: 22px;
    }

    .gallery-modal-body h2 {
        font-size: 24px;
    }

    .gallery-viewer {
        height: 52vh;
    }

    .gallery-viewer-nav {
        width: 38px;
        height: 38px;
        font-size: 17px;
    }

    .gallery-viewer-prev {
        left: 8px;
    }

    .gallery-viewer-next {
        right: 8px;
    }
}

/* Gallery & Events page styles end */

/* Keyboard focus ring goes around the whole card, since the button covers all of it. */

/* Fills the card so the progress block lines up along the bottom of every card in a row. */

/* Long descriptions are cut at three lines on the card; the full text is in the details modal. */

/* Image beside the details on wider screens, stacked on phones. */

/* Preset amounts as a row of selectable tiles. */

/* Sits on its own line under the buttons. */

.modal-footer {
    gap: 15px;
}

.modal {
    max-height: (100vh - 2rem);
    overflow-y: auto;
}


/* =========================================
   Contact Us & About Us pages
   ========================================= */

/* =========================================
   Contact Us Page Styles
   ========================================= */

.contact-page p,
.contact-page label,
.contact-page input,
.contact-page select,
.contact-page textarea,
.contact-page button {
    font-size: 16px;
}

/* Quick-contact buttons under the hero text; they wrap onto new lines on narrow screens. */
.contact-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.contact-quick-actions .bi {
    margin-right: 6px;
}

/* =========================================
   Contact Details and Form Layout
   ========================================= */

/* Details stacked above the form on smaller screens, side by side on wide ones. */
.contact-layout {
    display: grid;
    gap: 3rem;
}

/* Stacked: the details share the form's 720px column so their edges line up. */
.contact-details {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
}

@media (min-width: 1200px) {
    .contact-layout {
        grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
        gap: 4rem;
        align-items: start;
    }

    .contact-details {
        max-width: none;
    }
}

.contact-details .section-title {
    margin-bottom: 1rem;
}

/* Phone, email and address rows. */
.contact-detail-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--color-border);
}

.contact-detail {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--color-border);
}

.contact-detail > div {
    min-width: 0;
}

.contact-detail-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: var(--color-surface);
    color: var(--color-primary);
    font-size: 1.15rem;
}

.contact-page .contact-detail-label {
    margin: 0 0 2px;
    color: var(--color-navy);
    font-size: 14px;
    font-weight: 600;
}

.contact-page .contact-detail-value {
    display: inline-block;
    margin: 0;
    color: var(--color-text);
    font-weight: 500;
    overflow-wrap: anywhere;
}

a.contact-detail-value {
    color: var(--color-primary);
    text-decoration: underline;
    text-decoration-color: var(--color-accent);
    text-underline-offset: 3px;
}

a.contact-detail-value:hover {
    color: var(--color-accent);
}

.contact-page .contact-detail-note {
    margin: 2px 0 0;
    color: var(--color-muted);
    font-size: 14px;
}

/* Office map: a placeholder button until the visitor chooses to load Google Maps. */
.contact-map {
    margin-top: 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
}

.contact-map-frame {
    aspect-ratio: 16 / 9;
    background-color: var(--color-surface);
}

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

.contact-map-load {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
    color: var(--color-primary);
    font-weight: 600;
    cursor: pointer;
}

.contact-map-load .bi {
    font-size: 1.75rem;
}

.contact-map-load small {
    color: var(--color-muted);
    font-size: 13px;
    font-weight: 400;
}

.contact-map-load:hover {
    background-color: var(--color-border);
}

.contact-map-load:focus-visible,
.contact-map-link:focus-visible {
    outline: 3px solid rgba(3, 137, 225, 0.4);
    outline-offset: -3px;
}

.contact-map-link {
    display: block;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--color-border);
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(15, 60, 122, 0.3);
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    transition: color 0.2s ease, text-decoration-color 0.2s ease, text-underline-offset 0.2s ease;
}

.contact-map-link:hover {
    color: var(--color-accent);
    text-decoration-color: currentColor;
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
}

/* Social links under the map. */
.contact-social {
    margin-top: 1.5rem;
}

.contact-social .social-links {
    margin-top: 0.75rem;
}

/* Booking form card: the same white panel, border and soft shadow as the partner cards,
   so the form stands out from the contact details beside it. */
.contact-layout > .contact-form-section {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem;
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(4, 17, 59, 0.08);
}

@media (min-width: 1200px) {
    .contact-layout > .contact-form-section {
        max-width: none;
        padding: 2.5rem;
    }
}

@media (max-width: 575px) {
    .contact-layout > .contact-form-section {
        padding: 1.25rem;
    }
}

/* The card now sets the width, so the heading and form fill it. */
.contact-layout .contact-form-section .section-title,
.contact-layout .contact-form-wrap {
    max-width: none;
}

.contact-layout .contact-form-section .section-title {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

/* Leaves a little space above the form heading when the hero button jumps to it. */
#enquiry-form {
    scroll-margin-top: 24px;
}

/* =========================================
   Contact Enquiry Form
   ========================================= */

/* Name, phone, email and organisation: two per row when the form column has room, otherwise one. */
.contact-form-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    column-gap: 1.5rem;
}

.contact-form-fields > div {
    min-width: 0;
}
/*Keeps the form a readable width, aligned with the section heading.*/
/* Heading and form share one centred column, so the heading lines up with the labels */
.contact-form-section .section-title {
    max-width: 720px;
    margin: 0 auto 1.5rem;
}

.contact-form-wrap {
    max-width: 720px;
    margin: 0 auto;
}

/*Form labels.*/
.contact-form-section .form-label {
    color: var(--color-navy);
    font-weight: 500;
}

/*Text inputs and dropdowns.*/
.contact-form-section .form-control,
.contact-form-section .form-select {
    background-color: #ffffff;
    color: #212529;
    border: 1px solid #ced4da;
}

/*Placeholder text.*/
.contact-form-section .form-control::placeholder {
    color: #6c757d;
    opacity: 1;
}

/*Custom focus effect for text inputs,textarea and dropdowns.*/
.contact-form-section .form-control:focus,
.contact-form-section .form-select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 0.2rem rgba(3, 137, 225, 0.2);
}

/* Meeting type radios shown as toggle buttons, matching the About page value buttons */
.meeting-type-options {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* Hidden visually but still focusable and validated by the browser */
.meeting-type-input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.meeting-type-button {
    padding: 8px 20px;
    border: 2px solid var(--color-primary);
    border-radius: 6px;
    background-color: #ffffff;
    color: var(--color-primary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.meeting-type-button:hover,
.meeting-type-input:checked + .meeting-type-button {
    background-color: var(--color-primary);
    color: #ffffff;
}

.meeting-type-input:focus-visible + .meeting-type-button {
    outline: 3px solid rgba(3, 137, 225, 0.4);
    outline-offset: 2px;
}

/*Allows the enquiry textarea to resize vertically.*/
.contact-form-section textarea {
    resize: vertical;
}

/* Spam-trap field: moved off screen rather than display:none, which some bots skip. */
.contact-trap {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* =========================================
   Contact Privacy Consent and Modal
   ========================================= */

/* Aligns the mandatory checkbox with the consent wording. */
.contact-consent {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.5rem;
    /* Bootstrap's .form-check offsets the checkbox with padding; the flex gap spaces it instead. */
    padding-left: 0;
}

/* The wording takes the rest of the row beside the checkbox instead of dropping below it. */
.contact-consent .consent-copy {
    flex: 1 1 0;
    min-width: 0;
}

/* The consent error sits on its own line under the checkbox and wording. */
.contact-consent .invalid-feedback {
    flex-basis: 100%;
    margin-top: 0;
}

/* Keeps the checkbox aligned with the first line of text. */
.contact-consent .form-check-input {
    flex: 0 0 auto;
    float: none;
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.15rem;
    margin-left: 0;
    border: 2px solid #0F3C7A;
    background-color: #fff;
    cursor: pointer;
}

/* Fills the checkbox in the brand blue once ticked. */
.contact-consent .form-check-input:checked {
    background-color: #0F3C7A;
    border-color: #0F3C7A;
}

/* Keeps the checkbox clearly visible in red when consent is missing. */
.contact-consent .form-check-input.is-invalid {
    border-color: #dc3545;
}

/* Styles the privacy trigger as an inline accessible link. */
.privacy-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: #0F3C7A;
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

/* Provides a visible keyboard focus state for the privacy link. */
.privacy-link:focus-visible {
    outline: 2px solid #0389E1;
    outline-offset: 3px;
}

/* Prevents the page behind the modal from scrolling. */
.contact-modal-open {
    overflow: hidden;
}

/* Covers the page with the hidden modal layer. */
.contact-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: rgba(4, 17, 59, 0.72);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Displays the modal layer after the privacy link is clicked. */
.contact-modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* Creates the white, scrollable privacy notice panel. */
.contact-modal-box {
    position: relative;
    width: min(100%, 700px);
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    background-color: #ffffff;
    color: var(--color-text);
    border-radius: 8px;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.25);
    transform: translateY(-1rem);
    transition: transform 0.2s ease;
}

/* Moves the panel into position when it becomes visible. */
.contact-modal-overlay.is-visible .contact-modal-box {
    transform: translateY(0);
}

/* Positions and styles the modal close button. */
.contact-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: #04113B;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
}

/* Adds a clear focus state to the modal close button. */
.contact-modal-close:focus-visible {
    outline: 2px solid #0389E1;
    outline-offset: 3px;
}

/* Styles the privacy modal heading. */
.contact-modal-box h2 {
    margin: 0 2rem 1.25rem 0;
    color: var(--color-primary);
    font-size: 1.5rem;
}

/* Improves readability of the privacy notice. */
.privacy-modal-content {
    color: var(--color-text);
    line-height: 1.6;
}

/* Adds consistent spacing between notice paragraphs. */
.privacy-modal-content p {
    margin-bottom: 1rem;
}

/* Privacy Policy page: same notice as the modal, at a comfortable reading width. */
.privacy-page-content {
    max-width: 760px;
    color: var(--color-text);
    line-height: 1.7;
}

.privacy-page-content p {
    margin-bottom: 1rem;
}

/* Aligns the modal action button to the right. */
.contact-modal-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Makes the modal comfortable to use on narrow screens. */
@media (max-width: 575px) {
    .contact-modal-box {
        padding: 1.5rem;
    }

    .contact-modal-box h2 {
        font-size: 1.25rem;
    }
}

/* Removes modal movement for visitors who prefer reduced motion. */
@media (prefers-reduced-motion: reduce) {
    .contact-modal-overlay,
    .contact-modal-box {
        transition: none;
    }
}

/* =========================================
   Connect With Us Section
   ========================================= */

/*Keeps the social media icons aligned and responsive.*/
.social-links {
    flex-wrap: wrap;
}

/* =========================================
   Social Media Icons
   ========================================= */
/*Base style for all social media buttons.*/
.social-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 3.25rem;
    height: 3.25rem;

    border-radius: 50%;

    color: #ffffff;
    text-decoration: none;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

/*All platforms share the site colours so the icons sit with the rest of the page.*/
.social-icon-link {
    background-color: var(--color-primary);
}

/*Icon size.*/
.social-icon-link i {
    font-size: 1.5rem;
    line-height: 1;
}

/*Hover effect.*/
.social-icon-link:hover,
.social-icon-link:focus-visible {
    color: #ffffff;
    background-color: var(--color-accent);

    transform: translateY(-3px);

    box-shadow:
        0 0.4rem 0.8rem rgba(4, 17, 59, 0.2);
}

/*Removes the default focus outline.*/
.social-icon-link:focus {
    outline: none;
}

/*Keyboard focus indicator.*/
.social-icon-link:focus-visible {
    outline: 3px solid #04113B;
    outline-offset: 3px;
}

/*Accessibility - Reduced Motion*/

@media (prefers-reduced-motion: reduce) {

    .social-icon-link {
        transition: none;
    }

    .social-icon-link:hover,
    .social-icon-link:focus-visible {
        transform: none;
    }
}

/*Mobile Social Media Icons*/

@media (max-width: 575px) {

    .social-icon-link {
        width: 3rem;
        height: 3rem;
    }

    .social-icon-link i {
        font-size: 1.35rem;
    }
}

/* =========================================
   About Us Page Styles
   ========================================= */

.about-page p {
    line-height: 1.6;
}

/* Story / Mission / Vision tabs on the left, company image on the right */
.about-history-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 48px;
    align-items: center;
}

.about-value-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Outlined buttons that fill navy when selected */
.about-value-button {
    padding: 8px 20px;
    border: 2px solid var(--color-primary);
    border-radius: 6px;
    background-color: #ffffff;
    color: var(--color-primary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.about-value-button:hover,
.about-value-button:focus-visible,
.about-value-button.is-active {
    background-color: var(--color-primary);
    color: #ffffff;
}

/* Light panel with a blue edge; min-height stops the image
   jumping when a shorter value is selected */
.about-value-description {
    min-height: 13rem;
    margin-top: 1.25rem;
    padding: 1.25rem 1.5rem;
    border-left: 4px solid var(--color-accent);
    border-radius: 0 8px 8px 0;
    background-color: var(--color-surface);
    color: var(--color-text);
    font-size: 15px;
}

.about-value-description-title {
    margin-bottom: 0.35rem;
    color: var(--color-primary);
    font-weight: 700;
}

.about-value-description p:last-child {
    margin-bottom: 0;
}

.about-history-image-wrap {
    border-radius: 8px;
    overflow: hidden;
}

/* Shown at its natural height so nobody in the group photo is cropped */
.about-history-image {
    display: block;
    width: 100%;
    height: auto;
}

/* =========================================
   Meet Our Team
   Same card treatment as the event cards.
   ========================================= */
/* Fixed-width cards keep them slim; the row is centred in the column */
.team-grid {
    display: grid;
    grid-template-columns: repeat(3, 260px);
    justify-content: center;
    gap: 56px 80px;
}

.team-member-card {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background-color: #fff;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.team-member-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.11);
}

/* Shown at their natural height so portraits are never cropped */
.team-member-image {
    display: block;
    width: 100%;
    height: auto;
    background-color: #E9ECEF;
}

.team-member-body {
    padding: 14px 16px 16px;
}

.team-member-card h3 {
    margin: 0 0 4px;
    color: var(--color-primary);
    font-size: 16px;
    line-height: 1.25;
}

.team-member-role {
    margin: 0;
    color: var(--color-accent);
    font-size: 13px;
    font-weight: 500;
}

.team-member-bio {
    margin: 8px 0 0;
    color: var(--color-muted);
    font-size: 13px;
    line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
    .team-member-card {
        transition: none;
    }

    .team-member-card:hover {
        transform: none;
    }
}

/* Tablets and phones */
@media (max-width: 991px) {
    .about-history-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .about-value-description {
        min-height: 0;
    }

    .team-grid {
        grid-template-columns: repeat(2, 260px);
    }
}

/* Two 260px cards no longer fit below 768px, so stack them */
@media (max-width: 767px) {
    .team-grid {
        grid-template-columns: minmax(0, 300px);
        gap: 32px;
    }
}

/* Contact Us & About Us pages styles end */

/* =========================================
   Cyber Young Minds page
   ========================================= */

/* Uses the site navbar, font, hero and section layout; only the pieces unique to CYM are styled here. */

/* Hero photo carousel (CYM and Gallery & Events pages): every photo is cropped to the same shape so the hero does not jump between slides */
.photo-carousel {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(4, 17, 59, 0.18);
}

.photo-carousel .carousel-item img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.photo-carousel .carousel-indicators [data-bs-target] {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
}

/* Scrolling programme ribbon: one item per programme, fading out at both edges */
.banner {
    overflow: hidden;
    background: linear-gradient(90deg, var(--color-navy), var(--color-primary) 50%, var(--color-navy));
    color: #ffffff;
    white-space: nowrap;
    position: relative;
}

/* Items fade into the navy at both edges as they scroll in and out */
.banner::before,
.banner::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 10%;
    z-index: 1;
    pointer-events: none;
}

.banner::before {
    left: 0;
    background: linear-gradient(90deg, var(--color-navy), transparent);
}

.banner::after {
    right: 0;
    background: linear-gradient(270deg, var(--color-navy), transparent);
}

.banner-track {
    display: flex;
    align-items: center;
    width: max-content;
    min-width: 100%;
    padding: 0.55rem 0;
    will-change: transform;
    animation: banner-scroll 40s linear infinite;
}

.banner-group {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.banner-item {
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Small blue diamond between programmes */
.banner-item::after {
    content: "";
    width: 5px;
    height: 5px;
    margin: 0 1.5rem;
    background-color: var(--color-accent);
    transform: rotate(45deg);
}

/* Pause so visitors can read it */
.banner:hover .banner-track {
    animation-play-state: paused;
}

@keyframes banner-scroll {
    from {
        transform: translate3d(0, 0, 0);
    }
    to {
        transform: translate3d(-50%, 0, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .banner-track {
        animation-duration: 60s;
    }
}

/* About the programme: text on the left, stats on the right */
.cym-about {
    padding-top: 3rem;
}

.cym-about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr);
    gap: 64px;
    align-items: start;
}

.cym-about-text h3 {
    margin: 0 0 1.25rem;
}

.cym-about-text p {
    max-width: 620px;
    color: var(--color-text);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* Same light panel with a blue edge as the About page values */
.cym-about-text .cym-lead {
    padding: 1.25rem 1.5rem;
    border-left: 4px solid var(--color-accent);
    border-radius: 0 8px 8px 0;
    background-color: var(--color-surface);
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.55;
    color: var(--color-navy);
}

.cym-stats {
    margin: 0;
    padding: 8px 28px;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--color-primary), var(--color-navy));
    color: #ffffff;
}

.cym-stat {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 18px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.cym-stat:last-child {
    border-bottom: none;
}

.cym-stat-label {
    font-weight: 400;
    text-align: right;
    color: rgba(255, 255, 255, 0.8);
}

.cym-stat-number {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
    color: #ffffff;
}

/* Registration: text beside the programme site card */
.cym-join-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr);
    gap: 64px;
    align-items: center;
}

.cym-join-card {
    padding: 32px;
    border-radius: 12px;
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-top: 4px solid var(--color-accent);
    box-shadow: 0 10px 30px rgba(4, 17, 59, 0.06);
}

.cym-section-heading {
    font-size: clamp(1.4rem, 2.4vw, 1.9rem);
    font-weight: 700;
    color: var(--color-navy);
}

.cym-site-name {
    margin: 0 0 12px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-accent);
}

.cym-join-card h6 {
    margin: 0 0 8px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-muted);
}

.cym-site-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cym-site-list li {
    padding: 10px 0;
    border-bottom: 1px dashed var(--color-border);
    color: var(--color-navy);
}

.cym-site-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.cym-join-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

/* Register: the page's main action, so it is larger and in the accent blue */
.btn.cym-register-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 30px;
    background-color: var(--color-accent);
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(3, 137, 225, 0.3);
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.btn.cym-register-cta:hover,
.btn.cym-register-cta:focus-visible {
    background-color: var(--color-primary);
    box-shadow: 0 10px 24px rgba(15, 60, 122, 0.35);
    transform: translateY(-2px);
}

/* Carousel: grab cursor shows the photos can be dragged */
.photo-carousel .carousel-inner {
    cursor: grab;
    user-select: none;
}

.photo-carousel .carousel-inner:active {
    cursor: grabbing;
}

@media (max-width: 991px) {
    .cym-about-grid,
    .cym-join-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

@media (max-width: 575px) {
    .cym-stats {
        padding: 4px 20px;
    }

    .cym-stat-number {
        font-size: 1.8rem;
    }

    .cym-join-card {
        padding: 24px 20px;
    }

    .cym-about-text .cym-lead {
        font-size: 1.05rem;
    }
}

/*Registration form*/
.cym-register {
    padding: 2rem;
    border-radius: 20px;
    width: 100%;
    box-sizing: border-box;
}
.cym-register h2 { 
    color: rgb(3, 19, 60); 
    font-size: 1.6rem; 
    margin-bottom: 0.3rem; 
}
.cym-register .subtitle { 
    color: rgb(3, 19, 60); 
    font-size: 0.85rem; 
    margin-bottom: 1.8rem; 
}
.cym-register label { 
    display: block; 
    font-weight: 600; 
    font-size: 0.82rem; 
    color:rgb(3, 19, 60); 
    margin-bottom: 5px; 
    margin-top: 1rem; 
}
.cym-register input { 
    width: 100%; 
    box-sizing: border-box;
    padding: 11px 14px; 
    border: 1.5px solid white; 
    border-radius: 10px; 
    font-family: inherit; 
    font-size: 0.9rem; 
    background:White; 
    color:rgb(3, 19, 60);
    outline: grey; 
    transition: 0.2s; 
}

.cym-register .form-field.is-missing input {
    border-color: #C0392B;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.15);
}

.cym-register .form-field.is-missing .field-note {
    color: #C0392B;
    font-weight: 700;
}

.cym-register .form-message {
    margin-bottom: 16px;
    padding: 10px 14px;
    border-left: 4px solid #C0392B;
    border-radius: 6px;
    background: rgba(192, 57, 43, 0.08);
    color: #C0392B;
    font-size: 0.95rem;
}

.cym-register input:focus{
    background: white;
    color: rgb(3, 19, 60);
    border-color: #0389E1;
    box-shadow: 0 0 0 3px rgba(3, 137, 225, 0.2);
}

.cym-register input::placeholder{
    color: rgb(3, 19, 60);
    opacity: 0.4;
}

.cym-register input:focus::placeholder{
    color: rgb(3, 19, 60);
    opacity: 0.4;
}

.cym-register select{
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    border: 1.5px solid white;
    border-radius: 10px;
    font: inherit;
    background: white;
}

.form-row{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-field{
    min-width: 0;
}

.guardian-fields{
    display: grid;
    gap: 0.25rem;
    margin-top: 0.75rem;
}

.cym-register .consent{
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin: 1rem 0 0;
    line-height: 1.4;
}

.cym-register .consent input[type="checkbox"]{
    width: auto;
    flex: 0 0 auto;
    margin-top: 0.2rem;
}

.guardian-fields[hidden]{
    display: none;
}

@media screen and (max-width: 560px){
    .form-row{
        grid-template-columns: 1fr;
    }
}
 
/* Registration modal styles */
.modal-overlay{
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(3, 3, 42, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active{
    display: flex;
}

body.modal-open{
    overflow: hidden;
}

.modal-box{
    background: white;
    border-radius: 1rem;
    padding: 1rem;
    width: 90%;
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    color: rgb(3, 3, 42);
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

/* Privacy modal styles */
.privacy-modal-box,
.success-modal-box {
    max-width: 700px;
}

.privacy-content,
.success-content {
    color: rgb(3, 3, 42);
    line-height: 1.6;
    font-size: 0.95rem;
}

.privacy-content p,
.success-content p {
    margin: 0 0 0.9rem;
}

.privacy-modal-actions,
.success-modal-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.modal-close{
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: rgb(3, 3, 42);
}

.modal-box h3{
    margin-top: 0;
}

.modal-box form{
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.modal-box label{
    font-size: 0.85rem;
    font-weight: 600;
}

.modal-box input,
.modal-box select{
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    margin-bottom: 0.6rem;
}

.modal-box button[type="submit"]{
    border: none;
    cursor: pointer;
    margin-top: 0.5rem;
}

@media screen and (max-width: 560px){
    .modal-box{
        width: 94%;
        padding: 0.5rem;
    }

    .cym-register{
        padding: 1.5rem;
    }
}

/* Registration form spacing: one even gap between every row, the same as the guardian section. */
.cym-register form,
.cym-register .guardian-fields{
    gap: 1rem;
}

.cym-register .form-row{
    margin-bottom: 0;
    /* Inputs line up even when one label wraps onto two lines. */
    align-items: end;
}

.cym-register .form-field label{
    margin-top: 0;
}

.cym-register .form-field input,
.cym-register .form-field select{
    height: 2.75rem;
    margin-bottom: 0;
    padding: 0 12px;
    font-size: 0.95rem;
    border: 1px solid #ccc;
    border-radius: 8px;
}

.cym-register .guardian-fields h4{
    font-size: 1.05rem;
    margin: 0.5rem 0 0;
}

.cym-register .consent{
    margin-top: 0;
}

/* Cyber Young Minds page styles end */

/* Services page wheel styles start */
/* Every size below is derived from --wheel-size, so the whole wheel scales together on any screen. */
.services-wheel-wrap {
    --wheel-size: clamp(260px, 38vw, 480px);
    --bubble-size: calc(var(--wheel-size) * 0.25);
    --hub-size: calc(var(--wheel-size) * 0.28);
    --wheel-radius: calc(var(--wheel-size) / 2 - var(--bubble-size) / 2 - 4px);
    --wheel-speed: 30s;
    position: relative;
    flex: 0 0 auto;
    width: var(--wheel-size);
    aspect-ratio: 1 / 1;
    margin-left: auto;
}

.services-wheel {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    animation: wheel-spin var(--wheel-speed) linear infinite;
}

.wheel-item {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    transform: rotate(var(--angle)) translateY(calc(var(--wheel-radius) * -1)) rotate(calc(var(--angle) * -1));
}

/* Spins the opposite way so each label stays upright while the wheel turns */
.wheel-item-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--bubble-size);
    height: var(--bubble-size);
    margin: calc(var(--bubble-size) / -2) 0 0 calc(var(--bubble-size) / -2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: calc(var(--bubble-size) * 0.05);
    padding: calc(var(--bubble-size) * 0.1);
    text-align: center;
    border-radius: 50%;
    background-color: #ffffff;
    border: 2px solid var(--color-accent);
    box-shadow: 0 6px 18px rgba(4, 17, 59, 0.12);
    color: var(--color-primary);
    font-size: max(9px, calc(var(--bubble-size) * 0.1));
    font-weight: 600;
    line-height: 1.15;
    animation: wheel-spin var(--wheel-speed) linear infinite reverse;
}

.wheel-item-inner i {
    font-size: calc(var(--bubble-size) * 0.22);
    line-height: 1;
    color: var(--color-accent);
}

.wheel-hub {
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--hub-size);
    height: var(--hub-size);
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--color-navy);
    color: #ffffff;
    font-weight: 700;
    font-size: calc(var(--hub-size) * 0.12);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* logo fills the hub and is cropped to the circle */
.wheel-hub-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.wheel-hub small {
    color: var(--color-accent);
    font-size: calc(var(--hub-size) * 0.09);
}

@keyframes wheel-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Tablets and phones: stack the wheel under the hero text and centre it */
@media (max-width: 767px) {
    .hero-wheel {
        flex-wrap: wrap;
        gap: 32px;
    }

    .hero-wheel .hero-content {
        flex: 1 1 100%;
    }

    .services-wheel-wrap {
        --wheel-size: min(80vw, 400px);
        margin: 0 auto;
    }
}

/* Small phones: slightly larger bubbles relative to the wheel so labels stay readable */
@media (max-width: 400px) {
    .services-wheel-wrap {
        --wheel-size: calc(100vw - 48px);
        --bubble-size: calc(var(--wheel-size) * 0.28);
    }
}

@media (prefers-reduced-motion: reduce) {
    .services-wheel,
    .wheel-item-inner {
        animation-duration: 120s;
    }
}
/* Services page wheel styles end */

/* Services page bento hero */
.hero-services {
    align-items: center;
    gap: clamp(32px, 4vw, 64px);
    padding-top: clamp(80px, 7vw, 104px);
    padding-bottom: clamp(80px, 7vw, 104px);
}

.hero-services .hero-content {
    flex: 0 1 36%;
    width: auto;
    max-width: 440px;
    margin: 0;
    text-align: left;
}

.hero-services .hero-content > div:first-child {
    margin: 0;
}

.hero-services .btn-group {
    justify-content: flex-start;
    margin: 0;
}

.hero-services .service-bento {
    flex: 1 1 64%;
    width: auto;
    max-width: 760px;
    grid-template-columns: 1.15fr 1fr 1fr;
    grid-auto-rows: minmax(100px, auto);
    gap: 10px;
    padding: 0;
    margin: 0;
}

.hero-services .service-tile {
    min-height: 100px;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    background: linear-gradient(145deg, #0789df, #0f3c7a);
    box-shadow: 0 16px 36px rgba(4, 17, 59, 0.16);
    transition: transform 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.hero-services .service-tile:not(.is-featured) {
    background: linear-gradient(145deg, #0789df, #126fb3);
}

.hero-services .service-tile:hover,
.hero-services .service-tile:focus-visible {
    background: linear-gradient(145deg, #0f3c7a, #04113b);
    box-shadow: 0 22px 44px rgba(4, 17, 59, 0.24);
}

.hero-services .service-tile:hover .service-tile-link,
.hero-services .service-tile:focus-visible .service-tile-link {
    color: #ffffff;
}

.hero-services .service-tile:focus-visible {
    outline: 3px solid #f6c453;
    outline-offset: 3px;
}

.hero-services .service-tile-icon {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
    font-size: 22px;
}

.hero-services .service-tile.is-featured {
    min-height: 0;
}

.hero-services .service-tile.is-featured .service-tile-description {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}

.hero-services .service-tile-description {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    margin-bottom: 6px;
}

.hero-services .service-tile-tags {
    display: none;
}

.hero-services .service-tile-eyebrow {
    margin-bottom: 4px;
}

.hero-services .service-tile-title {
    margin-bottom: 4px;
}

@media (max-width: 1199px) {
    .hero-services {
        flex-direction: column;
        align-items: stretch;
        gap: clamp(28px, 5vw, 52px);
    }

    .hero-services .hero-content {
        flex: 0 0 auto;
        width: 100%;
        max-width: 860px;
        margin: 0 auto;
        text-align: center;
    }

    .hero-services .hero-content > div:first-child {
        max-width: 760px;
        margin: 0 auto;
    }

    .hero-services .btn-group {
        justify-content: center;
        margin: 0 auto;
    }

    .hero-services .service-bento {
        flex: 0 0 auto;
        width: 100%;
        max-width: 900px;
        align-self: center;
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: minmax(125px, auto);
        gap: 12px;
    }

    .hero-services .service-tile.is-featured {
        grid-column: span 2;
        grid-row: auto;
        min-height: 155px;
    }

    .hero-services .service-tile {
        min-height: 125px;
        padding: 16px 20px;
    }
}

@media (max-width: 767px) {
    .hero-services {
        flex-wrap: nowrap;
    }

    .hero-services .hero-content {
        flex: 0 0 auto;
    }
}

@media (max-width: 575px) {
    .hero-services .service-bento {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        gap: 16px;
    }

    .hero-services .service-tile {
        min-height: 115px;
    }

    .hero-services .service-tile.is-featured {
        grid-column: auto;
        min-height: 160px;
        padding: 16px;
    }
}

.hero-services .service-tile.is-featured .service-tile-icon {
    width: 50px;
    height: 50px;
    font-size: 24px;
}

@media (prefers-reduced-motion: reduce) {
    .hero-services .service-tile {
        transition: none;
    }

    .hero-services .service-tile:hover {
        transform: none;
    }
}

/* Services page stacked cards styles start */
.service-stack {
    padding: 48px var(--section-gutter);
}

.service-stack-heading {
    padding-left: 0;
    margin-bottom: clamp(8px, 1.5vh, 16px);
}

.service-stack-intro {
    max-width: 820px;
    margin: 0 auto clamp(16px, 3vh, 28px);
    font-size: clamp(0.95rem, 0.9rem + 0.25vw, 1.075rem);
    line-height: 1.6;
    color: var(--color-muted);
    text-align: center;
}

/* Without JavaScript (or on very short screens) the cards are simply listed one under another */
.service-stack-deck {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
}

/* Sizes scale with the screen between a phone-sized floor and a desktop ceiling */
.stack-card {
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 1.6vh, 16px);
    padding: clamp(22px, 4vw, 44px);
    border-radius: 16px;
    background: linear-gradient(145deg, var(--color-primary), var(--color-navy));
    color: #ffffff;
    box-shadow: 0 18px 40px rgba(4, 17, 59, 0.25);
    box-sizing: border-box;
}

.stack-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stack-card-top i {
    font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.6rem);
    line-height: 1;
    color: var(--color-accent);
}

.stack-card-count {
    font-size: clamp(0.8rem, 0.75rem + 0.2vw, 0.9rem);
    font-weight: 600;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.6);
}

.stack-card-tagline {
    font-size: clamp(0.72rem, 0.68rem + 0.15vw, 0.8rem);
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #3FA2F0;
}

.stack-card-title {
    margin: 0;
    font-size: clamp(1.35rem, 1rem + 1.8vw, 2.3rem);
    font-weight: 700;
    line-height: 1.2;
    color: #ffffff;
}

.stack-card-text {
    margin: 0;
    max-width: 600px;
    font-size: clamp(0.95rem, 0.88rem + 0.3vw, 1.125rem);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
}

.stack-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 4px 0 0;
}

.stack-card-tags li {
    font-size: clamp(0.75rem, 0.72rem + 0.12vw, 0.85rem);
    line-height: 1.3;
    padding: 5px 12px;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.92);
}

/* One call to action for the whole section, centred under the deck */
.service-stack-cta-wrap {
    display: flex;
    justify-content: center;
    margin-top: clamp(16px, 3vh, 32px);
}

.btn.stack-card-cta {
    background-color: var(--color-accent);
    padding: 10px 24px;
    border-radius: 7px;
    font-size: 15px;
}

.btn.stack-card-cta:hover,
.btn.stack-card-cta:focus {
    background-color: #ffffff;
    color: var(--color-primary);
}

.service-stack-dots {
    display: none;
}

/* With JavaScript: the section is tall so there is room to scroll, and the deck stays pinned while it plays */
.service-stack.is-stacked {
    height: calc(var(--stack-count, 5) * 70vh + 30vh);
    padding-top: 0;
    padding-bottom: 0;
}

.service-stack.is-stacked .service-stack-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(16px, 4vh, 40px) 0;
    box-sizing: border-box;
    overflow: hidden;
}

.service-stack.is-stacked .service-stack-deck {
    position: relative;
    display: block;
    /* Takes whatever height the pinned screen has left after the heading, intro, dots and button */
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
    min-height: 280px;
    max-height: 440px;
    /* Cards slide in and out through the deck's left and right edges; top and bottom stay open for the shadow */
    clip-path: inset(-60px 0);
}

/* Cards sit side by side, centred, with the neighbours peeking in from either side */
.service-stack.is-stacked .stack-card {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: min(720px, 60%);
    transform-origin: center center;
    will-change: transform, opacity;
}

/* The text sits at the bottom of the card, so a tall card looks deliberate rather than empty */
.service-stack.is-stacked .stack-card-tagline {
    margin-top: auto;
}

.service-stack.is-stacked .service-stack-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: clamp(16px, 4vh, 40px);
}

.service-stack-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--color-border);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.service-stack-dots span.is-active {
    background-color: var(--color-accent);
    transform: scale(1.3);
}

/* Phones: narrower cards need a little more height for the wrapped text */
@media (max-width: 575px) {
    .stack-card {
        border-radius: 14px;
    }

    .service-stack.is-stacked .service-stack-deck {
        min-height: 320px;
        max-height: 520px;
    }

    .service-stack.is-stacked .stack-card {
        width: 80%;
    }

    .stack-card-tags {
        gap: 6px;
    }

    .stack-card-tags li {
        padding: 4px 10px;
    }

    .btn.stack-card-cta {
        padding: 9px 20px;
        font-size: 14px;
    }
}

/* Very narrow phones */
@media (max-width: 360px) {
    .stack-card-text {
        font-size: 0.9rem;
        line-height: 1.5;
    }
}
/* Services page stacked cards styles end */

/* Services page consulting package styles start */
/* Light section with a document-style card, so it reads apart from the navy service cards above */
.package {
    background-color: var(--color-surface);
    color: var(--color-text);
    padding: 88px var(--section-gutter);
    scroll-margin-top: 24px;
    border-top: 1px solid var(--color-border);
}

.package-inner {
    display: flex;
    align-items: flex-start;
    gap: 72px;
}

.package-intro {
    flex: 1 1 40%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    position: sticky;
    top: 32px;
}

.package-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-primary);
}

.package-eyebrow::before {
    content: "";
    width: 28px;
    height: 2px;
    background-color: var(--color-accent);
}

.package-title {
    margin: 0;
    font-size: clamp(1.8rem, 3.2vw, 2.6rem);
    font-weight: 700;
    color: var(--color-navy);
}

.package-text {
    margin: 0;
    max-width: 480px;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--color-muted);
}

.btn.package-cta {
    margin-top: 8px;
    background-color: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    padding: 10px 26px;
    border-radius: 7px;
    font-size: 15px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.btn.package-cta:hover,
.btn.package-cta:focus {
    background-color: var(--color-primary);
    color: #ffffff;
}

.package-includes {
    flex: 1 1 60%;
    padding: 36px 40px 28px;
    border-radius: 12px;
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-top: 4px solid var(--color-accent);
    box-shadow: 0 10px 30px rgba(4, 17, 59, 0.06);
}

.package-includes-title {
    margin: 0 0 8px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-muted);
}

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

.package-list li {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px dashed var(--color-border);
    font-size: 1.02rem;
    font-weight: 500;
    line-height: 1.45;
    color: var(--color-navy);
}

.package-list li:last-child {
    border-bottom: none;
}

.package-list i {
    flex-shrink: 0;
    font-size: 1.15rem;
    color: var(--color-accent);
}

@media (max-width: 991px) {
    .package-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 40px;
    }

    .package-intro {
        position: static;
    }
}

@media (max-width: 575px) {
    .package {
        padding: 56px var(--section-gutter);
    }

    .package-includes {
        padding: 24px 20px 16px;
    }

    .package-list li {
        padding: 14px 0;
        font-size: 0.95rem;
    }

    .btn.package-cta {
        padding: 8px 20px;
    }
}
/* Services page consulting package styles end */

/* Staff login page styles */
.staff-login {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 160px);
    padding: 56px var(--section-gutter);
    background-color: var(--color-surface);
}

.staff-login-card {
    width: 100%;
    max-width: 420px;
    padding: 40px 36px;
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(4, 17, 59, 0.08);
}

.staff-login-logo {
    display: block;
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 12px;
    object-fit: cover;
}

.staff-login-title {
    margin-bottom: 28px;
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-primary);
}

.staff-login-error {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px 14px;
    border: 1px solid #F5C2C0;
    border-radius: 8px;
    background-color: #FDECEC;
    color: #A3261B;
    font-size: 0.92rem;
}

.staff-login-form .form-label {
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.92rem;
    color: var(--color-text);
}

.staff-login-form .form-control {
    margin-bottom: 18px;
    padding: 10px 14px;
    border-color: var(--color-border);
    border-radius: 7px;
}

.staff-login-form .form-control:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(3, 137, 225, 0.15);
}

/* The wrapper carries the bottom margin so the toggle can fill the input's full height. */
.password-field {
    position: relative;
    margin-bottom: 18px;
}

.staff-login-form .password-field .form-control {
    margin-bottom: 0;
    padding-right: 46px;
}

.password-toggle {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: none;
    color: var(--color-muted);
}

.password-toggle .bi::before {
    vertical-align: 0;
}

.password-toggle .bi {
    line-height: 1;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: var(--color-primary);
}

.staff-login-form .btn-primary {
    margin-top: 6px;
}

@media (max-width: 575px) {
    .staff-login {
        padding: 32px var(--section-gutter);
    }

    .staff-login-card {
        padding: 32px 22px;
    }
}
/* Staff login page styles end */

/* Cookie notice styles start */
/* A compact bar along the bottom of the public pages until the visitor dismisses it (components/cookieNotice.php). */
.cookie-notice {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 1040;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 720px;
    margin: 0 auto;
    padding: 0.625rem 0.75rem 0.625rem 1rem;
    background-color: var(--color-navy);
    color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(4, 17, 59, 0.25);
    font-size: 13px;
    line-height: 1.45;
}

.cookie-notice a {
    color: #ffffff;
    text-decoration: underline;
}

.cookie-notice-actions {
    display: flex;
    flex-shrink: 0;
    gap: 0.5rem;
}

.cookie-notice .btn {
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 13px;
}

@media (max-width: 575px) {
    .cookie-notice {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        left: 0.5rem;
        right: 0.5rem;
        bottom: 0.5rem;
        padding: 0.75rem;
    }

    .cookie-notice-actions .btn {
        flex: 1;
    }
}
/* Cookie notice styles end */

/* 404 page styles start */
/* Large "404" above the heading on 404.php; the rest uses the shared text-only hero. */
.not-found .not-found-code {
    margin-bottom: 0.25rem;
    font-size: clamp(3.5rem, 10vw, 6rem);
    font-weight: 800;
    line-height: 1;
    color: var(--color-accent);
}

.not-found {
    min-height: 55vh;
}
/* 404 page styles end */

/* Modals and popup forms still scroll when they are taller than the screen,
   but without a visible scrollbar (same as the staff sidebar). */
.modal,
.modal-dialog-scrollable .modal-body,
.gallery-modal-dialog,
.contact-modal-box,
.modal-box {
    scrollbar-width: none;
}

.modal::-webkit-scrollbar,
.modal-dialog-scrollable .modal-body::-webkit-scrollbar,
.gallery-modal-dialog::-webkit-scrollbar,
.contact-modal-box::-webkit-scrollbar,
.modal-box::-webkit-scrollbar {
    display: none;
}
