/**
 * sheet.css — Bottom sheet « Apple » (2026-06-18)
 * Feuille modale qui monte du bas : coins hauts arrondis, grabber, fond
 * assombri (scrim), surface glass, détente à l'ouverture. Pilotée par
 * public/js/sheet.js (ouverture/fermeture, focus-trap, Esc, reduced-motion).
 *
 * Markup attendu :
 *   <div class="sheet-scrim" data-sheet-scrim hidden></div>
 *   <div class="sheet" id="..." role="dialog" aria-modal="true"
 *        aria-labelledby="..." hidden>
 *     <div class="sheet-grabber" aria-hidden="true"></div>
 *     <div class="sheet-body"> ... </div>
 *   </div>
 *
 * sheet.js ajoute .sheet--open / .sheet-scrim--open pour animer.
 */

.sheet-scrim {
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: var(--scrim, rgba(15,37,68,0.32));
  opacity: 0;
  transition: opacity var(--dur, 0.25s) var(--ease, ease);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.sheet-scrim--open { opacity: 1; }

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 9991;
  width: min(560px, 100%);
  max-height: 90dvh;
  transform: translate(-50%, 100%);
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  /* glass : translucide + flou (repli sur bg-elevated si non supporté) */
  background: var(--glass-bg, var(--bg-elevated));
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--glass-border, var(--separator));
  border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow-lg);
  padding: 0 clamp(1rem, 4vw, 1.75rem) max(1.25rem, env(safe-area-inset-bottom));
  transition: transform var(--dur, 0.25s) var(--ease, ease);
  will-change: transform;
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .sheet { background: var(--bg-elevated); }
}
.sheet--open { transform: translate(-50%, 0); }

/* Détente (rebond léger) à l'ouverture : courbe spring */
.sheet.sheet--spring { transition-timing-function: var(--ease-spring, ease); }

.sheet-grabber {
  flex: 0 0 auto;
  width: 38px;
  height: 5px;
  margin: 10px auto 6px;
  border-radius: var(--r-pill, 100px);
  background: var(--label-quaternary);
}
.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.25rem 0 0.75rem;
}
.sheet-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--label-primary);
}
.sheet-close {
  appearance: none;
  border: none;
  background: var(--fill-secondary);
  color: var(--label-secondary);
  width: 30px;
  height: 30px;
  border-radius: var(--r-pill, 100px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background var(--dur-fast, 0.15s) var(--ease, ease);
}
.sheet-close:hover { background: var(--fill-primary); }
.sheet-close:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus, 0 0 0 3px rgba(94,127,168,0.35));
}
.sheet-close svg { width: 16px; height: 16px; }
.sheet-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.5rem;
}

@media (prefers-reduced-motion: reduce) {
  .sheet,
  .sheet-scrim { transition: opacity var(--dur-fast, 0.15s) linear; }
  .sheet { transition: none; }
  .sheet--open { transform: translate(-50%, 0); }
}
