/* =========================================================================
   gallery.css - Media Gallery Page Styling
   ========================================================================= */

/* 1. Gallery Hero */
.gal-hero {
    position: relative;
    height: 60vh;
    min-height: 450px;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding-top: var(--header-height);
    background-color: var(--black);
}

.gal-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../../assets/PLD-Development-13.jpg');
    background-size: cover;
    background-position: center;
    z-index: 1;
    opacity: 0.35;
}

.gal-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(5,5,5,0.4) 0%, rgba(5,5,5,0.95) 100%);
    z-index: 2;
}

.gal-hero .container {
    position: relative;
    z-index: 3;
    max-width: 900px;
}

.gal-hero h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 20px;
    font-weight: 700;
    color: var(--off-white);
}

html[lang="ar"] .gal-hero h1 {
    font-size: 3.8rem;
}

.gal-hero p {
    font-size: 1.1rem;
    color: var(--stone);
    margin-bottom: 30px;
    line-height: 1.7;
    max-width: 700px;
}

/* 2. Visual Wall Editorial Grid */
.visual-wall-section {
    padding: 80px 0;
    background-color: var(--black);
}

/* Luxury magazine layout */
.visual-wall-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 240px;
    gap: 20px;
    margin-top: 50px;
}

.gal-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    cursor: pointer;
    background-color: var(--charcoal);
}

.gal-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: var(--transition-smooth);
}

.gal-card:hover img {
    transform: scale(1.05);
}

/* Spotlight layout positions */
.gal-card.size-featured-h {
    grid-column: span 2;
    grid-row: span 2;
}

.gal-card.size-featured-v {
    grid-column: span 1;
    grid-row: span 2;
}

/* Captions overlay on hover */
.gal-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(5,5,5,0.9) 0%, rgba(5,5,5,0.3) 50%, rgba(5,5,5,0.1) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 30px;
    opacity: 0;
    transition: var(--transition-fast);
    z-index: 5;
    border: 1px solid var(--gold);
}

.gal-card:hover .gal-card-overlay {
    opacity: 1;
}

.gal-card-icon {
    position: absolute;
    top: 24px;
    inset-inline-end: 24px;
    color: var(--gold);
    font-size: 1.4rem;
    transition: var(--transition-fast);
}

.gal-card:hover .gal-card-icon {
    transform: scale(1.1);
}

.gal-card-tag {
    font-size: 0.75rem;
    color: var(--gold);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: block;
}

.gal-card-title {
    font-size: 1.15rem;
    color: var(--off-white);
    font-weight: 600;
    margin-bottom: 6px;
}

.gal-card-desc {
    color: var(--stone);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* 3. Q Mall Visual Story Section */
.qmall-visual-section {
    padding: 100px 0;
    background-color: var(--charcoal);
    border-top: 1px solid rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.02);
}

.qmall-visual-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 40px;
    margin-bottom: 40px;
}

.qmall-visual-card {
    position: relative;
    border: 1px solid var(--border-color);
    aspect-ratio: 4/3;
    overflow: hidden;
    cursor: pointer;
}

.qmall-visual-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: var(--transition-smooth);
}

.qmall-visual-card:hover img {
    transform: scale(1.04);
}

/* 4. Lightbox Modal styling */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(5, 5, 5, 0.98);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.lightbox-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    inset-inline-end: 30px;
    background: transparent;
    border: none;
    color: var(--off-white);
    font-size: 2rem;
    cursor: pointer;
    z-index: 100;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition-fast);
}

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

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--off-white);
    font-size: 2.5rem;
    cursor: pointer;
    padding: 20px;
    transition: var(--transition-fast);
    z-index: 100;
}

.lightbox-nav:hover {
    color: var(--gold);
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-container {
    width: 85%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #030303;
    border: 1px solid var(--border-color);
}

.lightbox-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.lightbox-info {
    width: 100%;
    margin-top: 20px;
    text-align: center;
}

.lightbox-caption {
    font-size: 1.1rem;
    color: var(--off-white);
    margin-bottom: 6px;
}

.lightbox-details {
    font-size: 0.85rem;
    color: var(--stone);
    display: flex;
    justify-content: center;
    gap: 16px;
}

.lightbox-counter {
    color: var(--gold);
    font-weight: 600;
}

/* 5. Gallery CTA Section */
.gal-cta {
    padding: 100px 0;
    text-align: center;
    background-color: var(--black);
}

.gal-cta h2 {
    font-size: 2.8rem;
    margin-bottom: 20px;
    color: var(--off-white);
}

.gal-cta h2 span {
    color: var(--gold);
}

.gal-cta p {
    font-size: 1.1rem;
    color: var(--stone);
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

/* =========================================================================
   Gallery Responsiveness
   ========================================================================= */

@media (max-width: 1024px) {
    .visual-wall-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 200px;
    }
    
    .gal-card.size-featured-h {
        grid-column: span 2;
        grid-row: span 2;
    }
    
    .qmall-visual-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .gal-hero h1 {
        font-size: 2.5rem;
    }
    
    .visual-wall-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }
    
    .gal-card {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
        aspect-ratio: 16 / 10;
    }
    
    .gal-card-overlay {
        opacity: 1;
        background: linear-gradient(to top, rgba(5,5,5,0.95) 0%, rgba(5,5,5,0.4) 100%);
        padding: 20px;
    }
    
    .qmall-visual-grid {
        grid-template-columns: 1fr;
    }
    
    .lightbox-nav {
        display: none; /* Hide navigation arrows on mobile, rely on swipes or touch (or just closing) */
    }
    
    .lightbox-wrapper {
        aspect-ratio: 4 / 3;
    }
    
    .lightbox-close {
        top: 15px;
        right: 15px;
    }
    
    .gal-cta h2 {
        font-size: 2.2rem;
    }
}
