/* Don Bosco YaR Forum — shared design system */
:root {
    --red: #b90908;
    --red-dark: #8f0606;
    --orange: #ff7900;
    --ink: #262626;
    --muted: #686868;
    --cream: #fffaf6;
    --line: #ece5df;
    --shadow: 0 14px 40px rgba(60, 25, 15, .10)
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px
}

body {
    margin: 0;
    color: var(--ink);
    font-family: "IBM Plex Sans Thai Looped", sans-serif;
    font-size: 17px;
    line-height: 1.8;
    color: #000;
    background: #fff
}

h1,
h2,
h3,
h4,
.navbar {
    font-family: "Poppins", Arial, sans-serif
}

h2 {
    font-size: clamp(1.65rem, 2.5vw, 2.25rem);
    line-height: 1.25;
    font-weight: 700;
    color: var(--red);
    margin: 0 0 1.25rem
}

h3 {
    font-size: 1.05rem;
    font-weight: 700
}

p {
    margin-bottom: 1rem;
    font-size: 16px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .07)
}

.navbar-brand {
    padding: 0;
}

.navbar {
    min-height: 70px;
    padding: 0 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--red);
    line-height: 1.05;
    white-space: normal
}

.brand:hover {
    color: var(--red)
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 37px;
    height: 37px;
    border: 1.5px solid var(--orange);
    border-radius: 50%;
    font-size: 23px;
    color: var(--orange)
}

.brand strong {
    display: block;
    font-size: 15px;
    letter-spacing: .3px
}

.brand small {
    display: block;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .4px;
    max-width: 210px
}

.navbar-nav {
    gap: 4px
}

.dropdown-menu li a {
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    color: #242424 !important;
}

.nav-link {
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    color: #242424 !important;
    padding: 1rem .7rem !important;
    position: relative
}

.nav-link:after {
    content: "";
    position: absolute;
    bottom: 7px;
    left: .7rem;
    right: .7rem;
    height: 2px;
    background: var(--orange);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .25s
}

.nav-link:hover:after,
.nav-link.active:after {
    transform: scaleX(1)
}

.nav-link.active {
    color: var(--red) !important
}

.nav-link.nav-join,
.nav-link.nav-join.active,
.nav-link.nav-join:hover,
.nav-link.nav-join:focus {
    background: var(--red);
    color: #ffffff !important;
    border-radius: 2px;
    padding: .65rem 1.25rem !important;
}

.nav-link.nav-join.active {
    background: #900605;
    color: #ffffff !important;
}

.nav-join:after {
    display: none
}

.nav-link.nav-join:hover {
    background: var(--orange);
    color: #ffffff !important;
}

.dropdown-menu {
    border: 0;
    box-shadow: var(--shadow);
    border-radius: 5px;
    padding: .5rem
}

.dropdown-arrow {
    display: inline-block;
    vertical-align: middle;
    transition: transform 0.25s ease;
}

@media (min-width: 992px) {
    .navbar-nav .nav-item.dropdown:hover > .dropdown-menu {
        display: block;
        margin-top: 0;
    }
    .navbar-nav .nav-item.dropdown:hover > .nav-link .dropdown-arrow {
        transform: rotate(180deg);
    }
}

@media (max-width: 991.98px) {
    .navbar-nav .dropdown-menu {
        display: none;
        border: none;
        box-shadow: none;
        padding-left: 1rem;
        background: #fbf9f8;
        border-left: 3px solid var(--orange);
        margin: 0.3rem 0 0.6rem 0.5rem;
        border-radius: 4px;
    }
    .navbar-nav .dropdown-menu.show {
        display: block;
    }
}

.dropdown-item {
    font-size: 13px;
    padding: .55rem .8rem
}

.dropdown-item:hover {
    background: #fff2e8;
    color: var(--red)
}

.hero {
    position: relative;
    height: min(43vw, 510px);
    min-height: 280px;
    overflow: hidden;
    background: #241d1a
}

.hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 43%
}

.hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, .05), rgba(0, 0, 0, .1) 45%, rgba(0, 0, 0, .68))
}

.hero-content {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    padding-bottom: 4.2rem;
    color: #fff
}

.eyebrow {
    font-size: .92rem;
    font-weight: 600;
    letter-spacing: .04em;
    margin: 0 0 .2rem
}

.eyebrow.light {
    color: #fff
}

