:root {
    --ras-green-dark: #145c2f;
    --ras-green-footer: #2c8444;
    --ras-green-lime: #a5e25b;
    --ras-navy: #18404d;
    --ras-blue-button: #1d4991;
    --ras-text: #2b2b2b;
    /* --ras-hero-heading-font-size: clamp(2rem, 4.3vw, 3.4rem); */
    --ras-banner-gradient: linear-gradient(100deg, #9fdc5c 0%, #6fab5d 25%, #387460 50%, #225153 75%, #0c2a4a 100%);

    --ras-font-heading: "Poppins", sans-serif;
    --ras-font-body: "Montserrat", sans-serif;
    --ras-font-ui: "Fira Sans", sans-serif;

    --ras-header-height: 118px;
    --ras-header-height-mobile: 72px;
}

html {
    scroll-padding-top: var(--ras-header-height);
    /* background-color: var(--ras-green-footer); */
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: var(--ras-font-body);
    color: var(--ras-text);

    /* for iOS Safari URL bar */
    background-color: var(--ras-green-footer);
}

main {
    flex: 1 0 auto;
    background-color: #ffffff;
}

/* ---------- Header / navigation ---------- */

.site-header {
    background-color: #ffffff;
    transition: box-shadow 0.25s ease;
}

.site-header.is-scrolled {
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}

.site-header .navbar {
    padding-top: 0;
    padding-bottom: 0;
}

.site-header .navbar-brand {
    display: flex;
    align-items: center;
    height: var(--ras-header-height);
    padding-top: 0;
    padding-bottom: 0;
}

.site-logo {
    width: 260px;
    height: auto;
}

.site-nav-list {
    gap: 0.25rem;
}

.site-nav-link {
    font-family: var(--ras-font-ui);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--ras-green-dark);
    position: relative;
}

