/* Quizothèque V9 — correctifs secondaires et blocs éditoriaux.
 * Charge APRES quizotheque.css sur les pages thème, âge et jeu.
 * Compatible PHP/CakePHP sans dépendance JS.
 */

.qz-page .qz-card.no-media .qz-card-body {
  min-height: 190px;
  justify-content: flex-start;
}

.qz-page .qz-card.no-media .qz-card-cta,
.qz-page .qz-card.no-media .qz-card-body > span:last-child {
  margin-top: auto;
}

/* Aucun faux visuel technique sur le public. */
.qz-page .qz-card-placeholder {
  display: none !important;
}

/* Hero sans image : une seule colonne propre. */
.qz-page .qz-hero.qz-hero-no-media,
.qz-page .qz-theme-hero.qz-theme-hero-no-media {
  grid-template-columns: minmax(0, 1fr) !important;
}

.qz-page .qz-hero.qz-hero-no-media .qz-hero-copy,
.qz-page .qz-theme-hero.qz-theme-hero-no-media .qz-theme-hero-copy {
  max-width: 900px;
}

/* Les titres et labels restent ensemble dans la colonne gauche. */
.qz-page .qz-section-heading > .qz-heading-copy {
  min-width: 0;
  align-self: start;
}

.qz-page .qz-section-heading > .qz-heading-text {
  min-width: 0;
  align-self: end;
  max-width: 680px;
  color: #746e7e;
  font-size: .92rem;
  line-height: 1.68;
}

.qz-page .qz-section-heading > .qz-heading-text p {
  margin: 0 0 12px;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.qz-page .qz-section-heading > .qz-heading-text p:last-child {
  margin-bottom: 0;
}

.qz-page .qz-section-heading-single {
  grid-template-columns: minmax(0, 1fr) !important;
}

.qz-page .qz-section-heading-single .qz-heading-copy {
  max-width: 900px;
}

/* Texte de partie unique : évite un pavé trop large dans le hero. */
.qz-page .qz-play-intro {
  max-width: 760px;
}

.qz-page .qz-play-intro p {
  margin: 0 0 10px;
}

.qz-page .qz-play-intro p:last-child {
  margin-bottom: 0;
}

/* Bloc FAQ éditorial. */
.qz-page .qz-faq-section {
  margin-top: 72px;
}

.qz-page .qz-faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.qz-page .qz-faq-grid details {
  overflow: hidden;
  border: 1px solid rgba(42,31,72,.09);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(35,28,59,.06);
}

.qz-page .qz-faq-grid summary {
  position: relative;
  padding: 18px 48px 18px 20px;
  color: #211b2d;
  font-weight: 900;
  line-height: 1.35;
  cursor: pointer;
  list-style: none;
}

.qz-page .qz-faq-grid summary::-webkit-details-marker {
  display: none;
}

.qz-page .qz-faq-grid summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f0ebff;
  color: #6849e6;
  font-size: 1rem;
  font-weight: 950;
}

.qz-page .qz-faq-grid details[open] summary::after {
  content: "–";
}

.qz-page .qz-faq-grid details p {
  margin: 0;
  padding: 0 20px 20px;
  color: #6f6878;
  font-size: .88rem;
  line-height: 1.65;
}

/* Maillage sémantique entre thèmes. */
.qz-page .qz-topic-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 52px;
  padding: 19px 20px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(35,28,59,.05);
}

.qz-page .qz-topic-links > span {
  margin-right: 4px;
  color: #81798a;
  font-size: .73rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.qz-page .qz-topic-links a {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f4f0ff;
  color: #5e46c8;
  font-size: .78rem;
  font-weight: 850;
  text-decoration: none;
}

.qz-page .qz-topic-links a:hover,
.qz-page .qz-topic-links a:focus {
  background: #211b37;
  color: #fff;
}

@media (max-width: 880px) {
  .qz-page .qz-section-heading > .qz-heading-text {
    max-width: 720px;
    align-self: start;
  }

  .qz-page .qz-faq-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .qz-page .qz-card.no-media .qz-card-body {
    min-height: 165px;
  }

  .qz-page .qz-faq-section {
    margin-top: 48px;
  }

  .qz-page .qz-faq-grid details {
    border-radius: 16px;
  }

  .qz-page .qz-topic-links {
    align-items: flex-start;
    margin-top: 38px;
    padding: 16px;
  }

  .qz-page .qz-topic-links > span {
    width: 100%;
  }
}

/* ======================================================================
 * V11 — bloc éditorial premium
 * Titre sur toute la largeur + texte juste dessous dans une carte premium.
 * ====================================================================== */
.qz-page .qz-editorial-section {
  margin-top: 72px;
}

.qz-page .qz-editorial-section > .qz-section-heading {
  display: block !important;
  grid-template-columns: none !important;
  gap: 0 !important;
  align-items: initial !important;
  margin-bottom: 0 !important;
}

.qz-page .qz-editorial-section .qz-heading-copy {
  width: 100%;
  max-width: 980px;
  margin: 0 0 22px;
}

.qz-page .qz-editorial-section .qz-heading-copy .qz-step-label,
.qz-page .qz-editorial-section .qz-heading-copy .qz-kicker {
  margin-bottom: 7px;
}

.qz-page .qz-editorial-section .qz-heading-copy h2 {
  max-width: 980px;
  margin: 0;
  color: #1a1628;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.02;
  letter-spacing: -.045em;
}

.qz-page .qz-editorial-section .qz-heading-text {
  position: relative;
  width: 100%;
  max-width: none !important;
  overflow: hidden;
  padding: 30px 34px 30px 38px;
  border: 1px solid rgba(55, 42, 86, .08);
  border-radius: 26px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 201, 77, .15), transparent 210px),
    radial-gradient(circle at 0% 100%, rgba(116, 81, 255, .10), transparent 240px),
    rgba(255, 255, 255, .94);
  box-shadow:
    0 18px 50px rgba(35, 28, 59, .08),
    inset 0 1px 0 rgba(255, 255, 255, .85);
  color: #625b6d;
  font-size: .97rem;
  line-height: 1.78;
}

