body {
    margin: 0;
    font-family: sans-serif;
    background-color: #121212;
    color: #e0e0e0;
}

.menu-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #000;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding-right: 20px;
    z-index: 1000;
}

.logo {
    height: 60px;
    padding: 5px 15px 5px 0;
    box-sizing: border-box;
    flex-shrink: 0;
    cursor: pointer;
}

.logo img {
    height: 100%;
    width: auto;
    object-fit: contain;
}

.menu-principal {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    flex-grow: 1;
    margin-left: 20px;
}

.menu-item {
    position: relative;
}

.menu-principal button {
    padding: 15px 20px;
    border: none;
    background: none;
    color: #e0e0e0;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

.menu-principal button:hover {
    background-color: #333;
}

.sous-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #1e1e1e;
    border: 1px solid #333;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 10;
}

.menu-item:hover .sous-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sous-menu ul {
    list-style: none;
    margin: 0;
    padding: 10px;
}

.sous-menu li {
    position: relative;
    padding: 0;
    color: #cfcfcf;
    cursor: pointer;
}

.sous-menu li > a, .sous-menu li > li {
     padding: 8px 0 8px 15px;
     display: block;
}

.sous-menu li:hover, .sous-menu li.selected {
    color: #ffffff;
    background-color: #333;
}

.contenu {
    padding: 20px;
    padding-top: 10px;
}

.about-container {
    max-width: 900px;
    background-color: #000;
    border: 1px solid #fff;
    padding: 10px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.about-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #555;
    margin-bottom: 25px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.about-container h1 {
    color: #ffffff;
    font-size: 2.5em;
    margin-bottom: 20px;
}

.about-container p {
    font-size: 1.1em;
    margin-bottom: 15px;
    color: #ffffff;
}

.quote {
    font-style: italic;
    margin: 30px 0;
    font-size: 1.2em;
    color: #87ceeb;
}

.quote cite {
    display: inline;
    margin-top: 0;
    margin-left: 6px;
    font-size: 0.9em;
    color: #888;
}

.signature {
    margin-top: 30px;
}

.signature img {
    max-width: 100%;
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.about-banner {
    width: 100%;
    max-width: 100%;
    height: auto;
    margin-bottom: 25px;
    display: block;
}

.note {
    font-size: 0.8em;
    color: #555;
    margin-top: 20px;
}

/* --- Mode Moderne --- */

#contentDisplayArea.mode-moderne {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    align-content: flex-start;
    gap: 10px;
    padding: 8px;
}

#contentDisplayArea.mode-moderne .vignette {
    display: block;
    width: auto;
    height: auto;
    background: none;
    border: none;
    border-radius: 0;
    margin: 0;
    overflow: hidden;
}

#contentDisplayArea.mode-moderne .vignette img {
    display: block;
    height: 200px;
    width: auto;
    object-fit: fill;
    transform: none;
    transition: opacity 0.2s;
}

#contentDisplayArea.mode-moderne .vignette:hover img {
    opacity: 0.85;
    transform: none;
}

/* --- Page Statistiques --- */

.stats-container {
    max-width: 900px;
    margin: 0 auto;
    background-color: #000;
    padding: 25px;
    border-radius: 8px;
}

.header-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
}

.stats-container h1 {
    color: #ffffff;
    border-bottom: 2px solid #555;
    padding-bottom: 10px;
    font-size: 1.3em;
}

.stat-entry {
    display: grid;
    grid-template-columns: auto 130px 100px;
    gap: 15px;
    align-items: baseline;
    margin-bottom: 5px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.stat-entry:hover {
    background-color: #1a1a1a;
}

.stat-entry .path {
    color: #a0c4ff;
}

.stat-entry .date {
    color: #ffffff;
}

.stat-entry .count {
    color: #b9fbc0;
    font-weight: bold;
}

#contentDisplayArea {
    gap: 20px;
    padding: 20px;
    border-radius: 8px;
    margin-top: 1px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.vignette {
    cursor: pointer;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 150px;
    width: 150px;
    border: 2px solid #555;
    border-radius: 8px;
    overflow: hidden;
    margin: 5px;
    position: relative;
}

.vignette-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    font-size: 11px;
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    padding: 3px 6px;
    opacity: 0;
    transition: opacity 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.vignette:hover .vignette-name {
    opacity: 1;
}

.vignette img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.2s ease, border-color 0.2s ease;
    border: none;
    border-radius: 0;
}

