
/* =========================================
   Photos Gallery Stylesheet
   ========================================= */

/* Hero Banner */
.heading-hero {
    background-color: var(--bg-callout);
    background-image: linear-gradient(rgba(27, 59, 43, 0.82), rgba(27, 59, 43, 0.88)), url('../images/photos/hero/TetonWagonTrain_C-296.webp');
    background-size: cover;
    background-position: center;
    color: var(--text-light);
    padding: 3.5rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    margin-bottom: 1rem;
}

.photos-hero .section-title {
    font-family: 'Rye', Georgia, serif;
    font-size: 3rem;
    color: #ffffff;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.photos-hero .hero-subtitle {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--accent-gold);
    max-width: 800px;
    margin: 0 auto 1.5rem auto;
}

/* Gallery Header Text */
.gallery-header-text {
    text-align: center;
    margin-bottom: 2rem;
}

.gallery-header-text h2 {
    font-family: 'Rye', Georgia, serif;
    font-size: 2rem;
    color: var(--bg-callout);
    margin-bottom: 0.5rem;
}

.gallery-header-text p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 750px;
    margin: 0 auto;
}

/* Outer Frame matching screenshot visual style */
.gallery-card-frame {
    /* background-color: var(--bg-card);
    background-image: 
        linear-gradient(rgba(253, 251, 247, 0.9), rgba(253, 251, 247, 0.95)),
        var(--parchment-img); */
    /* background-size: cover; */
    padding: 18px;
    /* border-radius: var(--radius-md); */
    /* box-shadow: 0 4px 16px rgba(45, 38, 30, 0.08); */
    /* border: 1px solid rgba(194, 155, 56, 0.35); */
    /* outline: 1px solid rgba(90, 56, 37, 0.12); */
    /* outline-offset: -5px; */
}

/* Consistent Rows Justified Flex Gallery */
.photo-gallery-grid {
    background-image: var(--parchment-sheet-aged);
    background-repeat: repeat-y;
    background-position: top center;
    background-size: 100% auto;
    --gallery-row-height: 120px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: center;
    min-height: 800px;
    padding: 0 var(--spacing-xxxl);
}

/* Gallery Item Styling - Row height standardized with ratio scaling */
.gallery-item {
    flex-grow: 0;
    flex-shrink: 0;
    max-width: calc(50% - 6px);

    height: var(--gallery-row-height);
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background-color: #e2e8f0;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    z-index: 1;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), filter 0.4s ease;
}

/* Hover Effects */
.gallery-item:hover {
    box-shadow: var(--shadow-md);
    z-index: 2;
}

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

/* Hover Overlay */
.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(27, 59, 43, 0.75) 0%, rgba(27, 59, 43, 0.15) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: #ffffff;
}

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

.gallery-item-overlay svg {
    width: 28px;
    height: 28px;
    margin-bottom: 6px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.gallery-item-overlay span {
    font-size: 0.9rem;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

/* CTA Blurb */
.gallery-cta-blurb {
    margin-top: 2.5rem;
    text-align: center;
    border-top: 4px solid var(--accent-gold);
}


/* =========================================
   LIGHTBOX MODAL
   ========================================= */
.lightbox-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2500;
    background-color: rgba(15, 23, 18, 0.94);
    backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-modal.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img {
    max-width: 90vw;
    max-height: 78vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.lightbox-caption {
    margin-top: 12px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    background: rgba(0, 0, 0, 0.4);
    padding: 6px 16px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

/* Lightbox Navigation & Close Buttons */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 25px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 2.8rem;
    cursor: pointer;
    line-height: 1;
    z-index: 2600;
    transition: color 0.2s ease, transform 0.2s ease;
}

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

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-size: 2rem;
    padding: 12px 18px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2600;
    transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.lightbox-nav:hover {
    background: var(--bg-callout);
    color: var(--accent-gold);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 25px;
}

.lightbox-next {
    right: 25px;
}

/* Responsive Rules */
@media (max-width: 768px) {
    .photo-gallery-grid {
        --gallery-row-height: 100px;
    }
    .gallery-item {
    flex-grow: 0;
    flex-shrink: 0;
        height: var(--gallery-row-height);
    }

    .photos-hero .section-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 480px) {
    .photo-gallery-grid {
        --gallery-row-height: 80px;
    }
    .gallery-item {
    flex-grow: 0;
    flex-shrink: 0;
        height: var(--gallery-row-height);
        max-width: calc(50% - 4px);



    }

    .lightbox-prev {
        left: 10px;
        padding: 8px 14px;
        font-size: 1.5rem;
    }

    .lightbox-next {
        right: 10px;
        padding: 8px 14px;
        font-size: 1.5rem;
    }
}
