/* ============================================================
   TOEIC 4-Skills – Preparation page styles
   Fusionne : tests-langues.css + carrousel-preparation-toeic.css
            + toeic-4skills-presentation.css
   ============================================================ */

/* ── CANVAS & LAYOUT DE BASE ────────────────────────────────── */
canvas.webgl {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100vh;
  z-index: 0;
  pointer-events: none}
main { position: relative}

/* ── ENCADRÉ (guide d'apprentissage) ───────────────────────── */
.encadre {
  width: 100%;
  max-width: 800px;
  margin: 20px auto;
  padding: 20px;
  border-radius: 16px;
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 30px rgba(0,0,0,.1);
  box-sizing: border-box;
  border-left: 1px solid rgba(255,255,255,.3);
  border-right: 1px solid rgba(255,255,255,.3);
  position: relative;
  z-index: 10}

/* ── TITRE DU GUIDE ─────────────────────────────────────────── */
div.title-guide {
  font-size: 1.8rem;
  text-align: center;
  font-weight: 900;
  color: var(--accent-warm);
  position: relative;
  z-index: 10}

/* ── ACCORDION ──────────────────────────────────────────────── */
.accordion {
  display: block;
  width: 100%;
  padding: 15px 20px;
  margin-top: 1rem;
  margin-bottom: 5px;
  line-height: 1.5;
  cursor: pointer;
  border: 1px solid rgba(11,117,201,.1);
  outline: 0;
  background-color: #f7f9fc;
  color: #0b75c9;
  font-weight: 700;
  font-size: 1.1rem;
  text-align: left;
  border-radius: 5px;
  box-sizing: border-box;
  box-shadow: 0 2px 5px rgba(0,0,0,.05);
  position: relative;
  z-index: 10;
  word-wrap: break-word;
  transition: all .3s ease}
.accordion::after {
  content: '\25BC';
  font-size: .8rem;
  float: right;
  margin-left: 20px;
  transition: transform .3s ease;
  color: #0b75c9}
.accordion.active::after { transform: rotate(180deg)}
.accordion.active,
.accordion:hover {
  background-color: #e5f0ff;
  padding-left: 16px;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,.1)}

/* ── PANEL ──────────────────────────────────────────────────── */
.panel {
  display: block;
  max-height: 0;
  overflow: hidden;
  padding: 0 20px;
  
  border-right: 2px solid #e5f0ff;
  border-bottom: 2px solid #e5f0ff;
  border-radius: 0 0 5px 5px;
  margin-bottom: 10px;
  background-color: #fff;
  box-sizing: border-box;
  opacity: 0;
  position: relative;
  z-index: 10;
  transition: max-height .3s ease-out, opacity .3s ease-out, padding .3s ease-out}
.panel.active {
  max-height: 1000px;
  opacity: 1;
  padding: 15px 20px;
  transition: max-height .5s ease-in, opacity .3s ease-in, padding .3s ease-in}

/* ── LISTES ─────────────────────────────────────────────────── */
ol, ul { margin-left: 1.5rem; padding-left: 0}
li, p  { font-size: 1rem; margin-bottom: .4rem}

ul { list-style: none; padding-left: 2rem; margin: 0}
ul li { display: flex; align-items: center; margin-bottom: .4rem; font-size: 1rem}
ul li::before {
  content: "➜";
  display: inline-block;
  width: 1.2rem; height: 1.2rem; line-height: 1.2rem;
  border-radius: 50%;
  background-color: #0b75c9;
  color: #fff;
  text-align: center;
  margin-right: .5rem;
  flex-shrink: 0}

ol { counter-reset: my-counter; list-style: none; padding-left: 2rem; margin: 0}
ol li { counter-increment: my-counter; margin-bottom: .4rem; font-size: 1rem; position: relative}
ol li::before {
  content: counter(my-counter);
  display: inline-block;
  width: 1.2rem; height: 1.2rem; line-height: 1.2rem;
  border-radius: 50%;
  background-color: #0b75c9;
  color: #fff;
  text-align: center;
  margin-right: .5rem;
  font-weight: 700;
  flex-shrink: 0}

