/**
 * Yoopies FR — Bloc Questionnaire ([yoopies_quiz]).
 *
 * Les tuiles réutilisent le visuel .yp-hub-question (défini dans hub.css).
 * On overrride uniquement ce qui diffère entre <a> (statique) et <button> (quiz).
 *
 * Les tuiles sont dans un rail horizontal (.yp-hub-questions__scroll) qui
 * scrolle à partir de N > ce qui tient à l'écran.
 */

/* ===== Rail scrollable (prend 3/4 colonnes à droite du head) =====
 * Le layout parent .yp-hub-questions garde son grid 4 colonnes (hub.css).
 * Head en col 1, rail en cols 2 à 4 → même visuel qu'avant mais scrollable. */
.yp-hub-questions__scroll {
  grid-column: 2 / -1;
  min-width: 0;                /* indispensable pour qu'overflow-x marche dans un grid item */
  display: flex;
  flex-wrap: nowrap;
  gap: 14px;
  overflow-x: auto;
  cursor: grab;
  /* top : espace pour le badge "Quiz" qui dépasse en haut d'une tuile
     bottom : marge pour la scrollbar + ombre hover non clippée */
  padding: 14px 4px 14px 0;
  margin: -14px -4px -14px 0;  /* compense le padding sans décaler le layout */
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #c7e9df transparent;
}
.yp-hub-questions__scroll.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;      /* laisse le drag libre sans snap qui résiste */
  user-select: none;
}
.yp-hub-questions__scroll::-webkit-scrollbar { height: 6px; }
.yp-hub-questions__scroll::-webkit-scrollbar-thumb {
  background: #c7e9df;
  border-radius: 3px;
}
.yp-hub-questions__scroll::-webkit-scrollbar-track { background: transparent; }

.yp-hub-questions__scroll > .yp-hub-question {
  flex: 0 0 clamp(220px, 24vw, 280px);
  scroll-snap-align: start;
  min-height: 120px;
}

@media (max-width: 768px) {
  /* Mobile : le parent passe à 1 col, le rail prend toute la largeur */
  .yp-hub-questions__scroll { grid-column: 1 / -1; }
  .yp-hub-questions__scroll > .yp-hub-question { flex: 0 0 230px; }
}

/* ===== Tuile quiz (variante <button> de .yp-hub-question) ===== */
button.yp-hub-question,
.yp-hub-question--quiz {
  width: 100%;
  text-align: inherit;
  font-family: inherit;
  cursor: pointer;
  color: inherit;
}
.yp-hub-question--quiz {
  position: relative;
}
/* Petit badge discret "Quiz" en coin pour signaler que c'est interactif */
.yp-hub-question--quiz::before {
  content: "Quiz";
  position: absolute;
  top: -10px;
  right: 12px;
  background: var(--q-color, #32bfa3);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  box-shadow: 0 2px 4px rgba(20,72,98,.14);
}

/* ===== Modale ===== */
.yp-quiz-modal[hidden] { display: none !important; }
.yp-quiz-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity .18s cubic-bezier(.4,0,.2,1);
}
.yp-quiz-modal--open { opacity: 1; }

.yp-quiz-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(20, 72, 98, .55);
  backdrop-filter: blur(2px);
  cursor: pointer;
}

.yp-quiz-modal__panel {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 22px;
  width: min(640px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 40px 36px 32px;
  box-shadow: 0 24px 60px rgba(20, 72, 98, .32);
  box-sizing: border-box;
  transform: translateY(10px);
  transition: transform .22s cubic-bezier(.4,0,.2,1);
  font-family: Nunito, sans-serif;
}
.yp-quiz-modal--open .yp-quiz-modal__panel { transform: none; }

.yp-quiz-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: #5b7a8a;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .14s, color .14s;
}
.yp-quiz-modal__close:hover,
.yp-quiz-modal__close:focus-visible {
  background: #e3eefb;
  color: #144862;
  outline: none;
}

