/* Page de test isolée — "Ce jour dans l'Histoire" (GET /historical-events-test).
   Fichier dédié, non chargé par les autres vues : ne pas fusionner dans style.css
   tant que la fonctionnalité n'est pas branchée à l'accueil. */

html {
  background: #243038;
}

.het-body {
  margin: 0;
  min-height: 100vh;
  background: #243038;
  color: #111827;
  font-family: Arial, Helvetica, sans-serif;
}

/* Bandeau logo — mêmes classes/valeurs que .topbar dans style.css (version
   simplifiée, sans l'auto-hide au scroll, qui dépend de script.js non chargé
   ici), dupliqué car cette page ne charge pas style.css (fichier isolé, cf.
   en-tête du fichier). Sans lui, cette page n'avait pas le même espace en
   haut que /qcm-du-jour et /eclairages. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background:
    linear-gradient(90deg, #f3f4f6 0%, #d1d5db 25%, #9ca3af 50%, #374151 75%, #111827 100%) top / 100% 5px no-repeat,
    #e9ebec;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding-top: 5px;
  box-sizing: border-box;
}
/* Seconde barre dégradée (couleurs inversées), sous le bandeau cette fois. */
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, #111827 0%, #374151 25%, #9ca3af 50%, #d1d5db 75%, #f3f4f6 100%);
  opacity: 1;
  pointer-events: none;
  z-index: 40;
}
.container {
  width: min(1200px, 92%);
  margin: 0 auto;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 0;
  gap: 16px;
}
.home-brand-block {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}
.home-brand-main {
  display: flex;
  align-items: center;
}
.home-logo {
  width: 116px;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0;
  transform: translateY(2px);
}
@media (max-width: 768px) {
  .home-logo {
    width: 74px;
  }
  .topbar-inner {
    padding: 0;
  }
}

/* Même bandeau Mnoria que l'index : cette page isolée ne charge pas style.css. */
.topbar.topbar--mnoria-uniform {
  height: 152px;
  min-height: 152px;
  max-height: 152px;
}
.topbar.topbar--mnoria-uniform .topbar-inner {
  height: 146px;
  min-height: 146px;
  max-height: 146px;
  padding: 0;
  box-sizing: border-box;
}
.topbar.topbar--mnoria-uniform .home-logo.home-logo--mnoria {
  width: 220px;
  max-width: 220px;
  height: 92px;
  max-height: 92px;
  object-fit: contain;
}
@media (max-width: 768px) {
  .topbar.topbar--mnoria-uniform {
    height: 102px;
    min-height: 102px;
    max-height: 102px;
  }
  .topbar.topbar--mnoria-uniform .topbar-inner {
    height: 96px;
    min-height: 96px;
    max-height: 96px;
  }
  .topbar.topbar--mnoria-uniform .home-logo.home-logo--mnoria {
    width: 128px;
    max-width: 128px;
    height: 96px;
    max-height: 96px;
  }
}
@media (display-mode: standalone) and (max-width: 768px) {
  .topbar.topbar--mnoria-uniform {
    height: calc(98px + env(safe-area-inset-top, 0px));
    min-height: calc(98px + env(safe-area-inset-top, 0px));
    max-height: calc(98px + env(safe-area-inset-top, 0px));
    padding-top: calc(1px + env(safe-area-inset-top, 0px));
  }
}

.het-body::after {
  content: "";
  display: block;
  height: 320px;
  background: #243038;
}

@media (max-width: 768px) {
  .het-body::after {
    height: clamp(400px, 44vh, 580px);
  }
}

.het-page {
  box-sizing: border-box;
  width: min(100% - 32px, 1100px);
  margin: 0 auto;
  /* Padding bas généreux : laisse scroller au-delà du bas du contenu plutôt
     que de s'arrêter pile dessus. */
  padding: 40px 0 180px;
}
/* En iframe (modale ouverte depuis l'accueil, cas d'usage réel de cette
   page) : même principe que .page-eclairages.in-iframe .ecl-page-shell —
   le padding-top "page autonome" (40px) laissait un grand vide au-dessus du
   cadre, la modale ayant déjà son propre espace en haut. */
.het-body.in-iframe .het-page {
  /* 20px (même marge que .qcm-page-shell/.ecl-page-shell en iframe) + 16px :
     ces pages sont des <main>, qui héritent en mobile d'un padding-top
     générique de style.css (main { padding: 16px 0 28px 0 }) que cette page
     isolée ne charge pas — reproduit ici en dur pour un total identique. */
  padding-top: 36px;
}
.het-body.in-iframe .het-panel {
  margin-top: 0;
}

.het-kicker {
  margin: 0 0 4px;
  color: #9cc3f0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
}