.hero h1 {
    font-size: clamp(2.3rem, 5.3vw, 4.7rem);
    font-weight: 800;
    letter-spacing: -.04em;
    margin: 0;
    color: #fff;
    text-shadow: 0 2px 15px #0005
}

.section {
    padding: clamp(2rem, 1vw, 3.5rem) 0
}

.about-intro {
    background: linear-gradient(120deg, #fff, #fffaf6)
}

.section-kicker {
    text-transform: uppercase;
    color: var(--orange);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .15em;
    margin-bottom: .65rem
}

.accent-leaf {
    color: var(--orange);
    font-size: 1.2em;
    display: inline-block;
    transform: rotate(-20deg);
    margin-left: .2rem
}

.btn-orange {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    border: 0;
    border-radius: 0;
    background: var(--orange);
    color: white;
    padding: .75rem 1.25rem;
    font-family: "Poppins", sans-serif;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    transition: transform .2s, background .2s
}

.btn-orange:hover,
.btn-orange:focus {
    background: var(--red);
    color: #fff;
    transform: translateY(-2px)
}

.image-feature {
    position: relative;
    max-width: 480px;
    margin-left: auto
}

.image-feature img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 16px 16px 16px 70px;
    box-shadow: var(--shadow)
}

.round-stamp {
    position: absolute;
    left: -20px;
    bottom: 20px;
    width: 65px;
    height: 65px;
    display: grid;
    place-items: center;
    background: #fff;
    color: var(--red);
    font-size: 1.7rem;
    border-radius: 15px;
    box-shadow: var(--shadow)
}

.narrow {
    max-width: 900px
}

.family-section {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem
}

.center-heading {
    text-align: center;
    margin-bottom: 2rem
}

.family-section p,
.program-list li {
    font-size: 17px;
    color: #000;
}

.attention-section {
    padding-top: 2rem
}

.attention-section h2 {
    font-size: clamp(1.45rem, 2.8vw, 2rem);
    max-width: 800px
}

.program-list {
    padding-left: 1.4rem;
    font-size: .88rem
}

.programs-section {
    padding-top: 3rem
}

.program-card {
    display: block;
    position: relative;
    height: 180px;
    overflow: hidden;
    color: white;
    text-decoration: none;
    background: #333
}

.program-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s
}

.program-card:after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, .78), transparent 75%)
}

.program-card span {
    position: absolute;
    z-index: 1;
    left: 1.1rem;
    bottom: 1rem;
    font-family: "Poppins";
    font-weight: 700;
    font-size: 1rem
}

.program-card:hover img {
    transform: scale(1.06)
}

.reach-section {
    padding-top: 3rem;
    padding-bottom: 3rem
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px
}

.stat {
    min-height: 115px;
    padding: 1.2rem .8rem;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center
}

.stat.red {
    background: var(--red)
}

.stat.orange {
    background: var(--orange)
}

.stat strong {
    font-family: "Poppins";
    font-size: clamp(1.35rem, 2.5vw, 2rem);
    line-height: 1.25
}

.stat span {
    font-size: 17px;
    line-height: 1.4;
    margin-top: .4rem;
    max-width: 180px
}

.stories-section {
    padding-top: 2rem;
    padding-bottom: 2rem
}

.story-feature {
    display: block;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: white
}

.story-feature img {
    width: 100%;
    height: clamp(240px, 38vw, 450px);
    object-fit: cover;
    object-position: center 43%;
    transition: transform .5s
}

.story-feature:hover img {
    transform: scale(1.025)
}

.story-feature span {
    display: block;
    background: var(--red);
    color: white;
    text-align: center;
    padding: 1rem;
    font-family: "Poppins";
    font-size: clamp(1rem, 2vw, 1.35rem);
    font-weight: 700
}

.text-link {
    color: var(--red);
    font-size: 17px;
    font-weight: 700;
    text-decoration: none
}

.text-link:hover {
    color: var(--orange)
}

.gallery-preview {
    padding-top: 1rem;
    padding-bottom: 5rem;
}

.gallery-strip {
    width: 100%;
    height: 210px;
    object-fit: cover;
    display: block
}

/* ===== DBYaR Footer ===== */
.dbyar-footer {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    color: #fff;
    background:
        linear-gradient(rgba(0, 0, 0, 0.90), rgba(0, 0, 0, 0.94)),
        #101010;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
}

