/* ─── Photo Gallery ──────────────────────────────────── */

/* Hero */
.photo-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    position: relative;
    overflow: hidden;
}

.photo-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 50%, rgba(99, 102, 241, .15) 0%, transparent 60%),
        radial-gradient(circle at 70% 30%, rgba(139, 92, 246, .10) 0%, transparent 50%);
    pointer-events: none;
}

/* Filter Pills */
.filter-pill {
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .05);
    color: rgba(255, 255, 255, .6);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(.4, 0, .2, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    white-space: nowrap;
}

.filter-pill:hover {
    background: rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .9);
    border-color: rgba(255, 255, 255, .25);
}

.filter-pill.active {
    background: rgba(99, 102, 241, .7);
    color: white;
    border-color: rgba(99, 102, 241, .9);
    box-shadow: 0 0 20px rgba(99, 102, 241, .3);
}

/* Masonry Grid */
.gallery-grid {
    columns: 3;
    column-gap: 1rem;
}

@media (max-width: 1024px) {
    .gallery-grid {
        columns: 2;
    }
}

@media (max-width: 640px) {
    .gallery-grid {
        columns: 1;
    }
}

/* Photo Card */
.photo-card {
    break-inside: avoid;
    margin-bottom: 1rem;
    border-radius: 0.75rem;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background: #1e293b;
    transition: transform 0.3s cubic-bezier(.4, 0, .2, 1),
        box-shadow 0.3s cubic-bezier(.4, 0, .2, 1);
    /* Fix for column alignment */
    display: inline-block;
    width: 100%;
    /* Enforce Aspect Ratio */
    aspect-ratio: 4/3;
}

.photo-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, .4);
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(.4, 0, .2, 1),
        opacity 0.4s ease;
    opacity: 0;
}

.photo-card img.loaded {
    opacity: 1;
}

.photo-card:hover img {
    transform: scale(1.05);
}

/* Photo Overlay */
.photo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg,
            rgba(0, 0, 0, .7) 0%,
            rgba(0, 0, 0, .0) 40%,
            rgba(0, 0, 0, .0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.25rem;
}

.photo-card:hover .photo-overlay {
    opacity: 1;
}

.photo-overlay h3 {
    color: white;
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    transform: translateY(8px);
    transition: transform 0.3s ease;
}

.photo-overlay .photo-location {
    color: rgba(255, 255, 255, .6);
    font-size: 0.75rem;
    transform: translateY(8px);
    transition: transform 0.35s ease;
}

.photo-card:hover .photo-overlay h3,
.photo-card:hover .photo-overlay .photo-location {
    transform: translateY(0);
}

/* Category Badge on Card */
.photo-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(0, 0, 0, .5);
    color: rgba(255, 255, 255, .8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-card:hover .photo-badge {
    opacity: 1;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, .92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.lightbox-content {
    display: flex;
    max-width: 90vw;
    max-height: 90vh;
    gap: 0;
    position: relative;
}

.lightbox-image-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.lightbox-image-wrap img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 0.5rem;
    transition: opacity 0.3s ease;
}

/* EXIF Panel */
.lightbox-exif {
    width: 280px;
    flex-shrink: 0;
    background: rgba(15, 23, 42, .9);
    border-left: 1px solid rgba(255, 255, 255, .08);
    padding: 2rem 1.5rem;
    overflow-y: auto;
    border-radius: 0 0.5rem 0.5rem 0;
}

@media (max-width: 768px) {
    .lightbox-content {
        flex-direction: column;
        max-height: 95vh;
    }

    .lightbox-exif {
        width: 100%;
        max-height: 35vh;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, .08);
        border-radius: 0 0 0.5rem 0.5rem;
    }
}

.lightbox-exif h3 {
    color: white;
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.lightbox-exif .exif-location {
    color: rgba(255, 255, 255, .5);
    font-size: 0.8125rem;
    margin-bottom: 1.5rem;
}

.exif-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.exif-item {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.exif-item .exif-label {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, .35);
}

.exif-item .exif-value {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, .85);
    font-weight: 500;
}

/* Nav Arrows */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.2s ease;
    z-index: 10;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, .15);
    border-color: rgba(255, 255, 255, .25);
}

.lightbox-nav.prev {
    left: -60px;
}

.lightbox-nav.next {
    right: -60px;
}

@media (max-width: 768px) {
    .lightbox-nav.prev {
        left: 8px;
    }

    .lightbox-nav.next {
        right: 8px;
    }
}

/* Close Button */
.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.2s ease;
    z-index: 10001;
}

.lightbox-close:hover {
    background: rgba(239, 68, 68, .6);
    border-color: rgba(239, 68, 68, .8);
}

/* Counter */
.lightbox-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, .4);
    font-size: 0.75rem;
    font-weight: 500;
    z-index: 10001;
}

/* Card entry animation */
.photo-card {
    animation: fadeInUp 0.5s ease both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Skeleton loader while images load */
.photo-skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    min-height: 200px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* About section */
.photo-about {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    border-top: 1px solid rgba(255, 255, 255, .05);
}