/*
 * Gallery showcase for the default school website (gallery and album pages).
 * Albums, titles, descriptions and photos come from the school admin's Gallery module.
 */
.gs {
    --gs-navy: #1b3a68;
    --gs-gold: #e2b33c;
    --gs-ink: #1c2433;
    --gs-muted: #5b6474;
    --gs-radius: 22px;
    position: relative;
    isolation: isolate;
    overflow-x: clip;
    padding-bottom: 120px;
}

/* Soft dotted accent behind the page */
.gs::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 40px;
    right: -120px;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background-image: radial-gradient(rgba(27, 58, 104, .16) 1.6px, transparent 1.8px);
    background-size: 18px 18px;
    animation: gs-drift 18s ease-in-out infinite alternate;
}

.gs-intro {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.gs-title {
    margin: 0;
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 700;
    line-height: 1.15;
    color: var(--gs-ink);
}
.gs-lead {
    margin: 0;
    font-size: 17px;
    line-height: 1.6;
    color: var(--gs-muted);
}

/* ---------- Album grid ---------- */
.gs-grid {
    list-style: none;
    padding: 0 !important;
    margin: 44px 0 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 250px;
    gap: 22px;
}
.gs-item { min-width: 0; }
.gs-item--feature { grid-column: span 2; grid-row: span 2; }
.gs-item--tall { grid-row: span 2; }
.gs-item--span2 { grid-column: span 2; }
.gs-item--span3 { grid-column: span 3; }
.gs-item--full { grid-column: 1 / -1; grid-row: span 2; }

.gs-card {
    position: relative;
    display: block;
    height: 100%;
    border-radius: var(--gs-radius);
    overflow: hidden;
    isolation: isolate;
    color: #fff !important;
    text-decoration: none !important;
    background: var(--gs-navy);
    box-shadow: 0 22px 44px -26px rgba(27, 58, 104, .6);
    transition: translate .45s cubic-bezier(.2, .65, .3, 1), box-shadow .45s ease;
}
.gs-card:hover { translate: 0 -6px; box-shadow: 0 30px 56px -26px rgba(27, 58, 104, .7); }
.gs-card:focus-visible { outline: 3px solid var(--gs-gold); outline-offset: 4px; }

.gs-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    transition: scale 1.3s cubic-bezier(.2, .65, .3, 1);
}
.gs-card:hover .gs-card__img { scale: 1.08; }
/* Each card's photo settles into place as it scrolls into view */
.reveal-on [data-reveal]:not(.is-revealed) .gs-card__img { scale: 1.2; }

.gs-card__shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(14, 30, 58, 0) 30%, rgba(14, 30, 58, .55) 62%, rgba(14, 30, 58, .92) 100%);
}
.gs-card::after {
    content: "";
    position: absolute;
    left: 24px;
    bottom: 0;
    width: 0;
    height: 4px;
    border-radius: 4px 4px 0 0;
    background: var(--gs-gold);
    transition: width .55s cubic-bezier(.2, .65, .3, 1);
}
.gs-card:hover::after, .gs-card:focus-visible::after { width: calc(100% - 48px); }

.gs-card__body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 22px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.gs-card__meta {
    align-self: flex-start;
    padding: 4px 11px;
    border-radius: 999px;
    background: var(--gs-gold);
    color: var(--gs-navy);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .02em;
}
.gs-card__title { font-size: 21px; font-weight: 700; line-height: 1.2; }
.gs-item--feature .gs-card__title, .gs-item--full .gs-card__title { font-size: clamp(24px, 2.6vw, 32px); }
.gs-card__desc {
    font-size: 14.5px;
    line-height: 1.5;
    opacity: .92;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.gs-item--feature .gs-card__desc, .gs-item--full .gs-card__desc { font-size: 16px; -webkit-line-clamp: 3; max-width: 560px; }
.gs-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gs-gold);
    opacity: 0;
    translate: 0 8px;
    transition: opacity .35s ease, translate .35s ease;
}
.gs-card:hover .gs-card__cta, .gs-card:focus-visible .gs-card__cta { opacity: 1; translate: 0 0; }
@media (hover: none) { .gs-card__cta { opacity: 1; translate: 0 0; } }

