.college-gallery-page {
    --gallery-ink: var(--heading-color);
    --gallery-muted: color-mix(in srgb, var(--default-color), transparent 25%);
    --gallery-border: color-mix(in srgb, var(--default-color), transparent 86%);
    --gallery-radius: 14px;
    overflow: visible;
}

.college-gallery-page .gallery-intro {
    max-width: 760px;
    margin: 0 auto 34px;
    text-align: center;
}

.college-gallery-page .gallery-eyebrow {
    margin: 0 0 8px;
    color: var(--accent-color);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.college-gallery-page .gallery-intro h2 {
    margin: 0 0 12px;
    color: var(--gallery-ink);
    font-family: var(--heading-font);
    font-size: clamp(26px, 3vw, 36px);
    font-weight: 700;
}

.college-gallery-page .gallery-intro > p:last-child {
    margin: 0;
    color: var(--gallery-muted);
    font-size: 16px;
    line-height: 1.7;
}

.college-gallery-page .gallery-filter-wrap {
    margin-bottom: 12px;
    overflow: hidden;
}

.college-gallery-page .gallery-filters {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 5px 2px 12px;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
}

.college-gallery-page .gallery-filter {
    display: inline-flex;
    min-height: 44px;
    flex: 0 0 auto;
    align-items: center;
    gap: 9px;
    padding: 9px 15px;
    border: 1px solid var(--gallery-border);
    border-radius: 999px;
    background: var(--surface-color);
    color: var(--gallery-ink);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    scroll-snap-align: start;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.college-gallery-page .gallery-filter:hover {
    border-color: var(--accent-color);
    transform: translateY(-1px);
}

.college-gallery-page .gallery-filter.is-active {
    border-color: var(--accent-color);
    background: var(--accent-color);
    color: var(--contrast-color);
}

.college-gallery-page .gallery-filter-count {
    min-width: 22px;
    padding: 2px 6px;
    border-radius: 999px;
    background: color-mix(in srgb, currentColor, transparent 88%);
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
}

.college-gallery-page .gallery-status {
    min-height: 24px;
    margin: 5px 0 18px;
    color: var(--gallery-muted);
    font-size: 14px;
}

.college-gallery-page .gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}

.college-gallery-page .gallery-item[hidden],
.college-gallery-page .gallery-viewer[hidden],
.college-gallery-page .gallery-load-more[hidden] {
    display: none !important;
}

.college-gallery-page .gallery-item.is-entering {
    animation: gallery-card-enter 0.28s ease both;
}

.college-gallery-page .gallery-card {
    position: relative;
    display: block;
    width: 100%;
    overflow: hidden;
    padding: 0;
    border: 0;
    border-radius: var(--gallery-radius);
    background: var(--surface-color);
    box-shadow: 0 8px 24px color-mix(in srgb, var(--default-color), transparent 88%);
    color: var(--contrast-color);
    cursor: zoom-in;
    text-align: left;
}

.college-gallery-page .gallery-card img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.college-gallery-page .gallery-card:hover img,
.college-gallery-page .gallery-card:focus-visible img {
    transform: scale(1.045);
}

.college-gallery-page .gallery-card-overlay {
    position: absolute;
    inset: 30% 0 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding: 18px;
    background: linear-gradient(transparent, rgba(7, 24, 39, 0.86));
    opacity: 0;
    transition: opacity 0.22s ease;
}

.college-gallery-page .gallery-card:hover .gallery-card-overlay,
.college-gallery-page .gallery-card:focus-visible .gallery-card-overlay {
    opacity: 1;
}

.college-gallery-page .gallery-card-copy {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.college-gallery-page .gallery-card-title {
    overflow: hidden;
    font-size: 15px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.college-gallery-page .gallery-card-category {
    color: rgba(255, 255, 255, 0.82);
    font-size: 12px;
    line-height: 1.4;
}

.college-gallery-page .gallery-card-zoom {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 50%;
    font-size: 18px;
}

.college-gallery-page .gallery-card:focus-visible,
.college-gallery-page .gallery-filter:focus-visible,
.college-gallery-page .gallery-load-more:focus-visible,
.college-gallery-page .gallery-viewer button:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
}

.college-gallery-page .gallery-load-more-wrap {
    display: flex;
    justify-content: center;
    padding-top: 34px;
}

.college-gallery-page .gallery-load-more {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    border: 1px solid var(--accent-color);
    border-radius: 999px;
    background: var(--accent-color);
    color: var(--contrast-color);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.college-gallery-page .gallery-load-more:hover {
    background: color-mix(in srgb, var(--accent-color), #000 12%);
    transform: translateY(-1px);
}

.college-gallery-page .gallery-load-more-count {
    color: color-mix(in srgb, var(--contrast-color), transparent 18%);
    font-size: 13px;
    font-weight: 400;
}

.college-gallery-page .gallery-empty {
    padding: 64px 20px;
    border: 1px dashed var(--gallery-border);
    border-radius: var(--gallery-radius);
    color: var(--gallery-muted);
    text-align: center;
}

.college-gallery-page .gallery-empty i {
    color: var(--accent-color);
    font-size: 36px;
}

.college-gallery-page .gallery-empty p {
    margin: 12px 0 0;
}

.college-gallery-page .gallery-viewer {
    position: fixed;
    z-index: 20000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 22px;
}

.college-gallery-page .gallery-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 13, 23, 0.92);
}

.college-gallery-page .gallery-viewer-dialog {
    position: relative;
    z-index: 1;
    display: flex;
    width: min(1100px, 100%);
    max-height: 96vh;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    background: #101923;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.college-gallery-page .gallery-viewer-stage {
    position: relative;
    display: grid;
    min-height: 220px;
    height: min(72vh, 760px);
    flex: 1 1 auto;
    place-items: center;
    padding: 52px 72px 18px;
}

.college-gallery-page .gallery-viewer-image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.college-gallery-page .gallery-viewer-close,
.college-gallery-page .gallery-viewer-arrow {
    position: absolute;
    z-index: 2;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 50%;
    background: rgba(12, 21, 31, 0.82);
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.college-gallery-page .gallery-viewer-close:hover,
.college-gallery-page .gallery-viewer-arrow:hover {
    background: var(--accent-color);
    transform: scale(1.04);
}

.college-gallery-page .gallery-viewer-close {
    top: 14px;
    right: 16px;
    font-size: 16px;
}

.college-gallery-page .gallery-viewer-arrow {
    top: 50%;
    width: 46px;
    height: 46px;
    font-size: 22px;
    transform: translateY(-50%);
}

.college-gallery-page .gallery-viewer-arrow:hover {
    transform: translateY(-50%) scale(1.04);
}

.college-gallery-page .gallery-viewer-previous {
    left: 16px;
}

.college-gallery-page .gallery-viewer-next {
    right: 16px;
}

.college-gallery-page .gallery-viewer-caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 22px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
}

.college-gallery-page .gallery-viewer-caption h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
}

.college-gallery-page .gallery-viewer-caption p {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
}

.college-gallery-page .gallery-viewer-caption .gallery-viewer-counter {
    flex: 0 0 auto;
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
}

@keyframes gallery-card-enter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1199px) {
    .college-gallery-page .gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .college-gallery-page .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }
}

