/*!
 * STG Slider Download — styles boutons overlay téléchargement.
 *
 * Palette STG : #403935 (brun) · #ffffff (blanc) · Raleway.
 * Boutons ronds compacts, visibles au hover sur desktop, TOUJOURS visibles
 * sur touch pour rester découvrable au doigt (pas de hover mobile fiable).
 */

/* ─── Bouton par image (overlay top-right d'un slide) ─────────────── */
/* v1.5.191 — Reset all:unset + tous props critiques en !important +
   flèche en marron STG #403935 sur fond blanc semi-opaque. Le CSS Houzez
   forçait fond blanc via `button { background:#fff; border-radius:50% }`
   → notre fond rgba noir était écrasé, et notre flèche blanche devenait
   invisible sur ce fond blanc. Nouveau design : fond blanc contrasté +
   flèche brune (charte STG) = toujours visible sur toute image. */
.stg-dl-btn-single,
button.stg-dl-btn-single {
    all: unset;
    box-sizing: border-box !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    z-index: 20 !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 1px solid rgba(64, 57, 53, 0.25) !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.92) !important;
    color: #403935 !important; /* flèche marron STG, visible sur fond clair */
    font-family: Raleway, sans-serif !important;
    font-size: 16px !important;
    line-height: 1 !important;
    text-align: center !important;
    text-decoration: none !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0;
    transition: opacity .18s ease, background-color .18s ease, transform .18s ease, color .18s ease !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
    -webkit-tap-highlight-color: transparent !important;
    overflow: visible !important;
}
.stg-dl-btn-single > span[aria-hidden="true"],
button.stg-dl-btn-single > span[aria-hidden="true"] {
    color: #403935 !important;
    font-size: 16px !important;
    line-height: 1 !important;
    display: inline-block !important;
    font-weight: 700 !important;
}
.slick-slide:hover .stg-dl-btn-single,
.stg-v5-slide:hover .stg-dl-btn-single,
.stg-dl-btn-single:focus-visible {
    opacity: 1;
}
.stg-dl-btn-single:hover,
button.stg-dl-btn-single:hover {
    opacity: 1 !important;
    background: #403935 !important;
    color: #ffffff !important;
    border-color: #403935 !important;
    transform: scale(1.06) !important;
}
.stg-dl-btn-single:hover > span[aria-hidden="true"],
button.stg-dl-btn-single:hover > span[aria-hidden="true"] {
    color: #ffffff !important;
}

/* ─── Barre « tout télécharger » (SOUS le slider, dans le flux) ────── */
/* v1.5.187 — Sortie du mode overlay pour rester lisible et ne pas
   recouvrir l'image. Insérée dans le flux DOM juste après le slider.
   v1.5.188 — Propriétés critiques en !important pour battre les CSS
   Houzez/Elementor (les containers de gallery imposent parfois
   display:none, text-align:center, width forcée qui écrasait la barre). */
.stg-dl-toolbar {
    all: unset;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    padding: 12px 8px 4px !important;
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    text-align: center !important;
    background: transparent !important;
    border: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
    /* v1.5.204 — RETRAIT des overrides flex-basis/grid-column/order v1.5.203.
       Combinés avec les overrides CSS Slick sur .stg-v5-slider, ils
       contribuaient à casser totalement la lightbox programme neuf.
       Retour à un simple width:100% qui suffit dans la majorité des cas. */
}

/* v1.5.188 — Sélecteur dédoublé `.stg-dl-toolbar .stg-dl-btn-all` +
   propriétés critiques en !important. Le thème Houzez / Elementor pose
   sur `button` par défaut : border-radius:50%, width/height fixes, fond
   blanc, appearance:none → le bouton rendait "cercle blanc vide" sans
   ces overrides. On force aussi min-width:auto pour battre les
   width:44px hérités des boutons cercle Houzez. */