strong { font-weight: 600}
em     { color: #555}
.note  { font-style: italic; color: #444}
.emoji { font-size: 1.1rem}

/* ── DISCLAIMER ─────────────────────────────────────────────── */
.disclaimer {
  font-size: .85rem;
  color: #666;
  text-align: center;
  font-style: italic;
  max-width: 700px;
  margin: 20px auto 30px;
  padding: 0 10px;
  position: relative;
  z-index: 10}

/* ── NAV CARDS GRID ─────────────────────────────────────────── */
.nav-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  padding: 32px 16px 16px;
  box-sizing: border-box;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 10}

.nav-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 0;                 /* le padding passe sur .nav-card-link */
  background: #ffffff;
  border: 2px solid #e8e8e8;
  border-radius: 16px;
  text-decoration: none;
  color: #222;
  cursor: pointer;
  position: relative;
  overflow: visible;          /* permet au panneau conseil de se déployer */
  isolation: isolate;
  transition:
    transform  .25s cubic-bezier(.34,1.56,.64,1),
    box-shadow .25s ease,
    border-color .25s ease}

/* Le lien occupe toute la zone "carte" (icône + label) → grande zone de clic */
.nav-card .nav-card-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex: 1 1 auto;
  width: 100%;
  padding: 24px 16px 20px;
  text-decoration: none;
  color: inherit;
  border-radius: 16px 16px 0 0;
  position: static;          /* pour que ::after se cale sur .nav-card */
  z-index: 1}
/* Zone cliquable étendue : couvre toute la carte, du haut jusqu'au bouton.
   Le bouton "Conseil" et le panneau sont en z-index supérieur → cliquables. */
.nav-card .nav-card-link::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1}
.nav-card .card-tip-toggle { z-index: 2}
.nav-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--card-accent, #4f8ef7);
  opacity: 0;
  transition: opacity .25s ease;
  z-index: 0;
  pointer-events: none}
.nav-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 32px rgba(0,0,0,.13);
  border-color: var(--card-accent, #4f8ef7)}
.nav-card:hover::before { opacity: .07}

.nav-card svg,
.nav-card .card-label,
.nav-card .card-badge { position: relative; z-index: 1}

.nav-card svg {
  width: 64px; height: 64px;
  flex-shrink: 0;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1)}
.nav-card:hover svg { transform: scale(1.12) rotate(-2deg)}

.card-label {
  font-size: .88em;
  font-weight: 700;
  text-align: center;
  line-height: 1.35;
  letter-spacing: .01em;
  color: inherit}