.footer-container {
    padding: 44px 5.4% 0;
}

.footer-main {
    padding-bottom: 34px;
}

.footer-column h5 {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 36px;
    line-height: 1.3;
}

.footer-contact p {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 0 0 27px;
    line-height: 1.7;
    font-size: 14px;
}

.footer-contact i {
    font-size: 13px;
    flex-shrink: 0;
    margin-top: 2px;
}

.dbyar-footer a {
    color: #fff;
    text-decoration: none;
    transition: color 0.25s ease;
}

.dbyar-footer a:hover {
    color: #ff8a00;
}

.footer-address {
    padding-left: 0;
}

.footer-social {
    display: flex;
    align-items: center;
    gap: 29px;
    margin-top: 52px;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
}

.footer-links-grid {
    display: grid;
    grid-template-columns: auto auto;
    column-gap: 25px;
}

.footer-links-grid>div {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-links-grid a {
    white-space: nowrap;
    line-height: 1.5;
}

.footer-description {
    font-size: 14px;
    line-height: 1.5;
    margin: -13px 0 8px;
}

.footer-form {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

.footer-form input,
.footer-form textarea {
    display: block;
    width: 100%;
    padding: 6px 0;
    border: 0;
    border-bottom: 1px solid #888;
    border-radius: 0;
    outline: none;
    background: transparent;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
}

.footer-form input::placeholder,
.footer-form textarea::placeholder {
    color: #fff;
    opacity: 1;
}

.footer-form input:focus,
.footer-form textarea:focus {
    border-bottom-color: #ff8a00;
    box-shadow: none;
}

.footer-submit,
.footer-download {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 151px;
    min-height: 33px;
    border: 0;
    border-radius: 0;
    color: #fff !important;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.25s ease;
}

.footer-submit {
    margin-top: 10px;
    background: #ff8500;
    cursor: pointer;
}

.footer-submit:hover {
    background: #e87500;
}

.footer-resources-text {
    margin-top: -1px;
    margin-bottom: 19px;
    font-size: 14px;
    line-height: 1.65;
}

.footer-download {
    background: #c00000;
}

.footer-download:hover {
    background: #e00000;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 67px;
    border-top: 1px solid #777;
}

.footer-legal,
.footer-copyright {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 500;
}

.footer-copyright {
    justify-content: flex-end;
    gap: 20px;
    text-align: right;
}

.copyright-divider {
    display: inline-block;
    height: 20px;
    border-left: 1px solid #fff;
}

/* Tablet */
@media (max-width: 991.98px) {
    .footer-container {
        padding: 38px 4% 0;
    }

    .footer-column h5 {
        margin-bottom: 25px;
    }

    .footer-social {
        margin-top: 35px;
    }

    .footer-main {
        row-gap: 35px !important;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px 0;
    }

    .footer-copyright {
        flex-wrap: wrap;
        justify-content: flex-start;
        text-align: left;
        gap: 10px;
    }
}

/* Mobile */
@media (max-width: 575.98px) {
    .footer-container {
        padding: 32px 22px 0;
    }

    .footer-main {
        padding-bottom: 28px;
    }

    .footer-column h5 {
        margin-bottom: 22px;
    }

    .footer-links-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        column-gap: 12px;
    }

    .footer-links-grid a {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .footer-links-grid>div {
        gap: 22px;
    }

    .footer-social {
        margin-top: 30px;
        gap: 25px;
    }

    .footer-form,
    .footer-description {
        max-width: 100%;
    }

    .footer-bottom {
        gap: 14px;
    }

    .footer-copyright {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        line-height: 1.6;
    }

    .copyright-divider {
        display: none;
    }
}

.socials {
    display: flex;
    gap: 15px;
    margin-top: 1rem
}

.socials a {
    font-size: 1.1rem
}

.mini-form input {
    width: 100%;
    padding: .65rem;
    border: 1px solid #666;
    background: #1c1c1c;
    color: #fff;
    margin-bottom: .45rem
}

.mini-form button {
    border: 0;
    background: var(--orange);
    color: #fff;
    padding: .55rem 1.2rem;
    font-weight: 700;
    font-size: .72rem;
    text-transform: uppercase
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-top: 1px solid #444;
    margin-top: 2rem;
    padding-top: 1rem;
    color: #aaa;
    font-size: .68rem
}

.footer-bottom a {
    display: inline !important
}

.back-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: var(--red);
    color: white;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: .25s;
    z-index: 900
}

.back-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0)
}