.vignette img:hover {
    transform: scale(1.03);
}

.vignette:hover {
    border-color: #eee;
}

.burger {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    padding: 15px;
    cursor: pointer;
}

.has-submenu > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.has-submenu > a::after {
    content: '▸';
    margin-right: 15px;
    font-size: 1.5em;
    color: #888;
    line-height: 1;
    vertical-align: middle;
}
.sous-menu-niveau2 {
    position: absolute;
    top: -11px;
    left: 100%;
    display: none;
    background-color: #1e1e1e;
    border: 1px solid #333;
    min-width: 200px;
    z-index: 20;
}
.sous-menu-niveau2 ul {
    padding: 10px;
    list-style: none;
    margin: 0;
}
.sous-menu li:hover > .sous-menu-niveau2 {
    display: block;
}

.view-mode-toggle {
    display: flex;
    margin-right: 12px;
}

.view-mode-toggle button {
    background: none;
    border: 1px solid #555;
    color: #aaa;
    padding: 4px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.mode-icon {
    display: none;
    vertical-align: middle;
    flex-shrink: 0;
}

.view-mode-toggle button:first-child {
    border-radius: 4px 0 0 4px;
    border-right: none;
}

.view-mode-toggle button:last-child {
    border-radius: 0 4px 4px 0;
}

.view-mode-toggle button.active {
    background-color: #555;
    color: #fff;
}

.view-mode-toggle button:hover:not(.active) {
    background-color: #2a2a2a;
    color: #ddd;
}

.slider-container {
    display: flex;
    align-items: center;
    white-space: nowrap;
    margin-left: 0;
}

.slider-container label,
.slider-container span {
    color: #e0e0e0;
    font-size: 14px;
}

.slider-container label {
    margin-right: 10px;
}

.slider-container span {
    margin-left: 10px;
    min-width: 50px;
    text-align: left;
}

#thumbnailSizeSlider {
    width: 120px;
    -webkit-appearance: none;
    appearance: none;
    background: #555;
    outline: none;
    border-radius: 5px;
    height: 8px;
}

#thumbnailSizeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e0e0e0;
    cursor: grab;
}

.gallery-info-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 4px 20px;
    background-color: #121212;
    color: #ccc;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.gallery-stats {
    display: flex;
    gap: 20px;
    align-items: center;
}

.gallery-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.gallery-nav-btn {
    background: none;
    border: 1px solid #555;
    color: #aaa;
    padding: 3px 8px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 3px;
    transition: background-color 0.2s, color 0.2s;
    line-height: 1;
}

.gallery-nav-btn:hover {
    background-color: #2a2a2a;
    color: #ddd;
}

.gallery-nav-label {
    color: #aaa;
    font-size: 13px;
    user-select: none;
    white-space: nowrap;
}

.gallery-nav-name {
    color: #87ceeb;
    font-size: 13px;
    user-select: none;
    white-space: nowrap;
    margin-left: 6px;
    margin-right: 8px;
}

#btnMapMobile {
    display: none;
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}

.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.lightbox-content {
    position: relative;
    width: 100vw;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.lightbox-content img {
    width: auto;
    height: auto;
    max-width: 95vw;
    max-height: 95vh;
    border: none;
    border-radius: 0;
}

.lightbox-caption {
    color: #e0e0e0;
    font-size: 1.2em;
    margin-top: 15px;
    text-align: center;
    max-width: 80%;
    word-wrap: break-word;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
}

.lightbox-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top-color: #e0e0e0;
    border-radius: 50%;
    animation: lightbox-spin 0.7s linear infinite;
    z-index: 10;
    pointer-events: none;
}