.stg-dl-toolbar .stg-dl-btn-all,
button.stg-dl-btn-all {
    all: unset;
    box-sizing: border-box !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 10px 18px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 24px !important;
    background: rgba(64, 57, 53, 0.9) !important;
    color: #fff !important;
    font-family: Raleway, sans-serif !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
    text-align: center !important;
    text-decoration: none !important;
    cursor: pointer !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
    transition: background-color .18s ease, transform .18s ease !important;
    -webkit-tap-highlight-color: transparent !important;
    overflow: visible !important;
    white-space: nowrap !important;
}
.stg-dl-toolbar .stg-dl-btn-all:hover,
button.stg-dl-btn-all:hover {
    background: #403935 !important;
    color: #fff !important;
    transform: translateY(-1px) !important;
}
.stg-dl-toolbar .stg-dl-btn-all:focus,
.stg-dl-toolbar .stg-dl-btn-all:focus-visible,
button.stg-dl-btn-all:focus,
button.stg-dl-btn-all:focus-visible {
    outline: 2px solid #403935 !important;
    outline-offset: 2px !important;
}
.stg-dl-toolbar .stg-dl-btn-all[aria-busy="true"],
button.stg-dl-btn-all[aria-busy="true"] {
    opacity: 0.7 !important;
    cursor: wait !important;
}
.stg-dl-toolbar .stg-dl-btn-all > span[aria-hidden="true"],
button.stg-dl-btn-all > span[aria-hidden="true"] {
    font-size: 14px !important;
    line-height: 1 !important;
    display: inline-block !important;
    color: inherit !important;
}
.stg-dl-toolbar .stg-dl-btn-label,
.stg-dl-btn-label {
    display: inline-block !important;
    font-family: Raleway, sans-serif !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
    color: inherit !important;
    white-space: nowrap !important;
}

.stg-dl-status {
    display: inline-block;
    min-width: 34px;
    padding: 4px 8px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-family: Raleway, sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.5px;
    text-align: center;
}
.stg-dl-status:empty {
    display: none;
}

/* ─── Adaptations lightbox (fond noir → bouton reste blanc+marron) ──── */
/* v1.5.191 — Sur fond noir de la lightbox, on garde le fond blanc opaque
   pour un contraste maximal avec la flèche marron STG. Cohérent avec le
   design du bouton en contexte normal. */
.lightbox-slider .stg-dl-btn-single,
.stg-v5-slider .stg-dl-btn-single,
.stg-fake-fs .stg-dl-btn-single {
    background: rgba(255, 255, 255, 0.92) !important;
    color: #403935 !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
}
.lightbox-slider .stg-dl-btn-single:hover,
.stg-v5-slider .stg-dl-btn-single:hover,
.stg-fake-fs .stg-dl-btn-single:hover {
    background: #403935 !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
}

/* ─── Mobile (< 768 OU landscape court) : boutons TOUJOURS visibles + tap 44px ── */
/* v1.5.190 — Ajout landscape smartphone (max-height:500) sinon le viewport
   844×390 échappait au media query et le hover desktop laissait le bouton
   invisible tant que la souris n'était pas passée. */
@media (max-width: 767.98px), (max-height: 500px) {
    /* v1.5.195 — Sur mobile, le bouton ⬇ passe en BOTTOM-RIGHT de l\'image
       (au lieu de top-right qui chevauchait le X du header + notre ⛶ FS
       positionnés en haut). Bottom-right = zone libre garantie sur toutes
       les images, ne fait interférence avec aucun bouton système. */
    .stg-dl-btn-single,
    button.stg-dl-btn-single {
        opacity: 1 !important; /* pas de hover fiable → toujours visible */
        top: auto !important;
        bottom: 10px !important;
        right: 10px !important;
        width: 42px !important;
        height: 42px !important;
        font-size: 18px !important;
    }
    .stg-dl-btn-single > span[aria-hidden="true"],
    button.stg-dl-btn-single > span[aria-hidden="true"] {
        font-size: 18px !important;
    }
    .stg-dl-btn-single:active,
    button.stg-dl-btn-single:active {
        transform: scale(0.92) !important;
        background: #403935 !important;
        color: #ffffff !important;
    }
    .stg-dl-btn-single:active > span[aria-hidden="true"],
    button.stg-dl-btn-single:active > span[aria-hidden="true"] {
        color: #ffffff !important;
    }
    .stg-dl-toolbar {
        padding: 10px 8px 6px;
        gap: 8px;
    }
    .stg-dl-btn-all {
        padding: 12px 16px;
        font-size: 12px;
        letter-spacing: 0.5px;
    }
}

/* ─── Fake fullscreen : bouton reste accessible en overlay bas centré ─ */
/* Dans le fake-fullscreen l'image occupe 100vw×100vh — il n'y a plus de
   "sous le slider" possible, on garde donc la toolbar en overlay bas centrée */
.stg-fake-fs .stg-dl-toolbar {
    position: absolute;
    bottom: 56px; /* laisse la place au compteur en bas à 16px */
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    padding: 0;
    z-index: 12;
}
.stg-fake-fs .stg-dl-btn-all {
    background: rgba(0, 0, 0, 0.55);
}
.stg-fake-fs .stg-dl-btn-all:hover {
    background: #403935;
}
.stg-fake-fs .stg-dl-btn-single {
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    font-size: 17px;
    opacity: 0.85;
}

/* ─── Impression : masquer les boutons ───────────────────────────── */
@media print {
    .stg-dl-btn-single,
    .stg-dl-toolbar { display: none !important; }
}
