/*
 * Bannière de consentement.
 *
 * Reprend les variables de la charte quand elles existent (pages du site) et
 * retombe sur des valeurs équivalentes sinon, pour rester lisible partout.
 */

.yj-consent {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  padding: clamp(0.75rem, 2vw, 1.5rem);
  background: rgba(5, 18, 38, 0.45);
  animation: yj-consent-in 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (min-height: 520px) {
  .yj-consent { inset: 0; align-items: flex-end; }
}

@keyframes yj-consent-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .yj-consent { animation: none; }
}

/* La boîte reçoit le focus à l'ouverture ; elle n'a pas besoin d'un anneau,
   le dialogue est déjà évident à l'œil. Les boutons, eux, gardent le leur. */
.yj-consent-box:focus { outline: none; }

.yj-consent-box {
  width: min(46rem, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--white, #fff);
  color: var(--navy, #0a2c54);
  font-family: var(--font, 'Montserrat', ui-sans-serif, system-ui, sans-serif);
  font-size: 0.95rem;
  line-height: 1.55;
  border-radius: var(--r-lg, 24px);
  box-shadow: 0 34px 64px -26px rgba(10, 44, 84, 0.55);
  padding: clamp(1.25rem, 3vw, 2rem);
}

.yj-consent-title {
  margin: 0 0 0.6rem;
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.yj-consent-intro {
  margin: 0 0 1.25rem;
  color: var(--muted, #51647d);
}

.yj-consent-link {
  color: var(--navy, #0a2c54);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.yj-consent-link:hover { color: var(--cyan, #1acdd8); }

.yj-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.yj-consent-btn {
  flex: 1 1 12rem;
  min-height: 46px;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

/*
 * Accepter et refuser partagent volontairement le même style : donner et
 * refuser son consentement doivent demander le même effort.
 */
.yj-consent-btn-primary {
  background: var(--cyan, #1acdd8);
  color: var(--navy, #0a2c54);
}

.yj-consent-btn-primary:hover { background: var(--cyan-soft, #7de3ea); }

.yj-consent-btn-ghost {
  background: transparent;
  color: var(--navy, #0a2c54);
  border-color: var(--line, rgba(10, 44, 84, 0.12));
}

.yj-consent-btn-ghost:hover { border-color: var(--cyan, #1acdd8); }

.yj-consent-btn:focus-visible,
.yj-consent-link:focus-visible {
  outline: 3px solid var(--cyan, #1acdd8);
  outline-offset: 3px;
}

.yj-consent-cat {
  padding: 0.9rem 0;
  border-top: 1px solid var(--line, rgba(10, 44, 84, 0.12));
}

.yj-consent-cat:first-of-type { border-top: 0; }

.yj-consent-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.yj-consent-cat-name {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  cursor: pointer;
}

.yj-consent-cat-name input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--cyan, #1acdd8);
  cursor: pointer;
}

.yj-consent-always {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted, #51647d);
}

.yj-consent-cat-desc {
  margin: 0;
  color: var(--muted, #51647d);
  font-size: 0.9rem;
}

.yj-consent-cat + .yj-consent-actions { margin-top: 1.25rem; }

/* La page ne défile pas derrière le dialogue. */
.yj-consent-open, .yj-consent-open body { overflow: hidden; }

/*
 * Le bouton « Gérer mes cookies ». Réinitialisation minimale : chaque page
 * habille ensuite ce bouton avec le style de son propre pied de page.
 */
[data-yj-consent-open] {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

[data-yj-consent-open]:hover { color: var(--cyan, #1acdd8); }

/* ————— note sur les pages sensibles ————— */

.yj-consent-sensitive {
  margin: 1rem 0 0;
  padding: .75rem 1rem;
  background: var(--mist, #DEFBFF);
  border-radius: 12px;
  font-size: .88rem;
  color: var(--navy, #0a2c54);
}

/* ————— façade YouTube ————— */

/*
 * Une iframe YouTube dépose des cookies dès l'affichage. Tant que la catégorie
 * « contenus externes » n'est pas acceptée, cette façade prend sa place : rien
 * n'est demandé à Google avant un clic.
 */
[data-yj-youtube] {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: var(--r, 18px);
  overflow: hidden;
  background: var(--navy, #0a2c54);
}

[data-yj-youtube] iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.yj-facade {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .9rem;
  padding: clamp(1rem, 3vw, 2rem);
  text-align: center;
  background:
    radial-gradient(120% 90% at 80% -10%, rgba(26, 205, 216, .35), transparent 55%),
    linear-gradient(160deg, #123a6b, #08203f 72%);
}

.yj-facade-text {
  margin: 0;
  max-width: 40ch;
  color: rgba(255, 255, 255, .85);
  font-size: clamp(.82rem, 1.6vw, .95rem);
  line-height: 1.45;
}

.yj-facade-play {
  width: clamp(56px, 7vw, 76px);
  height: clamp(56px, 7vw, 76px);
  border: 0;
  border-radius: 50%;
  background: var(--cyan, #1acdd8);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 30px rgba(5, 18, 38, .45);
  transition: transform .2s var(--ease, ease);
}

.yj-facade-play::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 5px;
  border-left: 18px solid var(--navy, #0a2c54);
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
}

.yj-facade-play:hover { transform: scale(1.06); }

.yj-facade-link {
  color: var(--cyan-soft, #7DE3EA);
  font-size: .82rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.yj-facade-play:focus-visible,
.yj-facade-link:focus-visible {
  outline: 3px solid var(--cyan, #1acdd8);
  outline-offset: 3px;
}
