/* 
 * Premium Gallery Styles 
 * Covers Photo Grids, Video Cards, and custom Lightbox Modals
 */

/* ==========================================================================
   1. Shared Layouts
   ========================================================================== */
.gallery-section {
    padding: 80px 0;
    background-color: var(--color-bg-light);
    min-height: 70vh;
}

.gallery-header {
    text-align: center;
    margin-bottom: 50px;
}

.gallery-header h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--color-dark-blue);
    margin-bottom: 15px;
    font-weight: 700;
}

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

/* ==========================================================================
   2. Photo Gallery & Hover Effects
   ========================================================================== */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.photo-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    background-color: #000; /* Dark background behind image for overlay effect */
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.2, 1, 0.3, 1);
    display: block;
}

.photo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 50%, rgba(0,92,48,0.2) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 25px;
    pointer-events: none;
}

.photo-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    color: #fff;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.2, 1, 0.3, 1);
}

.photo-icon svg {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}

.photo-caption {
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1rem;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.2, 1, 0.3, 1);
}

/* Photo Hover States */
.photo-item:hover img {
    transform: scale(1.08);
}

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

.photo-item:hover .photo-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.photo-item:hover .photo-caption {
    transform: translateY(0);
}

/* ==========================================================================
   3. Custom Fullscreen Lightbox Modal
   ========================================================================== */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 15, 30, 0.95);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(5px);
}

.lightbox-modal.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
    z-index: 10000;
}

.lightbox-close:hover {
    color: var(--color-secondary);
}

.lightbox-content {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.2, 1, 0.3, 1);
}

.lightbox-modal.active .lightbox-content {
    transform: scale(1);
}

.lightbox-caption-text {
    position: absolute;
    bottom: 30px;
    left: 0;
    width: 100%;
    text-align: center;
    color: #fff;
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   4. Video Gallery Cards
   ========================================================================== */

/* Section separator labels (e.g. "Full Videos" / "Shorts") */
.video-section-label {
    grid-column: 1 / -1;
    text-align: center;
    margin: 40px 0 10px;
    position: relative;
}

.video-section-label span {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-dark-blue);
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Container grid — separate declaration so each section starts on its own row */
.video-grid-full {
    grid-column: 1 / -1;
}

.video-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition-smooth);
    border: 1px solid rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
}

.video-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

/* Responsive iframe wrapper maintaining 16:9 aspect ratio */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    background-color: #000;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-info {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.video-title {
    font-family: var(--font-heading);
    color: var(--color-dark-blue);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
}

.video-desc {
    color: var(--color-text-muted);
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0;
}

/* ==========================================================================
   4b. YouTube Shorts (Vertical Cards)
   ========================================================================== */
.shorts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    grid-column: 1 / -1;
}

.short-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition-smooth);
    border: 1px solid rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
}

.short-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

/* Vertical wrapper for 9:16 aspect ratio */
.short-wrapper {
    position: relative;
    padding-bottom: 177.78%; /* 9:16 (16/9*100 = 177.78%) */
    height: 0;
    overflow: hidden;
    background-color: #000;
}

.short-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.short-info {
    padding: 18px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.short-title {
    font-family: var(--font-heading);
    color: var(--color-dark-blue);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.3;
}

.short-desc {
    color: var(--color-text-muted);
    font-family: var(--font-body);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 0;
}

/* ==========================================================================
   5. Responsive Queries
   ========================================================================== */
@media (max-width: 991px) {
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .video-grid {
        grid-template-columns: 1fr;
        max-width: 700px;
    }

    .shorts-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 600px;
    }
}

@media (max-width: 768px) {
    .shorts-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 400px;
    }
}

@media (max-width: 576px) {
    .photo-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
    }

    .shorts-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 400px;
        gap: 20px;
    }

    .lightbox-close {
        top: 15px;
        right: 20px;
        font-size: 35px;
    }
}
