/* ============================================
   CALENDRIER VOYAGEUR — grille maison de calendrier_voyageur.js, le seul du site côté
   voyageur : panneau Dates de la barre desktop, carte « Quand ? » de la modale mobile,
   panneau .booking-cal de la fiche et de la réservation (calendrier_sejour.js).
   Plage : disques navy aux deux bouts, bande grise continue entre les deux.
   ============================================ */

.calendrier {
    position: relative;
}

.calendrier__nav {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.calendrier__fleche {
    pointer-events: auto;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
    transition: background-color 0.15s;
}

.calendrier__fleche:hover:not(:disabled) {
    background: var(--color-surface);
}

.calendrier__fleche:disabled {
    color: var(--color-border-strong);
    opacity: 0.5;
    cursor: default;
}

.calendrier__fleche:focus-visible,
.calendrier__jour:focus-visible {
    outline: 2px solid var(--color-text);
    outline-offset: 0;
}

.calendrier__mois-liste {
    display: flex;
    justify-content: center;
    gap: 48px;
}

.calendrier__mois {
    flex: 1 1 0;
    min-width: 0;
    max-width: 336px;
}

.calendrier__titre {
    height: 32px;
    margin-bottom: 12px;
    font-size: var(--font-size-base);
    font-weight: 700;
    line-height: 32px;
    text-align: center;
}

.calendrier__semaine,
.calendrier__grille {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendrier__semaine {
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-light);
    text-align: center;
}

.calendrier__semaine abbr {
    text-decoration: none;
}

.calendrier__grille {
    row-gap: 2px;
}

.calendrier__case {
    display: flex;
    aspect-ratio: 1;
}

/* Bande continue de la plage, qui relie les deux disques */
.calendrier__case--plage {
    background: var(--color-surface);
}

.calendrier__case--debut {
    background: linear-gradient(to right, transparent 50%, var(--color-surface) 50%);
}

.calendrier__case--fin {
    background: linear-gradient(to left, transparent 50%, var(--color-surface) 50%);
}

.calendrier__jour {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--color-text);
    font: inherit;
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
}

.calendrier__jour:hover:not([aria-disabled="true"]) {
    box-shadow: inset 0 0 0 1.5px var(--color-text);
}

/* Jour non cliquable : passé, hors horizon, ou refusé par les règles du bien */
.calendrier__jour--passe {
    color: var(--color-border-strong);
    text-decoration: line-through;
    cursor: default;
}

/* Nuit réservée (fiche, réservation) : barrée même quand elle reste un départ possible,
   le matin d'une autre arrivée (séjours bout à bout) */
.calendrier__jour--pris {
    text-decoration: line-through;
}

.calendrier__jour--aujourdhui::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 18%;
    width: 4px;
    height: 4px;
    margin-left: -2px;
    border-radius: 50%;
    background: currentColor;
}

.calendrier__jour--choisi,
.calendrier__jour--choisi:hover:not([aria-disabled="true"]) {
    background: var(--color-text);
    color: var(--color-on-dark);
    box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
    .calendrier * {
        transition-duration: 0s !important;
    }
}
