/**
 * Styles de la Galerie Photos Airbnb (Mosaïque 5 Photos & Visionneuse Plein Écran)
 *
 * @package Oradys
 * @since   1.2.0
 */

/* ==========================================================================
   1. Section & En-tête de Galerie
   ========================================================================== */
.oradys-airbnb-gallery-section {
    position: relative;
    margin-top: 28px;
    margin-bottom: 40px;
    width: 100%;
    box-sizing: border-box;
}

.gallery-section-header {
    margin-bottom: 18px;
}

.gallery-overline {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--oradys-gold, #DCA744);
    margin-bottom: 6px;
}

.gallery-title {
    font-family: var(--font-serif, 'Cormorant Garamond', Georgia, serif);
    font-size: 32px;
    font-weight: 600;
    color: var(--oradys-text-main, #2D2926);
    margin: 0;
    line-height: 1.2;
}

/* ==========================================================================
   2. Mosaïque 5 Photos Style Airbnb
   ========================================================================== */
.oradys-airbnb-grid {
    position: relative;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 230px 230px;
    gap: 8px;
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;
    background: transparent;
    box-shadow: 0 4px 20px rgba(26, 22, 20, 0.05);
}

.airbnb-grid-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background-color: #F8F4EE;
    user-select: none;
}

/* Photo 1 (Principale à gauche - 50% de la largeur totale, 2 rangées) */
.airbnb-grid-item-main {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
}

/* Photos 2 et 3 (Rangée 1 à droite) */
.airbnb-grid-item-1 {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
}
.airbnb-grid-item-2 {
    grid-column: 3 / 4;
    grid-row: 1 / 2;
}

/* Photos 4 et 5 (Rangée 2 à droite) */
.airbnb-grid-item-3 {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
}
.airbnb-grid-item-4 {
    grid-column: 3 / 4;
    grid-row: 2 / 3;
}

/* Images de la grille */
.airbnb-grid-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), filter 0.35s ease;
}

.airbnb-grid-item:hover .airbnb-grid-img {
    transform: scale(1.035);
    filter: brightness(0.94);
}

/* Overlay léger au survol */
.airbnb-grid-hover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(26, 22, 20, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.airbnb-grid-hover-overlay i {
    color: #ffffff;
    font-size: 24px;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
    transform: scale(0.85);
    transition: transform 0.25s ease;
}

.airbnb-grid-item:hover .airbnb-grid-hover-overlay {
    opacity: 1;
}

.airbnb-grid-item:hover .airbnb-grid-hover-overlay i {
    transform: scale(1);
}

/* ==========================================================================
   3. Bouton Flottant "Afficher toutes les photos" (Style Airbnb Officiel)
   ========================================================================== */
.oradys-airbnb-btn-all {
    position: absolute;
    bottom: 16px;
    right: 16px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    color: #222222;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-family: var(--font-sans, 'Outfit', sans-serif);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.oradys-airbnb-btn-all:hover {
    background-color: #f7f7f7;
    transform: scale(1.02);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.22);
}

.oradys-airbnb-btn-all:active {
    transform: scale(0.98);
}

.oradys-airbnb-btn-all .airbnb-dots-icon {
    width: 15px;
    height: 15px;
    fill: #222222;
    flex-shrink: 0;
}

/* ==========================================================================
   4. Visionneuse Plein Écran Interactive (Modal Lightbox - Couleur Ivoire)
   ========================================================================== */
.oradys-gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: #FAF7F2; /* Couleur Ivoire */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.oradys-gallery-modal.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.gallery-modal-backdrop {
    position: absolute;
    inset: 0;
    background: #FAF7F2; /* Couleur Ivoire */
}