.card-badge {
  position: absolute;
  top: 10px; right: 12px;
  background: var(--card-accent, #4f8ef7);
  color: #fff;
  font-size: .65em;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: .04em;
  text-transform: uppercase;
  z-index: 1}

/* ── INTRO DU HUB (bandeau opaque, lisible par-dessus le canvas WebGL) ── */
.hub-intro {
  position: relative;
  z-index: 10;
  max-width: 820px;
  margin: 16px auto 0;
  padding: 14px 22px;
  background: #ffffff;
  border: 1px solid #e8e8e8;
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(0,0,0,.07);
  box-sizing: border-box;
  text-align: center;
  color: #475569;
  font-size: 1rem;
  line-height: 1.6}
.hub-intro p { margin: 0; font-size: 1rem}

/* ── BOUTON « CONSEIL » DANS LA CARTE ───────────────────────── */
.nav-card .card-tip-toggle {
  position: relative;
  z-index: 2;
  margin: 0 0 16px;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  font-size: .8rem;
  font-weight: 700;
  color: #1e293b;
  background: #f1f5f9;
  border: 1px solid rgba(100,116,139,.3);
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease}
.nav-card .card-tip-toggle:hover {
  background: #fff;
  border-color: rgba(100,116,139,.55)}
.nav-card .card-tip-toggle.is-active {
  background: var(--card-accent, #4f8ef7);
  border-color: var(--card-accent, #4f8ef7);
  color: #fff}
.nav-card .card-tip-toggle .chev {
  font-size: .7rem;
  transition: transform .2s ease}
.nav-card .card-tip-toggle[aria-expanded="true"] .chev {
  transform: rotate(180deg)}

/* Le contenu source des conseils est dans des <template> : jamais affiché. */
.card-tip-tpl { display: none}

/* ── PANNEAU DÉDIÉ (sous la grille, vignettes immobiles) ────── */
.hub-tip-panel {
  position: relative;
  z-index: 10;
  max-width: 820px;
  margin: 12px auto 0;
  padding: 0;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.10);
  overflow: hidden;
  box-sizing: border-box}
.hub-tip-panel[hidden] { display: none}
.hub-tip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e8e8e8}
.hub-tip-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #1e293b}
.hub-tip-close {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background .15s ease, color .15s ease}
.hub-tip-close:hover { background: #eef2f7; color: #1e293b}
.hub-tip-body {
  padding: 16px 20px 18px;
  text-align: left;
  color: #334155;
  font-size: .98rem;
  line-height: 1.6}
.hub-tip-body p { margin: 0 0 10px; font-size: .98rem}
.hub-tip-body p:last-child { margin-bottom: 0}
.hub-tip-body a { color: #2563eb; font-weight: 700}
.hub-tip-body .note { color: #475569}
.hub-tip-body ol,
.hub-tip-body ul { margin: 8px 0 10px; padding-left: 1.5rem}
.hub-tip-body li { display: list-item; margin: 4px 0; font-size: .98rem}
.hub-tip-body ul { list-style: disc}
.hub-tip-body ul li::before { content: none}
.hub-tip-body ol { list-style: decimal; counter-reset: none}
.hub-tip-body ol li::before { content: none}

/* Couleurs d'accent par carte */
.nav-card.presentation  { --card-accent: #7c3aed}
.nav-card.grammar       { --card-accent: #0ea5e9}
.nav-card.vocabulary    { --card-accent: #10b981}
.nav-card.phonology     { --card-accent: #f59e0b}
.nav-card.timed-exam-lr { --card-accent: #ef4444}
.nav-card.timed-exam-sw { --card-accent: #ec4899}
.nav-card.task-training { --card-accent: #6366f1}
/* Échantillons gratuits : seule carte du hub à pointer HORS du paywall.
   Une ligne suffit — le badge, le voile ::before et la bordure au survol
   dérivent tous de --card-accent. */
.nav-card.free-samples  { --card-accent: #2563eb}

/* La vignette se comporte comme les autres au repos (bordure grise, fond blanc) :
   elle ne se distingue qu'au survol, comme toute la grille. Son seul marqueur
   permanent est le badge « FREE / GRATUIT », qui suffit à la signaler. */
/* Badge : sur les autres cartes il informe (« ×10 »), ici il porte l'argument.
   Il hérite déjà de --card-accent ; seul le poids est renforcé. */
.nav-card.free-samples .card-badge { font-weight: 900}

/* Animation d'entrée en cascade */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(22px)}
  to   { opacity: 1; transform: translateY(0)}
}
.nav-card              { animation: cardIn .45s ease both}
.nav-card:nth-child(1) { animation-delay: .05s}
.nav-card:nth-child(2) { animation-delay: .10s}
.nav-card:nth-child(3) { animation-delay: .15s}
.nav-card:nth-child(4) { animation-delay: .20s}
.nav-card:nth-child(5) { animation-delay: .25s}
.nav-card:nth-child(6) { animation-delay: .30s}
.nav-card:nth-child(7) { animation-delay: .35s}
.nav-card:nth-child(8) { animation-delay: .40s}
.nav-card:nth-child(9) { animation-delay: .45s}
.nav-card:nth-child(10){ animation-delay: .50s}
.nav-card:nth-child(11){ animation-delay: .55s}
.nav-card:nth-child(12){ animation-delay: .60s}
/* Filet de sécurité : toute carte au-delà de la 12e garde un délai plafonné,
   pour qu'une future carte non listée ne réapparaisse jamais désynchronisée
   (cause du bug initial : la 8e carte TOEIC n'avait aucun animation-delay). */
.nav-card:nth-child(n+13) { animation-delay: .60s}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .encadre { max-width: 90%; padding: 18px}
}
@media (max-width: 600px) {
  .encadre { max-width: 95%; padding: 15px; margin: 15px auto}
  h1       { font-size: 1.8rem}
  .nav-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 20px 12px 12px;
    width: 100%}
  .nav-card svg { width: 52px; height: 52px}
  .card-label   { font-size: .80em}
}
