/* ===========================================
   COMPLETE GALLERY.CSS
   Includes: Gallery Grid + Lightbox + Portfolio Headers
   For Davis Capture & Creations
   =========================================== */

/* ===========================================
   PORTFOLIO PAGE HEADER STYLES
   =========================================== */

/* Portfolio Hero Section */
.portfolio-hero {
    background: linear-gradient(135deg, #FAF8F5 0%, #FFFFFF 100%);
    padding: 100px 20px 60px;
    text-align: center;
    border-bottom: 1px solid #F5F1ED;
}

.portfolio-hero h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 3.5rem;
    font-weight: 300;
    color: #2D2D2D;
    margin: 0 0 20px 0;
    letter-spacing: 2px;
}

.portfolio-hero .subtitle {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    font-weight: 300;
    color: #6B6B6B;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.8;
}

/* Portfolio Breadcrumb Navigation */
.portfolio-breadcrumb {
    background: #FFFFFF;
    padding: 20px 0;
    border-bottom: 1px solid #F5F1ED;
}

.portfolio-breadcrumb .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.portfolio-breadcrumb a {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    color: #6B6B6B;
    text-decoration: none;
    transition: color 0.3s ease;
}

.portfolio-breadcrumb a:hover {
    color: #D4A5A5;
}

.portfolio-breadcrumb .separator {
    margin: 0 10px;
    color: #D4A5A5;
}

.portfolio-breadcrumb span:last-child {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    color: #2D2D2D;
    font-weight: 500;
}

/* ===========================================
   GALLERY GRID LAYOUT
   =========================================== */

/* Gallery Container */
.gallery-container {
    padding: 60px 20px;
    max-width: 1600px;
    margin: 0 auto;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Gallery Items */
.gallery-item {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    background: #F5F1ED;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Gallery Images */
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.5s ease;
    opacity: 0;
    animation: fadeIn 0.5s ease-in forwards;
}

/* Hover Effects */
.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* ===========================================
   LIGHTBOX MODAL
   =========================================== */

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

/* Lightbox Content */
.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Lightbox Image */
.lightbox-content img,
#lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    transition: opacity 0.15s ease;
}

/* Close Button */
.lightbox-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    color: white;
    font-size: 32px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10002;
    padding: 0;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
    border-color: white;
}

/* Navigation Buttons */
.lightbox-nav,
.lightbox-prev,
.lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    color: white;
    font-size: 32px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10002;
    padding: 0;
}

.lightbox-nav:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* Image Counter */
.lightbox-counter {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 1px;
    z-index: 10002;
}

/* ===========================================
   RESPONSIVE DESIGN
   =========================================== */

/* Portfolio Hero - Responsive */
@media (max-width: 768px) {
    .portfolio-hero {
        padding: 80px 20px 40px;
    }
    
    .portfolio-hero h1 {
        font-size: 2.5rem;
    }
    
    .portfolio-hero .subtitle {
        font-size: 1rem;
    }
    
    .portfolio-breadcrumb {
        padding: 15px 0;
    }
    
    .portfolio-breadcrumb a,
    .portfolio-breadcrumb span {
        font-size: 0.85rem;
    }
    
    .portfolio-breadcrumb .separator {
        margin: 0 8px;
    }
}

@media (max-width: 480px) {
    .portfolio-hero {
        padding: 60px 15px 30px;
    }
    
    .portfolio-hero h1 {
        font-size: 2rem;
        letter-spacing: 1px;
    }
    
    .portfolio-hero .subtitle {
        font-size: 0.95rem;
        line-height: 1.6;
    }
}

/* Gallery - Responsive */
@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 18px;
    }
}

@media (max-width: 768px) {
    .gallery-container {
        padding: 40px 15px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .gallery-item {
        aspect-ratio: 3/4;
    }
    
    /* Smaller lightbox controls */
    .lightbox-close,
    .lightbox-prev,
    .lightbox-next {
        width: 45px;
        height: 45px;
        font-size: 28px;
    }
    
    .lightbox-prev {
        left: 15px;
    }
    
    .lightbox-next {
        right: 15px;
    }
    
    .lightbox-close {
        top: 15px;
        right: 15px;
    }
    
    .lightbox-counter {
        bottom: 20px;
        font-size: 12px;
        padding: 6px 16px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .lightbox-content img,
    #lightbox-img {
        max-width: 95vw;
        max-height: 85vh;
    }
    
    .lightbox-close,
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
    }
    
    .lightbox-counter {
        bottom: 15px;
        font-size: 11px;
        padding: 5px 12px;
    }
}

/* ===========================================
   ANIMATIONS
   =========================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ===========================================
   ACCESSIBILITY
   =========================================== */

/* Focus states for keyboard navigation */
.gallery-item:focus {
    outline: 3px solid #D4A5A5;
    outline-offset: 3px;
}

.lightbox-close:focus,
.lightbox-prev:focus,
.lightbox-next:focus {
    outline: 3px solid white;
    outline-offset: 3px;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ===========================================
   PRINT STYLES
   =========================================== */

@media print {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .gallery-item:hover {
        transform: none;
        box-shadow: none;
    }
    
    .lightbox {
        display: none !important;
    }
    
    .portfolio-breadcrumb {
        display: none;
    }
}

/* ===========================================
   BROWSER COMPATIBILITY
   =========================================== */

/* Fallback for browsers without aspect-ratio support */
@supports not (aspect-ratio: 3/4) {
    .gallery-item {
        padding-bottom: 133%; /* 4/3 * 100 = 133% */
        height: 0;
    }
    
    .gallery-item img {
        position: absolute;
        top: 0;
        left: 0;
    }
}