@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;1,400;1,500&family=DM+Sans:wght@300;400;500;700&display=swap');

/* ══════════════════════════════════════════════════════════════════
   TOKENS
══════════════════════════════════════════════════════════════════ */
:root {
    --b-dark:    #1a2535;   
    --b-accent:  #6b8cae;   
    --b-soft:    #9ab3cc;   
    --b-sand:    #f4ede0;   
    --b-cream:   #fdf9f3;   
    --b-text:    #1a2535;   
    --b-body:    #3d4f60;   
    --b-muted:   rgba(244, 237, 224, 0.62);
}

/* ══════════════════════════════════════════════════════════════════
   HERO (Mirrored for Consistency)
══════════════════════════════════════════════════════════════════ */
.gallery-hero {
    padding: 150px 0 120px;
    background: var(--b-dark);
    background-image:
        radial-gradient(ellipse at 10% 80%, rgba(107,140,174,0.22) 0%, transparent 55%),
        radial-gradient(ellipse at 90% 10%, rgba(154,179,204,0.10) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(46,63,88,0.40) 0%, transparent 70%);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.gallery-hero::before {
    content: '';
    position: absolute; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    opacity: 0.4;
    pointer-events: none;
}

.gallery-hero::after {
    content: '';
    position: absolute; inset: 36px;
    border: 1px solid rgba(107,140,174,0.10);
    border-radius: 12px;
    pointer-events: none;
}

.paw-float {
    position: absolute;
    font-size: 1.8rem;
    opacity: 0.07;
    pointer-events: none;
    animation: floatPaw 10s ease-in-out infinite;
}
.paw-float--1 { top: 18%; left: 8%;  animation-delay: 0s; }
.paw-float--2 { top: 62%; right: 9%; animation-delay: 4s; font-size: 1.3rem; }
.paw-float--3 { bottom: 16%; left: 42%; animation-delay: 7s; font-size: 1.1rem; }

@keyframes floatPaw {
    0%, 100% { transform: translateY(0) rotate(-5deg); opacity: 0.07; }
    50%       { transform: translateY(-14px) rotate(5deg); opacity: 0.12; }
}

.hero-inner {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 40px;
    position: relative;
    z-index: 1;
}

.hero-icon {
    width: 70px; height: 70px;
    margin: 0 auto 30px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(154,179,204,0.28);
    background: rgba(107,140,174,0.10);
}
.hero-cat-icon { font-size: 2rem; line-height: 1; }

.hero-eyebrow {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: var(--b-soft);
    margin: 0 0 20px;
}

.hero-title {
    font-family: 'Lora', serif;
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    font-weight: 600;
    color: var(--b-sand);
    line-height: 1.2;
    margin: 0 0 16px;
}
.hero-title em {
    font-style: italic;
    color: var(--b-soft);
}

.hero-divider {
    display: flex; align-items: center; gap: 14px;
    justify-content: center; margin: 32px 0;
}
.hero-divider span {
    display: block; height: 1px; width: 70px;
    background: linear-gradient(to right, transparent, var(--b-soft), transparent);
}
.divider-paw { font-style: normal; font-size: 0.85rem; opacity: 0.6; }

.hero-subtitle {
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.95;
    color: var(--b-muted);
    max-width: 580px;
    margin: 0 auto;
}

/* ══════════════════════════════════════════════════════════════════
   GALLERY SECTION & FILTERS
══════════════════════════════════════════════════════════════════ */
.gallery-section {
    padding: 80px 0 120px;
    background: var(--b-sand);
    position: relative;
    min-height: 80vh;
}

.gallery-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

/* Filters */
.filter-controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 50px;
}

.filter-btn {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--b-body);
    background: transparent;
    border: 1px solid rgba(107, 140, 174, 0.3);
    padding: 10px 24px;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: var(--b-accent);
    color: var(--b-dark);
}

.filter-btn.active {
    background: var(--b-accent);
    color: var(--b-cream);
    border-color: var(--b-accent);
    box-shadow: 0 4px 15px rgba(26, 37, 53, 0.15);
}

/* ══════════════════════════════════════════════════════════════════
   MASONRY GRID
══════════════════════════════════════════════════════════════════ */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 240px;
    gap: 20px;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: var(--b-cream);
    box-shadow: 0 10px 30px rgba(26,37,53,0.05);
    transition: transform 0.4s ease, opacity 0.4s ease, filter 0.4s ease;
}

/* Grid Spans for Masonry look */
.gallery-item.featured {
    grid-column: span 2;
    grid-row: span 2;
}
.gallery-item.tall {
    grid-row: span 2;
}
.gallery-item.wide {
    grid-column: span 2;
}

/* Logic for hidden filtered items */
.gallery-item.hidden {
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
    position: absolute; /* Takes them out of the document flow so grid collapses */
    visibility: hidden;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* Hover Overlay */
.item-overlay {
    position: absolute;
    inset: 0;
    background: rgba(26, 37, 53, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

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

.overlay-icon {
    color: var(--b-cream);
    font-size: 2rem;
    transform: scale(0.5);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gallery-item:hover .overlay-icon {
    transform: scale(1);
}

/* ══════════════════════════════════════════════════════════════════
   LIGHTBOX MODAL
══════════════════════════════════════════════════════════════════ */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(26, 37, 53, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

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

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lightbox.show .lightbox-content img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: var(--b-sand);
    font-size: 3rem;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease, transform 0.3s ease;
}

.lightbox-close:hover {
    color: var(--b-accent);
    transform: scale(1.1);
}

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════════ */
@media (max-width: 991px) {
    .gallery-hero { padding: 100px 0 70px; }
    .gallery-inner, .hero-inner { padding: 0 24px; }
    
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 200px;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 180px;
        gap: 16px;
    }
    .filter-btn {
        font-size: 0.75rem;
        padding: 8px 18px;
    }
}

@media (max-width: 540px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 250px;
    }
    /* Disable masonry spans on mobile for a clean stacked feed */
    .gallery-item.featured,
    .gallery-item.tall,
    .gallery-item.wide {
        grid-column: span 1;
        grid-row: span 1;
    }
    .lightbox-close { top: 15px; right: 20px; font-size: 2.5rem; }
}