/* H&C — bandeau de consentement aux cookies (toutes les pages, voir consent.js). 2026-10-16.
   1. `.cc` : la carte flottante en bas à gauche (nuit `--night`), trois boutons de MÊME poids (Refuser · Personnaliser · Accepter).
   2. `.cc-panel` : le panneau « Personnaliser » (carte blanche sur voile), quatre interrupteurs.
   3. `.cc-ph` : l'espace réservé d'une carte ou d'une vidéo de tiers tant que le visiteur n'a pas accepté.
   4. `.cc-open` : le bouton « Gérer mes cookies » du pied de page (même allure qu'un lien).
   Pas de contour, pas de liseré : des aplats seulement. */

:root { --cc-bg: #0b1626; --cc-line: rgb(255 255 255 / 0.12); }

/* ---------- 1. la carte ---------- */
.cc:not(section)[hidden], .cc-panel[hidden], .cc-ph[hidden], iframe[data-consent-src][hidden] { display: none !important; }
/* :not(section) : la section « Cohorte » des pages académies TATEA porte aussi la classe .cc */
.cc:not(section) {
  position: fixed;
  z-index: 900;
  left: clamp(12px, 2vw, 28px);
  bottom: clamp(12px, 2vw, 28px);
  display: grid;
  gap: 10px;
  width: min(392px, calc(100vw - 24px));
  padding: 20px 20px 16px;
  border-radius: 24px;
  background: var(--cc-bg, #0b1626);
  color: #fff;
  box-shadow: 0 28px 60px -20px rgb(4 10 22 / 0.7), 0 6px 18px -8px rgb(4 10 22 / 0.5);
  font-family: var(--font, "Barlow", system-ui, sans-serif);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s var(--ease-out, ease), transform 0.45s var(--ease-out, ease);
}
.cc:not(section).is-in { opacity: 1; transform: none; }
.cc__t { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.005em; }
.cc__p { margin: 0; font-size: 0.9375rem; line-height: 1.45; color: rgb(255 255 255 / 0.74); text-wrap: pretty; }
.cc__bs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.cc__b {
  display: grid;
  place-items: center;
  min-height: 42px;
  padding: 0 8px;
  border: 0;
  border-radius: 21px;
  background: rgb(255 255 255 / 0.13);
  color: #fff;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.25s;
}
.cc__b:hover { background: rgb(255 255 255 / 0.24); }
.cc__lk {
  justify-self: start;
  font-size: 0.8125rem;
  color: rgb(255 255 255 / 0.62);
  text-decoration: underline;
  text-underline-offset: 0.22em;
  text-decoration-color: rgb(255 255 255 / 0.35);
}
.cc__lk:hover { color: #fff; text-decoration-color: var(--gold, #e2ae0c); }
.cc:not(section) :is(button, a):focus-visible, .cc-panel :is(button, a, input):focus-visible { outline: 2px solid var(--gold, #e2ae0c); outline-offset: 3px; }

/* ---------- 2. le panneau « Personnaliser » ---------- */
.cc-lock { overflow: hidden; }
.cc-panel {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  font-family: var(--font, "Barlow", system-ui, sans-serif);
  opacity: 0;
  transition: opacity 0.3s;
}
.cc-panel.is-in { opacity: 1; }
.cc-panel__veil { position: absolute; inset: 0; background: rgb(6 12 24 / 0.62); backdrop-filter: blur(3px); }
.cc-panel__card {
  position: relative;
  display: grid;
  gap: 14px;
  width: min(560px, 100%);
  max-height: calc(100svh - 32px);
  padding: 28px clamp(20px, 3vw, 32px) 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 28px;
  background: #fff;
  color: var(--ink, #16213d);
  box-shadow: 0 40px 80px -30px rgb(4 10 22 / 0.75);
  transform: translateY(12px) scale(0.985);
  transition: transform 0.4s var(--ease-out, ease);
}
.cc-panel.is-in .cc-panel__card { transform: none; }
.cc-panel__x {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(22 33 61 / 0.07);
  color: var(--ink, #16213d);
  cursor: pointer;
  transition: background-color 0.25s;
}
.cc-panel__x:hover { background: rgb(22 33 61 / 0.14); }
.cc-panel__x svg { width: 18px; height: 18px; }
.cc-panel__t { margin: 0; padding-right: 44px; font-size: 1.5rem; font-weight: 500; letter-spacing: -0.01em; line-height: 1.15; }
.cc-panel__t:focus { outline: 0; }
.cc-panel__p { margin: 0; font-size: 0.9375rem; line-height: 1.5; color: #2f3a52; }
.cc-panel__p a { color: var(--ink, #16213d); text-decoration: underline; text-decoration-color: var(--gold, #e2ae0c); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
.cc-panel__ls { display: grid; gap: 8px; margin: 2px 0 0; padding: 0; list-style: none; }
.cc-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 16px; border-radius: 18px; background: #f2f4f8; cursor: pointer; }
.cc-row__tx { display: grid; gap: 2px; min-width: 0; }
.cc-row__tx b { font-size: 1rem; font-weight: 600; }
.cc-row__tx span { font-size: 0.875rem; line-height: 1.4; color: #5b6478; }
.cc-sw {
  appearance: none;
  position: relative;
  flex: none;
  width: 48px;
  height: 28px;
  margin: 0;
  border-radius: 14px;
  background: #b9c0cf;
  cursor: pointer;
  transition: background-color 0.25s;
}
.cc-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgb(22 33 61 / 0.3); transition: transform 0.25s var(--ease-out, ease); }
.cc-sw:checked { background: var(--gold, #e2ae0c); }
.cc-sw:checked::after { transform: translateX(20px); }
.cc-sw:disabled { cursor: not-allowed; opacity: 0.55; }
.cc-panel__bs.cc__bs { margin-top: 6px; }
.cc-panel .cc__b { background: rgb(22 33 61 / 0.08); color: var(--ink, #16213d); }
.cc-panel .cc__b:hover { background: rgb(22 33 61 / 0.16); }

/* ---------- 3. l'espace réservé d'un contenu de tiers ---------- */
.cc-ph {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  min-height: 100%;
  padding: 28px 22px;
  text-align: center;
  background: #0b1626;
  color: #fff;
}
.cc-ph--fill { position: absolute; inset: 0; }
.cc-ph svg { width: 34px; height: 34px; color: var(--gold, #e2ae0c); }
.cc-ph b { font-size: 1.125rem; font-weight: 600; }
.cc-ph p { max-width: 38ch; margin: 0; font-size: 0.9375rem; line-height: 1.45; color: rgb(255 255 255 / 0.74); }
.cc-ph .cc__b { padding: 0 20px; background: var(--gold, #e2ae0c); color: var(--ink, #16213d); }
.cc-ph .cc__b:hover { background: var(--gold-strong, #f0bf24); }
.cc-ph a { color: rgb(255 255 255 / 0.8); text-underline-offset: 0.2em; }

/* ---------- 4. « Gérer mes cookies » dans le pied de page ---------- */
button.cc-open { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.coda__bar button.cc-open { color: var(--ink, #16213d); }
.cz__bot button.cc-open { margin-left: 18px; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.lcf button.cc-open { color: inherit; }
:is(.coda__bar, .cz__bot, .lcf) button.cc-open:hover { text-decoration: underline; text-underline-offset: 3px; }
button.cc-open:focus-visible { outline: 2px solid var(--gold, #e2ae0c); outline-offset: 3px; }

/* ---------- petits écrans ---------- */
@media (max-width: 560px) {
  .cc:not(section) { left: 12px; right: 12px; bottom: 12px; width: auto; padding: 18px 16px 14px; }
  .cc__bs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .cc__b { padding: 0 6px; font-size: 0.875rem; }
  .cc-panel { padding: 10px; place-items: end center; }
  .cc-panel__card { max-height: calc(100svh - 20px); border-radius: 24px; padding: 24px 16px 18px; }
  .cc-panel__t { font-size: 1.3125rem; }
  .cc-panel__bs.cc__bs { grid-template-columns: 1fr; }
  .cc-row { padding: 12px 14px; gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .cc:not(section), .cc-panel, .cc-panel__card, .cc-sw, .cc-sw::after { transition: none; }
  .cc:not(section) { transform: none; }
}
@media print { .cc:not(section), .cc-panel { display: none !important; } }
