/* =====================================================
   MDC · Galerie Photos - CSS
   3 layouts (grid, masonry, carousel)
   3 lightbox (simple, navigation, premium)
   + filtres + avant/après
   ===================================================== */

.mdc-gallery {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    --mdc-dark: #080a0a;
    --mdc-main: #b8252e;
    --mdc-light: #e8a0a4;
}

.mdc-gallery *,
.mdc-gallery *::before,
.mdc-gallery *::after {
    box-sizing: border-box;
}

/* =====================================================
   EN-TÊTE
   ===================================================== */
.mdc-gallery-header {
    text-align: center;
    margin-bottom: 50px;
}

.mdc-gallery-pretitle {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 13px;
    font-weight: 600;
    color: var(--mdc-main);
    margin-bottom: 16px;
    position: relative;
    padding: 0 30px;
}

.mdc-gallery-pretitle::before,
.mdc-gallery-pretitle::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 20px;
    height: 1px;
    background: currentColor;
}
.mdc-gallery-pretitle::before { left: 0; }
.mdc-gallery-pretitle::after  { right: 0; }

.mdc-gallery-title {
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 700;
    line-height: 1.2;
    color: var(--mdc-dark);
    margin: 0 0 16px 0;
}

.mdc-gallery-subtitle {
    font-size: 16px;
    line-height: 1.6;
    color: #5A5A5A;
    max-width: 720px;
    margin: 0 auto;
}

/* =====================================================
   FILTRES
   ===================================================== */
.mdc-gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 40px;
}

.mdc-gallery-filter-btn {
    padding: 10px 22px;
    background-color: rgba(201,150,26,0.08);
    color: var(--mdc-dark);
    border: none;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease, background 0.3s ease;
}

.mdc-gallery-filter-btn:hover {
    background-color: rgba(201,150,26,0.18);
}

.mdc-gallery-filter-btn.is-active {
    background: linear-gradient(135deg, var(--mdc-dark) 0%, var(--mdc-main) 100%);
    color: #FFFFFF;
    box-shadow: 0 6px 18px rgba(10,10,10,0.25);
}

.mdc-gallery-filter-btn:focus-visible {
    outline: 2px solid var(--mdc-main);
    outline-offset: 2px;
}

/* =====================================================
   LAYOUT : GRILLE
   ===================================================== */
.mdc-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
}

/* =====================================================
   LAYOUT : MASONRY
   ===================================================== */
.mdc-gallery-masonry {
    column-count: 3;
    column-gap: 20px;
    width: 100%;
}

.mdc-gallery-masonry .mdc-gallery-item {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    margin-bottom: 20px;
    display: block;
}

.mdc-gallery-masonry .mdc-gallery-item-media {
    aspect-ratio: unset !important;
}

.mdc-gallery-masonry .mdc-gallery-item-media img {
    height: auto !important;
}

/* =====================================================
   LAYOUT : CARROUSEL
   ===================================================== */
.mdc-gallery-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.mdc-gallery-carousel-viewport {
    overflow: hidden;
    width: 100%;
    padding: 6px 4px;
    box-sizing: border-box;
}

.mdc-gallery-carousel-track {
    display: flex;
    gap: 20px;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.mdc-gallery-carousel-track > .mdc-gallery-item {
    flex: 0 0 auto;
}

/* Flèches */
.mdc-gallery-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: 2px solid #b8252e;
    border-radius: 50%;
    background-color: #080a0a;
    color: #b8252e;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 18px rgba(10,10,10,0.3);
}

.mdc-gallery-carousel-arrow svg {
    width: 22px !important;
    height: 22px !important;
    display: block;
    fill: currentColor !important;
}
.mdc-gallery-carousel-arrow svg path {
    fill: currentColor !important;
}

.mdc-gallery-carousel-arrow:hover {
    background: linear-gradient(135deg, #8e1d24 0%, #b8252e 30%, #f5d6d8 50%, #e8a0a4 70%, #8e1d24 100%);
    color: #080a0a;
    border-color: transparent;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 25px rgba(201,150,26,0.45);
}
.mdc-gallery-carousel-arrow:hover svg,
.mdc-gallery-carousel-arrow:hover svg path {
    fill: #080a0a !important;
}

.mdc-gallery-carousel-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.mdc-gallery-carousel-prev { left: 12px; }
.mdc-gallery-carousel-next { right: 12px; }

/* Dots */
.mdc-gallery-carousel-dots {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 24px;
}

.mdc-gallery-carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(201,150,26,0.3);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.3s ease, width 0.3s ease;
}

