/* Polices auto-hebergees (fichiers variables Google Fonts, sous-ensembles latin + latin-ext) :
   aucune requete vers Google depuis le navigateur du visiteur. */
@font-face {
  font-family: "Karla";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/karla-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Karla";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/karla-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 300 400;
  font-display: swap;
  src: url("/fonts/newsreader-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 300 400;
  font-display: swap;
  src: url("/fonts/newsreader-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Palette derivee du logo cocoon-tonic.be (bleu marine + orange terracotta). */
  --paper: #faf6f0;
  --surface: #ffffff;
  --ink: #263862;
  --ink-soft: #6b7690;
  --line: #e3ddd0;

  --free-ink: #b1502a;
  --free-edge: #e2a67d;
  --free-wash: #fbeee3;

  --hold-ink: #3f5c82;
  --hold-edge: #9db3cd;
  --hold-wash: #eaf0f6;

  --taken-ink: #9098a6;
  --taken-wash: #edeef1;

  --measure: 60rem;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Karla", "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

html {
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  padding: 0 1.5rem 5rem;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ---------- En-tete ---------- */

.masthead {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 4rem 0 2.5rem;
}

.masthead__kicker {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--free-ink);
}

.masthead__title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.5rem, 7vw, 4rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.015em;
}

/* ---------- Agenda ---------- */

.agenda {
  max-width: var(--measure);
  margin: 0 auto;
}

.month + .month {
  margin-top: 3rem;
}

.month__band {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 0;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}

.month__name {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1.2;
}

.month__free {
  flex: none;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

/* ---------- Journee ---------- */

.day {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1.25rem;
  align-items: start;
  padding: 1.125rem 0;
  border-bottom: 1px solid var(--line);
}

.day__date {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding-top: 0.3rem;
}

.day__weekday {
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.day__number {
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1;
}

.day__slots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------- Creneaux ---------- */

.slot {
  display: inline-block;
  min-width: 5rem;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
  text-decoration: none;
}

.slot__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.slot.is-free {
  background: var(--surface);
  border-color: var(--free-edge);
  color: var(--free-ink);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.slot.is-free:hover,
.slot.is-free:focus-visible {
  background: var(--free-ink);
  border-color: var(--free-ink);
  color: var(--surface);
}

.slot.is-free:focus-visible {
  outline: 2px solid var(--free-ink);
  outline-offset: 2px;
}

.slot.is-hold {
  background: var(--hold-wash);
  border-style: dashed;
  border-color: var(--hold-edge);
  color: var(--hold-ink);
}

.slot.is-taken {
  background: var(--taken-wash);
  color: var(--taken-ink);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

/* ---------- Reservation ---------- */

.booking {
  max-width: 34rem;
  margin: 0 auto;
}

.recap {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--ink);
}

.recap__slot {
  pointer-events: none;
}

.recap__text {
  margin: 0;
  color: var(--ink-soft);
}

.booking-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.field__label {
  font-size: 0.9375rem;
  font-weight: 600;
}

.field__control {
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.field__control:focus-visible {
  outline: 2px solid var(--free-ink);
  outline-offset: 1px;
}

textarea.field__control {
  resize: vertical;
}

.booking-form__notice {
  margin: 0;
  padding: 0.875rem 1rem;
  background: var(--hold-wash);
  border: 1px solid var(--hold-edge);
  color: var(--ink);
  font-size: 0.9375rem;
}

.button {
  align-self: flex-start;
  padding: 0.75rem 1.75rem;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.button:hover,
.button:focus-visible {
  background: var(--free-ink);
  border-color: var(--free-ink);
}

.button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.back-link {
  color: var(--ink-soft);
}

/* ---------- Etat vide ---------- */

.empty {
  padding: 3rem 0;
  border-top: 1px solid var(--ink);
}

.empty__title {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.375rem;
}

.empty__hint {
  margin: 0.5rem 0 0;
  color: var(--ink-soft);
}

/* ---------- Legende ---------- */

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 1.25rem 0 0;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.legend__chip {
  width: 1.5rem;
  height: 0.875rem;
  border: 1px solid transparent;
  border-radius: 999px;
}

.legend__chip.is-free {
  background: var(--surface);
  border-color: var(--free-edge);
}

.legend__chip.is-hold {
  background: var(--hold-wash);
  border-style: dashed;
  border-color: var(--hold-edge);
}

.legend__chip.is-taken {
  background: var(--taken-wash);
  border-color: var(--taken-wash);
}

/* ---------- Petits ecrans ---------- */

@media (max-width: 34rem) {
  body {
    padding-inline: 1rem;
  }

  .masthead {
    padding-top: 2.5rem;
  }

  .day {
    grid-template-columns: 1fr;
    gap: 0.625rem;
  }

  .day__date {
    padding-top: 0;
  }

  .slot {
    min-width: 4.5rem;
    padding-inline: 0.875rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .slot.is-free {
    transition: none;
  }
}
