/* ==========================================================================
   Affiliations & Awards page
   Tabbed layout built on the PTA "stagger-stage" grid + Magnific lightbox.
   Theme colours: --blue #003366, --secondary-color #ecb250
   ========================================================================== */

.affiliations-wrap {
    padding: 2vh 0 6vh;
}

.affil-intro {
    text-align: center;
    color: #44617c;
    max-width: 880px;
    margin: 0 auto 2.5rem;
    line-height: 1.8;
    font-family: 'Merriweather', serif;
}

/* ---------------- Tabs ---------------- */
.aa-tabs {
    display: flex;
    justify-content: center;
    margin: 0 auto 2.5rem;
    border-radius: 50px;
    background: #eef2f7;
    padding: 6px;
    width: fit-content;
    max-width: 100%;
    /* flex-wrap: wrap; */
}

.aa-tab {
    border: none;
    background: transparent;
    color: var(--blue);
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    /* text-transform: uppercase; */
    letter-spacing: 0.5px;
    padding: 12px 32px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.aa-tab:hover {
    color: var(--secondary-color);
}

.aa-tab.active {
    background: var(--blue);
    color: #fff;
    box-shadow: 0 6px 16px rgba(0, 51, 102, 0.25);
}

/* ---------------- Panels ---------------- */
.aa-panel {
    display: none;
}

.aa-panel.active {
    display: block;
}

/* ==========================================================================
   AFFILIATIONS — grid of 2, using the student-council card style
   (thick colour-bordered rounded certificate frame + content card with the
   animated gold "right-border" corner accent).
   ========================================================================== */
.affil-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3.5rem 3rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 0 2rem;
}

.affil-item {
    display: flex;
    flex-direction: column;
}

/* --- certificate frame (thick colour border, rounded, click-to-zoom) ---
   The set mixes 3 portrait (Cambridge) + 1 landscape (IB) certificate, so
   instead of cropping (which can't suit both shapes) each certificate is
   shown in full with object-fit:contain on a soft matte background. Every
   card is the same size, so the grid stays uniform and tidy, and no text is
   lost. Full-resolution read via click-to-zoom. */
.affil-img-frame {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 340px;
    padding: 20px;
    background: linear-gradient(160deg, #f4f8fc 0%, #e9f0f8 100%);
    border: 1.2vh solid var(--blue);
    border-radius: 36px;
    overflow: hidden;
    text-decoration: none;
    cursor: zoom-in;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.affil-img-frame:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 38px rgba(0, 51, 102, 0.18);
}

.affil-img-frame img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0, 51, 102, 0.14);
    transition: transform 0.5s ease;
}

.affil-img-frame:hover img {
    transform: scale(1.04);
}

/* "View certificate" hint — a pill that fades in over a soft dim on hover */
.affil-img-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 51, 102, 0.12);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    z-index: 2;
}

.affil-img-frame:hover::after {
    opacity: 1;
}

.affil-view-hint {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 30px;
    background: var(--blue);
    color: #fff;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 8px 20px rgba(0, 51, 102, 0.35);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.85);
    transition: opacity 0.35s ease, transform 0.35s ease;
    pointer-events: none;
}