.mdc-gallery-carousel-dot.is-active {
    background-color: var(--mdc-dark);
    width: 28px;
    border-radius: 5px;
}

/* =====================================================
   ITEM (CARD IMAGE)
   ===================================================== */
.mdc-gallery-item {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background-color: #FFFFFF;
    box-shadow: 0 8px 24px rgba(10,10,10,0.12);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.4s ease,
                opacity 0.4s ease;
}

.mdc-gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(10,10,10,0.22);
}

.mdc-gallery-item.is-hidden {
    display: none;
}

.mdc-gallery-item.is-filtering {
    opacity: 0;
    transform: scale(0.95);
}

/* Media wrapper */
.mdc-gallery-item-media {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: rgba(201,150,26,0.05);
}

/* Aspect ratios */
.mdc-gallery-aspect-1-1 .mdc-gallery-item-media   { aspect-ratio: 1 / 1; }
.mdc-gallery-aspect-4-3 .mdc-gallery-item-media   { aspect-ratio: 4 / 3; }
.mdc-gallery-aspect-3-2 .mdc-gallery-item-media   { aspect-ratio: 3 / 2; }
.mdc-gallery-aspect-16-9 .mdc-gallery-item-media  { aspect-ratio: 16 / 9; }
.mdc-gallery-aspect-3-4 .mdc-gallery-item-media   { aspect-ratio: 3 / 4; }

.mdc-gallery-item-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    cursor: zoom-in;
}

.mdc-gallery-item-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.mdc-gallery-item:hover .mdc-gallery-item-media img {
    transform: scale(1.06);
}

/* Overlay au hover */
.mdc-gallery-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(10,10,10,0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    padding: 24px;
    text-align: center;
    color: #FFFFFF;
}

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

.mdc-gallery-overlay-icon {
    width: 56px;
    height: 56px;
    background-color: rgba(255,255,255,0.18);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    transform: scale(0.7);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mdc-gallery-overlay-icon svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
}

.mdc-gallery-item:hover .mdc-gallery-overlay-icon {
    transform: scale(1);
}

.mdc-gallery-overlay-caption {
    margin-bottom: 16px;
    transform: translateY(10px);
    transition: transform 0.4s ease;
}

.mdc-gallery-item:hover .mdc-gallery-overlay-caption {
    transform: translateY(0);
}

.mdc-gallery-caption-overlay .mdc-gallery-overlay-caption .mdc-gallery-caption-title {
    font-size: 18px;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0 0 6px 0;
}

.mdc-gallery-caption-overlay .mdc-gallery-overlay-caption .mdc-gallery-caption-desc {
    font-size: 14px;
    color: rgba(255,255,255,0.85);
    margin: 0;
}

/* Légende en dessous */
.mdc-gallery-caption-below {
    padding: 18px 20px;
    background-color: #FFFFFF;
}

.mdc-gallery-caption-below .mdc-gallery-caption-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--mdc-dark);
    margin: 0 0 4px 0;
}

.mdc-gallery-caption-below .mdc-gallery-caption-desc {
    font-size: 13px;
    color: #5A5A5A;
    margin: 0;
}

/* En mode masonry, la légende en dessous est dans le flux normal de la column */
.mdc-gallery-masonry .mdc-gallery-caption-below {
    border-top: 1px solid rgba(201,150,26,0.08);
}

/* =====================================================
   AVANT / APRÈS (slider)
   ===================================================== */
.mdc-ba-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    cursor: ew-resize;
}

.mdc-ba-after,
.mdc-ba-before {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.mdc-ba-before-wrap {
    position: absolute;
    inset: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
    transition: width 0.05s linear;
}

.mdc-ba-before-wrap .mdc-ba-before {
    /* L'image AVANT doit garder ses dimensions originales et être positionnée absolument */
    width: calc(100vw + 200px);
    max-width: none;
}

/* Pour que ça marche en taille réelle de l'item : on bascule en width 100% du parent original */
.mdc-ba-wrapper .mdc-ba-before {
    width: 100%;
}

.mdc-ba-wrapper .mdc-ba-before-wrap {
    width: 50%;
}

.mdc-ba-wrapper .mdc-ba-before-wrap .mdc-ba-before {
    width: 200%;
}

.mdc-ba-slider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 3px;
    height: 100%;
    background-color: #FFFFFF;
    box-shadow: 0 0 12px rgba(0,0,0,0.4);
    transform: translateX(-50%);
    cursor: ew-resize;
    z-index: 3;
    transition: left 0.05s linear;
}