.het-title {
  margin: 0;
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: 40px;
  line-height: 1.05;
  color: #ffffff;
  text-align: center;
}

/* Panneau blanc unique — même visuel que .ecl-panel dans views/eclairages.html
   (fond blanc, coins arrondis, ombre portée) : les 3 catégories vivent
   maintenant dedans comme des blocs accordéon, plutôt que 3 cartes séparées
   posées directement sur le fond sombre de la page. */
.het-panel,
.het-panel * {
  box-sizing: border-box;
}
.het-panel {
  width: min(100% - 32px, 900px);
  margin: 24px auto 0;
  padding: 24px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  color: #111827;
}
.het-panel .het-title {
  color: #111827;
}
.het-panel .het-date {
  color: #6b7280;
}

.het-date {
  margin: 4px 0 24px;
  font-size: 15px;
  text-align: center;
}

/* Menu discret "jours précédents" — mêmes classes/valeurs que .ph-history*
   dans views/parallele-historique.html, dupliquées ici car cette page ne
   charge pas ce fichier (isolé, cf. en-tête de historical-events-test.css). */
.het-history {
  width: 100%;
  text-align: center;
  margin: 0 0 28px;
}
.het-history-toggle {
  display: block;
  width: fit-content;
  margin: 0 auto;
  border: none;
  background: none;
  padding: 4px 6px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.het-history-toggle:hover {
  color: #243038;
  text-decoration: underline;
}
.het-history-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}
.het-history-panel[hidden] {
  display: none;
}
.het-history-date {
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  color: #374151;
}
.het-history-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #f9fafb;
  color: #374151;
  font-size: 12px;
  cursor: pointer;
}
.het-history-arrow:hover:not(:disabled) {
  background: #eef3f6;
}
.het-history-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}
.het-history-today {
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #f9fafb;
  color: #374151;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.het-history-today:hover {
  background: #eef3f6;
}

.het-status {
  margin: 0 0 20px;
  color: #6b7280;
  font-size: 15px;
  text-align: center;
}
.het-loading-hourglass {
  display: inline-block;
  width: 28px;
  height: 28px;
  margin-right: 7px;
  vertical-align: middle;
  object-fit: contain;
  animation: hetHourglassSpin 0.9s linear infinite;
}
@keyframes hetHourglassSpin { to { transform: rotate(360deg); } }

.het-status.het-status-error {
  color: #fca5a5;
  font-weight: 700;
}

.het-status[hidden] {
  display: none;
}

/* Un bloc accordéon par catégorie (France/Europe/Monde), même visuel que les
   blocs .ecl-block de views/eclairages.html : replié par défaut, un seul
   ouvert à la fois, "Masquer" en bas du contenu déplié. Empilés verticalement
   dans le panneau blanc plutôt qu'en grille de cartes séparées. */
.het-cards {
  display: block;
}

.het-block + .het-block {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid #e5e7eb;
}

.het-block-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 6px 0;
  border: none;
  background: none;
  cursor: pointer;
  text-align: center;
}

.het-block-toggle-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #111827;
}

.het-block-toggle-title i {
  color: #f5b642;
}

.het-block-toggle:hover .het-block-toggle-title {
  color: #243038;
}

.het-block-chevron {
  color: #9ca3af;
  font-size: 15px;
  transition: transform 0.2s ease;
}

.het-block-toggle[aria-expanded="true"] .het-block-chevron {
  transform: rotate(180deg);
}

/* Bouton "Mémoriser" (cf. memorizeEvent dans historical-events-test-page.js) :
   en bas du contenu de chaque bloc, une fois le texte lu. Coloré une fois
   actif (cf. .is-active). */
.het-rubric-memorize-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  max-width: 320px;
  margin: 20px auto 0;
  padding: 13px 20px;
  border: 2px solid #243038;
  border-radius: 999px;
  background: #ffffff;
  color: #243038;
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.het-rubric-memorize-btn:hover {
  background: #f4f6f8;
}

.het-rubric-memorize-btn:active {
  transform: scale(0.98);
}

.het-rubric-memorize-btn.is-active {
  border-color: #f5b642;
  background: #f5b642;
  color: #243038;
}

.het-rubric-memorize-btn.is-active:hover {
  background: #f0aa27;
}