@media (max-width: 575px) {
    .college-gallery-page .gallery-intro {
        margin-bottom: 25px;
        text-align: left;
    }

    .college-gallery-page .gallery-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .college-gallery-page .gallery-card-overlay {
        opacity: 1;
        padding: 14px;
    }

    .college-gallery-page .gallery-viewer {
        padding: 10px;
    }

    .college-gallery-page .gallery-viewer-dialog {
        width: 100%;
        max-height: 94vh;
    }

    .college-gallery-page .gallery-viewer-stage {
        height: 70vh;
        min-height: 180px;
        padding: 58px 42px 12px;
    }

    .college-gallery-page .gallery-viewer-arrow {
        width: 38px;
        height: 38px;
    }

    .college-gallery-page .gallery-viewer-previous {
        left: 6px;
    }

    .college-gallery-page .gallery-viewer-next {
        right: 6px;
    }

    .college-gallery-page .gallery-viewer-caption {
        padding: 13px 15px 15px;
    }

    .college-gallery-page .gallery-viewer-caption h2 {
        font-size: 15px;
    }
}

@media (hover: none) {
    .college-gallery-page .gallery-card-overlay {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .college-gallery-page *,
    .college-gallery-page *::before,
    .college-gallery-page *::after {
        animation-duration: 0.01ms !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
