/* =========================================================
   Public Gallery - Visual Diary
========================================================= */

.rps-gallery-page {
    --gallery-navy: #080724;
    --gallery-ink: #111019;
    --gallery-muted: #474160;
    --gallery-panel: #FFFFFF;
    --gallery-line: rgba(8, 7, 36, 0.18);
    --gallery-accent: var(--primary-maroon, #7A1E2C);
    --gallery-gold: var(--soft-gold, #FCD34D);
    --gallery-slide-width: 306px;
    --gallery-overlap: -60px;
    position: relative;
    display: flex;
    min-height: 100vh;
    align-items: center;
    overflow: hidden;
    padding: 118px 0 92px;
    color: var(--gallery-ink);
    background: #111739;
}

.rps-gallery-page::before {
    content: "";
    position: absolute;
    inset: -28px;
    background:
        linear-gradient(90deg, rgba(8, 7, 36, 0.72), rgba(122, 30, 44, 0.18), rgba(8, 7, 36, 0.78)),
        url("../images/campus-1.jpg") center 46% / cover no-repeat;
    filter: blur(14px) saturate(1.08);
    transform: scale(1.04);
}

.rps-gallery-page::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 247, 237, 0.1), rgba(8, 7, 36, 0.2));
}

.rps-gallery-page .container {
    position: relative;
    z-index: 1;
}

.rps-gallery-shell {
    position: relative;
    width: min(1060px, calc(100vw - 48px));
    min-height: 570px;
    margin: 0 auto;
    padding: 50px 70px 36px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 24px;
    background: var(--gallery-panel);
    box-shadow:
        0 34px 80px rgba(8, 7, 36, 0.34),
        0 0 0 7px rgba(255, 255, 255, 0.18);
}

.rps-gallery-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 2px rgba(122, 30, 44, 0.08);
    pointer-events: none;
}

.rps-gallery-heading {
    max-width: 440px;
    margin: 0 auto;
    text-align: center;
}

.rps-gallery-heading .rgs-kicker {
    justify-content: center;
    gap: 6px;
    color: var(--gallery-navy);
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0;
}

.rps-gallery-heading .rgs-kicker i {
    color: var(--gallery-accent);
}

.rps-gallery-heading h1 {
    margin: 10px 0 8px;
    color: var(--gallery-ink);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(1.65rem, 2.6vw, 2rem);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: 0;
}

.rps-gallery-heading p {
    max-width: 340px;
    margin: 0 auto;
    color: var(--gallery-muted);
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.45;
}

