/*
 * Calendriers de disponibilité — styles neutres du cœur (lib/calendars.php, partials/calendar.php).
 * Un thème les complète par son propre assets/calendar.css (chargé après) ou par les variables
 * --nbc-* ci-dessous. Une demi-journée indisponible est HACHURÉE (jamais la couleur seule).
 */
.nbc {
  --nbc-free: #f3f8f4;
  --nbc-free-border: #c9d8cd;
  --nbc-text: inherit;
  --nbc-muted: #5f6b7a;
  --nbc-today: #1d4ed8;
  --nbc-hatch: rgba(255, 255, 255, .55);
  --nbc-radius: 6px;
  color: var(--nbc-text);
  margin: 1.5rem 0;
  min-width: 0;
}
.nbc__desc { margin: 0 0 .75rem; }
.nbc__nav { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin: 0 0 .75rem; }
.nbc__navlink { display: inline-flex; align-items: center; gap: .35em; min-height: 44px; padding: 0 .75rem; border: 1px solid currentColor; border-radius: var(--nbc-radius); text-decoration: none; }
.nbc__navlink.is-off { visibility: hidden; }
.nbc__navlink--next { margin-left: auto; }
.nbc__months { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 1rem 1.5rem; }
.nbc__months[aria-busy="true"] { opacity: .6; }
.nbc__month { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 3px; margin: 0; }
.nbc__caption { font-weight: 600; text-align: left; padding: 0 3px .35rem; text-transform: capitalize; }
.nbc__month th { font-size: .75rem; font-weight: 600; color: var(--nbc-muted); text-align: center; padding: 0 0 .2rem; overflow: hidden; text-overflow: clip; white-space: nowrap; }
.nbc__month td { padding: 0; position: relative; }
.nbc__cell { position: relative; display: block; aspect-ratio: 1 / 1; border: 1px solid var(--nbc-free-border); border-radius: var(--nbc-radius); overflow: hidden; background: var(--nbc-free); }
.nbc__half { position: absolute; inset: 0; }
.nbc__half--am { clip-path: polygon(0 0, 100% 0, 0 100%); }
.nbc__half--pm { clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.nbc__half.has-status { background-color: var(--nbc-c, #888); }
.nbc__half.is-busy {
  background-image: repeating-linear-gradient(135deg, var(--nbc-hatch) 0 2px, transparent 2px 6px);
}
.nbc__num { position: absolute; inset: 0; display: grid; place-items: center; font-size: .85rem; font-weight: 600; font-variant-numeric: tabular-nums; color: #111; text-shadow: 0 0 3px #fff, 0 0 2px #fff; }
.nbc__day--past .nbc__cell { opacity: .45; filter: grayscale(1); }
.nbc__day--today .nbc__cell { outline: 2px solid var(--nbc-today); outline-offset: 1px; }
.nbc__legend { margin-top: 1rem; font-size: .9rem; }
.nbc__legend-title { font-weight: 600; margin: 0 0 .35rem; }
.nbc__keys { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; }
.nbc__keys li { display: inline-flex; align-items: center; gap: .4rem; }
.nbc__key { position: relative; display: inline-block; width: 1.4rem; height: 1.4rem; border: 1px solid var(--nbc-free-border); border-radius: 4px; overflow: hidden; background: var(--nbc-free); flex: none; }
.nbc__hint { color: var(--nbc-muted); margin: .5rem 0 0; }
.nbc__error { color: #b42318; }
/* sélection d'une plage (script, calendrier lié à un champ de dates) */
.nbc__pick { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; margin: 0; border: 0; background: transparent; cursor: pointer; border-radius: var(--nbc-radius); }
.nbc__pick:focus-visible { outline: 3px solid var(--nbc-today); outline-offset: 1px; }
.nbc__day.is-selected .nbc__cell { box-shadow: inset 0 0 0 3px var(--nbc-today); }
/* texte réservé aux lecteurs d'écran : dans une cellule (position relative), jamais sur une table */
.nbc-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 420px) {
  .nbc__month { border-spacing: 2px; }
  .nbc__num { font-size: .78rem; }
}
@media (forced-colors: active) {
  .nbc__half.is-busy { background: repeating-linear-gradient(135deg, CanvasText 0 2px, Canvas 2px 6px); }
}
