﻿.gallery-page {
    width: min(1280px, 100% - 34px);
    margin-inline: auto;
    padding: 1.6rem 0 42px;
    display: grid;
    gap: 22px;
}

.gallery-page .media-item,
.gallery-page .media-card,
.gallery-page .media-open-btn,
.gallery-page .media-open-btn img,
.gallery-page .media-open-btn video {
    background-color: #06172e !important;
}

.gallery-hero {
    display: grid;
    gap: 18px;
    margin-top: 0.4rem;
    padding: clamp(20px, 3vw, 34px);
    border-radius: 24px;
    background:
        radial-gradient(620px 260px at 6% -18%, rgba(79, 209, 197, 0.22), transparent 60%),
        radial-gradient(580px 250px at 94% -24%, rgba(242, 195, 91, 0.18), transparent 58%),
        rgba(8, 21, 44, 0.84);
    border: 1px solid rgba(156, 205, 255, 0.2);
}

.gallery-hero-content h1 {
    margin: 10px 0 10px;
    font-family: "Sora", "Manrope", sans-serif;
    font-size: clamp(1.68rem, 3.4vw, 2.65rem);
    line-height: 1.1;
    color: #f5fbff;
}

.gallery-hero-content p {
    margin: 0;
    max-width: 860px;
    color: #c4d5ea;
    font-size: clamp(0.98rem, 1.6vw, 1.1rem);
}

.gallery-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 6px 12px;
    border: 1px solid rgba(79, 209, 197, 0.38);
    background: rgba(79, 209, 197, 0.14);
    color: #a9f2ea;
    font-size: 0.74rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 800;
}

.gallery-kicker::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #4fd1c5;
    box-shadow: 0 0 0 5px rgba(79, 209, 197, 0.16);
}

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

.gallery-stat-card {
    border-radius: 16px;
    border: 1px solid rgba(165, 217, 255, 0.22);
    background: rgba(7, 19, 40, 0.68);
    padding: 14px;
    display: grid;
    gap: 3px;
}

.gallery-stat-card strong {
    font-family: "Sora", "Manrope", sans-serif;
    font-size: clamp(1.25rem, 2.6vw, 1.85rem);
    font-weight: 800;
    color: #f6fbff;
    line-height: 1;
}

.gallery-stat-card span {
    color: #aabdd7;
    font-size: 0.9rem;
    font-weight: 650;
}

.gallery-toolbar {
    border-radius: 20px;
    border: 1px solid rgba(164, 216, 255, 0.18);
    background: rgba(8, 20, 40, 0.66);
    padding: clamp(14px, 2.2vw, 18px);
    display: grid;
    gap: 14px;
}

.gallery-filters {
    margin-top: 0;
    justify-content: flex-start;
    gap: 10px;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid rgba(165, 221, 255, 0.42);
    background: rgba(10, 24, 48, 0.78);
    color: #dbe8f9;
    font-weight: 700;
    line-height: 1;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.filter-btn:hover,
.filter-btn:focus-visible {
    border-color: rgba(79, 209, 197, 0.72);
    background: rgba(79, 209, 197, 0.18);
    transform: translateY(-1px);
}

.filter-btn.active {
    color: #f7fcff;
    border-color: rgba(79, 209, 197, 0.78);
    background: linear-gradient(125deg, rgba(79, 209, 197, 0.26), rgba(47, 137, 255, 0.25));
}

.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 24px;
    border-radius: 999px;
    background: rgba(4, 13, 29, 0.74);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #cbe0f6;
    font-size: 0.78rem;
    font-weight: 800;
}

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

.gallery-search-wrap,
.gallery-sort-wrap {
    display: grid;
    gap: 6px;
}

.gallery-search-wrap span,
.gallery-sort-wrap span {
    color: #b6c9e2;
    font-size: 0.83rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.gallery-search,
.gallery-sort {
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(158, 209, 255, 0.26);
    background: rgba(5, 15, 31, 0.78);
    color: #eef6ff;
    outline: 0;
    font-size: 0.95rem;
    padding-inline: 13px;
}

.gallery-search:focus,
.gallery-sort:focus {
    border-color: rgba(79, 209, 197, 0.82);
    box-shadow: 0 0 0 0.2rem rgba(79, 209, 197, 0.2);
}

.gallery-sort {
    min-width: 190px;
}

.gallery-results {
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
    color: #b2c7e1;
    font-size: 0.9rem;
}

.gallery-results strong {
    font-size: 1.1rem;
    color: #f2f8ff;
}

.media-gallery {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid rgba(162, 213, 255, 0.18);
    background:
        radial-gradient(620px 240px at -8% -18%, rgba(79, 209, 197, 0.16), transparent 60%),
        radial-gradient(620px 240px at 108% -20%, rgba(242, 195, 91, 0.14), transparent 60%),
        linear-gradient(172deg, rgba(8, 20, 42, 0.72), rgba(7, 19, 38, 0.88));
    padding: clamp(14px, 2.3vw, 20px);
}

.media-gallery::before,
.media-gallery::after {
    content: "";
    position: absolute;
    pointer-events: none;
    border-radius: 999px;
    filter: blur(42px);
    opacity: 0.38;
}

.media-gallery::before {
    width: 180px;
    height: 180px;
    top: -74px;
    left: -48px;
    background: rgba(79, 209, 197, 0.35);
}

.media-gallery::after {
    width: 190px;
    height: 190px;
    right: -68px;
    bottom: -70px;
    background: rgba(242, 195, 91, 0.24);
}

.media-gallery-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
}