.rps-gallery-filters {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 9px;
    max-width: 100%;
    margin: 24px auto 8px;
    padding: 0 6px 4px;
    overflow-x: auto;
    scroll-padding-inline: 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.rps-gallery-filters::-webkit-scrollbar {
    display: none;
}

.rps-gallery-filter {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 15px;
    border: 1px solid rgba(8, 7, 36, 0.34);
    border-radius: 999px;
    color: var(--gallery-navy);
    background: #FFFFFF;
    box-shadow: none;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.rps-gallery-filter i {
    color: currentColor;
    font-size: 0.86rem;
}

.rps-gallery-filter em {
    display: none;
}

.rps-gallery-filter:hover,
.rps-gallery-filter:focus-visible {
    color: var(--gallery-accent);
    border-color: rgba(122, 30, 44, 0.58);
    background: #FFF9EF;
    transform: translateY(-1px);
}

.rps-gallery-filter.is-active {
    color: #FFFFFF;
    border-color: var(--gallery-navy);
    background: var(--gallery-navy);
    box-shadow: 0 12px 28px rgba(8, 7, 36, 0.2);
}

.rps-gallery-panel {
    position: relative;
    z-index: 1;
}

.rps-gallery-viewport {
    position: relative;
    min-height: 260px;
    margin: 0 -70px;
    overflow: hidden;
    padding: 8px 0 4px;
}

.rps-gallery-track {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 24px max(70px, calc((100% - var(--gallery-slide-width)) / 2)) 22px;
    transition: transform 0.52s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.rps-gallery-slide {
    position: relative;
    flex: 0 0 var(--gallery-slide-width);
    aspect-ratio: 4 / 3;
    margin-inline: var(--gallery-overlap);
    overflow: hidden;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: var(--gallery-navy);
    box-shadow: 0 22px 54px rgba(8, 7, 36, 0.2);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.72);
    transform-origin: center;
    transition:
        opacity 0.42s ease,
        transform 0.42s ease,
        box-shadow 0.42s ease,
        filter 0.42s ease;
}

.rps-gallery-slide[hidden] {
    display: none !important;
}

.rps-gallery-slide.is-far-previous,
.rps-gallery-slide.is-far-next {
    z-index: 1;
    opacity: 0.52;
    pointer-events: auto;
    transform: scale(0.76);
}

.rps-gallery-slide.is-previous,
.rps-gallery-slide.is-next {
    z-index: 2;
    opacity: 0.88;
    pointer-events: auto;
    transform: scale(0.88);
}

.rps-gallery-slide.is-active {
    z-index: 5;
    opacity: 1;
    pointer-events: auto;
    transform: scale(1.14);
    box-shadow: 0 34px 70px rgba(8, 7, 36, 0.26);
}

.rps-gallery-slide-frame {
    display: block;
    width: 100%;
    height: 100%;
}

.rps-gallery-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
    transition: transform 0.56s ease, filter 0.3s ease;
    user-select: none;
    -webkit-user-drag: none;
}

.rps-gallery-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 58%, rgba(8, 7, 36, 0.35));
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.rps-gallery-slide-label {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 2;
    display: inline-flex;
    width: fit-content;
    max-width: calc(100% - 28px);
    min-height: 34px;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    color: #FFFFFF;
    background: rgba(8, 7, 36, 0.62);
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1.2;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.rps-gallery-slide:hover::after,
.rps-gallery-slide:focus-visible::after {
    opacity: 1;
}

.rps-gallery-slide:hover img,
.rps-gallery-slide:focus-visible img,
.rps-gallery-slide.is-active img {
    transform: scale(1.06);
    filter: saturate(1.05) contrast(1.03);
}

.rps-gallery-slide.is-active:hover .rps-gallery-slide-label,
.rps-gallery-slide.is-active:focus-visible .rps-gallery-slide-label {
    opacity: 1;
    transform: translateY(0);
}

.rps-gallery-controls {
    position: relative;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
}

.rps-gallery-controls button {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--gallery-navy);
    border-radius: 999px;
    color: var(--gallery-navy);
    background: #FFFFFF;
    cursor: pointer;
    box-shadow: none;
}

.rps-gallery-controls button:hover,
.rps-gallery-controls button:focus-visible {
    color: #FFFFFF;
    background: var(--gallery-navy);
    transform: translateY(-1px);
}

.rps-gallery-controls button:disabled {
    cursor: not-allowed;
    opacity: 0.38;
    transform: none;
}

.rps-gallery-status {
    color: var(--gallery-muted);
}

.rps-gallery-progress {
    width: 220px;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(8, 7, 36, 0.12);
}

.rps-gallery-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--gallery-accent), var(--gallery-gold));
    transition: width 0.35s ease;
}

.rps-gallery-empty {
    max-width: 520px;
    margin: 34px auto 0;
    padding: 30px;
    border: 1px dashed rgba(8, 7, 36, 0.22);
    border-radius: 12px;
    text-align: center;
    background: #FFF9EF;
}

.rps-gallery-empty i {
    color: var(--gallery-accent);
    font-size: 2rem;
}

.rps-gallery-empty h2 {
    margin: 14px 0 8px;
    color: var(--gallery-ink);
    font-size: 1.3rem;
    font-weight: 950;
}

.rps-gallery-empty p {
    margin: 0;
    color: var(--gallery-muted);
}

.rps-gallery-empty span {
    color: var(--gallery-accent);
    font-weight: 900;
}

@media (max-width: 1199px) {
    .rps-gallery-page {
        --gallery-slide-width: 286px;
        --gallery-overlap: -54px;
    }

    .rps-gallery-shell {
        width: min(940px, calc(100vw - 40px));
        padding-inline: 54px;
    }

    .rps-gallery-viewport {
        margin-inline: -54px;
    }
}

@media (max-width: 991px) {
    .rps-gallery-page {
        --gallery-slide-width: 276px;
        --gallery-overlap: -48px;
        padding: 104px 0 78px;
    }

    .rps-gallery-shell {
        min-height: 540px;
        padding: 48px 34px 36px;
    }

    .rps-gallery-filters {
        margin-top: 24px;
    }

    .rps-gallery-viewport {
        min-height: 260px;
        margin-inline: -34px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rps-gallery-page *,
    .rps-gallery-page *::before,
    .rps-gallery-page *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
