/* =============================================================================
   Calendrier de disponibilité des salles — fiche publique /salles/<slug>/
   Chargé par public/salles.php ($headExtra) seulement si le calendrier est allumé.
   Les 7 thèmes sont figés : tout passe par les jetons partagés --ntc-color-*
   (définis par chaque thème, en clair ET en sombre), avec une valeur de repli.
   Grilles en minmax(0,1fr) + min-width:0 (piège WebKit des colonnes 1fr).
   ============================================================================= */

.ntc-sc {
  border: 1px solid var(--ntc-color-border, #d6dbe3);
  border-radius: 8px;
  background: var(--ntc-color-surface, #fff);
  padding: 1.25rem 1.35rem 1.1rem;
}
.ntc-sc-tete { display: flex; align-items: center; justify-content: space-between; gap: .6rem 1rem; flex-wrap: wrap; }
.ntc-sc-tete h2 { margin: 0; }
.ntc-sc-nav { display: flex; gap: .5rem; }
.ntc-sc-fleche {
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  display: inline-grid; place-items: center;
  border: 1px solid var(--ntc-color-border-strong, #b3bccd);
  color: var(--ntc-color-text, #1a1f2e); background: var(--ntc-color-surface, #fff);
  font-size: 1.3rem; line-height: 1; text-decoration: none;
}
a.ntc-sc-fleche:hover { border-color: var(--ntc-color-link, #1d5a8f); color: var(--ntc-color-link, #1d5a8f); }
.ntc-sc-fleche.is-off { opacity: .35; }
.ntc-sc-sous { margin: .4rem 0 .6rem; color: var(--ntc-color-text-muted, #4a5061); }

.ntc-sc-leg { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; font-size: .92rem; color: var(--ntc-color-text-muted, #4a5061); }
.ntc-sc-leg li { display: inline-flex; align-items: center; gap: .45rem; }
.ntc-sc-pastille { width: 1rem; height: 1rem; border-radius: 4px; border: 1px solid var(--ntc-color-border, #d6dbe3); }
.ntc-sc-pastille.is-libre {
  background: #d4eedc;
  background: color-mix(in srgb, var(--ntc-color-success, #18753c) 24%, var(--ntc-color-surface, #fff));
  border-color: color-mix(in srgb, var(--ntc-color-success, #18753c) 65%, var(--ntc-color-surface, #fff));
}
/* Pris = case VIDE en pointillés + chiffre barré : se distingue du vert sans dépendre de la couleur. */
.ntc-sc-pastille.is-pris { background: transparent; border: 1px dashed var(--ntc-color-border-strong, #b3bccd); }

/* Deux mois côte à côte (is-deux) : la carte prend toute la largeur, les deux mois la remplissent.
   Un seul mois (is-un) : la carte garde la largeur d'un formulaire (700px, comme .ntc-form des
   thèmes), jamais 100 % de la page — ni mois étiré, ni mois perdu au milieu d'une carte vide. */
.ntc-sc-vue { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
.ntc-sc-vue.is-deux { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ntc-sc.is-un { max-width: 700px; }
.ntc-sc.is-un .ntc-sc-j { height: 3rem; }
.ntc-sc-mois { min-width: 0; }
/* Flèches collées au nom du mois (vue à un mois) */
.ntc-sc-mois-tete { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.ntc-sc-mois-tete h3 { flex: 1; margin: 0; }
/* Pendant le rechargement sur place (salles-calendrier.js) : la grille s'estompe, la page ne bouge pas. */
.ntc-sc[aria-busy="true"] .ntc-sc-vue { opacity: .55; transition: opacity .15s; }
.ntc-sc:focus { outline: none; }
.ntc-sc-mois h3 { margin: 0 0 .5rem; text-align: center; font-size: 1.05rem; }
.ntc-sc-grille { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.ntc-sc-js { text-align: center; font-size: .78rem; font-weight: 700; color: var(--ntc-color-text-muted, #4a5061); padding-bottom: .2rem; }
.ntc-sc-vide { min-width: 0; }

.ntc-sc-j {
  min-width: 0; height: 2.6rem; border-radius: 6px;
  display: grid; place-items: center;
  font-size: 1rem; font-weight: 600; font-variant-numeric: tabular-nums;
  border: 1px solid transparent; color: var(--ntc-color-text, #1a1f2e);
  text-decoration: none;
}
.ntc-sc-j.is-libre {
  background: #d4eedc;
  background: color-mix(in srgb, var(--ntc-color-success, #18753c) 24%, var(--ntc-color-surface, #fff));
  border-color: color-mix(in srgb, var(--ntc-color-success, #18753c) 65%, var(--ntc-color-surface, #fff));
  font-weight: 700;
}
a.ntc-sc-j.is-libre:hover { border-color: var(--ntc-color-success, #18753c); box-shadow: 0 0 0 1px var(--ntc-color-success, #18753c); }
a.ntc-sc-j:focus-visible, .ntc-sc-fleche:focus-visible { outline: 3px solid var(--ntc-color-focus, #0a76f6); outline-offset: 2px; }
.ntc-sc-j.is-pris {
  background: transparent;
  border: 1px dashed var(--ntc-color-border-strong, #b3bccd);
  color: var(--ntc-color-text-faint, #5e6678);
  text-decoration: line-through; font-weight: 500;
}
.ntc-sc-j.is-passe { color: var(--ntc-color-text-faint, #5e6678); opacity: .55; font-weight: 400; }
.ntc-sc-j.is-auj { box-shadow: inset 0 0 0 2px var(--ntc-color-link, #1d5a8f); }
.ntc-sc-j.is-choisi,
a.ntc-sc-j.is-choisi:hover {
  background: var(--ntc-color-action, #1e3a8a); border-color: var(--ntc-color-action, #1e3a8a);
  color: var(--ntc-color-on-action, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ntc-color-action, #1e3a8a) 35%, transparent);
}
/* Plusieurs jours : les jours entre le premier et le dernier choisis */
.ntc-sc-j.is-plage,
a.ntc-sc-j.is-plage:hover {
  background: color-mix(in srgb, var(--ntc-color-action, #1e3a8a) 22%, var(--ntc-color-surface, #fff));
  border-color: var(--ntc-color-action, #1e3a8a);
  color: var(--ntc-color-text, #1a1f2e);
}
.ntc-sc-choix .ntc-sc-astuce { display: block; margin-top: .3rem; font-size: .9rem; color: var(--ntc-color-text-muted, #4a5061); }
.ntc-sc-choix .ntc-sc-lien { font-size: .92rem; white-space: nowrap; }

/* Carte « Demande envoyée » (retour après l'envoi du formulaire) */
.ntc-sc-envoye {
  display: flex; gap: .9rem; align-items: flex-start;
  margin: .9rem 0 1rem; padding: 1rem 1.15rem; border-radius: 10px;
  background: #e3f4e8;
  background: color-mix(in srgb, var(--ntc-color-success, #18753c) 12%, var(--ntc-color-surface, #fff));
  border: 2px solid color-mix(in srgb, var(--ntc-color-success, #18753c) 60%, var(--ntc-color-surface, #fff));
}
.ntc-sc-envoye-ico { font-size: 1.8rem; line-height: 1; }
.ntc-sc-envoye h3 { margin: 0 0 .35rem; font-size: 1.15rem; }
.ntc-sc-envoye p { margin: .2rem 0; }
.ntc-sc-envoye .ntc-sc-ref { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; }

.ntc-sc-choix {
  margin-top: 1.1rem; padding: .9rem 1rem; border-radius: 8px;
  border: 1px solid var(--ntc-color-border, #d6dbe3);
  background: var(--ntc-color-surface-alt, #f6f7fa);
  display: flex; align-items: center; justify-content: space-between; gap: .75rem 1.25rem; flex-wrap: wrap;
}
.ntc-sc-choix p { margin: 0; }
.ntc-sc-choix.is-ok {
  background: #e3f4e8;
  background: color-mix(in srgb, var(--ntc-color-success, #18753c) 10%, var(--ntc-color-surface, #fff));
  border-color: color-mix(in srgb, var(--ntc-color-success, #18753c) 50%, var(--ntc-color-surface, #fff));
}
.ntc-sc-choix.is-ko {
  background: #fff4e5;
  background: color-mix(in srgb, var(--ntc-color-warning, #b34000) 10%, var(--ntc-color-surface, #fff));
  border-color: color-mix(in srgb, var(--ntc-color-warning, #b34000) 45%, var(--ntc-color-surface, #fff));
}
.ntc-sc-choix.is-tel {
  background: #eef3fa;
  background: color-mix(in srgb, var(--ntc-color-link, #1d5a8f) 8%, var(--ntc-color-surface, #fff));
  border-color: color-mix(in srgb, var(--ntc-color-link, #1d5a8f) 35%, var(--ntc-color-surface, #fff));
}
.ntc-sc-btn { white-space: nowrap; }
.ntc-sc-mention { margin: .8rem 0 0; font-size: .88rem; color: var(--ntc-color-text-muted, #4a5061); }
.ntc-sc-loc { font-weight: 600; }

/* Page « Demande de réservation » : salle + date figées. Même largeur que le formulaire (.ntc-form : 700px), pas 100 %. */
.ntc-sc-recap {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem 1.25rem; flex-wrap: wrap;
  max-width: 700px; box-sizing: border-box;
  margin: 0 0 1.5rem; padding: 1rem 1.1rem; border-radius: 8px;
  background: #e3f4e8;
  background: color-mix(in srgb, var(--ntc-color-success, #18753c) 10%, var(--ntc-color-surface, #fff));
  border: 1px solid color-mix(in srgb, var(--ntc-color-success, #18753c) 50%, var(--ntc-color-surface, #fff));
}
.ntc-sc-recap p { margin: 0; }
.ntc-sc-recap-titre { font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-bottom: .3rem !important; color: var(--ntc-color-text-muted, #4a5061); }
.ntc-sc-recap-ligne { font-size: 1.08rem; font-weight: 700; }

@media (max-width: 700px) {
  .ntc-sc { padding: 1rem .75rem .9rem; }
  .ntc-sc-vue.is-deux { grid-template-columns: minmax(0, 1fr); }
  .ntc-sc-vue.is-deux .ntc-sc-mois + .ntc-sc-mois { display: none; } /* un mois à la fois, flèches pour avancer */
  .ntc-sc-grille { gap: 3px; }
  .ntc-sc-j, .ntc-sc.is-un .ntc-sc-j { height: 2.5rem; font-size: .95rem; }
  .ntc-sc-btn { width: 100%; text-align: center; white-space: normal; }
}
