/* =========================================================
   TATEA — S09 « Prochaines cohortes » : le calendrier des réservations (réf. « Bookings »)
   Grille commune : intro + bouton jaune à gauche (--col), carte blanche à droite (--r).
   Les 4 pistes précédentes sont rangées dans bak/co-pistes/.
   ========================================================= */
[data-co] .co__list, [data-co] .co__note { display: none; }
.cox button { font: inherit; color: inherit; text-align: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.cox h3, .cox p { margin: 0; }
.cox svg { flex: none; width: 15px; height: 15px; fill: currentColor; }

/* la grille commune */
.cox { position: absolute; left: var(--edge); right: var(--edge); top: calc(var(--top) + var(--tth, 110px) + var(--tg)); bottom: calc(var(--bh10, 0px) + var(--bot));
  display: grid; grid-template-columns: minmax(0, var(--col)) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "intro vis" ". vis" "foot vis"; gap: 16px var(--gap); }
.cox .co__intro { grid-area: intro; font-size: var(--intro); line-height: 1.45; color: var(--text); max-width: 38ch; }
.cox__vis { grid-area: vis; position: relative; min-height: 0; }
.cox .co__foot { grid-area: foot; display: grid; justify-items: start; }

/* la carte */
.cox__card { position: absolute; inset: 0; display: flex; flex-direction: column; padding: clamp(18px, 2.2vw, 32px) clamp(20px, 2.4vw, 36px) clamp(10px, 1.4vw, 18px); border-radius: var(--r); background: #fff; color: var(--ink); }

/* l'en-tête : le mois en grand, ses flèches, la ligne de l'académie (réf. « Jan' 2020 ») */
.cal__hd { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 24px; }
.cal__t { display: flex; align-items: center; gap: 16px; }
.cal__m { font-size: clamp(24px, 2.3vw, 34px); font-weight: 700; letter-spacing: -.02em; line-height: 1.05; }
.cal__m span { font-weight: 400; color: rgb(22 33 61 / .4); }
.cal__nav { display: flex; align-items: center; gap: 4px; }
.cox .cal__b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgb(22 33 61 / .06); transition: background-color .25s, opacity .25s; }
.cal__b:hover:not(:disabled) { background: rgb(22 33 61 / .13); }
.cal__b:disabled { opacity: .3; cursor: default; }
.cox .cal__ch { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cox .cal__now i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
.cal__subs { position: relative; }
.cal__sub { display: none; font-size: 14px; color: var(--text); }
.cal__sub.on { display: block; }
.cal__sub em { margin-left: 8px; font-style: normal; font-weight: 600; color: var(--gold-strong); }

/* les onglets : même pastille que les choix de la S08 (piste grise, l'actif en bleu nuit) */
.cox__tabs { align-self: flex-start; display: flex; gap: 4px; margin-top: clamp(10px, 1.4vw, 18px); padding: 4px; border-radius: 999px; background: rgb(22 33 61 / .07); }
.cox__tabs button { position: relative; isolation: isolate; padding: 7px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--ink); white-space: nowrap; transition: color .3s; }
.cox__tabs button::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--night); opacity: 0; transition: opacity .3s; }
.cox__tabs button.on { color: #fff; }
.cox__tabs button.on::before { opacity: 1; }
.cox__ts { display: none; }

/* les jours de la semaine, puis une ligne par semaine */
.cal__wk { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin-top: clamp(10px, 1.4vw, 18px); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: rgb(22 33 61 / .5); }
.cal__wk span { padding: 0 8px 7px; }
.cal__gw { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cal__gw.is-empty .cal__g { opacity: .32; pointer-events: none; }
.cal__g { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(var(--wks, 6), minmax(0, 1fr)); }
.cal__g.is-swap { animation: cal-in .4s var(--ease) both; }
@keyframes cal-in { from { opacity: 0; transform: translate3d(0, 8px, 0); } }

/* une case : trait en haut, gros numéro, et le rassemblement écrit dessous */
.cox .cal__c { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; min-height: 0; padding: 8px 8px 4px; text-align: left; }
.cal__c::before { content: ""; position: absolute; top: 0; left: 0; right: 10px; height: 1px; background: var(--ink); }
.cal__d { font-size: clamp(16px, 1.5vw, 22px); font-weight: 500; line-height: 1.1; letter-spacing: -.01em; }
.cal__r { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; }
.cal__c.is-out .cal__d { color: rgb(22 33 61 / .28); }
.cal__c.is-out::before { background: rgb(22 33 61 / .18); }
.cal__c.is-today .cal__d { display: inline-grid; place-items: center; min-width: 1.7em; height: 1.7em; margin: -.25em 0 -.25em -.35em; border-radius: 50%; background: var(--night); color: #fff; font-size: .85em; }

/* un rassemblement : les jours se touchent en une bande grise, le premier jour porte son nom */
.cal__c.is-ev { background: #f1efea; cursor: pointer; transition: background-color .25s; }
.cal__c.is-ev:not(.is-last)::before { right: 0; }
.cal__c.is-ev:hover, .cal__c.is-open { background: #e9e6df; }
.cal__c.is-ev:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.cal__l { position: relative; z-index: 1; font-size: 11.5px; font-weight: 600; line-height: 1.25; white-space: nowrap; color: var(--ink); }
.cal__c.is-next.is-start .cal__d { color: var(--gold-strong); }
.cal__nx { padding: 2px 8px; border-radius: 999px; background: var(--gold); font-size: 10.5px; font-style: normal; font-weight: 600; color: var(--ink); white-space: nowrap; }
.cal__c.is-past .cal__d, .cal__c.is-past .cal__l { color: rgb(22 33 61 / .45); }
.cal__c.is-past .cal__l { text-decoration: line-through; text-decoration-thickness: 1px; }

/* pas encore de date : une carte posée sur la grille effacée */
.cal__empty { position: absolute; left: 50%; top: 50%; z-index: 2; display: none; flex-direction: column; align-items: center; gap: 10px; width: min(440px, calc(100% - 24px)); padding: 24px 28px 26px; border-radius: 18px; background: #fff; text-align: center;
  box-shadow: 0 1px 2px rgb(11 22 38 / .06), 0 20px 50px rgb(11 22 38 / .16); transform: translate(-50%, -50%); }
.cal__empty.on { display: flex; animation: cal-in .4s var(--ease) both; }
.cal__ei { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: color-mix(in srgb, var(--gold) 22%, #fff); }
.cal__ei svg { width: 22px; height: 22px; color: var(--ink); }
.cal__empty b { font-size: clamp(17px, 1.4vw, 20px); font-weight: 600; letter-spacing: -.01em; }
.cal__empty p { font-size: 14px; line-height: 1.4; color: var(--text); }
.cal__empty .cal__bt { margin: 6px 0 0; background: var(--night); color: #fff; }
.cal__empty .cal__bt:hover { background: #16253d; }
.cal__empty .cal__bt svg { color: #fff; }

/* les dates pas encore fixées */
.cal__tb { display: none; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 10px; }
.cal__tb.on { display: flex; }
.cal__pl { padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--gold) 14%, #fff); font-size: 12px; font-weight: 600; color: var(--gold-strong); white-space: nowrap; }
.cal__bt { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; padding: 9px 14px; border-radius: 8px; background: #f1f2f4; font-size: 14px; font-weight: 500; color: var(--ink); text-decoration: none; white-space: nowrap; transition: background-color .25s; }
.cal__bt:hover { background: #e6e8ec; }

/* le menu d'un rassemblement */
.cox__menu { position: absolute; z-index: 6; width: min(300px, calc(100% - 16px)); padding: 6px; border-radius: 12px; background: #fff;
  box-shadow: 0 1px 2px rgb(11 22 38 / .06), 0 18px 40px rgb(11 22 38 / .18); animation: cox-menu .25s var(--ease) both; }
@keyframes cox-menu { from { opacity: 0; transform: translate3d(0, -6px, 0); } }
.cox__mt { display: grid; gap: 3px; padding: 8px 10px 10px; }
.cox__mt b { font-size: 14px; font-weight: 600; color: var(--ink); }
.cox__mt span { font-size: 12.5px; line-height: 1.35; color: var(--text); }
.cox__menu a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--ink); text-decoration: none; }
.cox__menu a:first-of-type, .cox__menu a:hover, .cox__menu a:focus-visible { background: #f3f4f6; outline: 0; }
.cox__menu a svg { color: rgb(22 33 61 / .6); }
.cox__menu a:first-of-type svg { color: var(--ink); }
.cox__menu hr { margin: 6px 4px; border: 0; height: 1px; background: rgb(22 33 61 / .1); }

/* ---------- écrans peu hauts ---------- */
@media (min-width: 900px) and (max-height: 820px) {
  .cal__sub { display: none !important; }
  .cal__wk { margin-top: 8px; }
  .cal__wk span { padding-bottom: 5px; }
  .cal__d { font-size: 15px; }
  .cal__c { padding: 6px 8px 3px; gap: 2px; }
  .cal__l { font-size: 10.5px; }
  .cal__tb { margin-top: 6px; }
  .cal__bt { padding: 7px 12px; font-size: 13px; }
  .cal__empty { gap: 7px; padding: 16px 22px 18px; }
  .cal__ei { display: none; }
}

/* ---------- tablette en paysage ---------- */
@media (min-width: 900px) and (max-width: 1180px) {
  .cox__tl { display: none; }
  .cox__ts { display: inline; }
  .cal__nx { display: none; }
  .cal__l { font-size: 10.5px; }
  .cal__d { font-size: 15px; }
}

/* ---------- téléphone et tablette en portrait ---------- */
@media (max-width: 899px) {
  .cox { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "intro" "vis" "foot"; gap: 12px; }
  .cox__card { padding: 14px 12px 8px; }
  .cal__m { font-size: 22px; }
  .cal__sub span { display: none; }
  .cal__sub em { margin-left: 0; font-size: 12.5px; }
  .cox__tl { display: none; }
  .cox__ts { display: inline; }
  .cox__tabs { align-self: stretch; margin-top: 10px; }
  .cox__tabs button { flex: 1; padding: 7px 4px; font-size: 12.5px; text-align: center; }
  .cal__wk { margin-top: 8px; font-size: 10px; letter-spacing: .04em; }
  .cal__wk span { padding: 0 3px 5px; }
  .cal__c { padding: 5px 3px 2px; }
  .cal__d { font-size: 14px; }
  .cal__l, .cal__nx { display: none; }
  .cal__tb { margin-top: 6px; gap: 6px 8px; }
  .cal__bt { margin-left: 0; padding: 7px 11px; font-size: 13px; }
  .cal__empty { gap: 6px; padding: 14px 16px 16px; }
  .cal__ei { display: none; }
  .cal__empty p { font-size: 12.5px; }
}