.page-hero {
    min-height: 200px;
    height: auto;
    padding: 2.5rem 0;
    position: relative;
    background: #251a16;
    display: flex;
    align-items: center;
}

.page-hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, .75), rgba(0, 0, 0, .28)), url('/assets/images/yar-leaders-orientation.jpg') center 40%/cover;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    background-position: top;
}

.page-hero-content {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
    z-index: 2;
}

.page-hero h1 {
    font-size: clamp(2rem, 4vw, 3.4rem);
    font-weight: 800;
    color: white;
    margin: .2rem 0 1rem
}

.breadcrumb {
    margin: 0
}

.breadcrumb-item,
.breadcrumb-item a {
    color: #fff;
    font-size: .78rem;
    text-decoration: none
}

.breadcrumb-item.active {
    color: #ffd4b4
}

.breadcrumb-item+.breadcrumb-item:before {
    color: #ddd
}

.rounded-photo {
    width: 100%;
    max-height: 390px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: var(--shadow)
}

.soft-panel {
    background: var(--cream);
    border-left: 4px solid var(--orange);
    padding: 2rem;
    border-radius: 0 10px 10px 0
}

.lead-copy {
    max-width: 750px;
    color: var(--muted);
    font-size: 1rem
}

.content-card {
    height: 100%;
    background: white;
    border: 1px solid var(--line);
    box-shadow: 0 8px 30px #251a160b;
    transition: transform .25s, box-shadow .25s
}

.content-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow)
}

.content-card img {
    width: 100%;
    height: 190px;
    object-fit: cover
}

.content-card-body {
    padding: 1.4rem
}

.content-card h3 {
    color: var(--red)
}

.resource-card {
    display: flex;
    gap: 1.2rem;
    height: 100%;
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    transition: border-color .2s, transform .2s
}

.resource-card:hover {
    border-color: #ffc18e;
    transform: translateY(-3px)
}

.resource-icon {
    flex: 0 0 55px;
    width: 55px;
    height: 55px;
    display: grid;
    place-items: center;
    background: #fff0e3;
    color: var(--red);
    font-size: 1.5rem;
    border-radius: 50%
}

.resource-card h3 {
    color: var(--red)
}

.resource-note {
    font-size: .75rem;
    color: #777
}

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

.gallery-item {
    height: 240px;
    position: relative;
    display: block;
    overflow: hidden;
    background: #eee
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s
}

.gallery-item:hover img {
    transform: scale(1.06)
}

.gallery-item span {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    background: #fff;
    color: var(--red);
    border-radius: 50%;
    opacity: 0;
    transition: opacity .2s
}

.gallery-item:hover span,
.gallery-item:focus span {
    opacity: 1
}

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .92);
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 5vw
}

.lightbox[hidden] {
    display: none
}

.lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 25px;
    border: 0;
    background: transparent;
    color: white;
    font-size: 1.7rem
}

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

.contact-detail>i {
    display: grid;
    place-items: center;
    width: 45px;
    height: 45px;
    background: #fff0e3;
    color: var(--red);
    border-radius: 50%;
    font-size: 1.2rem
}

.contact-detail strong,
.contact-detail span {
    display: block
}

.contact-detail span {
    color: var(--muted);
    font-size: .86rem
}

.contact-form {
    padding: clamp(1.25rem, 3vw, 2.25rem);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    border-radius: 8px
}

.form-label {
    font-weight: 700;
    font-size: .82rem
}

.form-control,
.form-select {
    border-color: #ddd;
    padding: .75rem;
    border-radius: 3px
}

.form-control:focus,
.form-select:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 .2rem #ff790020
}

.form-feedback {
    font-size: .82rem;
    color: #a30b0b;
    margin: .5rem 0 0
}

.form-feedback.success {
    color: #197245
}

.reveal {
    opacity: 1;
    transform: none
}

.js-motion .reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .65s ease, transform .65s ease
}

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

/* =========================================
   OUR NATIONAL PROGRAMMES
========================================= */

.programmes-section {
    width: 100%;
    overflow: hidden;
    background: #fff;
}

.programmes-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: repeat(3, 200px);
    gap: 4px;
    width: 100%;
}