@keyframes lightbox-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.fade-in {
    animation: fadeIn 0.5s ease;
}

.lightbox-button {
    position: absolute;
    background-color: rgba(51, 51, 51, 0.7);
    color: #e0e0e0;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 24px;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.lightbox-button:hover {
    background-color: rgba(80, 80, 80, 0.9);
}

.lightbox-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-close {
    top: 20px;
    right: 20px;
    font-size: 22px;
    padding: 2px 10px;
}


@media (max-width: 1500px) {
    #btnMapMobile {
        display: inline-block;
    }

    .contenu {
        padding-top: 10px;
    }
    .menu-container {
        flex-direction: column;
        align-items: flex-start;
        padding-right: 0;
    }

    .logo {
        width: 100%;
        text-align: center;
        height: 50px;
        padding: 10px 0;
    }

    .menu-principal {
        flex-direction: column;
        display: none;
        margin-left: 0;
        
        position: absolute;
        top: 70px;
        left: 0;
        background-color: #1e1e1e;
        border: 1px solid #333;
        border-top: none;
        min-width: 250px;
        width: auto;
        box-shadow: 0 5px 15px rgba(0,0,0,0.5);
        z-index: 1100;
    }

    .menu-principal.active {
        display: flex;
    }

    .burger {
        display: block;
        position: absolute;
        left: 15px;
        top: 15px;
        padding: 0;
    }

    .menu-item {
        width: 100%;
    }

    .sous-menu {
        position: relative;
        border: none;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        display: none;
    }

    .menu-item.open .sous-menu {
        display: block;
    }

    .menu-item:hover .sous-menu {
        /* Ne rien faire sur mobile */
    }

    .slider-container {
        display: none !important;
    }

    #contentDisplayArea {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 15px;
    }
    .vignette {
        height: 100px; 
        width: 100px; 
    }
    
    .about-container h1 {
        font-size: 2em;
    }
    .about-container p {
        font-size: 1em;
    }
    .note {
        font-size: 0.6em;
    }
    .quote {
        font-size: 1.1em;
    }
    .signature img {
        max-width: 100%;
    }

    .stats-container {
        padding: 10px;
    }
    .stats-container h1 {
        font-size: 1.1em;
    }
    .stat-entry {
        font-size: 0.9em;
        grid-template-columns: 1fr auto auto;
        gap: 10px;
    }
    .stat-entry .path {
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    .has-submenu > a::after {
        content: '▾';
    }
    .has-submenu.open > a::after {
        content: '▴';
    }
    .sous-menu-niveau2 {
        position: relative;
        left: auto;
        top: auto;
        width: 100%;
        border: none;
        display: none;
        background-color: #2a2a2a;
        box-shadow: inset 0 5px 10px -5px rgba(0,0,0,0.4);
    }
    .has-submenu.open > .sous-menu-niveau2 {
        display: block;
    }

    /* Tablette : masquer diaporama et toggle vignettes */
    #btnStripToggle,
    #btnSlideshowPlay,
    #slideshowSpeed { display: none !important; }

    /* Tablette : tout sur une ligne */
    .gallery-info-bar {
        flex-direction: row;
        flex-wrap: nowrap;
        padding: 6px 12px;
        gap: 10px;
    }
    .gallery-stats {
        margin-bottom: 0;
    }
    .gallery-nav-label {
        display: none;
    }
    .gallery-nav-name {
        display: none;
    }
    .view-mode-toggle {
        margin-right: 0;
        margin-bottom: 0;
    }
    
    .lightbox-prev, .lightbox-next {
        left: 5px;
        right: 5px;
        font-size: 20px;
        padding: 8px 12px;
        width: 40px;
        text-align: center;
        top: unset;
        transform: unset;
        bottom: 10px;
        z-index: 101;
    }
    .lightbox-prev {
        left: 10px;
        right: auto;
    }
    .lightbox-next {
        right: 10px;
        left: auto;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
        font-size: 20px;
        padding: 2px 8px;
    }
    .lightbox-caption {
        font-size: 1em;
        margin-top: 10px;
    }
}