.het-memorize-explainer-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(17, 24, 39, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.het-memorize-explainer-modal {
  width: 100%;
  max-width: 400px;
  padding: 24px;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 20px 45px rgba(17, 24, 39, 0.25);
  text-align: center;
}

.het-memorize-explainer-text {
  margin: 0 0 20px;
  color: #243038;
  font-size: 15px;
  line-height: 1.5;
}

.het-memorize-explainer-qcm {
  width: 100%;
  margin: 0 0 10px;
  padding: 12px 20px;
  border: none;
  border-radius: 999px;
  background: #f5b642;
  color: #243038;
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
}

.het-memorize-explainer-qcm:hover {
  background: #f0aa27;
}

.het-memorize-explainer-close {
  width: 100%;
  padding: 12px 20px;
  border: none;
  border-radius: 999px;
  background: none;
  color: #6b7280;
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
}

.het-memorize-explainer-close:hover {
  color: #243038;
}

.het-block-content {
  margin-top: 16px;
}

.het-block-content[hidden] {
  display: none;
}

.het-block-collapse {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 24px;
  padding: 8px 0 0;
  border: none;
  border-top: 1px solid #e5e7eb;
  background: none;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.het-block-collapse:hover {
  color: #243038;
}

.het-card-figure {
  margin: 0 0 12px;
}

.het-card-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.het-card-image-meta {
  margin: 8px 0 0;
  color: #374151;
  font-size: 13px;
  line-height: 1.35;
}

.het-card-image-meta a {
  color: #516776;
  font-weight: 700;
  text-decoration: underline;
}

.het-card-body {
  padding: 14px 0 0;
}

.het-card-category {
  margin: 0 0 6px;
  color: #516776;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.het-card-year {
  margin: 0 0 4px;
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: 26px;
  color: #111827;
  line-height: 1;
}

.het-card-years-ago {
  margin: 0 0 10px;
  color: #9ca3af;
  font-size: 12px;
  font-style: italic;
}

.het-card-title {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  line-height: 1.25;
}

.het-card-summary-short {
  margin: 0 0 10px;
  color: #374151;
  font-size: 14px;
  line-height: 1.5;
}

.het-card-toggle {
  display: inline-block;
  margin: 0 0 10px;
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #f9fafb;
  color: #374151;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.het-card-toggle:hover {
  background: #eef3f6;
}

.het-card-more[hidden] {
  display: none;
}

.het-card-more-block {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f3f4f6;
}

.het-card-summary-long,
.het-card-why-it-matters {
  margin: 0;
  color: #374151;
  font-size: 13px;
  line-height: 1.5;
}

.het-card-summary-long + .het-card-why-it-matters {
  margin-top: 10px;
}

.het-card-anecdote {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff7ed;
  border: 1px dashed #fdba74;
  color: #7c2d12;
  font-size: 13px;
  line-height: 1.5;
}

.het-card-anecdote strong {
  display: block;
  margin-bottom: 4px;
  color: #c2410c;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.het-card-meta {
  margin: 0 0 6px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.4;
}

.het-card-meta strong {
  color: #374151;
}

.het-card-source-link {
  display: inline-block;
  margin-top: 8px;
  color: #516776;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
}

/* Desktop : plus de place par carte (340px de large, cartes centrées côte à
   côte) qu'en mobile — les tailles ci-dessus étaient calibrées pour le mobile,
   trop petites une fois affichées sur grand écran. */
@media (min-width: 901px) {
  .het-card-figure {
    width: min(100%, 560px);
    margin-left: auto;
    margin-right: auto;
  }
  .het-card-image {
    max-height: 315px;
    object-fit: cover;
  }
  .het-card-category {
    font-size: 13px;
  }
  .het-card-year {
    font-size: 30px;
  }
  .het-card-years-ago {
    font-size: 13px;
  }
  .het-card-title {
    font-size: 19px;
  }
  .het-card-summary-short {
    font-size: 16px;
  }
  .het-card-toggle {
    font-size: 14px;
  }
  .het-card-summary-long,
  .het-card-why-it-matters,
  .het-card-anecdote {
    font-size: 15px;
  }
  .het-card-anecdote strong {
    font-size: 12px;
  }
  .het-card-meta {
    font-size: 14px;
  }
  .het-card-image-meta {
    font-size: 14px;
  }
  .het-card-source-link {
    font-size: 14px;
  }
}

/* Dégradé + "suite ↓" en bas de page tant que du contenu dépasse en dessous
   (ex. un bloc catégorie déplié) — même principe que .page-scroll-fade-hint
   dans style.css (cf. attachPageScrollFadeHint), dupliqué ici car cette page
   ne charge pas script.js/style.css (fichier isolé, cf. en-tête du fichier). */
.het-scroll-fade-hint {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 6px;
  background: linear-gradient(180deg, transparent 0%, #ffffff 45%);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.2s ease;
  z-index: 500;
}
.het-scroll-fade-hint.is-hidden {
  opacity: 0;
  pointer-events: none;
}
.het-scroll-fade-hint-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 4px 10px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  pointer-events: auto;
  cursor: pointer;
}
.het-scroll-fade-hint-text:hover {
  color: #374151;
  border-color: #d1d5db;
}
