/*
  One stylesheet for the whole application (Consistency Conventions).
  The palette lives in custom properties so the visual design pass has a single
  place to change. No CSS framework, no utility-class library, no bundler.
  Meaning is never carried by colour alone: every coloured element also carries
  a text label and an icon.
*/

:root {
  --sable: #f6f1e7;
  --sable-fonce: #e7ddcb;
  --encre: #23201c;
  --encre-douce: #5c564d;
  --buis: #4a6b4f;
  --buis-clair: #ecf2ec;
  --brique: #9b3b2f;
  --brique-clair: #f7e7e4;
  --ocre: #7a5a12;
  --ocre-clair: #fbf0d9;
  --blanc: #fffdf9;
  --rayon: 10px;
  --ombre: 0 1px 2px rgb(35 32 28 / 12%), 0 6px 20px rgb(35 32 28 / 6%);
  --espace: 1rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--sable);
  color: var(--encre);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

.entete {
  display: flex;
  flex-wrap: wrap;
  gap: var(--espace);
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem var(--espace);
  background: var(--blanc);
  border-bottom: 1px solid var(--sable-fonce);
}

.entete__gauche {
  display: flex;
  flex-wrap: wrap;
  gap: var(--espace);
  align-items: center;
}

.entete__droite {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--sable-clair);
  border: 1px solid var(--sable-fonce);
  font-size: 0.8rem;
  font-weight: 600;
}

.lang-btn {
  background: none;
  border: none;
  color: var(--texte-discret);
  cursor: pointer;
  padding: 0 0.15rem;
  font-size: inherit;
  font-weight: inherit;
  font-family: inherit;
  transition: color 0.15s ease;
}

.lang-btn:hover {
  color: var(--buis);
}

.lang-active {
  color: var(--buis);
  font-weight: 700;
  padding: 0 0.15rem;
}

.lang-sep {
  color: var(--sable-fonce);
  font-weight: 400;
  user-select: none;
}

.marque {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--buis);
  text-decoration: none;
}

