/* ===================================
   NovaCup - Gallery Page Styles
   (Layout mirrors players.css so both archive pages feel like one
   consistent system: same page-header treatment, same card language.)
   =================================== */

/* Page Header */
.page-header {
    position: relative;
    padding: 140px 0 60px;
    background: var(--bg-secondary);
    overflow: hidden;
}

.page-header-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.page-gradient-red {
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--red-glow) 0%, transparent 60%);
    top: -100px;
    right: 10%;
}

.page-gradient-blue {
    position: absolute;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, var(--blue-glow) 0%, transparent 60%);
    bottom: -100px;
    left: 20%;
}

.page-header-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.page-label {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--red-primary);
    text-transform: uppercase;
    margin-bottom: 16px;
}

.page-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-desc {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Gallery Section */
.gallery-section {
    padding: 60px 0 100px;
    background: var(--bg-secondary);
}

.gallery-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 60px 0;
}

/* Grid — explicit 2 columns on mobile, comfortably auto-fitting on
   wider screens. */
.gallery-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
}

/* Photo Card */
.gallery-photo-card {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.gallery-photo-frame {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 14px;
    background: #080808;
    border: 1px solid var(--border-color);
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.gallery-photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(25%) contrast(1.05);
    transition: transform 0.7s cubic-bezier(0.25, 1, 0.5, 1), filter 0.7s ease;
    will-change: transform, filter;
}

/* Shine sweep on hover, matching the player card treatment */
.gallery-photo-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg,
            transparent 40%,
            rgba(255, 255, 255, 0.06) 45%,
            rgba(255, 255, 255, 0.12) 50%,
            rgba(255, 255, 255, 0.06) 55%,
            transparent 60%);
    transform: translateX(-120%);
    transition: transform 0.8s ease;
    pointer-events: none;
}

.gallery-photo-zoom {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 46px;
    height: 46px;
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    transition: all 0.35s ease;
    pointer-events: none;
}

.gallery-photo-zoom svg {
    width: 20px;
    height: 20px;
}

.gallery-photo-card:hover .gallery-photo-frame img {
    transform: scale(1.06);
    filter: grayscale(0%) contrast(1.1) brightness(1.05);
}

.gallery-photo-card:hover .gallery-photo-shine {
    transform: translateX(120%);
}

.gallery-photo-card:hover .gallery-photo-frame {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2), 0 20px 50px -15px rgba(29, 78, 216, 0.25);
}

.gallery-photo-card:hover .gallery-photo-zoom {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.gallery-photo-card:focus-visible .gallery-photo-frame {
    outline: none;
    border-color: rgba(59, 130, 246, 0.6);
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(5, 5, 8, 0.92);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 90px 20px 30px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 92vw;
    max-height: 88vh;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.lightbox-close {
    top: -60px;
    left: 0;
}

.lightbox-prev {
    right: -68px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    left: -68px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-close svg,
.lightbox-prev svg,
.lightbox-next svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: white;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5);
}

.lightbox-media img {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    border-radius: 14px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}

/* Responsive */
@media (max-width: 900px) {
    .gallery-photo-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }
}

@media (max-width: 640px) {
    .page-header {
        padding: 120px 0 40px;
    }

    .gallery-section {
        padding: 40px 0 70px;
    }

    .gallery-photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .gallery-photo-frame {
        border-radius: 10px;
    }

    .lightbox {
        padding: 70px 16px 20px;
    }

    .lightbox-close {
        top: -50px;
        left: 0;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
    }

    .lightbox-prev {
        right: -6px;
    }

    .lightbox-next {
        left: -6px;
    }
}

@media (max-width: 380px) {
    .gallery-photo-grid {
        gap: 10px;
    }
}