.navbar-nav .site-nav-link {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.site-nav-link:hover,
.site-nav-link:focus-visible,
.navbar-nav .site-nav-link.active {
    color: var(--ras-green-footer);
}

.site-nav-link::after {
    content: "";
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.35rem;
    height: 2px;
    background-color: var(--ras-green-footer);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

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

.site-nav-toggler {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    padding: 8px;
    border: none;
}

.site-nav-toggler:focus {
    box-shadow: none;
}

.site-nav-toggler:focus-visible {
    outline: 2px solid var(--ras-green-dark);
    outline-offset: 2px;
}

.site-nav-toggler-bar {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background-color: var(--ras-text);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.site-nav-toggler[aria-expanded="true"] .site-nav-toggler-bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.site-nav-toggler[aria-expanded="true"] .site-nav-toggler-bar:nth-child(2) {
    opacity: 0;
}

.site-nav-toggler[aria-expanded="true"] .site-nav-toggler-bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 991.98px) {
    html {
        scroll-padding-top: var(--ras-header-height-mobile);
    }

    .site-header .navbar-brand {
        height: var(--ras-header-height-mobile);
    }

    .site-logo {
        width: 200px;
    }

    .site-nav-list {
        gap: 0;
        padding: 0.5rem 0 1rem;
        border-top: 1px solid #e6ece8;
        margin-top: 0.5rem;
    }

    .navbar-nav .site-nav-link {
        padding: 0.75rem 0.25rem;
        font-size: 1rem;
    }

    .site-nav-link::after {
        display: none;
    }
}

/* ---------- Headings ---------- */

h1, .h1,
h2, .h2,
h3, .h3,
h4, .h4,
h5, .h5,
h6, .h6 {
    font-family: var(--ras-font-heading);
}

.hero-heading {
    font-size: clamp(2rem, 4.3vw, 3.2rem);
    font-weight: 700;
    line-height: 1.25;
}

.hero-subheading {
    /* font-family: var(--ras-font-heading); */
    font-family: var(--ras-font-body);
    font-size: clamp(1.05rem, 1.6vw, 1.3rem);
    line-height: 1.4;
}

.section-heading {
    font-weight: 700;
    font-size: clamp(1.6rem, 2.4vw, 2rem);
    color: #275a40;
    margin-bottom: 1.25rem;
}

/* ---------- Parallax photo sections ---------- */

[data-parallax] {
    position: relative;
    isolation: isolate;
}

.parallax-layer {
    --parallax-active-distance: var(--parallax-desktop, 0px);
    
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    border-radius: inherit;
    pointer-events: none;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.parallax-photo {
    position: absolute;
    top: calc(var(--parallax-active-distance) / -2);
    bottom: calc(var(--parallax-active-distance) / -2);
    left: 0;
    right: 0;
    background-repeat: no-repeat;
    background-size: cover;
    will-change: transform;
}

@media (max-width: 991.98px) {
    .parallax-layer {
        --parallax-active-distance: var(--parallax-mobile, 0px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .parallax-layer {
        --parallax-active-distance: 0px;
    }
}

/* ---------- Buttons ---------- */

.btn-ras {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 2.75rem;
    border: 2px solid #ffffff;
    border-radius: 10px;
    font-family: var(--ras-font-ui);
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.2;
    text-align: center;
    text-transform: uppercase;
    text-decoration: none;
    color: #ffffff;
    transition: background-color 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.btn-ras:hover,
.btn-ras:focus-visible {
    color: #ffffff;
}

.btn-ras:focus-visible {
    outline: 3px solid var(--ras-green-lime);
    outline-offset: 2px;
}

.btn-ras-gradient {
    background-image: linear-gradient(90deg, #8fd14f 0%, #4d895f 50%, #0f2f4a 100%);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.btn-ras-gradient:not(.is-inactive):hover {
    filter: brightness(1.1);
}

.btn-ras.is-inactive,
.btn-ras-outline.is-inactive {
    cursor: default;
}

.btn-ras-blue {
    background-color: var(--ras-blue-button);
    box-shadow: 0 0 0 1px rgba(29, 73, 145, 0.35);
}

.btn-ras-outline {
    background-color: transparent;
}
.btn-ras-outline.green {
    color: var(--ras-green-dark);
    border-color: var(--ras-green-dark);
}

.btn-ras-blue:hover,
.btn-ras-blue:focus-visible,
.btn-ras-outline:hover,
.btn-ras-outline:focus-visible {
    color: #fff !important;
    border-color: #fff !important;
    background-color: #2a5cb3;
}

.btn-ras-outline.is-inactive:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

@media (max-width: 575.98px) {
    .btn-ras-outline {
        width: 100%;
    }
}

/* ---------- Ornaments ---------- */

.ornament {
    position: absolute;
    z-index: 1;
    height: auto;
    pointer-events: none;
    user-select: none;
}

.ornament-blur {
    z-index: 0;
    opacity: 0.35;
    filter: blur(6px);
}

/* ---------- Photo gallery (components/photo-gallery.php) ---------- */

.photo-gallery {
    --photo-gallery-columns: 4;

    visibility: visible;
}

.photo-gallery.splide .splide__track .splide__list.photo-gallery-list {
    display: grid;
    grid-template-columns: repeat(var(--photo-gallery-columns), minmax(0, 1fr));
    gap: 1rem;
}

.photo-gallery-arrows {
    display: none;
}

.photo-gallery-button {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    background: none;
    cursor: zoom-in;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.photo-gallery-button img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 13 / 10;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.photo-gallery-button:focus-visible img {
    transform: scale(1.05);
}

@media (hover: hover) {
    .photo-gallery-button:hover img {
        transform: scale(1.05);
    }
}

.photo-gallery-button:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 3px;
}

@media (max-width: 991.98px) {
    .photo-gallery {
        visibility: hidden;
        padding-bottom: 3.5rem;
    }

    .photo-gallery.splide .splide__track .splide__list.photo-gallery-list {
        display: flex;
        gap: 0;
    }

    .photo-gallery-arrows {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        display: flex;
        justify-content: space-between;
        pointer-events: none;
    }

    .photo-gallery-control {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
        border: 2px solid #ffffff;
        border-radius: 50%;
        background-color: rgba(255, 255, 255, 0.15);
        color: #ffffff;
        font-size: 1rem;
        pointer-events: auto;
        transition: background-color 0.2s ease, color 0.2s ease;
    }

    .photo-gallery-control:hover,
    .photo-gallery-control:focus-visible {
        background-color: #ffffff;
        color: var(--ras-blue-button);
    }

    .photo-gallery-control:focus-visible {
        outline: 3px solid var(--ras-green-lime);
        outline-offset: 2px;
    }

    .photo-gallery-pagination {
        position: absolute;
        left: 56px;
        right: 56px;
        bottom: 0;
        height: 40px;
        gap: 0.5rem;
        padding: 0;
    }

    .photo-gallery-page {
        display: block;
        width: 10px;
        height: 10px;
        padding: 0;
        border: 2px solid #ffffff;
        border-radius: 50%;
        background-color: transparent;
        transition: background-color 0.2s ease, transform 0.2s ease;
    }

    .photo-gallery-page.is-active {
        background-color: #ffffff;
        transform: scale(1.2);
    }

    .photo-gallery-page:focus-visible {
        outline: 3px solid var(--ras-green-lime);
        outline-offset: 2px;
    }
}

/* ---------- Photo gallery lightbox ---------- */

.photo-gallery-modal .modal-content {
    background: transparent;
    border: none;
}

.photo-gallery-modal {
    --gallery-photo-aspect-ratio: 1.5;
    --gallery-photo-max-height: min(82vh, calc(100vh - 7.5rem));
    --gallery-screen-edge-gap: 0.5rem;
    --bs-modal-margin: 3.75rem;
}

@supports (height: 100dvh) {
    .photo-gallery-modal {
        --gallery-photo-max-height: min(82dvh, calc(100dvh - 7.5rem));
    }
}

.photo-gallery-modal .modal-dialog {
    max-width: min(
        1140px,
        calc(var(--gallery-photo-max-height) * var(--gallery-photo-aspect-ratio)),
        calc(100% - var(--gallery-screen-edge-gap) * 2)
    );
    margin-left: auto;
    margin-right: auto;
}

.photo-gallery-modal-photo {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 14px;
}

.photo-gallery-modal-close {
    position: absolute;
    top: -3.25rem;
    right: 0;
    z-index: 3;
    width: 44px;
    height: 44px;
    border: 2px solid var(--ras-blue-button);
    border-radius: 50%;
    background-color: #ffffff;
    color: var(--ras-blue-button);
    font-size: 1.1rem;
    line-height: 1;
}

.photo-gallery-modal-arrow {
    width: auto;
    opacity: 1;
}

.photo-gallery-modal-arrow.carousel-control-prev {
    left: 0;
    transform: translateX(calc(-100% - 1.25rem));
}

.photo-gallery-modal-arrow.carousel-control-next {
    right: 0;
    transform: translateX(calc(100% + 1.25rem));
}

.photo-gallery-modal-arrow-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 2px solid var(--ras-blue-button);
    border-radius: 50%;
    background-color: #ffffff;
    color: var(--ras-blue-button);
    font-size: 1.1rem;
}

.photo-gallery-modal-close:focus-visible,
.photo-gallery-modal-arrow:focus-visible .photo-gallery-modal-arrow-icon {
    outline: 3px solid var(--ras-green-lime);
    outline-offset: 2px;
}

.modal-backdrop.show {
    opacity: 0.75;
}

@media (max-width: 1299.98px) {
    .photo-gallery-modal-arrow.carousel-control-prev {
        transform: translateX(-50%);
    }

    .photo-gallery-modal-arrow.carousel-control-next {
        transform: translateX(50%);
    }
}

@media (max-width: 1199px) {
    .photo-gallery-modal-arrow.carousel-control-prev {
        left: 0.5rem;
        transform: none;
    }

    .photo-gallery-modal-arrow.carousel-control-next {
        right: 0.5rem;
        transform: none;
    }
}

@media (max-width: 991.98px) {
    .photo-gallery-modal-arrow.carousel-control-prev,
    .photo-gallery-modal-arrow.carousel-control-next {
        top: auto;
        bottom: -3.25rem;
    }

    .photo-gallery-modal-arrow.carousel-control-prev {
        left: 0;
    }

    .photo-gallery-modal-arrow.carousel-control-next {
        right: 0;
    }
}

/* ---------- Footer ---------- */

.site-footer {
    flex-shrink: 0;
    background-color: var(--ras-green-footer);
    color: #ffffff;
    font-family: var(--ras-font-ui);
    padding: 2rem 0 1.75rem;
}

.footer-layout {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    grid-template-areas:
        "brand     organisers . social"
        "copyright organisers . social";
    column-gap: 1.5rem;
    align-items: start;
}

.footer-brand {
    grid-area: brand;
}

.footer-organisers {
    grid-area: organisers;
    align-self: end;
    margin-left: 1.25rem;
}

.footer-social {
    grid-area: social;
}

.footer-copyright {
    grid-area: copyright;
}

.footer-logo {
    width: 270px;
    max-width: 100%;
    height: auto;
}

.footer-tagline {
    font-size: 0.8rem;
    line-height: 1.4;
    max-width: 290px;
    margin: 0.75rem 0 0.5rem;
}

.footer-copyright {
    font-size: 0.6rem;
    margin-bottom: 0;
}

.footer-connect-title {
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 0.6rem;
}

.footer-organisers-title {
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.footer-organiser-logos {
    display: flex;
    align-items: flex-end;
    gap: 1.5rem;
}

.footer-organiser-logo {
    display: block;
    width: auto;
}

.footer-organiser-logo-nus {
    height: 42px;
}

.footer-organiser-logo-nus-college {
    height: 33px;
}

@media (max-width: 991.98px) {
    .footer-layout {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "brand      social"
            "organisers social"
            "copyright  social";
    }

    .footer-organisers {
        align-self: start;
        margin: 1.25rem 0 2rem;
    }

    .footer-organiser-logos {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

.footer-social-list {
    margin-bottom: 0;
}

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

.footer-social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #ffffff;
    font-size: 0.8rem;
    text-decoration: none;
    white-space: nowrap;
}

.footer-social-link .bi {
    font-size: 1.1rem;
    line-height: 1;
}

.footer-social-link:hover,
.footer-social-link:focus-visible {
    color: var(--ras-green-lime);
}

@media (max-width: 575.98px) {
    .site-footer {
        padding: 1.75rem 0 1.5rem;
    }

    .footer-layout {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "brand"
            "organisers"
            "social"
            "copyright";

        /* max-width: 250px; */
        margin-left: auto;
        margin-right: auto;
    }

    /* .footer-brand {
        text-align: center;
    }

    .footer-logo {
        width: 200px;
    } */

    .footer-tagline {
        font-size: 0.75rem;
        margin: 0 8px 2.25rem;
        max-width: none;
    }

    .footer-social {
        /* margin-left: auto;
        margin-right: auto;
        margin-bottom: 1.25rem; */

        margin: 0 8px 2.25rem;
    }

    .footer-organisers {
        margin: 0 8px 2.25rem;
    }

    .footer-organisers-title {
        font-size: 0.75rem;
    }

    .footer-organiser-logo-nus {
        height: 36px;
    }

    .footer-organiser-logo-nus-college {
        height: 26px;
    }

    .footer-copyright {
        font-size: 0.6rem;
        /* text-align: center; */
        
        margin: 0 8px;
    }

    .footer-connect-title,
    .footer-social-link {
        font-size: 0.75rem;
    }

    .footer-social-link .bi {
        font-size: 1rem;
    }
}
