.page-hero--gallery {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(115deg, rgba(43, 11, 11, 0.95), rgba(113, 25, 25, 0.82)),
        url('../images/gallery/alumni-meet-dms-family.jpg') center 45% / cover no-repeat;
}

.fms-gallery-section {
    overflow: hidden;
}

.fms-gallery-intro {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
    gap: 48px;
    align-items: end;
    margin-bottom: 26px;
}

.fms-gallery-intro p {
    margin: 0;
    max-width: 560px;
    color: #5e6774;
    line-height: 1.75;
}

.fms-gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0 32px;
}

.fms-gallery-filter {
    appearance: none;
    border: 1px solid rgba(107, 28, 28, 0.16);
    background: #ffffff;
    color: #632121;
    border-radius: 999px;
    padding: 10px 17px;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.2s ease;
}

.fms-gallery-filter:hover,
.fms-gallery-filter.is-active {
    background: #6d1c1c;
    border-color: #6d1c1c;
    color: #ffffff;
}

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

.fms-gallery-card {
    grid-column: span 4;
    min-height: 300px;
    overflow: hidden;
    border-radius: 18px;
    box-shadow: 0 18px 46px rgba(21, 26, 36, 0.10);
    background: #e8ebee;
}

.fms-gallery-card:nth-child(1),
.fms-gallery-card:nth-child(4),
.fms-gallery-card:nth-child(9) {
    grid-column: span 6;
}

.fms-gallery-open {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    min-height: inherit;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: #151a22;
    cursor: pointer;
    text-align: left;
}

.fms-gallery-open img {
    width: 100%;
    height: 100%;
    min-height: inherit;
    display: block;
    object-fit: cover;
    transition: transform 0.55s ease, filter 0.55s ease;
}

.fms-gallery-open:hover img,
.fms-gallery-open:focus-visible img {
    transform: scale(1.06);
    filter: brightness(0.78);
}

.fms-gallery-open:focus-visible {
    outline: 3px solid #f0b55a;
    outline-offset: 3px;
}

.fms-gallery-overlay {
    position: absolute;
    inset: auto 0 0;
    display: flex;
    min-height: 150px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: end;
    gap: 7px;
    padding: 22px;
    color: #ffffff;
    background: linear-gradient(180deg, transparent, rgba(20, 13, 13, 0.93));
}

.fms-gallery-category {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.20);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.fms-gallery-overlay strong {
    font-size: clamp(18px, 2vw, 25px);
    line-height: 1.18;
}

.fms-gallery-view {
    font-size: 13px;
    font-weight: 800;
    opacity: 0.92;
}

.fms-gallery-view b {
    font-size: 16px;
}

.fms-lightbox {
    position: fixed;
    z-index: 9999;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 32px 86px;
    background: rgba(9, 12, 18, 0.93);
}

.fms-lightbox.is-open {
    display: flex;
}

.fms-lightbox-content {
    width: min(100%, 1180px);
    max-height: 92vh;
    margin: 0;
    text-align: center;
}

.fms-lightbox-content img {
    width: auto;
    max-width: 100%;
    max-height: calc(92vh - 86px);
    display: block;
    margin: 0 auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 25px 85px rgba(0, 0, 0, 0.50);
}

.fms-lightbox-content figcaption {
    margin-top: 13px;
    color: #ffffff;
}

.fms-lightbox-content figcaption span,
.fms-lightbox-content figcaption strong {
    display: block;
}

.fms-lightbox-content figcaption span {
    margin-bottom: 4px;
    color: #f0b55a;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.fms-lightbox-content figcaption strong {
    font-size: 20px;
}

.fms-lightbox-close,
.fms-lightbox-nav {
    position: absolute;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.10);
    color: #ffffff;
    font: inherit;
    cursor: pointer;
}

.fms-lightbox-close {
    top: 22px;
    right: 25px;
    font-size: 32px;
    line-height: 1;
}

.fms-lightbox-nav {
    top: 50%;
    transform: translateY(-50%);
    font-size: 42px;
    line-height: 1;
}

.fms-lightbox-prev { left: 24px; }
.fms-lightbox-next { right: 24px; }

.fms-lightbox-close:hover,
.fms-lightbox-nav:hover {
    border-color: #f0b55a;
    background: #f0b55a;
    color: #321010;
}

.fms-gallery-no-scroll {
    overflow: hidden;
}

@media (max-width: 900px) {
    .fms-gallery-intro {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .fms-gallery-card,
    .fms-gallery-card:nth-child(1),
    .fms-gallery-card:nth-child(4),
    .fms-gallery-card:nth-child(9) {
        grid-column: span 6;
        min-height: 270px;
    }
}

@media (max-width: 620px) {
    .fms-gallery-grid {
        gap: 14px;
    }

    .fms-gallery-card,
    .fms-gallery-card:nth-child(1),
    .fms-gallery-card:nth-child(4),
    .fms-gallery-card:nth-child(9) {
        grid-column: span 12;
        min-height: 260px;
    }

    .fms-gallery-filters {
        gap: 8px;
    }

    .fms-gallery-filter {
        padding: 9px 13px;
        font-size: 13px;
    }

    .fms-lightbox {
        padding: 24px 14px 82px;
    }

    .fms-lightbox-content img {
        max-height: calc(85vh - 70px);
    }

    .fms-lightbox-close {
        top: 12px;
        right: 12px;
    }

    .fms-lightbox-nav {
        top: auto;
        bottom: 18px;
        transform: none;
    }

    .fms-lightbox-prev { left: calc(50% - 58px); }
    .fms-lightbox-next { right: calc(50% - 58px); }
}