/* ---------- Album page ---------- */
.gs-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--primary-color, var(--gs-navy)) !important;
    text-decoration: none !important;
}
.gs-back:hover i { translate: -4px 0; }
.gs-back i { transition: translate .25s ease; }
.gs-count { font-size: 14px; font-weight: 700; color: var(--gs-navy); background: rgba(226, 179, 60, .22); padding: 5px 12px; border-radius: 999px; }

.gs-masonry {
    list-style: none;
    padding: 0 !important;
    margin: 44px 0 0;
    columns: 3 300px;
    column-gap: 22px;
}
.gs-masonry:has(> li:only-child) { columns: 1; max-width: 920px; margin-inline: auto; }
.gs-masonry:has(> li:nth-child(2):last-child) { columns: 2; }
.gs-shot { break-inside: avoid; margin-bottom: 22px; }
.gs-shot__btn {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: var(--gs-radius);
    overflow: hidden;
    background: var(--gs-navy);
    cursor: zoom-in;
    box-shadow: 0 22px 44px -26px rgba(27, 58, 104, .6);
    transition: translate .45s cubic-bezier(.2, .65, .3, 1), box-shadow .45s ease;
}
.gs-shot__btn:hover { translate: 0 -5px; box-shadow: 0 30px 56px -26px rgba(27, 58, 104, .7); }
.gs-shot__btn:focus-visible { outline: 3px solid var(--gs-gold); outline-offset: 4px; }
.gs-shot__btn img { display: block; width: 100%; height: auto; transition: scale 1.2s cubic-bezier(.2, .65, .3, 1); }
.gs-shot__btn:hover img { scale: 1.05; }
.reveal-on [data-reveal]:not(.is-revealed) .gs-shot__btn img { scale: 1.15; }
.gs-shot__zoom {
    position: absolute;
    right: 14px;
    bottom: 14px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: var(--gs-navy);
    opacity: 0;
    scale: .8;
    transition: opacity .3s ease, scale .3s ease;
}
.gs-shot__btn:hover .gs-shot__zoom, .gs-shot__btn:focus-visible .gs-shot__zoom { opacity: 1; scale: 1; }
@media (hover: none) { .gs-shot__zoom { opacity: 1; scale: 1; } }
.gs-shot--video .gs-shot__zoom { opacity: 1; scale: 1; width: 58px; height: 58px; left: 50%; top: 50%; right: auto; bottom: auto; translate: -50% -50%; font-size: 20px; }
.gs-subtitle { margin: 56px 0 0; text-align: center; font-size: 26px; font-weight: 700; color: var(--gs-ink); }

