/*
 * Page publique des stages (layout/WP/stages.php, présentation du 2026-10-09), en iframe ou insérée
 * directement dans WordPress par le shortcode [atelier_bloc page="stages"] (docs/wordpress/).
 * Tout est rangé sous .stages-public : aucune règle ne déborde sur le reste de la page, au
 * contraire de ongletsWP.css et stages.css (règles globales sur a, h2, section, body, *).
 * Charte : bordeaux #96151B, corail #FF6767.
 */

.stages-public {
    --bordeaux: #96151B;
    --corail: #FF6767;
    --texte: #373737;
    --gris: #6b6b6b;
    --fond-carte: #fff;
    --bord: #e4dcdc;
    font-family: 'Montserrat', Arial, sans-serif;
    color: var(--texte);
    font-size: 16px;
    line-height: 1.45;
    max-width: 1240px;
    margin: 0 auto;
    padding: 8px 12px 24px;
    box-sizing: border-box;
}
.stages-public *, .stages-public *::before, .stages-public *::after { box-sizing: border-box; }

/* Défenses contre le thème WordPress, depuis que la page peut être insérée SANS iframe
 * (shortcode [atelier_bloc], 2026-10-10) : toutes les règles sont préfixées par .stages-public
 * pour l'emporter sur `.entry-content ul li` & co, et ces remises à zéro neutralisent les
 * habitudes courantes des thèmes (puces, retraits, soulignés en bordure, ombres de texte). */
.stages-public ul, .stages-public li, .stages-public p, .stages-public h2, .stages-public form { margin: 0; padding: 0; }
.stages-public li { list-style: none; }
.stages-public li::marker { content: none; }
.stages-public a { border: 0; box-shadow: none; text-decoration: none; }
.stages-public img { max-width: 100%; border: 0; border-radius: 0; box-shadow: none; margin: 0; }
.stages-public button { text-shadow: none; box-shadow: none; line-height: 1.2; height: auto; letter-spacing: normal; }

.stages-public .stages-vide { text-align: center; color: var(--gris); padding: 24px 0; }

/* ── Bande des mois : une seule ligne qui défile au doigt, centrée quand elle tient ── */
.stages-public .stages-mois {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 2px 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--bord);
}
.stages-public .stages-mois::-webkit-scrollbar { display: none; }
/* Centrage sans couper le premier onglet quand la bande déborde (justify-content: center le ferait). */
.stages-public .stages-mois > :first-child { margin-left: auto; }
.stages-public .stages-mois > :last-child { margin-right: auto; }

.stages-public .stages-onglet {
    flex: 0 0 auto;
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 92px;
    padding: 8px 14px;
    border: 1px solid var(--bord);
    border-radius: 999px;
    background: #f6f1f1;
    color: var(--texte);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    line-height: 1.15;
}
.stages-public .stages-onglet:hover { border-color: var(--corail); }
.stages-public .stages-onglet:focus-visible { outline: 2px solid var(--bordeaux); outline-offset: 2px; }
.stages-public .stages-onglet.est-ouvert { background: var(--bordeaux); border-color: var(--bordeaux); color: #fff; }
.stages-public .stages-onglet-annee { font-size: 11px; font-weight: 400; opacity: .8; }
.stages-public .stages-onglet-nombre {
    position: absolute; top: -6px; right: -4px;
    min-width: 20px; height: 20px; padding: 0 6px;
    border-radius: 10px; background: var(--corail); color: #fff;
    font-size: 11px; line-height: 20px; text-align: center;
}

/* ── Cartes ── */
.stages-public .stages-cartes {
    display: grid;
    /* Largeur de carte bornée + auto-fit : un mois de 1 ou 2 stages reste centré au lieu de
     * se caler à gauche devant des colonnes vides (demande de Pascal, 2026-10-10). */
    grid-template-columns: repeat(auto-fit, minmax(360px, 380px));
    justify-content: center;
    gap: 24px;
}
.stages-public .stages-cartes[hidden] { display: none; }

.stages-public .stage-carte {
    display: flex;
    flex-direction: column;
    background: var(--fond-carte);
    border: 1px solid var(--bord);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .06);
}
.stages-public .stage-image { display: block; aspect-ratio: 16 / 10; background: #eee; }
.stages-public .stage-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

.stages-public .stage-corps { display: flex; flex-direction: column; flex: 1; padding: 18px 20px 20px; }

.stages-public .stage-titre { margin: 0 0 6px; font-size: 21px; line-height: 1.25; font-weight: 700; }
.stages-public .stage-titre a { color: var(--texte); text-decoration: none; }
.stages-public .stage-titre a:hover { color: var(--bordeaux); }

.stages-public .stage-lieu { margin: 0 0 14px; color: var(--gris); font-size: 14px; }
.stages-public .stage-lieu span + span::before { content: " · "; }

.stages-public .stage-dates-titre { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--gris); }

.stages-public .stage-dates { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.stages-public .stage-dates li {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px;
    padding: 7px 10px;
    border-left: 3px solid var(--corail);
    background: #fff6f6;
    border-radius: 0 6px 6px 0;
}
.stages-public .stage-date { font-weight: 700; color: var(--bordeaux); }
.stages-public .stage-note { font-size: 13px; color: var(--gris); }
.stages-public .stage-etat { margin-left: auto; font-size: 12px; color: #2e7d32; }
.stages-public .stage-dates li.est-complet { border-left-color: #bbb; background: #f4f4f4; }
.stages-public .stage-dates li.est-complet .stage-date { color: #999; text-decoration: line-through; }
.stages-public .stage-dates li.est-complet .stage-etat { color: #999; }

.stages-public .stage-corps form { margin: auto 0 0; }
.stages-public .stage-bouton {
    display: block; width: 100%;
    padding: 12px 16px;
    border: 0; border-radius: 8px;
    background: var(--corail); color: #fff;
    font: inherit; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
    cursor: pointer;
}
.stages-public .stage-bouton:hover { background: var(--bordeaux); }
.stages-public .stage-bouton.est-complet { background: #c9c9c9; }
.stages-public .stage-aide { margin: 6px 0 0; text-align: center; font-size: 13px; color: var(--gris); }

/* ── Téléphone ── */
@media (max-width: 600px) {
    .stages-public { padding: 4px 8px 16px; font-size: 14px; }
    .stages-public .stages-mois > :first-child { margin-left: 0; }   /* la bande défile : on part du bord */
    .stages-public .stages-mois > :last-child { margin-right: 0; }
    .stages-public .stages-onglet { min-width: 84px; padding: 7px 12px; }
    .stages-public .stages-cartes { grid-template-columns: 1fr; gap: 14px; }
    .stages-public .stage-image { aspect-ratio: 16 / 9; }
    .stages-public .stage-bouton { padding: 14px 16px; }   /* cible tactile plus grande */
}