.identite {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.identite__nom {
  font-weight: 600;
}

.etiquette {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.85rem;
  background: var(--buis-clair);
  color: var(--buis);
  border: 1px solid currentcolor;
}

.etiquette--role {
  background: var(--buis-clair);
  color: var(--buis);
}

.etiquette__icone {
  font-size: 0.9em;
  line-height: 1;
}

.contenu {
  max-width: 44rem;
  margin: 0 auto;
  padding: calc(var(--espace) * 2) var(--espace);
}

.carte {
  padding: calc(var(--espace) * 1.5);
  background: var(--blanc);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
}

.carte--etroite {
  max-width: 26rem;
  margin: 0 auto;
}

h1 {
  margin-top: 0;
  font-size: 1.5rem;
}

h2 {
  font-size: 1.15rem;
  margin: var(--espace) 0 0.5rem;
}

.champ {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: var(--espace);
}

.champ label {
  font-weight: 600;
  font-size: 0.9rem;
}

.champ input,
.champ select,
.champ textarea {
  padding: 0.6rem 0.7rem;
  font: inherit;
  color: inherit;
  background: var(--blanc);
  border: 1px solid var(--sable-fonce);
  border-radius: var(--rayon);
}

.champ input:focus-visible,
.champ select:focus-visible,
.champ textarea:focus-visible {
  outline: 2px solid var(--buis);
  outline-offset: 1px;
}

.champ__erreur {
  color: var(--brique);
  font-size: 0.85rem;
}

.champ__aide {
  color: var(--encre-douce);
  font-size: 0.85rem;
}

.champ--choix {
  border: 0;
  padding: 0;
  margin: 0 0 var(--espace);
}

.champ--choix legend {
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0;
  margin-bottom: 0.3rem;
}

.choix {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  margin-right: var(--espace);
}

.message {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.6rem 0.75rem;
  border-radius: var(--rayon);
  font-size: 0.92rem;
}

.messages {
  margin: 0 0 var(--espace);
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.message__icone {
  flex: none;
  line-height: 1.5;
}

.message--error {
  background: var(--brique-clair);
  color: var(--brique);
  border: 1px solid currentcolor;
}

.message--warning {
  background: var(--sable-fonce);
  color: var(--encre);
  border: 1px solid currentcolor;
}

.message--success,
.message--info,
.message--debug {
  background: var(--buis-clair);
  color: var(--buis);
  border: 1px solid currentcolor;
}

.bouton {
  padding: 0.6rem 1.1rem;
  font: inherit;
  font-weight: 600;
  color: var(--blanc);
  background: var(--buis);
  border: 1px solid var(--buis);
  border-radius: var(--rayon);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.bouton--discret {
  color: var(--encre-douce);
  background: transparent;
  border-color: var(--sable-fonce);
  font-weight: 500;
}

.bouton--petit {
  padding: 0.35rem 0.8rem;
  font-size: 0.9rem;
}

.deconnexion {
  margin: 0;
}

.note {
  margin-bottom: 0;
  color: var(--encre-douce);
  font-size: 0.9rem;
}

.resume {
  font-size: 1.05rem;
}

.visuellement-cache {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --- navigation ---------------------------------------------------------- */

.navigation {
  display: flex;
  gap: var(--espace);
  flex-wrap: wrap;
}

.navigation a {
  color: var(--encre);
  text-decoration: none;
  font-weight: 600;
}

.navigation a:hover,
.navigation a:focus-visible {
  text-decoration: underline;
}

.liste-arenes {
  margin: 0 0 var(--espace);
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.liste-arenes__lien {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.75rem;
  border: 1px solid var(--sable-fonce);
  border-radius: var(--rayon);
  color: var(--encre);
  text-decoration: none;
}

.liste-arenes__nom {
  font-weight: 600;
}

.arenes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--espace);
}

.arenes__lien {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--sable-fonce);
  border-radius: 999px;
  background: var(--blanc);
  color: var(--encre);
  text-decoration: none;
}

.arenes__lien--active {
  border-color: var(--buis);
  background: var(--buis-clair);
  color: var(--buis);
  font-weight: 600;
}

/* Covered or open-air is never left to the icon alone. */
.arenes__type {
  color: var(--encre-douce);
  font-size: 0.8rem;
  font-weight: 400;
}

/* --- the calendar: the strip, then the day ---------------------------------
   Phone first: the seven days scroll horizontally on a narrow screen and sit
   in one row on a wide one. Every state carries an icon and a word; colour is
   an extra, never the message. */

.calendrier__entete h1 {
  margin-bottom: 0.25rem;
}

.calendrier__jour {
  margin: var(--espace) 0 0.5rem;
  font-size: 1.15rem;
  text-transform: capitalize;
}

.calendrier__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: var(--espace) 0 0;
}

.bandeau {
  margin-top: var(--espace);
}

.bandeau__navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.bandeau__periode {
  font-weight: 600;
  color: var(--encre-douce);
}

.bandeau__fleche {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--buis);
  text-decoration: none;
  border: 1px solid var(--sable-fonce);
  border-radius: var(--rayon);
  background: var(--blanc);
}

/* htmx puts `.htmx-request` on the tapped calendar link while its swap is in
   flight: the rider sees the tap was taken. Its own indicator styles are off
   (the base template's `htmx-config`), so this is the only one. */
#calendrier a.htmx-request {
  opacity: 0.6;
  cursor: progress;
}

.bandeau__fleche:hover,
.bandeau__fleche:focus-visible {
  border-color: var(--buis);
  background: var(--buis-clair);
}

.bandeau__fleche:focus-visible {
  outline: 2px solid var(--buis);
  outline-offset: 1px;
}

