/************************************
*       Countries Page
************************************/
/* ── Layout ── */
.gallery-images { padding-right: 30px; }
.countries-link { color: var(--hs-link); }
.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; }
/* ── Modal design ── */
#toggleInfo { text-align: center; }
.galleryModalPhotos img { max-height: 600px; width: auto; margin: 0 auto; display: block; }
.toggleInfoMark { display: block; color: #777; padding: 8px 0 8px 16px; text-decoration: none; }
.carousel-control-prev-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%2317a2b8' viewBox='0 0 8 8'%3E%3Cpath d='M5.25 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3E%3C/svg%3E");
}
.carousel-control-next-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%2317a2b8' viewBox='0 0 8 8'%3E%3Cpath d='M2.75 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z'/%3E%3C/svg%3E");
}
/* ── 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: #1a1a1a;
}
.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; }
/* ── Info cards in modal (from photos.html inline) ── */
.info-card {
    background: rgba(255,255,255,.06); border-radius: .375rem;
    padding: .5rem .75rem; line-height: 1.4;
}
/* ── Carousel fixed height (from photos.html inline) ── */
#galleryModal .carousel { background: #111; border-radius: .375rem; }
#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; }
/* ── 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"] .photo-thumb-link { background: #111318; }
[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; }