/* Liseré premium sans ajouter de contenu artificiel. */
.qz-page .qz-editorial-section .qz-heading-text::before {
  content: "";
  position: absolute;
  top: 22px;
  bottom: 22px;
  left: 0;
  width: 5px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(180deg, #7451ff 0%, #ff7a45 58%, #ffc94d 100%);
}

.qz-page .qz-editorial-section .qz-heading-text::after {
  content: "";
  position: absolute;
  top: -74px;
  right: -72px;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(116, 81, 255, .08);
  border-radius: 50%;
  box-shadow:
    0 0 0 30px rgba(116, 81, 255, .025),
    0 0 0 62px rgba(255, 122, 69, .018);
  pointer-events: none;
}

.qz-page .qz-editorial-section .qz-heading-text p {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 0 14px;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.qz-page .qz-editorial-section .qz-heading-text p:first-child {
  color: #443d4d;
  font-size: 1rem;
}

.qz-page .qz-editorial-section .qz-heading-text p:last-child {
  margin-bottom: 0;
}

@media (max-width: 620px) {
  .qz-page .qz-editorial-section {
    margin-top: 48px;
  }

  .qz-page .qz-editorial-section .qz-heading-copy {
    margin-bottom: 16px;
  }

  .qz-page .qz-editorial-section .qz-heading-copy h2 {
    font-size: 2rem;
    line-height: 1.05;
  }

  .qz-page .qz-editorial-section .qz-heading-text {
    padding: 22px 20px 22px 25px;
    border-radius: 20px;
    font-size: .92rem;
    line-height: 1.7;
  }

  .qz-page .qz-editorial-section .qz-heading-text::before {
    top: 16px;
    bottom: 16px;
    width: 4px;
  }

  .qz-page .qz-editorial-section .qz-heading-text::after {
    width: 135px;
    height: 135px;
    top: -60px;
    right: -58px;
  }
}

/* ======================================================================
 * V12 — même traitement premium sur TOUTES les pages individuelles
 * ====================================================================== */

/* Le bloc "Comment voulez-vous jouer ?" vit déjà dans la grande carte
   qz-app : on garde le titre puis le cadre juste dessous, sans marge externe. */
.qz-page .qz-editorial-compact {
  margin-top: 0 !important;
}

.qz-page .qz-editorial-compact > .qz-section-heading {
  margin-bottom: 28px !important;
}

.qz-page .qz-editorial-compact .qz-heading-copy {
  margin-bottom: 18px;
}

.qz-page .qz-editorial-compact .qz-heading-text {
  padding: 24px 28px 24px 32px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 201, 77, .12), transparent 170px),
    radial-gradient(circle at 0% 100%, rgba(116, 81, 255, .08), transparent 190px),
    #fbfaff;
  box-shadow:
    0 12px 34px rgba(35, 28, 59, .065),
    inset 0 1px 0 rgba(255, 255, 255, .9);
}

.qz-page .qz-editorial-compact .qz-heading-text p {
  max-width: 980px;
}

/* Dans "Comment jouer à ce quiz...", le cadre doit respirer avant les 4 cartes. */
.qz-page .qz-use-section.qz-editorial-section > .qz-section-heading {
  margin-bottom: 24px !important;
}

.qz-page .qz-use-section.qz-editorial-section .qz-value-grid {
  margin-top: 0;
}

/* Empêche les anciennes règles de grille de remettre le paragraphe à droite. */
.qz-page .qz-editorial-section .qz-section-heading > .qz-heading-text {
  grid-column: 1 / -1 !important;
  align-self: auto !important;
}

@media (max-width: 620px) {
  .qz-page .qz-editorial-compact > .qz-section-heading {
    margin-bottom: 22px !important;
  }

  .qz-page .qz-editorial-compact .qz-heading-text {
    padding: 19px 18px 19px 23px;
    border-radius: 18px;
  }
}

/* ======================================================================
 * V14 — TITRES LONGS : pas de ponctuation orpheline
 * Les blocs éditoriaux restent premium et pleine largeur.
 * ====================================================================== */
.qz-page .qz-editorial-section .qz-heading-copy {
  max-width: none !important;
}

.qz-page .qz-editorial-section .qz-heading-copy h2 {
  width: 100%;
  max-width: none !important;
  font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1.03;
  letter-spacing: -.042em;
  text-wrap: balance;
  word-break: normal;
  overflow-wrap: normal;
}

/* Sur les très grands écrans, le titre peut profiter de toute la largeur
   mais reste contenu dans la largeur éditoriale du site. */
.qz-page .qz-use-section.qz-editorial-section .qz-heading-copy,
.qz-page .qz-use-section.qz-editorial-section .qz-heading-copy h2 {
  width: 100%;
  max-width: 1160px !important;
}

@media (max-width: 760px) {
  .qz-page .qz-editorial-section .qz-heading-copy h2 {
    font-size: clamp(1.85rem, 8.5vw, 2.55rem);
    line-height: 1.06;
  }
}