.gallery-modal-container {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* En-tête Modal - Clair & Élégant */
.gallery-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    color: var(--oradys-text-main, #2D2926);
    border-bottom: 1px solid rgba(45, 41, 38, 0.08);
}

/* Bouton Fermer sans encadré / bouton : juste la croix et le label */
.gallery-modal-close-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--oradys-text-main, #2D2926);
    padding: 6px 0;
    font-family: var(--font-sans, 'Outfit', sans-serif);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.gallery-modal-close-btn:hover {
    background: transparent !important;
    border: none !important;
    color: var(--oradys-gold, #DCA744);
    opacity: 0.85;
}

.gallery-modal-close-btn i {
    font-size: 17px;
    display: inline-block;
}

.gallery-modal-counter {
    font-family: var(--font-sans, 'Outfit', sans-serif);
    font-size: 15px;
    font-weight: 600;
    color: var(--oradys-text-main, #2D2926);
    background: rgba(45, 41, 38, 0.06);
    padding: 5px 14px;
    border-radius: var(--radius-full, 9999px);
    letter-spacing: 0.5px;
}

.gallery-modal-counter .gallery-current-num {
    color: var(--oradys-gold, #DCA744);
    font-weight: 700;
}

.gallery-modal-acc-title {
    font-family: var(--font-serif, 'Cormorant Garamond', Georgia, serif);
    font-size: 18px;
    font-weight: 600;
    color: var(--oradys-text-main, #2D2926);
    max-width: 380px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
}

/* Zone d'Affichage Centrale */
.gallery-modal-viewer {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    overflow: hidden;
}

.gallery-modal-image-wrapper {
    position: relative;
    max-width: 90%;
    max-height: 72vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gallery-modal-main-img {
    max-width: 100%;
    max-height: 68vh;
    object-fit: contain;
    border-radius: var(--radius-sm, 8px);
    box-shadow: 0 10px 35px rgba(45, 41, 38, 0.12);
    user-select: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.gallery-modal-caption {
    margin-top: 10px;
    font-family: var(--font-sans, 'Outfit', sans-serif);
    font-size: 14px;
    color: var(--oradys-text-muted, #6B6560);
    text-align: center;
    max-width: 600px;
}

/* Flèches de navigation Suivant / Précédent (SANS BORDURE) */
.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #ffffff;
    border: none !important;
    outline: none !important;
    box-shadow: 0 3px 12px rgba(26, 22, 20, 0.14);
    color: var(--oradys-text-main, #2D2926);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 5;
}

.gallery-nav-btn:hover {
    background: #ffffff;
    border: none !important;
    color: var(--oradys-gold, #DCA744);
    box-shadow: 0 6px 20px rgba(26, 22, 20, 0.2);
    transform: translateY(-50%) scale(1.08);
}

.gallery-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.gallery-nav-prev {
    left: 24px;
}

.gallery-nav-next {
    right: 24px;
}

/* Ruban inférieur des vignettes (Thumbnails Strip) */
.gallery-modal-footer {
    padding: 12px 24px 18px;
    border-top: 1px solid rgba(45, 41, 38, 0.08);
    background: rgba(250, 247, 242, 0.95);
}

.gallery-thumbnails-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--oradys-gold, #DCA744) rgba(45, 41, 38, 0.05);
}

.gallery-thumbnails-strip::-webkit-scrollbar {
    height: 4px;
}
.gallery-thumbnails-strip::-webkit-scrollbar-thumb {
    background: var(--oradys-gold, #DCA744);
    border-radius: 4px;
}

.gallery-thumb-btn {
    position: relative;
    flex: 0 0 68px;
    height: 48px;
    padding: 0;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.gallery-thumb-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-thumb-btn:hover {
    opacity: 0.9;
}

.gallery-thumb-btn.is-active {
    opacity: 1;
    border-color: var(--oradys-gold, #DCA744);
    transform: scale(1.05);
    box-shadow: 0 2px 10px rgba(220, 167, 68, 0.35);
}

/* ==========================================================================
   5. Responsive Mobile & Tablette
   ========================================================================== */
@media (max-width: 991px) {
    .oradys-airbnb-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 200px 180px 180px;
    }

    .airbnb-grid-item-main {
        grid-column: 1 / span 2;
        grid-row: 1 / 2;
    }

    .airbnb-grid-item-1 {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
    }
    .airbnb-grid-item-2 {
        grid-column: 2 / 3;
        grid-row: 2 / 3;
    }
    .airbnb-grid-item-3 {
        grid-column: 1 / 2;
        grid-row: 3 / 4;
    }
    .airbnb-grid-item-4 {
        grid-column: 2 / 3;
        grid-row: 3 / 4;
    }
}

@media (max-width: 640px) {
    .oradys-airbnb-gallery-section {
        margin-top: 16px;
        margin-bottom: 28px;
    }

    .oradys-airbnb-grid {
        display: block;
        height: auto;
        border-radius: 12px;
    }

    /* Sur mobile : seule la photo principale est visible avec son bouton */
    .airbnb-grid-item-main {
        display: block;
        height: 260px;
        width: 100%;
    }

    .airbnb-grid-item-sub {
        display: none;
    }

    /* Déplacer le bouton sur la photo principale sur mobile */
    .airbnb-grid-item-main .oradys-airbnb-btn-all {
        display: inline-flex !important;
        bottom: 12px;
        right: 12px;
        padding: 6px 12px;
        font-size: 13px;
    }

    .gallery-modal-acc-title {
        display: none;
    }

    .gallery-nav-btn {
        width: 38px;
        height: 38px;
        font-size: 15px;
    }

    .gallery-nav-prev {
        left: 10px;
    }

    .gallery-nav-next {
        right: 10px;
    }

    .gallery-thumb-btn {
        flex: 0 0 54px;
        height: 38px;
    }
}
