/* =============================================
   GALLERY PAGE — gallery.css
   ============================================= */

/* ── Body override for gallery page ── */
.gallery-page {
    min-height: 100vh;
    background: linear-gradient(160deg, #f0f7f4 0%, #fce4ec 40%, #e8f5e9 70%, #fce4ec 100%);
    background-attachment: fixed;
    cursor: default;
}

/* ── Floating orbs (ambient background decoration) ── */
.gallery-bg-orbs {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    animation: orbDrift 18s ease-in-out infinite alternate;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #A3D1A3, transparent);
    top: -200px;
    left: -100px;
    animation-duration: 20s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #FFB7C5, transparent);
    top: 30%;
    right: -150px;
    animation-duration: 25s;
    animation-delay: -8s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #B5D8EB, transparent);
    bottom: 10%;
    left: 20%;
    animation-duration: 22s;
    animation-delay: -5s;
}

@keyframes orbDrift {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(40px, 60px) scale(1.1);
    }
}

/* ── Gallery Hero ── */
.gallery-hero {
    position: relative;
    z-index: 10;
    padding: 130px 5% 60px;
    text-align: center;
}

.gallery-hero-inner {
    max-width: 700px;
    margin: 0 auto 50px;
}

.gallery-hero-icon {
    font-size: 3.5rem;
    display: inline-block;
    animation: pawHeartbeat 4s ease-in-out infinite;
    margin-bottom: 16px;
    filter: drop-shadow(0 6px 16px rgba(58, 140, 99, 0.25));
}

.gallery-title {
    font-family: 'Pacifico', cursive;
    font-size: clamp(2.8rem, 6vw, 4.5rem);
    background: linear-gradient(135deg, #2D6A4F 0%, #9F7AEA 50%, #F6AD55 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    padding-bottom: 0.3em;
    margin-bottom: calc(18px - 0.2em);
    line-height: 1.2;
}

.gallery-subtitle {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    color: #4A5568;
    line-height: 1.7;
    margin-bottom: 28px;
    opacity: 0.9;
}

.gallery-back-link {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9000;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
    font-weight: 600;
    font-size: 1.05rem;
    padding: 14px 28px;
    border-radius: 50px;
    background: #3A8C63;
    box-shadow: 0 10px 30px rgba(58, 140, 99, 0.4);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gallery-back-link:hover {
    background: #2D6A4F;
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 15px 40px rgba(58, 140, 99, 0.5);
}

/* ── Stats bar ── */
.gallery-stats {
    display: inline-flex;
    align-items: center;
    gap: 0;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 50px;
    padding: 18px 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.07);
}

.gallery-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 30px;
}

.stat-num {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #2D6A4F;
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #718096;
    margin-top: 4px;
}

.gallery-stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(0, 0, 0, 0.1);
}

/* ── Main gallery area ── */
.gallery-main {
    position: relative;
    z-index: 10;
    padding: 0 4% 80px;
    max-width: 1600px;
    margin: 0 auto;
}

/* ── Masonry grid using CSS columns ── */
.gallery-masonry {
    columns: 5;
    column-gap: 12px;
}

@media (max-width: 1400px) {
    .gallery-masonry {
        columns: 4;
    }
}

@media (max-width: 1100px) {
    .gallery-masonry {
        columns: 3;
    }
}

@media (max-width: 700px) {
    .gallery-masonry {
        columns: 2;
        column-gap: 8px;
    }
}

@media (max-width: 420px) {
    .gallery-masonry {
        columns: 2;
        column-gap: 6px;
    }
}

/* ── Individual gallery item ── */
.gallery-item {
    break-inside: avoid;
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.35s ease;
}

@media (max-width: 700px) {
    .gallery-item {
        border-radius: 10px;
        margin-bottom: 8px;
    }
}

.gallery-item:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
    z-index: 2;
}

/* Blur background layer for narrow/portrait images */
.gallery-item-blur {
    position: absolute;
    inset: -10%;
    background-size: cover;
    background-position: center;
    filter: blur(22px) brightness(0.85);
    transform: scale(1.15);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* Show blur bg only when image is narrower than container */
.gallery-item.needs-blur .gallery-item-blur {
    opacity: 1;
}

.gallery-item img {
    display: block;
    width: 100%;
    height: auto;
    position: relative;
    z-index: 2;
    transition: transform 0.4s ease;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.4s ease;
}

.gallery-item img.loaded {
    opacity: 1;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Overlay on hover */
.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(45, 106, 79, 0.6) 0%, transparent 60%);
    z-index: 3;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 14px;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-overlay i {
    color: white;
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

/* Loading skeleton shimmer */
.gallery-skeleton {
    break-inside: avoid;
    border-radius: 16px;
    margin-bottom: 12px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.3) 25%, rgba(255, 255, 255, 0.6) 50%, rgba(255, 255, 255, 0.3) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}

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

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

/* ── Load More ── */
.gallery-load-more {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 50px 0 20px;
}

.gallery-load-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 40px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, #2D6A4F, #3A8C63);
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(58, 140, 99, 0.35);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    letter-spacing: 0.5px;
}

.gallery-load-btn:hover {
    transform: translateY(-4px) scale(1.04);
    box-shadow: 0 20px 45px rgba(58, 140, 99, 0.45);
}

.gallery-load-btn i {
    animation: pawHeartbeat 2s ease-in-out infinite;
}

.gallery-all-loaded {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    color: #3A8C63;
    font-weight: 600;
    text-align: center;
}

/* ── Lightbox ── */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 20, 0.92);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.gallery-lightbox.open {
    opacity: 1;
    pointer-events: all;
}

.lightbox-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 92vw;
    max-height: 90vh;
    gap: 14px;
}

.lightbox-img-wrap {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
    max-width: 90vw;
    max-height: 82vh;
    background: #111;
}

.lightbox-blur-bg {
    position: absolute;
    inset: -10%;
    background-size: cover;
    background-position: center;
    filter: blur(30px) brightness(0.7);
    transform: scale(1.2);
    z-index: 1;
}

.lightbox-img {
    display: block;
    max-width: 88vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    position: relative;
    z-index: 2;
    border-radius: 12px;
    transition: opacity 0.3s ease;
}

.lightbox-counter {
    font-family: 'Outfit', sans-serif;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 1px;
}

.lightbox-close {
    position: fixed;
    top: 20px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10000;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg) scale(1.1);
}

.lightbox-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    z-index: 10000;
}

.lightbox-arrow:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* ── Gallery nav link highlight ── */
.nav-active {
    color: #3A8C63 !important;
    font-weight: 700 !important;
}

.nav-active::after {
    width: 100% !important;
}

/* ── Mobile responsive fixes ── */
@media (max-width: 768px) {
    .gallery-hero {
        padding: 100px 5% 30px;
    }

    .gallery-title {
        font-size: 2.3rem;
    }

    .gallery-subtitle {
        font-size: 1rem;
        padding: 0 10px;
    }

    .gallery-stats {
        flex-wrap: wrap;
        justify-content: center;
        padding: 15px;
        border-radius: 20px;
        gap: 10px;
    }

    .gallery-stat {
        padding: 5px 15px;
    }

    .stat-num {
        font-size: 1.4rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .gallery-stat-divider {
        display: none;
    }

    .gallery-back-link {
        bottom: 20px;
        right: 20px;
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .lightbox-arrow {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    .lightbox-prev {
        left: 8px;
    }

    .lightbox-next {
        right: 8px;
    }

    .gallery-load-btn {
        padding: 14px 30px;
        font-size: 0.95rem;
    }
}