.mdc-ba-slider:focus-visible {
    outline: 2px solid var(--mdc-light);
    outline-offset: 4px;
}

.mdc-ba-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #FFFFFF;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mdc-dark);
    pointer-events: none;
}

.mdc-ba-handle svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.mdc-ba-label {
    position: absolute;
    top: 14px;
    padding: 6px 12px;
    background-color: rgba(10,10,10,0.85);
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    z-index: 2;
    pointer-events: none;
}

.mdc-ba-label-before { left: 14px; }
.mdc-ba-label-after  { right: 14px; }

/* =====================================================
   LIGHTBOX
   ===================================================== */
/* =====================================================
   LIGHTBOX - REFONTE PROPRE v1.3.0 (desktop base)
   Sélecteurs blindés pour battre le thème Greenola
   ===================================================== */
.mdc-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background-color: rgba(0,0,0,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 90px 120px;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-sizing: border-box;
}

.mdc-gallery-lightbox[hidden] {
    display: none !important;
}

/* Sécurité : aucun enfant de la lightbox fermée ne capture les clics */
.mdc-gallery-lightbox[hidden] * {
    pointer-events: none !important;
}

.mdc-gallery-lightbox.is-open {
    opacity: 1;
}

/* Bouton fermer (X) - toujours en haut à droite de l'écran */
html body .mdc-gallery-lightbox .mdc-gallery-lightbox-close {
    position: fixed !important;
    top: 24px !important;
    right: 24px !important;
    left: auto !important;
    bottom: auto !important;
    width: 50px !important;
    height: 50px !important;
    border: none !important;
    border-radius: 50% !important;
    background-color: rgba(0,0,0,0.6) !important;
    color: #FFFFFF !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background-color 0.3s ease, transform 0.3s ease !important;
    z-index: 100001 !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

html body .mdc-gallery-lightbox .mdc-gallery-lightbox-close:hover {
    background-color: rgba(0,0,0,0.85) !important;
    transform: rotate(90deg) !important;
}

html body .mdc-gallery-lightbox .mdc-gallery-lightbox-close svg {
    width: 24px !important;
    height: 24px !important;
    fill: #FFFFFF !important;
}

/* Flèches navigation - centrées verticalement sur les côtés */
html body .mdc-gallery-lightbox .mdc-gallery-lightbox-arrow {
    position: fixed !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 56px !important;
    height: 56px !important;
    border: none !important;
    border-radius: 50% !important;
    background-color: rgba(0,0,0,0.6) !important;
    color: #FFFFFF !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background-color 0.3s ease !important;
    z-index: 100000 !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

html body .mdc-gallery-lightbox .mdc-gallery-lightbox-arrow:hover {
    background-color: rgba(0,0,0,0.85) !important;
}

html body .mdc-gallery-lightbox .mdc-gallery-lightbox-arrow svg {
    width: 26px !important;
    height: 26px !important;
    fill: #FFFFFF !important;
}

html body .mdc-gallery-lightbox .mdc-gallery-lightbox-prev {
    left: 24px !important;
    right: auto !important;
}
html body .mdc-gallery-lightbox .mdc-gallery-lightbox-next {
    right: 24px !important;
    left: auto !important;
}

/* Conteneur du contenu (image + caption) */
.mdc-gallery-lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
}

.mdc-gallery-lightbox-image-wrap {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 100%;
    min-height: 0;
}

.mdc-gallery-lightbox-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.3s ease;
    cursor: grab;
}

.mdc-gallery-lightbox-image.is-zoomed {
    cursor: grabbing;
}

.mdc-gallery-lightbox-caption {
    margin-top: 20px;
    text-align: center;
    color: #FFFFFF;
    max-width: 720px;
}

.mdc-gallery-lightbox-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: #FFFFFF;
}