/*
  Seven days that always fit the screen: three per row on a phone (3 + 3 + 1),
  all seven on one row once there is room. Never scrolled sideways.
*/
.bandeau__jours {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bandeau__jour {
  min-width: 0;
}

.bandeau__jour a {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  height: 100%;
  padding: 0.5rem 0.4rem;
  border: 1px solid var(--sable-fonce);
  border-radius: var(--rayon);
  background: var(--blanc);
  color: var(--encre);
  text-decoration: none;
  text-align: center;
}

.bandeau__jour--choisi a {
  border-color: var(--buis);
  box-shadow: inset 0 0 0 1px var(--buis);
}

.bandeau__nom {
  font-weight: 700;
  text-transform: capitalize;
}

.bandeau__date {
  font-size: 0.85rem;
  color: var(--encre-douce);
}

.segment {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.25rem 0.2rem;
  border-radius: calc(var(--rayon) / 2);
  font-size: 0.78rem;
  line-height: 1.2;
  border: 1px solid currentcolor;
}

.segment__icone {
  font-size: 0.9rem;
}

.segment__mot {
  font-weight: 600;
}

.segment__moment {
  color: var(--encre-douce);
  font-size: 0.7rem;
}

.segment--libre {
  background: var(--buis-clair);
  color: var(--buis);
}

.segment--partiel {
  background: var(--ocre-clair);
  color: var(--ocre);
}

.segment--tout_pris {
  background: var(--brique-clair);
  color: var(--brique);
}

.segment--ferme {
  background: var(--sable-fonce);
  color: var(--encre-douce);
}

/* The blocks of one day. */

.blocs {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bloc {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.25rem 0.75rem;
  align-items: center;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--sable-fonce);
  border-left-width: 5px;
  border-radius: var(--rayon);
  background: var(--blanc);
}

.bloc__heures {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.bloc__etat {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  font-weight: 600;
}

.bloc__icone {
  line-height: 1;
}

.bloc__places {
  color: var(--encre-douce);
  font-size: 0.9rem;
  white-space: nowrap;
}

.bloc--libre {
  border-left-color: var(--buis);
}

.bloc--ferme {
  border-left-color: var(--sable-fonce);
  color: var(--encre-douce);
  background: var(--sable);
}

.bloc--creneau {
  border-left-color: var(--brique);
}

/* CAP-5 — a closure. It shares `.bloc--ferme`'s background on purpose: both say
   "nothing to take here", and the palette has no fourth neutral that would not
   read as a state. What tells them apart is the heavier double rule down the
   left, and above all the icon, the word *fermé par le propriétaire* and the
   *motif* — colour is never the carrier here, and here it carries nothing. */
.bloc--fermeture {
  border-left-color: var(--encre);
  border-left-style: double;
  border-left-width: 7px;
  background: var(--sable);
}

.bloc__motif {
  grid-column: 1 / -1;
  color: var(--encre);
  font-size: 0.92rem;
  font-style: italic;
}

.bloc--reserve_ouvert {
  border-left-color: var(--ocre);
}

.participants {
  grid-column: 1 / -1;
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.participant {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  align-items: baseline;
  font-size: 0.92rem;
}

.participant__nom {
  font-weight: 600;
}

.participant__cheval,
.participant__note {
  color: var(--encre-douce);
}

.participant__note {
  flex-basis: 100%;
  font-style: italic;
}

.etiquette--activite {
  background: var(--sable);
  color: var(--encre);
}

.etiquette--complet,
.etiquette--reserve_ferme,
.etiquette--annulee {
  background: var(--brique-clair);
  color: var(--brique);
}

.etiquette--reserve_ouvert {
  background: var(--ocre-clair);
  color: var(--ocre);
}

.etiquette--terminee {
  background: var(--sable-fonce);
  color: var(--encre-douce);
}

/* CAP-5 — the closure's *motif*, on the page that lifts it. */
.etiquette--fermeture {
  background: var(--sable-fonce);
  color: var(--encre);
}

/* --- mes réservations ------------------------------------------------------ */

.reservations {
  margin: 0 0 var(--espace);
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.reservation {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.75rem;
  border: 1px solid var(--sable-fonce);
  border-radius: var(--rayon);
  background: var(--blanc);
}

.reservation--passee {
  background: var(--sable);
  color: var(--encre-douce);
}

.reservation__quand {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
}

.reservation__jour {
  font-weight: 700;
  text-transform: capitalize;
}

.reservation__heures {
  font-variant-numeric: tabular-nums;
}

.reservation__quoi {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  align-items: center;
}

.reservation__quoi a {
  color: var(--buis);
  font-weight: 600;
}

.reservation__fin {
  margin: 0;
  font-size: 0.9rem;
}

.annulation {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.25rem 0 0;
}

.annulation input {
  flex: 1 1 12rem;
  padding: 0.5rem 0.7rem;
  font: inherit;
  border: 1px solid var(--sable-fonce);
  border-radius: var(--rayon);
}

/* --- CAP-8 : les invitations ---------------------------------------------- */

.invitations {
  margin: 0 0 var(--espace);
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.invitation {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  align-items: baseline;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--sable-fonce);
  border-radius: var(--rayon);
  background: var(--blanc);
  font-size: 0.92rem;
}

/* The link just issued: the whole product of the screen, so it is set apart. */
.invitation--nouvelle {
  flex-direction: column;
  align-items: stretch;
  margin-bottom: var(--espace);
  border-color: var(--buis);
  background: var(--buis-clair);
}

.invitation__qui {
  font-weight: 600;
}

.invitation__expire {
  color: var(--encre-douce);
}

/* Read-only, full width and selectable: a phone copies a link by long-pressing
   an input, and AD-12 forbids the script a copy button would need. */
.lien-invitation {
  flex: 1 1 100%;
  width: 100%;
  padding: 0.5rem 0.7rem;
  font: inherit;
  font-size: 0.85rem;
  color: var(--encre);
  background: var(--blanc);
  border: 1px solid var(--sable-fonce);
  border-radius: var(--rayon);
}

.etiquette--invitation {
  background: var(--sable);
  color: var(--encre);
}

.etiquette--invitation-libre {
  background: var(--buis-clair);
  color: var(--buis);
}

.etiquette--invitation-utilisee {
  background: var(--ocre-clair);
  color: var(--ocre);
}

/* The period and the switch between week and month, between the arrows. */
.bandeau__centre {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.6rem;
  align-items: center;
  justify-content: center;
  min-width: 0;
  text-align: center;
}

/* At the window's edge an arrow is absent; its place is kept so the title
   does not shift sideways between months. */
.bandeau__fleche--absente {
  visibility: hidden;
}

/* Days already gone, in the strip and in the month: still there to read, and
   still reachable, but set back. The word and the icon stay. */
.bandeau__jour--passe a,
.mois__jour--passe .mois__lien {
  opacity: 0.55;
}

/* Outside the calendar's window: drawn so the week and the month keep their
   shape, but plainly not a control — no fill, no border to press, no pointer.
   Their accessible name says « hors de la période réservable ». */
.bandeau__carte {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  height: 100%;
  padding: 0.5rem 0.4rem;
  border: 1px dashed var(--sable-fonce);
  border-radius: var(--rayon);
  color: var(--encre-douce);
  text-align: center;
  opacity: 0.45;
  cursor: default;
}

.mois__jours .mois__jour .mois__lien--hors-periode {
  border-style: dotted;
  border-color: var(--sable-fonce);
  background: transparent;
  color: var(--encre-douce);
  opacity: 0.35;
  cursor: default;
}

/* --- the month -------------------------------------------------------------
   Seven columns, Monday first, that fit a 411 px phone with no sideways
   scroll: each cell is its date and an icon, the word being in its
   accessible name and in the legend below. Colour repeats the icon, never
   replaces it. */

.mois {
  margin-top: var(--espace);
}

.mois__titre {
  text-transform: capitalize;
}

.mois__noms,
.mois__jours {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mois__noms {
  margin-bottom: 0.25rem;
  color: var(--encre-douce);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  text-transform: capitalize;
}

.mois__jour {
  min-width: 0;
}

.mois__lien {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  min-height: 2.75rem;
  padding: 0.2rem 0;
  border: 1px solid currentcolor;
  border-radius: calc(var(--rayon) / 2);
  text-decoration: none;
  line-height: 1.1;
}

.mois__date {
  color: var(--encre);
  font-size: 0.9rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.mois__icone {
  font-size: 0.85rem;
}

/* Outside the month shown: the leading and trailing days of its first and
   last weeks. */
.mois__jour--hors-mois .mois__lien {
  opacity: 0.4;
  border-style: dashed;
}

.mois__jour--aujourd-hui .mois__date {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

.mois__jour--choisi .mois__lien {
  outline: 2px solid var(--buis);
  outline-offset: 1px;
}

.mois__lien:focus-visible {
  outline: 3px solid var(--encre);
  outline-offset: 1px;
}

.mois__legende {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: var(--espace) 0 0;
  padding: 0;
  list-style: none;
}

.mois__cle {
  display: inline-flex;
  gap: 0.3rem;
  align-items: center;
  padding: 0.1rem 0.5rem;
  border: 1px solid currentcolor;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

@media (min-width: 40rem) {
  .bandeau__jours {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}

/*
  AD-20 — the offline page the service worker serves when a navigation cannot
  reach the network. It shows no booking data, and never claims whether the
  action went through.
*/
.hors-ligne h1 {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.hors-ligne__icone {
  color: var(--ocre);
}

.hors-ligne__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--espace);
  align-items: center;
  margin-bottom: 0;
}

/*
  The calendar's slide (AD-12: same-document View Transitions, no framework).
  htmx wraps each calendar swap in `document.startViewTransition`; the view
  marks the new region with `data-sens` — which way the day moved, and whether
  the week moved with it. A later day comes in from the right, an earlier one
  from the left; the arena name and chooser stay put. With no `data-sens`
  (another arena, the same day, a full load) the named parts crossfade.
  Without View Transitions, or with reduced motion asked for, the swap is
  instant.
*/
#calendrier .bandeau__jours {
  view-transition-name: semaine;
}

#calendrier .calendrier__jour {
  view-transition-name: jour-titre;
}

#calendrier .blocs {
  view-transition-name: journee;
}

/* The month's own two parts: its title and its grid. They share no name with
   the week's, so switching between the two views crossfades. */
#calendrier .mois__titre {
  view-transition-name: mois-titre;
}

#calendrier .mois__grille {
  view-transition-name: mois;
}

::view-transition-group(semaine),
::view-transition-group(jour-titre),
::view-transition-group(journee),
::view-transition-group(mois-titre),
::view-transition-group(mois) {
  animation-duration: 260ms;
  animation-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes entree-par-la-droite {
  from { transform: translateX(28%); opacity: 0; }
}

@keyframes entree-par-la-gauche {
  from { transform: translateX(-28%); opacity: 0; }
}

@keyframes sortie-par-la-gauche {
  to { transform: translateX(-28%); opacity: 0; }
}

@keyframes sortie-par-la-droite {
  to { transform: translateX(28%); opacity: 0; }
}

/* Forward: the old content leaves to the left, the new one arrives from the right. */
:root:has(#calendrier[data-sens="semaine-suivante"])::view-transition-old(semaine),
:root:has(#calendrier[data-sens$="-suivant"], #calendrier[data-sens="semaine-suivante"])::view-transition-old(jour-titre),
:root:has(#calendrier[data-sens$="-suivant"], #calendrier[data-sens="semaine-suivante"])::view-transition-old(journee) {
  animation: 260ms cubic-bezier(0.2, 0.7, 0.2, 1) both sortie-par-la-gauche;
}

:root:has(#calendrier[data-sens="semaine-suivante"])::view-transition-new(semaine),
:root:has(#calendrier[data-sens$="-suivant"], #calendrier[data-sens="semaine-suivante"])::view-transition-new(jour-titre),
:root:has(#calendrier[data-sens$="-suivant"], #calendrier[data-sens="semaine-suivante"])::view-transition-new(journee) {
  animation: 260ms cubic-bezier(0.2, 0.7, 0.2, 1) both entree-par-la-droite;
}

/* Back: the mirror image. */
:root:has(#calendrier[data-sens="semaine-precedente"])::view-transition-old(semaine),
:root:has(#calendrier[data-sens$="-precedent"], #calendrier[data-sens="semaine-precedente"])::view-transition-old(jour-titre),
:root:has(#calendrier[data-sens$="-precedent"], #calendrier[data-sens="semaine-precedente"])::view-transition-old(journee) {
  animation: 260ms cubic-bezier(0.2, 0.7, 0.2, 1) both sortie-par-la-droite;
}

:root:has(#calendrier[data-sens="semaine-precedente"])::view-transition-new(semaine),
:root:has(#calendrier[data-sens$="-precedent"], #calendrier[data-sens="semaine-precedente"])::view-transition-new(jour-titre),
:root:has(#calendrier[data-sens$="-precedent"], #calendrier[data-sens="semaine-precedente"])::view-transition-new(journee) {
  animation: 260ms cubic-bezier(0.2, 0.7, 0.2, 1) both entree-par-la-gauche;
}

/* A later month from the right, an earlier from the left, as the weeks do. */
:root:has(#calendrier[data-sens="mois-suivant"])::view-transition-old(mois-titre),
:root:has(#calendrier[data-sens="mois-suivant"])::view-transition-old(mois) {
  animation: 260ms cubic-bezier(0.2, 0.7, 0.2, 1) both sortie-par-la-gauche;
}

:root:has(#calendrier[data-sens="mois-suivant"])::view-transition-new(mois-titre),
:root:has(#calendrier[data-sens="mois-suivant"])::view-transition-new(mois) {
  animation: 260ms cubic-bezier(0.2, 0.7, 0.2, 1) both entree-par-la-droite;
}

:root:has(#calendrier[data-sens="mois-precedent"])::view-transition-old(mois-titre),
:root:has(#calendrier[data-sens="mois-precedent"])::view-transition-old(mois) {
  animation: 260ms cubic-bezier(0.2, 0.7, 0.2, 1) both sortie-par-la-droite;
}

:root:has(#calendrier[data-sens="mois-precedent"])::view-transition-new(mois-titre),
:root:has(#calendrier[data-sens="mois-precedent"])::view-transition-new(mois) {
  animation: 260ms cubic-bezier(0.2, 0.7, 0.2, 1) both entree-par-la-gauche;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}