.media-card {
    position: relative;
    isolation: isolate;
    grid-column: span 4;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(164, 217, 255, 0.24);
    background: linear-gradient(178deg, rgba(7, 21, 44, 0.92), rgba(6, 18, 37, 0.92));
    box-shadow: 0 18px 46px rgba(2, 12, 27, 0.44);
    backdrop-filter: blur(7px);
    display: grid;
    grid-template-rows: auto 1fr;
    min-height: 100%;
    transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.media-card-video {
    grid-column: span 6;
}

.media-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.09), transparent 34%);
    opacity: 0.45;
    z-index: 0;
}

.media-card:hover,
.media-card:focus-within {
    border-color: rgba(79, 209, 197, 0.5);
    box-shadow: 0 22px 52px rgba(2, 12, 27, 0.56);
    transform: translateY(-4px);
}

.media-open-btn {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    border: 0;
    padding: 0;
    margin: 0;
    background: #06172e;
    cursor: pointer;
    text-align: left;
    overflow: hidden;
}

.media-open-btn img,
.media-open-btn video {
    width: 100%;
    height: 100%;
    display: block;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: center;
    background: #06172e;
    -webkit-appearance: none;
    transition: transform 0.35s ease, filter 0.35s ease;
    filter: saturate(1.02);
}

.media-open-btn video {
    background-color: #06172e;
    box-shadow: inset 0 0 0 1px rgba(167, 220, 255, 0.08);
}

.media-video-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background:
        radial-gradient(400px 180px at 12% 0%, rgba(79, 209, 197, 0.22), transparent 58%),
        linear-gradient(165deg, #071a36, #06162d 58%, #051227);
}

.media-video-frame::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(2, 9, 22, 0.02), rgba(2, 9, 22, 0.56));
    z-index: 1;
}

.media-video-frame video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.media-video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 3;
    width: 66px;
    height: 66px;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    border: 1px solid rgba(174, 224, 255, 0.56);
    background: rgba(6, 18, 38, 0.64);
    backdrop-filter: blur(6px);
    transition: transform 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.media-video-play-icon::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 53%;
    transform: translate(-50%, -50%);
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
    border-left: 15px solid #d8eeff;
}

.media-video-preview-label {
    position: absolute;
    bottom: 14px;
    left: 14px;
    z-index: 3;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(173, 224, 255, 0.48);
    background: rgba(6, 18, 37, 0.66);
    color: #d9ebff;
    font-size: 0.72rem;
    font-weight: 760;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.media-video-frame.is-playing .media-video-play-icon {
    transform: translate(-50%, -50%) scale(0.92);
    opacity: 0;
}

.media-video-frame.is-playing .media-video-preview-label {
    border-color: rgba(79, 209, 197, 0.74);
    color: #d7fff8;
    background: rgba(8, 33, 58, 0.8);
}

.media-open-btn video::-webkit-media-controls,
.media-open-btn video::-webkit-media-controls-enclosure {
    display: none !important;
}

.media-card:hover .media-open-btn img,
.media-card:hover .media-open-btn video,
.media-card:hover .media-video-frame video,
.media-card:focus-within .media-open-btn img,
.media-card:focus-within .media-open-btn video,
.media-card:focus-within .media-video-frame video {
    transform: scale(1.045);
    filter: saturate(1.1) brightness(1.04);
}

.media-card:hover .media-video-play-icon,
.media-card:focus-within .media-video-play-icon {
    transform: translate(-50%, -50%) scale(1.06);
    border-color: rgba(79, 209, 197, 0.78);
    background: rgba(10, 30, 58, 0.72);
}

.media-open-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(2, 9, 20, 0.55), rgba(2, 9, 20, 0.08) 48%, rgba(2, 9, 20, 0));
}