.affil-img-frame:hover .affil-view-hint {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* border colour variants (mirrors the student-council alternating borders) */
.af-border-blue {
    border-color: #124268;
}

.af-border-gold {
    border-color: #ebb34d;
}

.af-border-skyblue {
    border-color: #067bbf;
}

/* --- content card below the frame ---
   flex:1 makes the card fill the leftover height of its (grid-stretched)
   item, so both cards in a row match height even when titles differ in
   length; the date is pushed to the bottom so dates line up across the row. */
.affil-content.right-border {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    background: #fff;
    border-radius: 22px;
    box-shadow: 3px 0px 13px 6px #00000016;
    padding: 2.5rem 2rem 2.25rem;
    margin: -2.5rem 1.5rem 0;
    z-index: 2;
}

/* push the date pill to the bottom so dates align row-to-row */
.affil-content .affil-date {
    margin-top: auto;
}

/* reuse the student-council gold "drawLine" corner, bottom-right */
.affil-content.right-border::after {
    content: '';
    position: absolute;
    border: 3px solid var(--secondary-color);
    border-radius: 0px 0px 30px 0px;
    border-left: none;
    border-top: none;
    bottom: -8px;
    right: -8px;
    pointer-events: none;
}

.affil-content.right-border.animate-border::after {
    animation: drawLine 2.5s linear forwards;
}

@keyframes drawLine {
    0% {
        width: 0%;
        height: 0;
    }

    50% {
        width: 12%;
        height: 28%;
    }

    100% {
        width: 24%;
        height: 55%;
    }
}

/* Highlighted year badge — floats onto the certificate frame above it */
.affil-year {
    position: absolute;
    top: -22px;
    left: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #f0c674 100%);
    color: var(--blue);
    font-family: 'Lato', sans-serif;
    font-weight: 900;
    font-size: 1.15rem;
    letter-spacing: 2px;
    padding: 8px 24px;
    border-radius: 30px;
    box-shadow: 0 8px 20px rgba(236, 178, 80, 0.45);
    border: 2px solid #fff;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* little star accent inside the badge */
/* .affil-year::before {
    content: "\2605";
    font-size: 0.85rem;
    color: var(--primary-color, #a20319);
    line-height: 1;
} */

.affil-title {
    color: var(--blue);
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 1.35rem;
    line-height: 1.3;
    margin: 0 0 0.6rem;
}

.affil-desc {
    color: #44617c;
    font-family: 'Merriweather', serif;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0 0 1rem;
}

.affil-date {
    display: inline-flex;
    align-items: center;
    color: #fff;
    background: var(--blue);
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 5px 16px;
    border-radius: 30px;
}

/* zoom icon on the certificate frame (reuses .award-zoom look) */
/* .affil-img-frame .award-zoom {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 5;
    pointer-events: none;
}

.affil-img-frame:hover .award-zoom {
    opacity: 1;
    transform: scale(1);
} */

/* Responsive: single column on tablet/phone */
@media (max-width: 991px) {
    .affil-grid {
        grid-template-columns: 1fr;
        gap: 3rem 0;
        max-width: 560px;
    }

    .affil-img-frame {
        height: 330px;
        border-width: 10px;
    }
}

@media (max-width: 575px) {
    .affil-img-frame {
        height: 300px;
        border-radius: 28px;
        padding: 14px;
    }

    .affil-content.right-border {
        padding: 1.5rem 1.5rem 1.75rem;
        margin: -2rem 1rem 0;
    }

    .affil-title {
        font-size: 1.2rem;
    }
}

/* ==========================================================================
   AWARDS & AFFILIATIONS — grouped by year, using the PTA stagger-stage cards + Magnific
   ========================================================================== */
.aa-year-group {
    margin-bottom: 2.5rem;
}

.aa-year-group:last-child {
    margin-bottom: 0;
}

.aa-year-title {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: var(--blue);
    font-family: 'Lato', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 10px 34px 10px 30px;
    margin: 60px auto 3rem;
    position: relative;
    background: linear-gradient(135deg, #f4f8fc 0%, #e9f0f8 100%);
    /* border-left: 6px solid var(--secondary-color); */
    border-radius: 50px;
    /* box-shadow: 0 10px 24px rgba(0, 51, 102, 0.10); */
    display: flex;
    width: fit-content;
}

/* small decorative diamond accent before the year number */
.aa-year-title::before {
    content: "";
    width: 12px;
    height: 12px;
    background: var(--primary-color, #a20319);
    transform: rotate(45deg);
    flex: 0 0 auto;
    box-shadow: 0 0 0 4px rgba(162, 3, 25, 0.12);
}

/* gold underline sweep that anchors the title to the row of cards */
/* .aa-year-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -12px;
    width: 72px;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary-color), rgba(236, 178, 80, 0));
    border-radius: 4px;
} */

/* Each year's stagger-stage sits tight under its title */
.aa-year-group .stagger-stage {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Cap each award card at ~a third of the row and align left, so a year with
   only 1 or 2 awards keeps the same card size as a year with 3 (instead of a
   single card stretching across the whole width). */
.awards-gallery .products-stagger {
    flex-wrap: wrap;
    justify-content: flex-start;
    /* gap: 1.75rem; */
}

.awards-gallery .products-stagger .stagger-card {
    flex: 0 0 calc((100% - 3.5rem) / 3);
    max-width: calc((100% - 3.5rem) / 3);
    min-width: 0;
}

/* Certificate media area inside the stagger showcase card.
   Override pta.css's canvas-area (cover/crop/negative margin) so each
   certificate is shown fully on a clean white panel and is clickable. */
.awards-gallery .canvas-area.aa-award-media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 240px;
    /* margin: 0 0 1rem; */
    padding: 16px;
    /* background: #fff; */
    border-radius: 12px;
    overflow: hidden;
    cursor: zoom-in;
    text-decoration: none;
    perspective: none;
}

/* beat pta.css ".canvas-area img { object-fit:cover }" */
.awards-gallery .canvas-area.aa-award-media img {
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    transition: transform 0.4s ease;
    border-radius: 10px;
}

.awards-gallery .canvas-area.aa-award-media:hover img {
    transform: scale(1.05);
}

/* caption text on the yellow card */
.awards-gallery .info-panel .product-description {
    color: var(--blue) !important;
    font-family: 'Merriweather', serif;
    font-weight: 600;
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
    text-align: center;
}

.aa-inline-date {
    display: block;
    margin-top: 6px;
    color: var(--primary-color);
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.82rem;
}

/* zoom icon overlay */
/* .award-zoom {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 5;
    pointer-events: none;
}

.awards-gallery .aa-award-media:hover .award-zoom {
    opacity: 1;
    transform: scale(1);
} */

/* ---------------- Responsive ---------------- */
/* Tablet: 2 per row */
@media (min-width: 768px) and (max-width: 1199px) {
    .awards-gallery .products-stagger .stagger-card {
        flex: 0 0 calc((100% - 1.75rem) / 2);
        max-width: calc((100% - 1.75rem) / 2);
    }
}

@media (max-width: 767px) {
    .aa-tab {
        font-size: 0.9rem;
        padding: 10px 20px;
    }

    .affil-intro {
        font-size: 0.95rem;
    }

    .aa-year-title {
        font-size: 1.2rem;
        padding: 8px 22px 8px 18px;
        gap: 10px;
    }

    .awards-gallery .canvas-area.aa-award-media {
        height: 220px;
    }

    /* Mobile: 1 per row */
    .awards-gallery .products-stagger .stagger-card {
        flex: 0 0 100%;
        max-width: 420px;
    }

    .awards-gallery .products-stagger {
        justify-content: center;
    }
}

@media (max-width: 420px) {
    .aa-tabs {
        width: 100%;
    }

    .aa-tab {
        flex: 1;
        padding: 10px 12px;
        text-align: center;
    }
}

/* ==========================================================================
   Magnific Popup close button — styled like the site's #closeVideo.close-btn
   (a plus icon rotated 45° into an ×, swapping to white on hover).
   Scoped to the certificate/award lightboxes via their mainClass.
   ========================================================================== */
.mfp-with-zoom .mfp-close,
.mfp-with-zoom .mfp-close:active {
    width: 46px;
    height: 46px;
    top: 18px;
    right: 22px;
    opacity: 1;
    margin: 0;
    padding: 0;
    background: url(../home-img/svg/plusIcon.svg) center / contain no-repeat;
    transform: rotate(45deg);
    transition: all 0.3s linear;
    /* no filter initially */
    filter: none;
    /* hide Magnific's default "×" glyph */
    font-size: 0 !important;
    line-height: 0 !important;
    color: transparent !important;
    text-indent: -9999px;
    overflow: hidden;
    white-space: nowrap;
}

.mfp-title{
    display: none;
}

/* belt-and-braces: blank the glyph even if Magnific injects it as ::after */
.mfp-with-zoom .mfp-close::after,
.mfp-with-zoom .mfp-close::before {
    content: "" !important;
    display: none !important;
}

.mfp-with-zoom .mfp-close:hover {
    /* white on hover: keep the same icon, add the filter + rotate a touch more */
    /* filter: brightness(0) invert(1); */
    background: url(../home-img/svg/plusIcon-white.svg);
    background-repeat: no-repeat;
    object-fit: cover;
    background-size: cover;
    transform: rotate(135deg) scale(1.08);
}

/* keep the icon crisp when the close sits inside the image container */
.mfp-with-zoom.mfp-close-btn-in .mfp-close {
    color: transparent;
}

@media (max-width: 767px) {

    /* beat Magnific's .mfp-img-mobile .mfp-close (dark box, fixed pos) */
    .mfp-with-zoom.mfp-img-mobile .mfp-close,
    .mfp-with-zoom .mfp-close,
    .mfp-with-zoom .mfp-close:active {
        position: fixed;
        width: 10vw;
        height: 10vw;
        max-width: 48px;
        max-height: 48px;
        top: 12px;
        right: 12px;
        background: url(../home-img/svg/plusIcon.svg) center / contain no-repeat;
        transform: rotate(45deg);
        /* no filter initially */
        filter: none;
    }

    .mfp-with-zoom.mfp-img-mobile .mfp-close:hover,
    .mfp-with-zoom .mfp-close:hover {
        /* white on hover via filter + extra rotation */
        filter: brightness(0) invert(1);
        transform: rotate(135deg) scale(1.08);
    }
}
