/* ==========================================================================
   Gallery Styles — Edge-to-edge masonry, hover overlays
   Dom Morris Photography — Premium Dark
   ========================================================================== */

/* --------------------------------------------------------------------------
   Gallery Page Background
   -------------------------------------------------------------------------- */

.gallery-page {
    background-color: var(--color-bg);
}

/* --------------------------------------------------------------------------
   Gallery Section Spacing (within restructured category pages)
   -------------------------------------------------------------------------- */

.gallery-section {
    padding-bottom: var(--space-xl);
}

/* --------------------------------------------------------------------------
   Masonry Grid Layout — No gaps, edge-to-edge
   -------------------------------------------------------------------------- */

.gallery-grid {
    column-count: 3;
    column-gap: 4px;
    padding: 4px;
    max-width: 100%;
    margin: 0 auto;
}

.gallery-grid .gallery-item {
    break-inside: avoid;
    margin-bottom: 4px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.gallery-grid .gallery-item img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform var(--transition-slow);
}

/* --------------------------------------------------------------------------
   Hover Effects — Zoom + Overlay with "View" text
   -------------------------------------------------------------------------- */

.gallery-item:hover img,
.gallery-item:focus-within img {
    transform: scale(1.05);
}

.gallery-item::after {
    content: 'View';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    color: transparent;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    transition: background var(--transition-normal), color var(--transition-normal);
    pointer-events: none;
}

.gallery-item:hover::after,
.gallery-item:focus-within::after {
    background: rgba(0, 0, 0, 0.4);
    color: var(--color-accent, #c9a96e);
}

/* --------------------------------------------------------------------------
   Responsive Masonry Breakpoints
   -------------------------------------------------------------------------- */

@media (max-width: 1200px) {
    .gallery-grid {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        column-count: 2;
        column-gap: 3px;
        padding: 3px;
    }

    .gallery-grid .gallery-item {
        margin-bottom: 3px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        column-count: 2;
        column-gap: 2px;
        padding: 2px;
    }

    .gallery-grid .gallery-item {
        margin-bottom: 2px;
    }
}

/* --------------------------------------------------------------------------
   Lightbox Modal Overlay
   -------------------------------------------------------------------------- */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.95);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.lightbox.is-active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 90vh;
}

.lightbox-content img {
    display: block;
    max-width: 90vw;
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Lightbox Navigation */
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 1px solid rgba(201, 169, 110, 0.3);
    color: var(--color-accent, #c9a96e);
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color var(--transition-fast), background var(--transition-fast);
    z-index: 1001;
}

.lightbox-prev:hover,
.lightbox-prev:focus,
.lightbox-next:hover,
.lightbox-next:focus {
    background: rgba(201, 169, 110, 0.1);
    border-color: var(--color-accent, #c9a96e);
}

.lightbox-prev { left: var(--space-lg); }
.lightbox-next { right: var(--space-lg); }

.lightbox-close {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    background: transparent;
    border: 1px solid rgba(201, 169, 110, 0.3);
    color: var(--color-accent, #c9a96e);
    font-size: 1.25rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color var(--transition-fast), background var(--transition-fast);
    z-index: 1002;
}

.lightbox-close:hover,
.lightbox-close:focus {
    background: rgba(201, 169, 110, 0.1);
    border-color: var(--color-accent, #c9a96e);
}

/* --------------------------------------------------------------------------
   Reduced Motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .gallery-item:hover img,
    .gallery-item:focus-within img {
        transform: none;
    }

    .gallery-item::after {
        transition: none;
    }

    .lightbox {
        transition: none;
    }
}