.mdc-gallery-lightbox-desc {
    font-size: 15px;
    margin: 0;
    color: rgba(255,255,255,0.8);
}

/* Counter (1/6) - fixe en haut centré */
html body .mdc-gallery-lightbox .mdc-gallery-lightbox-counter {
    position: fixed !important;
    top: 30px !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translateX(-50%) !important;
    color: #FFFFFF !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    background-color: rgba(0,0,0,0.6) !important;
    padding: 8px 16px !important;
    border-radius: 100px !important;
    z-index: 100000 !important;
    margin: 0 !important;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.mdc-gallery-lightbox-separator {
    opacity: 0.5;
    margin: 0 4px;
}

/* Thumbs - fixe en bas centré */
html body .mdc-gallery-lightbox .mdc-gallery-lightbox-thumbs {
    position: fixed !important;
    bottom: 20px !important;
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    max-width: 92vw !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 10px 14px !important;
    margin: 0 !important;
    background-color: rgba(0,0,0,0.6) !important;
    border-radius: 12px !important;
    z-index: 100000 !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.mdc-gallery-lightbox-thumbs::-webkit-scrollbar {
    height: 4px;
}

.mdc-gallery-lightbox-thumbs::-webkit-scrollbar-thumb {
    background-color: rgba(255,255,255,0.3);
    border-radius: 4px;
}

html body .mdc-gallery-lightbox .mdc-gallery-lightbox-thumb {
    flex: 0 0 64px !important;
    width: 64px !important;
    height: 48px !important;
    border: 2px solid transparent !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer !important;
    transition: border-color 0.3s ease, opacity 0.2s ease !important;
    opacity: 0.55 !important;
}

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

.mdc-gallery-lightbox-thumb:hover {
    opacity: 1;
}

.mdc-gallery-lightbox-thumb.is-active {
    border-color: var(--mdc-light);
    opacity: 1;
    transform: scale(1.05);
}

/* Zoom controls (premium) */
.mdc-gallery-lightbox-zoom-controls {
    position: absolute;
    top: 28px;
    left: 28px;
    display: flex;
    gap: 8px;
    z-index: 9;
}

.mdc-gallery-lightbox-zoom-controls button {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.12);
    color: #FFFFFF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.mdc-gallery-lightbox-zoom-controls button:hover {
    background-color: rgba(255,255,255,0.25);
}

.mdc-gallery-lightbox-zoom-controls svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Share buttons (premium) */
.mdc-gallery-lightbox-share {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
}

.mdc-gallery-lightbox-share-label {
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    margin-right: 4px;
}

.mdc-gallery-lightbox-share a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.12);
    color: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, transform 0.3s ease;
    text-decoration: none;
}

.mdc-gallery-lightbox-share a:hover {
    background-color: var(--mdc-light);
    transform: translateY(-2px);
}

.mdc-gallery-lightbox-share svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1024px) {
    .mdc-gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .mdc-gallery-masonry {
        column-count: 2 !important;
    }
}