/* ---------- Lightbox ---------- */
.gs-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 64px;
    align-items: center;
    padding: 24px 12px;
    background: rgba(8, 16, 30, .94);
    opacity: 0;
    transition: opacity .3s ease;
}
.gs-lightbox[hidden] { display: none; }
.gs-lightbox.is-open { opacity: 1; }
.gs-lb__stage { grid-column: 2; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 16px; max-height: 100%; }
.gs-lb__img, .gs-lb__video {
    max-width: 100%;
    max-height: calc(100vh - 190px);
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.gs-lb__img { object-fit: contain; animation: gs-pop .45s cubic-bezier(.2, .65, .3, 1); }
.gs-lb__video { width: min(1000px, 100%); aspect-ratio: 16 / 9; border: 0; }
.gs-lb__caption { max-width: 760px; text-align: center; color: #e9edf4; display: flex; flex-direction: column; gap: 4px; font-size: 15px; line-height: 1.5; }
.gs-lb__caption strong { color: #fff; font-size: 18px; }
.gs-lb__counter { color: var(--gs-gold); font-weight: 700; font-size: 13px; letter-spacing: .06em; }
.gs-lb__btn {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: background .2s ease, scale .2s ease;
}
.gs-lb__btn:hover { background: var(--gs-gold); color: var(--gs-navy); scale: 1.06; }
.gs-lb__btn:focus-visible { outline: 3px solid var(--gs-gold); outline-offset: 3px; }
.gs-lb__prev { grid-column: 1; justify-self: center; }
.gs-lb__next { grid-column: 3; justify-self: center; }
.gs-lb__close { position: absolute; top: 18px; right: 18px; }
.gs-lb__btn[hidden] { display: none; }

@keyframes gs-pop { from { opacity: 0; scale: .94; } to { opacity: 1; scale: 1; } }
@keyframes gs-drift { from { translate: 0 0; rotate: 0deg; } to { translate: -40px 30px; rotate: 8deg; } }

/* ---------- Smaller screens ---------- */
@media (max-width: 991px) {
    .gs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 230px; }
    .gs-item--feature, .gs-item--full { grid-column: 1 / -1; grid-row: span 2; }
    .gs-item--tall { grid-row: span 1; }
    .gs-item--span2, .gs-item--span3 { grid-column: auto; }
    .gs-item--span2:last-child:nth-child(even), .gs-item--span3:last-child:nth-child(even) { grid-column: 1 / -1; }
}
@media (max-width: 575px) {
    .gs { padding-bottom: 90px; }
    .gs-grid { grid-template-columns: minmax(0, 1fr); grid-auto-rows: 260px; gap: 18px; }
    .gs-item--feature, .gs-item--full, .gs-item--span2, .gs-item--span3 { grid-column: auto; grid-row: span 1; }
    .gs-item--span2:last-child:nth-child(even), .gs-item--span3:last-child:nth-child(even) { grid-column: auto; }
    .gs-masonry, .gs-masonry:has(> li:nth-child(2):last-child) { columns: 1; }
    .gs-lightbox { grid-template-columns: minmax(0, 1fr); padding: 70px 10px 90px; }
    .gs-lb__stage { grid-column: 1; }
    .gs-lb__prev, .gs-lb__next { position: absolute; bottom: 20px; }
    .gs-lb__prev { left: calc(50% - 64px); }
    .gs-lb__next { left: calc(50% + 12px); }
    .gs::before { width: 260px; height: 260px; right: -110px; }
}

@media (prefers-reduced-motion: reduce) {
    .gs::before, .gs-lb__img { animation: none; }
    .gs-card, .gs-card__img, .gs-card__cta, .gs-card::after, .gs-shot__btn, .gs-shot__btn img, .gs-lightbox { transition: none; }
    .gs-card:hover, .gs-shot__btn:hover { translate: none; }
    .gs-card:hover .gs-card__img, .gs-shot__btn:hover img { scale: none; }
}

/* ---------- Home page gallery strip ---------- */
.gs-home { padding-bottom: 100px; }
.gs-home .gs-title { display: block; }
.gs-more { display: flex; justify-content: center; margin-top: 36px; }
.gs-more__btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 26px;
    border-radius: 999px;
    background: var(--gs-navy);
    color: #fff !important;
    font-weight: 600;
    text-decoration: none !important;
    box-shadow: 0 16px 34px -18px rgba(27, 58, 104, .7);
    transition: background .25s ease, color .25s ease, translate .25s ease;
}
.gs-more__btn:hover { background: var(--gs-gold); color: var(--gs-navy) !important; translate: 0 -2px; }
.gs-more__btn:hover i { translate: 4px 0; }
.gs-more__btn i { transition: translate .25s ease; }
.gs-more__btn:focus-visible { outline: 3px solid var(--gs-gold); outline-offset: 4px; }
