/* Importer leaflet.min.css depuis assets/vendor/leaflet/dist/leaflet.min.css */
@import url("../../vendor/leaflet/dist/leaflet.min-eAGB7KE.css");
@import url("../variables/global-qhqcgov.css");

.layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

@media (max-width: 767px) {
    .site-header {
        text-align: center;
    }
}

.header-summary,
.stage-selector,
.main-content {
    background-color: #fff;
}

/* Bloc résumé route + étape */
.header-summary {
    padding: 0 var(--padding);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid #eee;
}

.route-title, .stage-title {
    text-align: center;
    margin: 0;
}

.route-title {
    font-size: 1.4rem;
}

.route-description, .stage-description {
    font-size: 0.95rem;
    color: var(--text-color-light);
}

.stage-title {
    font-size: 1.2rem;
}

/* Barre de navigation des étapes */
.stage-selector {
    padding: 0.5rem 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-bottom: 1px solid #eee;
}

.stage-selector a {
    padding: 0.4rem 0.8rem;
    background-color: #eee;
    border-radius: 0.5rem;
    text-decoration: none;
    color: #333;
    font-weight: 500;
}

.stage-selector a.active {
    background-color: #0077cc;
    color: white;
}

/* Style général de la barre des étapes */
.stage-selector {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    overflow-x: auto;
    border-bottom: 1px solid #eee;
    touch-action: pan-y;
}

.stage-selector a,
.stage-selector .stage-selector-button {
    touch-action: pan-y;
}

.stage-list {
    visibility: hidden;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
}

.stage-list a {
    flex: 0 1 auto;
    padding: 0.4rem 0.8rem;
    background-color: #eee;
    border-radius: 0.5rem;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.stage-list a:hover:not(.active) {
    background-color: #ddd;
    transform: translateY(-2px);
}

.stage-list a.active {
    background-color: #0077cc;
    color: white;
}

/* Pendant le drag, on coupe les transitions pour un rendu direct */
.stage-selector--swiping .stage-list {
    transition: none !important;
}

.stage-selector-controls {
    display: flex;
    flex-direction: column;
}

/* Boutons précédent / suivant */
.stage-selector-button {
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    background-color: #0077cc;
    color: white;
    border: none;
    cursor: pointer;
}

.stage-selector-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Donne le contrôle de l'horizontal au JS tout en laissant le scroll vertical global */
.layout {
    touch-action: pan-y;
}

/* La liste peut être traduite pendant le drag */
.stage-list {
    will-change: transform;
}

/* Hint visuel rapide sur les boutons */
.stage-selector-button.hint {
    box-shadow: 0 0 0 6px rgba(0, 119, 204, .18);
    transition: box-shadow 150ms ease;
}

.stage-selector-button.hint-off {
    box-shadow: none;
    transition: box-shadow 200ms ease;
}

/* Fallback: pulse de la barre si boutons masqués */
.stage-selector {
    position: relative; /* pour le pseudo-élément directionnel */
}

.stage-selector.hint-bar {
    box-shadow: 0 0 0 6px rgba(0, 119, 204, .18) inset;
    transition: box-shadow 150ms ease;
}

.stage-selector.hint-bar-off {
    box-shadow: none;
    transition: box-shadow 200ms ease;
}

/* Accent directionnel discret (bandes latérales) */
.stage-selector.hint-next::after,
.stage-selector.hint-prev::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 10px;
    pointer-events: none;
    background: linear-gradient(to left, rgba(0, 119, 204, .22), rgba(0, 119, 204, 0));
}

.stage-selector.hint-next::after {
    right: 0;
}

.stage-selector.hint-prev::before {
    left: 0;
}

/* Version mobile : 3 lignes, 1 lien par ligne */
@media (max-width: 1635px) {
    .stage-selector {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
    }

    .stage-selector-controls {
        width: 100%;
        display: flex;
        justify-content: center;
        margin: 0.5rem 0;
    }

    .stage-list {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .stage-list a {
        display: block;
        width: 100%;
        text-align: center;
    }
}

/* Contenu principal */
.main-content {
    flex-grow: 1;
    padding: 0 var(--padding) var(--padding) var(--padding);
}

.map-focus-button {
    margin-left: 0.5rem;
    font-size: 0.85rem;
    background: none;
    color: #0077cc;
    border: none;
    cursor: pointer;
}

.map-focus-button:hover {
    text-decoration: underline;
}

.mini-map {
    border: 1px solid #ccc;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1rem;
    height: 200px;
}

.photo-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

/* Mobile : 2 lignes */
@media (max-width: 767px) {
    .photo-gallery {
    }
}

.load-gallery-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: #ffffff;
    background-color: #0077cc;
    border: none;
    border-radius: 4px;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.load-gallery-button:hover {
    background-color: #005fa3;
}

.glightbox-hidden {
    display: none !important;
}

.glightbox-trigger--hidden {
    display: none;
}

.toggle-comments, .add-comment-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: #0077cc;
    background: transparent;
    border: 1px solid #0077cc;
    border-radius: 4px;
    padding: 0.25rem 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.toggle-comments:hover, .add-comment-button:hover {
    background-color: #0077cc;
    color: white;
}

.comment-list {
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 3px solid #eee;
    font-size: 0.9rem;
    color: #333;
}

.comment-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-list li {
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .comment-list li {
        flex-direction: row;
        align-items: baseline;
        gap: 0.5rem;
    }
}

.comment-list strong {
    color: #0077cc;
    font-weight: 600;
    margin-right: 0.25rem;
}

.comment-date {
    color: #999;
    font-size: 0.8rem;
    margin-left: 0.25rem;
}

#comment-form-wrapper {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border-left: 3px solid #0077cc;
    background-color: #f9f9f9;
    border-radius: 4px;
}

#comment-form-wrapper textarea {
    width: 100%;
    padding: 0.5rem;
    font-size: 0.9rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
    margin-bottom: 0.5rem;
    font-family: inherit;
}

#comment-form-wrapper button[type="submit"] {
    display: inline-block;
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    color: white;
    background-color: #0077cc;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#comment-form-wrapper button[type="submit"]:hover {
    background-color: #005fa3;
}

#comment-form-wrapper button[type="button"] {
    margin-left: 0.5rem;
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    color: #555;
    background-color: #eee;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#comment-form-wrapper button[type="button"]:hover {
    background-color: #ddd;
}