/* ===== États intérieurs ===== */
.yp-quiz__state {
  animation: yp-quiz-fade .28s cubic-bezier(.4,0,.2,1);
}
@keyframes yp-quiz-fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* Intro */
.yp-quiz__badge {
  display: inline-block;
  background: #e6f7f3;
  color: #0f7a66;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
}
.yp-quiz__title {
  margin: 12px 0 10px;
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 800;
  line-height: 1.2;
  color: #144862;
}
.yp-quiz__desc {
  margin: 0 0 22px;
  font-size: 16px;
  line-height: 1.5;
  color: #5b7a8a;
}
.yp-quiz__desc > p { margin: 0 0 10px; }
.yp-quiz__desc > p:last-child { margin-bottom: 0; }
.yp-quiz__desc strong { color: #144862; }
.yp-quiz__desc a { color: #0f7a66; text-decoration: underline; }
.yp-quiz__start { align-self: start; }

/* Question */
.yp-quiz__progress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.yp-quiz__progress-step {
  font-size: 13px;
  font-weight: 800;
  color: #9cb2bd;
  flex: none;
}
.yp-quiz__progress-bar {
  flex: 1;
  height: 6px;
  background: #e3eefb;
  border-radius: 999px;
  overflow: hidden;
}
.yp-quiz__progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: #32bfa3;
  border-radius: 999px;
  transition: width .32s cubic-bezier(.4,0,.2,1);
}
.yp-quiz__eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #9cb2bd;
}
.yp-quiz__q-text {
  margin: 0 0 18px;
  font-size: clamp(20px, 2.1vw, 24px);
  font-weight: 800;
  line-height: 1.3;
  color: #144862;
}
.yp-quiz__answers {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.yp-quiz__answer {
  text-align: left;
  background: #fff;
  color: #363636;
  border: 2px solid #dbe5ea;
  border-radius: 12px;
  padding: 14px 44px 14px 18px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: all .16s cubic-bezier(.4,0,.2,1);
  position: relative;
}
.yp-quiz__answer::after {
  content: "→";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: #9cb2bd;
  font-weight: 800;
  transition: color .16s, transform .16s;
}
.yp-quiz__answer:hover,
.yp-quiz__answer:focus-visible {
  border-color: #32bfa3;
  background: #e6f7f3;
  color: #144862;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(20,72,98,.1);
  outline: none;
}
.yp-quiz__answer:hover::after,
.yp-quiz__answer:focus-visible::after {
  color: #32bfa3;
  transform: translate(4px, -50%);
}

/* Result */
.yp-quiz__result-badge {
  display: inline-block;
  background: #fef0e6;
  color: #cc5a1d;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
}
.yp-quiz__result-name {
  margin: 10px 0 8px;
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 800;
  line-height: 1.2;
  color: #144862;
}
.yp-quiz__result-name::before { content: "✨ "; }
.yp-quiz__result-text {
  margin: 0 0 20px;
  font-size: 16px;
  line-height: 1.55;
  color: #363636;
}
.yp-quiz__result-text > p { margin: 0 0 12px; }
.yp-quiz__result-text > p:last-child { margin-bottom: 0; }
.yp-quiz__result-text strong { color: #144862; font-weight: 800; }
.yp-quiz__result-text em { font-style: italic; }
.yp-quiz__result-text ul,
.yp-quiz__result-text ol { margin: 0 0 12px; padding-left: 22px; }
.yp-quiz__result-text li { margin: 0 0 4px; }
.yp-quiz__result-text a { color: #0f7a66; text-decoration: underline; }
.yp-quiz__result-text a:hover { color: #144862; }
.yp-quiz__result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}
.yp-quiz__restart {
  background: transparent;
  border: 0;
  color: #5b7a8a;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 8px 4px;
  text-decoration: underline;
}
.yp-quiz__restart:hover { color: #144862; }

@media (max-width: 640px) {
  .yp-quiz-modal { padding: 12px; }
  .yp-quiz-modal__panel { padding: 32px 20px 24px; border-radius: 16px; }
  .yp-quiz__answer { padding: 12px 40px 12px 14px; font-size: 15px; }
  .yp-quiz__answer::after { right: 14px; }
}
