/************************************
*       Countries Page
************************************/
/* ── Layout ── */
.gallery-images { padding-right: 30px; }
.countries-link { color: var(--hs-link); }
/* Point 14 — titre de la grille des pays : la couleur était en dur dans le
   gabarit et ne suivait pas le thème. */
.countries-title { color: var(--hs-heading); }
.countries-font { font-size: 18px; }
@media(max-width:991px) { .countries-font { font-size: 16px; } }
@media(max-width:767px) { .countries-font { font-size: 12px; } }
@media(max-width:575px) { .countries-font { font-size: 16px; } }
#countries-sidenote { padding: 10px; font-size: 12px; font-style: italic; }
@media(max-width:576px) { #countries-sidenote { text-align: center; } }
/* ── Sidebar continent/country ── */
.sidebar-continent { color: var(--hs-sidebar-text); }
.sidebar-country { color: var(--hs-sidebar-text-muted); }
@media(max-width:575px) {
    .sidebar-continent { text-align: left; }
    .sidebar-country { text-align: left; }
}
/* ── Mobile: continent dropdown on the right ── */
@media(max-width:575px) {
    .sidebar-tree {
        position: relative;
        overflow: visible !important; /* allow dropdown to overflow */
    }
    /* continent-group must NOT be a positioned ancestor so the collapse
       is anchored to .sidebar-tree instead */
    .continent-group {
        position: static;
    }
    .continent-group .collapsing,
    .continent-group .collapse.show {
        position: absolute;
        right: 0;
        top: 4px;          /* petit décalage pour ne pas coller au bord */
        width: 55%;
        z-index: 200;
        background: var(--hs-bg, #fff);
        border: 1px solid var(--hs-border, #dee2e6);
        border-radius: .375rem;
        box-shadow: 0 4px 16px var(--hs-shadow-strong, rgba(0,0,0,.15));
        padding: 4px 0;    /* espace intérieur haut/bas */
    }
    .continent-group .collapse.show {
        overflow-y: auto;
        /* max-height set dynamically via JS to .sidebar-tree height */
    }
    .continent-group .collapsing {
        overflow: hidden;
    }
}
/* ── Sidebar wrapper ── */
#wrapper { overflow-x: hidden; }
#sidebar-wrapper-row { margin-left: 0; padding-right: 0; margin-bottom: 20px; }
#sidebar-wrapper {
    margin-left: 0;
    transition: margin .25s ease-out;
}
#sidebar-wrapper .sidebar-heading { padding: 0.875rem 1.25rem; font-size: 1.2rem; text-align: center; }
#page-content-wrapper { min-width: 100vw; }
#wrapper.toggled #sidebar-wrapper { margin-left: 0; }
@media(min-width:576px) {
    #sidebar-wrapper { min-height: 100vh; }
    #sidebar-wrapper-row { margin-bottom: 0; }
}
@media(min-width:768px) {
    #page-content-wrapper { min-width: 0; width: 100%; }
    #wrapper.toggled #sidebar-wrapper { margin-left: -15rem; }
}
/* ── Sidebar sizing (from countries.html inline) ── */
.sidebar-col {
    width: 200px; min-width: 200px; max-width: 200px;
    min-height: calc(100vh - 56px);
    transition: width .2s;
}
@media(max-width:575px) {
    .sidebar-col { width: 100%; min-width: 100%; max-width: 100%; min-height: auto; }
    .row.g-0 { flex-direction: column; }
    .gallery-images { overflow: visible !important; padding-right: 0; }
}
/* ── Sidebar tree typography (from countries.html inline) ── */
.sidebar-continent {
    font-size: .78rem; font-weight: 600;
    color: var(--hs-sidebar-text);
    background: transparent; border: none;
}
.sidebar-continent:hover { background: var(--hs-sidebar-hover); }
.sidebar-chevron {
    font-size: .6rem; transition: transform .2s; vertical-align: middle;
}
.sidebar-continent[aria-expanded="true"] .sidebar-chevron { transform: rotate(90deg); }
.sidebar-country {
    font-size: .75rem; color: var(--hs-sidebar-text-muted);
    border: none; background: transparent;
    padding-left: 1.5rem !important;
}
.sidebar-country:hover { background: #f3f4f6; color: #111827; }
.sidebar-country.active-country {
    background: var(--hs-sidebar-active);
    color: var(--hs-sidebar-active-text);
    font-weight: 600;
}
#countries-sidenote { font-size: .65rem; font-style: italic; color: var(--hs-sidebar-section); }
/* ── Gallery photo ── */
.gallery-photo { padding-top: 30px; padding-right: 30px; }
.hs-photo { height: 148px; }
/* ── Filter pills (from photos.html inline) ── */
.filter-label {
    font-size: .78rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
.filter-pill {
    font-size: .78rem; font-weight: 500; padding: .3em .75em;
    background: var(--hs-filter-pill-bg); color: var(--hs-filter-pill-text);
    border: 1.5px solid var(--hs-filter-pill-border);
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.filter-pill:hover {
    background: var(--hs-filter-pill-hover-bg); color: #212529;
    border-color: #adb5bd; transform: translateY(-1px);
}
.filter-pill--active {
    background: #0d6efd !important; color: #fff !important;
    border-color: #0d6efd !important;
}
/* ── Photo thumbnails (from photos.html inline) ── */
.photo-thumb-link {
    position: relative; overflow: hidden; border-radius: .375rem;
    display: block; background: var(--hs-lightbox-stage);
}
.photo-thumb {
    aspect-ratio: 1 / 1; object-fit: contain; border-radius: .375rem;
    transition: transform .2s ease, filter .2s ease; height: 120px;
}
@media(min-width:768px) { .photo-thumb { height: 140px; } }
.photo-thumb-link:hover .photo-thumb { transform: scale(1.06); filter: brightness(.85); }
.photo-thumb-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,.65));
    color: #fff; font-size: .7rem; padding: .25rem .4rem;
    opacity: 0; transition: opacity .2s;
    border-radius: 0 0 .375rem .375rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.photo-thumb-link:hover .photo-thumb-overlay { opacity: 1; }
/************************************
*       Visionneuse photo (#galleryModal)
*   Tout est piloté par les jetons --hs-lightbox-* de base.css : le thème
*   clair donne une visionneuse claire, le sombre une visionneuse sombre.
************************************/
.hs-lightbox .hs-lightbox-content {
    background: var(--hs-lightbox-bg);
    color: var(--hs-lightbox-text);
    border: 1px solid var(--hs-lightbox-border);
    border-radius: .75rem;
    box-shadow: 0 24px 60px var(--hs-shadow-strong);
    overflow: hidden;
}
/* ── En-tête ── */
.hs-lightbox-header {
    align-items: flex-start;
    gap: .75rem;
    padding: .85rem 1rem .6rem;
    border-bottom: 1px solid var(--hs-lightbox-border);
}
.hs-lightbox-heading { min-width: 0; }
.hs-lightbox-title {
    color: var(--hs-lightbox-text);
    font-size: 1rem; line-height: 1.3; margin: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hs-lightbox-counter {
    display: block; margin-top: .15rem;
    font-size: .72rem; font-weight: 600; letter-spacing: .06em;
    text-transform: uppercase; color: var(--hs-lightbox-muted);
}
/* La croix Bootstrap est une image noire : on l'inverse en thème sombre
   plutôt que de dépendre de `.btn-close-white`, figé côté template. */
.hs-lightbox-close { opacity: .55; transition: opacity .15s; }
.hs-lightbox-close:hover { opacity: 1; }
[data-bs-theme="dark"] .hs-lightbox-close { filter: invert(1) grayscale(100%) brightness(200%); }
.hs-lightbox-body { padding: .85rem 1rem 1.1rem; }
/* ── Scène (fond derrière la photo) ── */
.hs-stage {
    background: var(--hs-lightbox-stage);
    border: 1px solid var(--hs-lightbox-border);
    border-radius: .5rem;
    overflow: hidden;
}
#galleryModal .carousel-inner { height: 42vh; }
@media(min-width:576px) { #galleryModal .carousel-inner { height: 50vh; } }
@media(min-width:768px) { #galleryModal .carousel-inner { height: 56vh; } }
@media(min-width:1200px) { #galleryModal .carousel-inner { height: 62vh; } }
#galleryModal .carousel-item { height: 100%; }
.gallery-slide-img {
    height: 100%; width: 100%; object-fit: contain; display: block;
    padding: .5rem;
    filter: drop-shadow(0 6px 18px var(--hs-lightbox-img-shadow));
}
/* ── Flèches : pastilles lisibles sur une photo claire comme sombre ── */
.hs-stage-ctrl,
.hs-stage-ctrl:hover,
.hs-stage-ctrl:focus {
    /* Bootstrap descend l'opacité à .5 (et .9 au survol) : ici la pastille
       porte elle-même son contraste, l'estomper la rendrait illisible. */
    width: auto; padding: 0 .75rem; opacity: 1;
    display: flex; align-items: center; justify-content: center;
}
.hs-stage-ctrl-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.5rem; height: 2.5rem; border-radius: 50%;
    background: var(--hs-lightbox-ctrl-bg);
    color: var(--hs-lightbox-text);
    border: 1px solid var(--hs-lightbox-ctrl-border);
    box-shadow: 0 2px 10px var(--hs-shadow-strong);
    backdrop-filter: blur(6px);
    transition: background .15s, transform .15s;
}
.hs-stage-ctrl:hover .hs-stage-ctrl-icon,
.hs-stage-ctrl:focus-visible .hs-stage-ctrl-icon {
    background: var(--hs-lightbox-ctrl-hover-bg);
    transform: scale(1.08);
}
@media(max-width:575px) {
    .hs-stage-ctrl { padding: 0 .35rem; }
    .hs-stage-ctrl-icon { width: 2.1rem; height: 2.1rem; font-size: .85rem; }
}
/* ── Panneau d'information ── */
.info-card {
    height: 100%;
    background: var(--hs-lightbox-card-bg);
    border: 1px solid var(--hs-lightbox-card-border);
    border-radius: .5rem;
    padding: .5rem .7rem; line-height: 1.35;
}
.info-label {
    display: block;
    font-size: .68rem; font-weight: 600; letter-spacing: .05em;
    text-transform: uppercase; color: var(--hs-lightbox-muted);
    margin-bottom: .15rem;
}
.info-label i { color: var(--hs-lightbox-accent); margin-right: .35rem; }
.info-value {
    display: block; font-size: .88rem; color: var(--hs-lightbox-text);
    overflow-wrap: anywhere;
}
.info-value--text { font-weight: 400; }
/* ── Actions : « Report this photo » ── */
.hs-lightbox-actions {
    display: flex; justify-content: flex-end;
    margin-top: .75rem;
}
/* `display:flex` bat la règle `[hidden]` du navigateur : sans ceci, le bouton
   resterait visible alors que le formulaire n'est pas encore ciblé. */
.hs-lightbox-actions[hidden] { display: none; }
.hs-report-toggle {
    color: var(--hs-lightbox-muted);
    background: transparent;
    border: 1px solid var(--hs-lightbox-card-border);
    border-radius: 2rem;
    padding: .25rem .8rem; font-size: .78rem;
    transition: color .15s, border-color .15s, background .15s;
}
.hs-report-toggle:hover,
.hs-report-toggle:focus-visible,
.hs-report-toggle[aria-expanded="true"] {
    color: #dc3545; border-color: #dc3545;
    background: rgba(220,53,69,.08);
}
.hs-report-form {
    display: flex; flex-direction: column;
    background: var(--hs-lightbox-card-bg);
    border: 1px solid var(--hs-lightbox-card-border);
    border-radius: .5rem;
    padding: .9rem 1rem;
    color: var(--hs-lightbox-text);
}
.hs-report-form label { color: var(--hs-lightbox-text); font-size: .85rem; }
.hs-report-form .form-text,
.hs-report-intro { color: var(--hs-lightbox-muted) !important; }
/* ── Filter pills wrapper: always visible on sm+ even if Bootstrap collapse is active ── */
@media(min-width: 576px) {
    #filterPillsWrapper {
        display: block !important;
        height: auto !important;
        overflow: visible !important;
    }
}
/* ── Mobile filter toggle button chevron animation ── */
#filterToggleBtn .fa-filter { transition: transform .2s; }
#filterToggleBtn[aria-expanded="true"] { border-color: #6c757d; background: rgba(108,117,125,.08); }
/* ── Mobile: single column for very small screens (< 360px) ── */
@media(max-width: 359px) {
    .gallery-image .col-6 { width: 100%; }
    .photo-thumb { height: 200px; }
}
/* ── Dark mode ── */
[data-bs-theme="dark"] .filter-pill {
    background: var(--hs-filter-pill-bg); color: var(--hs-filter-pill-text);
    border-color: var(--hs-filter-pill-border);
}
[data-bs-theme="dark"] .filter-pill:hover {
    background: var(--hs-filter-pill-hover-bg); color: var(--hs-text);
    border-color: #8b949e;
}
[data-bs-theme="dark"] .sidebar-col { background-color: var(--hs-sidebar-bg) !important; }
[data-bs-theme="dark"] .sidebar-continent { color: var(--hs-sidebar-text); }
[data-bs-theme="dark"] .sidebar-continent:hover { background: var(--hs-sidebar-hover); }
[data-bs-theme="dark"] .sidebar-country { color: var(--hs-sidebar-text-muted); }
[data-bs-theme="dark"] .sidebar-country:hover { background: var(--hs-sidebar-hover); color: var(--hs-text); }
[data-bs-theme="dark"] .sidebar-country.active-country { background: var(--hs-sidebar-active); color: var(--hs-sidebar-active-text); }
[data-bs-theme="dark"] #countries-sidenote { color: var(--hs-sidebar-section); }
[data-bs-theme="dark"] .img-thumbnail { background-color: var(--hs-bg-secondary); border-color: var(--hs-border); }
[data-bs-theme="dark"] .countries-link { color: var(--hs-link); }
[data-bs-theme="dark"] .countries-link:hover { color: #7db8f5; }

/* ── En-tête éditorial et bloc « About » des pages pays (B1) ── */
.country-h1 { font-size: 1.35rem; font-weight: 700; color: #505050; }
.country-lead { font-size: .9rem; }
.country-about { font-size: .9rem; background: rgba(0,0,0,.015); }
.country-about h2 { color: #505050; }
@media(max-width: 575px) {
    .country-h1 { font-size: 1.15rem; }
}
[data-bs-theme="dark"] .country-h1,
[data-bs-theme="dark"] .country-about h2 { color: var(--hs-text); }
[data-bs-theme="dark"] .country-about { background: rgba(255,255,255,.02); }