.programme-card {
    position: relative;
    display: block;
    min-width: 0;
    overflow: hidden;
    color: #fff;
    text-decoration: none;
    background: #222;
    isolation: isolate;
}

/* Card placement: 3 / 2 / 3 */

.programme-one,
.programme-two,
.programme-three,
.programme-six,
.programme-seven,
.programme-eight {
    grid-column: span 2;
}

.programme-four,
.programme-five {
    grid-column: span 3;
}

/* Images */

.programme-card img {
    position: absolute;
    inset: 0;
    z-index: -2;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s ease;
}

/* Dark overlay for readable text */

.programme-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg,
            rgba(0, 0, 0, 0.38) 0%,
            rgba(0, 0, 0, 0.30) 45%,
            rgba(0, 0, 0, 0.48) 100%);
    transition: background 0.35s ease;
}

.programme-card:hover img {
    transform: scale(1.045);
}

.programme-card:hover::before {
    background: rgba(0, 0, 0, 0.48);
}

/* Content */

.programme-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 56px 12px 15px;
    text-align: center;
    color: #fff;
}

.programme-overlay h3 {
    width: 100%;
    margin: 0 0 15px;
    color: #fff;
    font-family: inherit;
    font-size: clamp(19px, 2.1vw, 29px);
    font-weight: 750;
    line-height: 1.2;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.55);
}

.programme-overlay p {
    max-width: 100%;
    margin: 0;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* Red captions on the bottom row */

.programme-caption {
    display: block;
    width: min(92%, 100%);
    margin-top: -1px;
    padding: 3px 8px;
    color: #fff;
    background: #c00000;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.45;
    text-align: center;
}

/* Adjust the wide cards */

.programme-four .programme-overlay,
.programme-five .programme-overlay {
    padding-top: 59px;
}

.programme-four .programme-overlay h3,
.programme-five .programme-overlay h3 {
    margin-bottom: 15px;
}

/* Bottom-row title and red caption */

.programme-six .programme-overlay,
.programme-seven .programme-overlay,
.programme-eight .programme-overlay {
    justify-content: center;
    padding: 12px;
}

.programme-six .programme-overlay h3,
.programme-seven .programme-overlay h3,
.programme-eight .programme-overlay h3 {
    margin-bottom: 5px;
}

/* Container set to 4 columns */
.custom-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 250px;
    /* Adjust this to change the baseline height */
    gap: 8px;
    /* The white spacing between images */
    grid-auto-flow: dense;
    /* Crucial: fills empty spaces automatically */
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
}

/* Base item styling */
.gallery-item {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 4px;
    /* Optional: remove if you want sharp corners */
}

/* Image styling to fill the grid boxes without distortion */
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Modifier class for the vertical images */
.item-tall {
    grid-row: span 2;
}

/* Responsive adjustment for mobile screens */
@media (max-width: 768px) {
    .custom-gallery {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 200px;
    }
}

@media (max-width: 480px) {
    .custom-gallery {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .item-tall {
        grid-row: span 1;
        /* Reset tall images to normal height on very small screens */
    }
}

/* Tablet */

@media (max-width: 991.98px) {
    .programmes-grid {
        grid-template-rows: repeat(4, 190px);
    }

    .programme-one,
    .programme-two,
    .programme-three,
    .programme-six,
    .programme-seven,
    .programme-eight {
        grid-column: span 2;
    }

    .programme-four,
    .programme-five {
        grid-column: span 3;
    }

    .programme-overlay {
        padding: 45px 10px 12px;
    }

    .programme-overlay h3 {
        font-size: clamp(18px, 2.5vw, 25px);
    }

    .programme-overlay p,
    .programme-caption {
        font-size: 11px;
    }
}

/* Mobile */

@media (max-width: 575.98px) {
    .programmes-grid {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: none;
        gap: 4px;
    }

    .programme-card {
        grid-column: 1 / -1;
        min-height: 200px;
    }

    .programme-one,
    .programme-two,
    .programme-three,
    .programme-four,
    .programme-five,
    .programme-six,
    .programme-seven,
    .programme-eight {
        grid-column: 1 / -1;
    }

    .programme-overlay,
    .programme-four .programme-overlay,
    .programme-five .programme-overlay {
        padding: 50px 16px 15px;
    }

    .programme-overlay h3 {
        margin-bottom: 12px;
        font-size: 23px;
    }

    .programme-overlay p {
        font-size: 12px;
    }

    .programme-six .programme-overlay,
    .programme-seven .programme-overlay,
    .programme-eight .programme-overlay {
        justify-content: center;
        padding: 15px;
    }

    .programme-caption {
        width: min(92%, 360px);
        font-size: 11px;
    }
}

/* Default size for desktop screens */
.brand-logo {
    height: 85px;
    width: auto;
    /* Maintains the aspect ratio so the image doesn't stretch */
    transition: height 0.3s ease-in-out;
    /* Adds a smooth resizing animation */
}

/* Tablet screens (under 992px) */
@media (max-width: 991px) {
    .brand-logo {
        height: 70px;
        /* Slightly smaller for tablets */
    }
}

/* Mobile screens (under 576px) */
@media (max-width: 575px) {
    .brand-logo {
        height: 55px;
        /* Smaller for mobile phones to save space */
    }
}

/* Reduced motion accessibility */

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

    .programme-card img,
    .programme-card::before {
        transition: none;
    }
}