/* ── Bandeau vignettes ───────────────────────────────────────── */
.thumbnail-strip {
    display: none;
    position: fixed;
    bottom: 62px;
    left: 0;
    right: 0;
    height: 72px;
    background: rgba(0, 0, 0, 0.75);
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 8px;
    gap: 4px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    z-index: 2050;
}
.thumbnail-strip::-webkit-scrollbar { height: 3px; }
.thumbnail-strip::-webkit-scrollbar-thumb { background: #444; border-radius: 2px; }

.thumb-strip-item {
    flex-shrink: 0;
    height: 62px;
    width: auto;
    cursor: pointer;
    opacity: 0.45;
    border: 2px solid transparent;
    border-radius: 2px;
    transition: opacity 0.15s;
    object-fit: cover;
}
.thumb-strip-item:hover { opacity: 0.75; }
.thumb-strip-item.active {
    opacity: 1;
    border-color: #ff6b35;
}

.lightbox-play-btn.active { color: #ff6b35; }

/* ── Cluster marqueurs carte ─────────────────────────────────── */
.cluster-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 107, 53, 0.85);
    border: 2px solid #fff;
    border-radius: 50%;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 6px rgba(0,0,0,0.5);
}

/* ── Contrôles diaporama ─────────────────────────────────────── */
.lightbox-controls {
    position: fixed;
    bottom: 16px;
    right: 20px;
    left: auto;
    transform: none;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.65);
    padding: 5px 16px;
    border-radius: 20px;
    z-index: 2100;
}
.lightbox-counter {
    color: #ccc;
    font-size: 13px;
    min-width: 56px;
    text-align: center;
}
.lightbox-play-btn {
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 18px;
    cursor: pointer;
    padding: 2px 4px;
    transition: color 0.2s;
    line-height: 1;
}
.lightbox-play-btn:hover { color: #fff; }
.slideshow-speed {
    background: #222;
    color: #ccc;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 13px;
    cursor: pointer;
}

/* ── Carte du monde ──────────────────────────────────────────── */
.worldmap-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 3000;
    justify-content: center;
    align-items: center;
}
.worldmap-overlay.active {
    display: flex;
}
.worldmap-container {
    position: relative;
    width: 90vw;
    max-width: 1200px;
    height: 80vh;
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.worldmap-title {
    color: #e0e0e0;
    text-align: center;
    margin: 0;
    padding: 8px 40px;
    font-size: 15px;
    font-weight: normal;
    background: #111;
    flex-shrink: 0;
    letter-spacing: 1px;
}
.worldmap-close-btn {
    position: absolute;
    top: 6px; right: 12px;
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
}
.worldmap-close-btn:hover { color: #fff; }
#worldMap {
    flex: 1;
    width: 100%;
}
.gallery-marker-dot {
    width: 10px;
    height: 10px;
    background: #ff6b35;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 6px rgba(255, 107, 53, 0.9);
    cursor: pointer;
}
.map-popup {
    color: #111;
    line-height: 1.5;
}
.map-popup a {
    color: #d44;
    font-weight: bold;
    text-decoration: none;
}
.map-popup a:hover { text-decoration: underline; }

@media (max-width: 768px) {
    #lightboxControls { display: none !important; }
    .thumbnail-strip  { display: none !important; }
}

/* Smartphone : compteur + toggle sur ligne 1, carnet de route sur ligne 2 */
@media (max-width: 767px) {
    .gallery-info-bar {
        flex-wrap: wrap;
        padding: 6px 8px;
        gap: 4px;
    }
    .gallery-stats {
        order: 1;
    }
    .view-mode-toggle {
        order: 2;
        margin-left: auto;
    }
    .view-mode-toggle button {
        padding: 5px 8px;
    }
    .mode-icon { display: inline-block; }
    .mode-label { display: none; }
    #travelogueButtonContainer {
        order: 3;
        width: 100% !important;
        flex-grow: 0 !important;
        text-align: center;
    }
}