@media (max-width: 767px) {
    html body .mdc-gallery {
        padding-left: 16px;
        padding-right: 16px;
        max-width: 100% !important;
        width: 100% !important;
        overflow: hidden;
        box-sizing: border-box !important;
    }

    html body .mdc-gallery * {
        box-sizing: border-box !important;
        max-width: 100% !important;
    }

    html body .mdc-gallery .mdc-gallery-header {
        margin-bottom: 32px !important;
        padding: 0 !important;
    }

    html body .mdc-gallery .mdc-gallery-pretitle {
        font-size: 11px !important;
        letter-spacing: 2px !important;
        padding: 0 24px !important;
    }
    html body .mdc-gallery .mdc-gallery-title {
        font-size: clamp(22px, 6vw, 30px) !important;
    }
    html body .mdc-gallery .mdc-gallery-subtitle {
        font-size: 14px !important;
    }

    html body .mdc-gallery .mdc-gallery-filters {
        gap: 8px !important;
        margin-bottom: 28px !important;
    }

    html body .mdc-gallery .mdc-gallery-filter-btn {
        padding: 8px 16px !important;
        font-size: 13px !important;
    }

    /* Grille → 1 colonne */
    html body .mdc-gallery .mdc-gallery-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    html body .mdc-gallery .mdc-gallery-item {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    html body .mdc-gallery .mdc-gallery-item-media {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
    }

    /* Garantir l'aspect-ratio sur mobile (sinon height:100% de l'img = 0) */
    html body .mdc-gallery-aspect-1-1 .mdc-gallery-item-media   { aspect-ratio: 1 / 1 !important; }
    html body .mdc-gallery-aspect-4-3 .mdc-gallery-item-media   { aspect-ratio: 4 / 3 !important; }
    html body .mdc-gallery-aspect-3-2 .mdc-gallery-item-media   { aspect-ratio: 3 / 2 !important; }
    html body .mdc-gallery-aspect-16-9 .mdc-gallery-item-media  { aspect-ratio: 16 / 9 !important; }
    html body .mdc-gallery-aspect-3-4 .mdc-gallery-item-media   { aspect-ratio: 3 / 4 !important; }

    html body .mdc-gallery .mdc-gallery-item-media img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
    }

    /* Masonry → 1 colonne */
    html body .mdc-gallery .mdc-gallery-masonry {
        column-count: 1 !important;
    }

    /* Carrousel : flèches plus petites */
    html body .mdc-gallery .mdc-gallery-carousel-arrow {
        width: 36px !important;
        height: 36px !important;
    }
    html body .mdc-gallery .mdc-gallery-carousel-arrow svg {
        width: 18px !important;
        height: 18px !important;
    }
    html body .mdc-gallery .mdc-gallery-carousel-prev { left: 4px !important; }
    html body .mdc-gallery .mdc-gallery-carousel-next { right: 4px !important; }

    html body .mdc-gallery .mdc-gallery-caption-below {
        padding: 14px 16px;
    }

    /* ============================================
       CARROUSEL MOBILE - REFONTE v1.2.3
       ============================================ */
    html body .mdc-gallery .mdc-gallery-carousel {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        position: relative !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    html body .mdc-gallery .mdc-gallery-carousel-viewport {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    html body .mdc-gallery .mdc-gallery-carousel-track {
        gap: 12px !important;
        display: flex !important;
    }

    /* Force chaque item à occuper 100% du viewport mobile */
    html body .mdc-gallery .mdc-gallery-carousel-track > .mdc-gallery-item {
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    /* L'image dans la card du carrousel */
    html body .mdc-gallery .mdc-gallery-carousel .mdc-gallery-item-media {
        width: 100% !important;
        max-width: 100% !important;
    }

    html body .mdc-gallery .mdc-gallery-carousel .mdc-gallery-item-media img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
    }

    /* Réduit la bande blanche en bas (caption) sur mobile */
    html body .mdc-gallery .mdc-gallery-caption-below {
        padding: 12px 14px !important;
    }

    /* Flèches carrousel mobile : plus petites + sur les côtés */
    html body .mdc-gallery .mdc-gallery-carousel-arrow {
        width: 36px !important;
        height: 36px !important;
        background: rgba(10,10,10, 0.85) !important;
    }
    html body .mdc-gallery .mdc-gallery-carousel-arrow svg {
        width: 18px !important;
        height: 18px !important;
    }
    html body .mdc-gallery .mdc-gallery-carousel-prev { left: 8px !important; }
    html body .mdc-gallery .mdc-gallery-carousel-next { right: 8px !important; }

    /* ============================================
       OUVERTURE LIGHTBOX - assurer le clic mobile
       ============================================ */
    html body .mdc-gallery .mdc-gallery-item {
        cursor: pointer !important;
        -webkit-tap-highlight-color: rgba(252,203,0, 0.2) !important;
    }

    html body .mdc-gallery .mdc-gallery-item-link {
        display: block !important;
        width: 100% !important;
        cursor: pointer !important;
        touch-action: manipulation !important;
    }

    html body .mdc-gallery .mdc-gallery-overlay {
        cursor: pointer !important;
        pointer-events: auto !important;
    }

    /* ============================================
       LIGHTBOX MOBILE - REFONTE PROPRE v1.3.0
       ============================================ */

    /* Conteneur lightbox : padding réduit pour mobile */
    html body .mdc-gallery-lightbox:not([hidden]) {
        padding: 70px 10px 90px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Compteur en haut centré */
    html body .mdc-gallery-lightbox .mdc-gallery-lightbox-counter {
        top: 18px !important;
        font-size: 14px !important;
        padding: 6px 14px !important;
    }

    /* Bouton fermer en haut à droite */
    html body .mdc-gallery-lightbox .mdc-gallery-lightbox-close {
        top: 14px !important;
        right: 14px !important;
        width: 44px !important;
        height: 44px !important;
    }
    html body .mdc-gallery-lightbox .mdc-gallery-lightbox-close svg {
        width: 22px !important;
        height: 22px !important;
    }

    /* Flèches plus petites, collées aux bords */
    html body .mdc-gallery-lightbox .mdc-gallery-lightbox-arrow {
        width: 44px !important;
        height: 44px !important;
    }
    html body .mdc-gallery-lightbox .mdc-gallery-lightbox-arrow svg {
        width: 20px !important;
        height: 20px !important;
    }
    html body .mdc-gallery-lightbox .mdc-gallery-lightbox-prev { left: 8px !important; }
    html body .mdc-gallery-lightbox .mdc-gallery-lightbox-next { right: 8px !important; }

    /* Contenu : prend tout l'espace dispo */
    html body .mdc-gallery-lightbox .mdc-gallery-lightbox-content {
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* L'image remplit le cadre disponible */
    html body .mdc-gallery-lightbox .mdc-gallery-lightbox-image-wrap {
        width: 100% !important;
        height: 100% !important;
        flex: 1 1 auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 0 !important;
    }

    html body .mdc-gallery-lightbox .mdc-gallery-lightbox-image {
        max-width: 100% !important;
        max-height: 100% !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
    }

    /* Caption compacte */
    html body .mdc-gallery-lightbox .mdc-gallery-lightbox-caption {
        margin-top: 10px !important;
        padding: 0 12px !important;
    }
    html body .mdc-gallery-lightbox .mdc-gallery-lightbox-title {
        font-size: 16px !important;
    }
    html body .mdc-gallery-lightbox .mdc-gallery-lightbox-desc {
        font-size: 13px !important;
    }

    /* Thumbnails en bas, centrées, défilables */
    html body .mdc-gallery-lightbox .mdc-gallery-lightbox-thumbs {
        bottom: 14px !important;
        max-width: 94vw !important;
        padding: 8px 10px !important;
        gap: 6px !important;
        justify-content: flex-start !important;
    }
    html body .mdc-gallery-lightbox .mdc-gallery-lightbox-thumb {
        flex: 0 0 48px !important;
        width: 48px !important;
        height: 38px !important;
    }
    html body .mdc-gallery-lightbox .mdc-gallery-lightbox-thumb.is-active {
        opacity: 1 !important;
        border-color: #b8252e !important;
    }

    /* Cacher zoom et partage sur mobile */
    html body .mdc-gallery-lightbox .mdc-gallery-lightbox-zoom-controls,
    html body .mdc-gallery-lightbox .mdc-gallery-lightbox-share {
        display: none !important;
    }

    /* Avant/après mobile */
    html body .mdc-gallery .mdc-ba-handle {
        width: 36px;
        height: 36px;
    }

    html body .mdc-gallery .mdc-ba-label {
        font-size: 10px;
        padding: 4px 10px;
    }
}

@media (max-width: 380px) {
    html body .mdc-gallery {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}

/* =====================================================
   ACCESSIBILITÉ
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
    .mdc-gallery-item,
    .mdc-gallery-item-media img,
    .mdc-gallery-overlay,
    .mdc-gallery-overlay-icon,
    .mdc-gallery-carousel-track,
    .mdc-gallery-lightbox,
    .mdc-gallery-lightbox-image,
    .mdc-gallery-lightbox-thumb {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}


/* === MDC Couverture · bordure dégradée orange (.mdc-gallery-item) === */
.mdc-gallery-item {
    border: 2px solid transparent;
    border-radius: 14px;
    background-image:
        linear-gradient(#ffffff, #ffffff),
        linear-gradient(135deg, #8e1d24 0%, #b8252e 30%, #f5d6d8 50%, #e8a0a4 70%, #8e1d24 100%);
    background-origin: border-box;
    background-clip: padding-box, border-box;
}
.mdc-gallery-item:hover {
    box-shadow: 0 14px 36px rgba(201,150,26,0.28);
}