@media(max-width:991.98px) {
    .navbar {
        padding: .5rem 0
    }

    .navbar-collapse {
        padding: .7rem 0 1rem
    }

    .nav-link {
        padding: .65rem .4rem !important
    }

    .nav-link:after {
        left: .4rem;
        right: auto;
        width: 38px;
        bottom: 4px
    }

    .nav-join {
        display: inline-block;
        margin-top: .4rem
    }

    .hero {
        height: 380px
    }

    .hero-content {
        align-items: flex-start;
        padding-bottom: 2.5rem
    }

    .hero-shade {
        background: linear-gradient(0deg, rgba(0, 0, 0, .7), transparent 85%)
    }

    .image-feature {
        margin: 0 auto
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .site-footer .row>div {
        margin-bottom: .5rem
    }
}

@media(max-width:575.98px) {
    body {
        font-size: 13px
    }

    .brand strong {
        font-size: 13px
    }

    .brand small {
        font-size: 7px;
        max-width: 180px
    }

    .hero {
        height: 310px;
        min-height: 0
    }

    .hero-image {
        object-position: 40% center
    }

    .hero h1 {
        font-size: 2.55rem
    }

    .hero-content {
        padding-bottom: 2rem
    }

    .eyebrow {
        font-size: .78rem
    }

    .section {
        padding: 3rem 0
    }

    .image-feature img {
        height: 240px
    }

    .family-section,
    .attention-section {
        padding-top: 2rem;
        padding-bottom: 2rem
    }

    .program-card {
        height: 165px
    }

    .stats-grid {
        gap: 7px
    }

    .stat {
        min-height: 105px;
        padding: .8rem .4rem
    }

    .stat span {
        font-size: .62rem
    }

    .gallery-strip {
        height: 145px
    }

    .footer-bottom {
        flex-direction: column
    }

    .page-hero {
        height: 230px
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px
    }

    .gallery-item {
        height: 160px
    }

    .resource-card {
        padding: 1rem;
        gap: .8rem
    }

    .resource-icon {
        flex-basis: 42px;
        width: 42px;
        height: 42px;
        font-size: 1.2rem
    }

    .story-feature img {
        height: 260px
    }
}

/* Homepage Gallery Hover Cards */
.gallery-hover-card {
    position: relative;
    display: block;
    border-radius: 12px;
    overflow: hidden;
    height: 280px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    background: #000;
}

.gallery-hover-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
}

.gallery-hover-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease, opacity 0.3s ease;
}

.gallery-hover-card:hover img {
    transform: scale(1.06);
    opacity: 0.92;
}

.gallery-hover-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 18px 16px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.55) 60%, transparent 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.gallery-hover-card:hover .gallery-hover-caption,
.gallery-hover-card:focus .gallery-hover-caption {
    opacity: 1;
    transform: translateY(0);
}

@media (hover: none) {
    .gallery-hover-caption {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-hover-title {
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 4px 0;
    line-height: 1.35;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.gallery-hover-count {
    color: #ff9800;
    font-size: 0.8rem;
    font-weight: 500;
}

@media(prefers-reduced-motion:reduce) {
    html {
        scroll-behavior: auto
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important
    }

    .js-motion .reveal {
        opacity: 1;
        transform: none
    }
}