.media-type-chip {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    border-radius: 999px;
    border: 1px solid rgba(166, 221, 255, 0.45);
    background: rgba(5, 16, 34, 0.74);
    color: #d9ebff;
    padding: 5px 10px;
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    font-weight: 800;
    text-transform: uppercase;
}

.media-hover-pill {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 2;
    border-radius: 999px;
    border: 1px solid rgba(79, 209, 197, 0.56);
    background: rgba(9, 28, 56, 0.84);
    color: #d8fff9;
    padding: 7px 11px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    transform: translateY(8px);
    opacity: 0;
    transition: transform 0.24s ease, opacity 0.24s ease;
}

.media-card:hover .media-hover-pill,
.media-card:focus-within .media-hover-pill {
    opacity: 1;
    transform: translateY(0);
}

.media-card-body {
    position: relative;
    z-index: 1;
    padding: 14px 14px 15px;
    display: grid;
    gap: 7px;
    background: linear-gradient(180deg, rgba(8, 23, 45, 0.54), rgba(7, 19, 37, 0.78));
    border-top: 1px solid rgba(158, 210, 255, 0.14);
}

.media-card-body h2 {
    margin: 0;
    font-size: 1.01rem;
    line-height: 1.33;
    color: #f2f8ff;
    font-weight: 760;
}

.media-card-body p {
    margin: 0;
    color: #b7cae2;
    font-size: 0.9rem;
    line-height: 1.52;
}

.media-card-body small {
    color: #95abc7;
    font-size: 0.78rem;
    letter-spacing: 0.01em;
}

.media-item[hidden] {
    display: none !important;
}

.gallery-empty {
    border-radius: 16px;
    border: 1px dashed rgba(166, 218, 255, 0.26);
    background: rgba(7, 19, 39, 0.66);
    padding: 26px 16px;
    text-align: center;
    display: grid;
    gap: 10px;
}

.gallery-empty h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #ecf6ff;
}

.gallery-empty p {
    margin: 0;
    color: #b8cae2;
}

.gallery-empty .expo-btn {
    justify-self: center;
    min-width: 220px;
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: grid;
    place-items: center;
    background: rgba(3, 10, 22, 0.86);
    backdrop-filter: blur(7px);
    padding: 22px;
}

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

.gallery-lightbox-dialog {
    width: min(980px, 100%);
    border-radius: 18px;
    border: 1px solid rgba(171, 220, 255, 0.32);
    background: linear-gradient(170deg, rgba(7, 18, 38, 0.96), rgba(7, 17, 36, 0.96));
    box-shadow: 0 26px 70px rgba(2, 9, 22, 0.65);
    overflow: hidden;
}

.gallery-lightbox-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 13px 14px;
    border-bottom: 1px solid rgba(171, 220, 255, 0.18);
}

.gallery-lightbox-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 760;
    color: #eff7ff;
}

.gallery-lightbox-close {
    border: 1px solid rgba(166, 219, 255, 0.4);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(7, 21, 43, 0.9);
    color: #e9f5ff;
    font-size: 1.05rem;
    cursor: pointer;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-close:focus-visible {
    background: rgba(79, 209, 197, 0.2);
    border-color: rgba(79, 209, 197, 0.72);
}

.gallery-lightbox-body {
    max-height: min(80vh, 760px);
    overflow: auto;
    display: grid;
}

.gallery-lightbox-media {
    width: 100%;
    max-height: min(70vh, 680px);
    object-fit: contain;
    background: rgba(2, 9, 20, 0.92);
}

.gallery-lightbox-desc {
    margin: 0;
    padding: 11px 14px 14px;
    color: #b9cde7;
    font-size: 0.92rem;
}

@media (max-width: 1199px) {
    .media-card {
        grid-column: span 6;
    }

    .media-card-video {
        grid-column: span 6;
    }
}

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

    .gallery-sort {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 767px) {
    .gallery-page {
        width: min(100% - 20px, 1280px);
        gap: 16px;
        padding-top: 1.2rem;
    }

    .gallery-stats {
        grid-template-columns: 1fr;
    }

    .gallery-filters {
        justify-content: flex-start;
    }

    .filter-btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .media-card {
        grid-column: span 12;
    }

    .media-card-video {
        grid-column: span 12;
    }

    .media-card-body {
        padding: 13px;
    }

    .gallery-lightbox {
        padding: 12px;
    }

    .gallery-lightbox-head {
        padding: 10px 11px;
    }

    .gallery-lightbox-desc {
        padding: 10px 11px 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .filter-btn,
    .media-open-btn img,
    .media-open-btn video,
    .media-hover-pill {
        transition: none !important;
    }
}
