/* arabic-dmam-gallery.css */
/* ============================================
   GALLERY GRID - FAIRMONT STYLE (from arabic-main.css)
   ============================================ */

/* 3. OUR GALLERY SECTION CSS - Original */
#gallery.section.gallery-section {
    height: auto !important;
    min-height: 100vh !important;
    padding: 190px 0 !important;
}

.gallery-section {
    position: relative;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 30px;
}

.gallery-section .section-title h2 {
    color: var(--navy);
}

.gallery-grid-fairmont {
    display: grid;
    grid-gap: 1.5rem;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 250px;
    width: 100%;
    margin: 0 auto;
}

.gallery-item-fairmont {
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    transition: transform var(--transition-medium);
    cursor: pointer;
}

.gallery-item-fairmont:hover {
    transform: scale(1.03);
}

.gallery-item-fairmont:nth-child(1) {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
}

.gallery-item-fairmont:nth-child(2) {
    grid-column: 3 / 4;
    grid-row: 1 / 2;
}

.gallery-item-fairmont:nth-child(3) {
    grid-column: 4 / 5;
    grid-row: 1 / 3;
}

.gallery-item-fairmont:nth-child(4) {
    grid-column: 1 / 2;
    grid-row: 3 / 5;
}

.gallery-item-fairmont:nth-child(5) {
    grid-column: 2 / 4;
    grid-row: 3 / 4;
}

.gallery-item-fairmont:nth-child(6) {
    grid-column: 4 / 5;
    grid-row: 3 / 4;
}

.gallery-item-fairmont:nth-child(7) {
    grid-column: 2 / 3;
    grid-row: 4 / 5;
}

.gallery-item-fairmont:nth-child(8) {
    grid-column: 3 / 5;
    grid-row: 4 / 5;
}

.gallery-item-fairmont img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-item-fairmont:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(10, 31, 58, 0.8), transparent);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    opacity: 0;
    transition: all var(--transition-medium);
    color: white;
    padding: 30px;
    text-align: left;
}

.gallery-item-fairmont:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay h3 {
    font-size: 1.8rem;
    transform: translateY(20px);
    transition: all var(--transition-medium) 0.1s;
}

.gallery-overlay p {
    font-size: 1rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-medium) 0.2s;
    color: var(--light-gray);
}

.gallery-item-fairmont:hover .gallery-overlay h3,
.gallery-item-fairmont:hover .gallery-overlay p {
    transform: translateY(0);
    opacity: 1;
}

.gallery-categories {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 60px;
}

.gallery-category {
    padding: 12px 25px;
    background: var(--white);
    border: 1px solid var(--light-gray);
    border-radius: 0px;
    cursor: pointer;
    transition: all var(--transition-medium);
    font-weight: 500;
    color: var(--black);
}

.gallery-category.active {
    background: var(--black);
    color: var(--white);
    border-color: var(--black);
}

.gallery-category:hover {
    background: var(--gold);
    color: var(--black);
    border-color: var(--gold);
}

/* ============================================
   GALLERY GRID RTL (Fairmont style) from arabic-main.css
   ============================================ */

.gallery-grid-fairmont {
    direction: ltr !important; /* Keep grid LTR for proper layout */
}

.gallery-item-fairmont {
    direction: rtl !important;
}

/* ============================================
   LIGHTBOX STYLES
   ============================================ */

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.98);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
    animation: lightboxFadeIn 0.3s ease;
    direction: ltr !important; /* Keep navigation buttons direction LTR */
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.lightbox-close {
    position: absolute;
    top: 25px;
    right: 35px;
    font-size: 40px;
    font-weight: 300;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10000;
    transition: all 0.3s ease;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.lightbox-close:hover {
    transform: scale(1.1);
    color: var(--gold, #c6ab7d);
    background: rgba(255, 255, 255, 0.1);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px;
    font-weight: 200;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px 8px;
    transition: none;
    z-index: 10000;
    line-height: 1;
    opacity: 0.7;
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: none;
    color: white;
    opacity: 1;
    transform: translateY(-50%);
}

.lightbox-image {
    max-width: 100vw;
    max-height: 100vh;
    width: auto;
    height: auto;
    min-width: 80vw;
    min-height: 80vh;
    object-fit: contain;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: imageZoomIn 0.3s ease;
    cursor: default;
}

@keyframes imageZoomIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Ensure the image container takes full space */
.lightbox-overlay {
    padding: 0;
    margin: 0;
}

/* Responsive Lightbox */
@media (max-width: 768px) {
    .lightbox-prev,
    .lightbox-next {
        font-size: 30px;
        padding: 8px 6px;
    }
    
    .lightbox-prev {
        left: 15px;
    }
    
    .lightbox-next {
        right: 15px;
    }
    
    .lightbox-close {
        top: 15px;
        right: 15px;
        font-size: 30px;
        width: 40px;
        height: 40px;
    }
    
    .lightbox-image {
        max-width: 100vw;
        max-height: 100vh;
        min-width: 85vw;
        min-height: 85vh;
    }
}

/* For very large screens */
@media (min-width: 1920px) {
    .lightbox-image {
        max-width: 100vw;
        max-height: 100vh;
        min-width: 70vw;
        min-height: 70vh;
    }
}

/* ============================================
   SECTION STYLES (from arabic-main.css)
   ============================================ */

.section {
    padding: 120px 0;
    width: 100%;
    position: relative;
}

.section-title {
    text-align: center;
    margin-bottom: 80px;
    position: relative;
    overflow: hidden;
    font-family: 'Montserrat';
}

.section-title h2 {
    font-size: 3.5rem;
    color: var(--navy);
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
    font-weight: 500;
}

.section-title h2:after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 2px;
    background: var(--gold);
    transition: var(--transition-medium);
}

.section-title:hover h2:after {
    width: 120px;
}

.section-title p {
    color: var(--medium-gray);
    max-width: 700px;
    margin: 30px auto 0;
    font-size: 1.2rem;
    font-weight: 300;
    line-height: 1.8;
}

/* Container */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Fade In Animation */
.fade-in {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Variables */
:root {
    --navy: #484745;
    --gold: #c6ab7d;
    --light-gold: #d4c5a8;
    --dark-gray: #d4c5a8;
    --medium-gray: #5a5a5a;
    --light-gray: #eaeaea;
    --white: #ffffff;
    --black: #000000;
    --transition-medium: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Mobile Responsive (from arabic-main.css) */
@media (max-width: 1200px) {
    .gallery-grid-fairmont {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 200px;
    }

    .gallery-item-fairmont:nth-child(n) {
        grid-column: auto;
        grid-row: auto;
    }
}

@media (max-width: 992px) {
    .gallery-grid-fairmont {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .section {
        padding: 100px 0;
    }
    
    .section-title h2 {
        font-size: 2.8rem;
    }
    
    .gallery-grid-fairmont {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 80px 0;
    }
    
    .section-title h2 {
        font-size: 2.3rem;
    }
}

/* Performance Optimizations */
.gallery-item-fairmont,
.gallery-item-fairmont img {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Disable animations on low-performance devices */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .gallery-item-fairmont:hover,
    .gallery-item-fairmont:hover img {
        transform: none;
    }
}