/* ==========================================================================
   Sama Cours — textes de présentation et version texte des manuels
   (contenu lisible par les moteurs de recherche et sans JavaScript)
   ========================================================================== */

/* Phrase de présentation sous le titre des pages classe / matière / catalogue */
.page-intro {
  max-width: 62ch;
  line-height: 1.55;
}

/* -------------------- Version texte d'un manuel (remplacée par la mise en page complète) -------------------- */
.real-manual-text {
  max-width: 760px;
  margin: 0 auto;
  padding: 0.5rem 1.25rem 2.5rem;
  color: var(--color-text);
  font-size: 1rem;
  line-height: 1.65;
}

.real-manual-text h1 {
  margin: 0 0 0.3rem;
  font-size: 1.6rem;
  line-height: 1.25;
}

.real-manual-text h2 {
  margin: 1.6rem 0 0.5rem;
  font-size: 1.25rem;
}

.real-manual-text h3,
.real-manual-text h4 {
  margin: 1.2rem 0 0.4rem;
  font-size: 1.05rem;
}

.real-manual-text p {
  margin: 0 0 0.75rem;
}

.real-manual-text ul {
  margin: 0 0 0.9rem;
  padding-left: 1.3rem;
}

.real-manual-text-meta {
  color: var(--color-text-muted);
  font-size: 0.88rem;
}

/* -------------------- Document précédent / suivant (bulle d'informations du lecteur) -------------------- */
.viewer-sibling-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.85rem;
}

.viewer-sibling-links a {
  color: var(--color-primary-dark);
  font-weight: 600;
}

.viewer-sibling-links a:hover {
  text-decoration: underline;
}

/* -------------------- Accueil : le premier écran reste « élastique », la suite défile -------------------- */
/* style.css verrouille l'accueil sur la hauteur de la fenêtre (aucun défilement) et centre son
   contenu. Ce verrou passe ici du corps de la page au bloc .home-screen : le premier écran garde
   exactement les mêmes proportions, et la section placée dessous s'atteint en faisant défiler.
   (La boutique, qui partage ces règles, n'est pas concernée.) */
@media (min-width: 701px) and (min-height: 421px) {
  body.page-accueil {
    height: auto;
    overflow: visible;
  }

  body.page-accueil .app-layout {
    height: auto;
    min-height: calc(100vh - var(--header-height));
    min-height: calc(100dvh - var(--header-height));
  }

  body.page-accueil .main-content {
    display: block;
    overflow: visible;
  }

  body.page-accueil .page-content {
    display: block;
  }

  body.page-accueil .home-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100vh - var(--header-height));
    min-height: calc(100dvh - var(--header-height));
    height: auto;
    overflow: visible;   /* 24/10 : plus de verrou de hauteur, la page défile si les badges dépassent l écran */
  }
}

/* -------------------- Accueil : toutes les matières par classe -------------------- */
/* Tailles en rem : cette section ne suit pas la mise à l'échelle du premier écran. */
.home-links {
  margin: 0;
  padding: 2.5rem 0 3rem;
  font-size: 1rem;
}

.home-links h2 {
  margin: 0 0 0.4rem;
  font-size: 1.5rem;
}

.home-links-intro {
  max-width: 70ch;
  margin: 0 0 1.2rem;
  color: var(--color-text-muted);
  line-height: 1.55;
}

.home-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1.2rem 1.5rem;
}

.home-links-col h3 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
}

.home-links-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.3rem;
  font-size: 0.92rem;
}

.home-links-col a {
  color: var(--color-text);
}

.home-links-col a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* Mobile : les classes en deux colonnes, mêmes tailles de texte ; les intitulés trop longs sont tronqués (…) */
@media (max-width: 700px) {
  .home-links-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem 0.9rem; }
  .home-links-col { min-width: 0; }
  .home-links-col h3, .home-links-col li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .home-links-col li a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .home-links-col h3 a { display: inline; }
}

/* -------------------- Sous-onglets de série (Mathématiques de Terminale) -------------------- */
.series-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1.1rem;
}

.series-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.74rem;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.series-tab:hover {
  border-color: var(--classe-accent, var(--color-primary));
  color: var(--classe-accent, var(--color-primary-dark));
}

.series-tab.is-active {
  background: var(--classe-accent, var(--color-primary));
  border-color: var(--classe-accent, var(--color-primary));
  color: #fff;
}

/* -------------------- Titres des pages classe / matière / catalogue : plus discrets -------------------- */
.page-header h1 {
  font-size: clamp(1.05rem, 1rem + 0.35vw, 1.25rem);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.35rem;
}

.page-header .page-eyebrow {
  font-size: 0.7rem;
  margin-bottom: 0.1rem;
}

.page-header {
  margin-bottom: 1.25rem;
}

/* -------------------- Pied de page discret et page « Vie privée » -------------------- */
.site-footer {
  margin: 2rem auto 0;
  padding: 1rem 0 1.5rem;
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}
.site-footer a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.site-footer a:hover { color: var(--color-primary-dark); }
.site-footer span { margin: 0 0.4rem; }
.footer-social { margin: 0.6rem 0 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.35rem 0.9rem; }
.site-footer a.footer-social-link { display: inline-flex; align-items: center; gap: 0.3rem; text-decoration: none; font-weight: 600; color: var(--color-text); }
.footer-social-link svg { width: 1.15em; height: 1.15em; }
.footer-social-link.is-whatsapp svg { color: #1f9d55; }
.site-footer a.footer-social-link:hover { color: var(--color-primary-dark); text-decoration: underline; }

/* Encart « chaîne WhatsApp » de l'accueil (sous le premier écran) */
.wa-channel { display: flex; align-items: center; gap: 0.9rem; max-width: 60rem; margin: 1.2rem auto 0; padding: 0.85rem 1.1rem; border-radius: var(--radius-md, 12px);
  background: #e7f6ec; border: 1px solid #b9e4c7; color: #14532d; text-decoration: none; }
.wa-channel:hover { background: #dcf1e3; }
.wa-channel-ico { flex: none; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: #1f9d55; color: #fff; font-size: 1.3rem; }
.wa-channel-txt { flex: 1; display: grid; gap: 0.1rem; line-height: 1.3; }
.wa-channel-txt strong { font-size: 1rem; }
.wa-channel-txt span { font-size: 0.88rem; color: #2f6b45; }
.wa-channel-go { flex: none; padding: 0.45rem 0.9rem; border-radius: 999px; background: #1f9d55; color: #fff; font-weight: 700; font-size: 0.88rem; white-space: nowrap; }
/* Carrousel d'accueil « À la une » (02/11) : badges des recueils « 100 exercices par leçon » et du guide du concours des douanes,
   défilement horizontal animé (components/home-carousel.php, assets/js/home-carousel.js). Remplace l'ancienne bande .rc-promo. */
.hc { max-width: 72rem; margin: 1.3rem auto 0; }
.hc-head { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin: 0 0 0.4rem; padding: 0 0.3rem; }
.hc-title { margin: 0; font-size: 1.15rem; }
.hc-sub { flex: 1; min-width: 12rem; font-size: 0.85rem; color: var(--color-text-muted, #5b6b64); }
.hc-ctrl { display: flex; gap: 0.35rem; margin-left: auto; }
.hc-btn { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; padding: 0; border-radius: 50%; border: 1px solid var(--color-border, #d9d9d9); background: #fff; color: #14213d; font-size: 1.15rem; line-height: 1; cursor: pointer; transition: background .15s, border-color .15s, transform .15s; }
.hc-btn:hover { background: #14213d; border-color: #14213d; color: #fff; transform: scale(1.06); }
.hc-btn:focus-visible { outline: 2px solid #c9962b; outline-offset: 2px; }
.hc-pause { font-size: 0.62rem; letter-spacing: -1px; }
.hc-viewport { overflow-x: auto; overflow-y: hidden; padding: 0.55rem 0 0.9rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; cursor: grab;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 26px, #000 calc(100% - 26px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 26px, #000 calc(100% - 26px), transparent 100%); }
.hc-viewport::-webkit-scrollbar { display: none; }
.hc-viewport.is-dragging { cursor: grabbing; user-select: none; }
.hc-track { display: flex; gap: 0.9rem; width: max-content; margin: 0; padding: 0 0.5rem; list-style: none; }
.hc-item { flex: none; width: min(20rem, 82vw); }
.hc-card { position: relative; display: flex; flex-direction: column; gap: 0.55rem; height: 100%; padding: 1rem 1.05rem 0.9rem; border-radius: 16px; color: #fff; text-decoration: none; overflow: hidden; box-shadow: 0 6px 18px rgba(20, 33, 61, .22); transition: transform .25s ease, box-shadow .25s ease; user-select: none; -webkit-user-drag: none; }
.hc-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 36%, rgba(255, 255, 255, .2) 50%, transparent 64%); transform: translateX(-130%); transition: transform .8s ease; pointer-events: none; }
.hc-card:hover, .hc-card:focus-visible { transform: translateY(-4px); box-shadow: 0 12px 26px rgba(20, 33, 61, .32); }
.hc-card:hover::after, .hc-card:focus-visible::after { transform: translateX(130%); }
.hc-card--navy { background: linear-gradient(135deg, #14213d 0%, #1f3566 100%); border: 1px solid #c9962b; }
.hc-card--green { background: linear-gradient(135deg, #0b3d2e 0%, #0e6e4f 100%); border: 1px solid #e0b43c; }
.hc-badge { position: absolute; top: 0.85rem; right: 0.85rem; display: grid; place-items: center; align-content: center; width: 3.9rem; height: 3.9rem; border-radius: 50%; background: #c9962b; color: #14213d; text-align: center; line-height: 1; box-shadow: 0 0 0 4px rgba(255, 255, 255, .13); animation: hc-pulse 3.2s ease-in-out infinite; }
.hc-card--green .hc-badge { background: #ffc83d; }
.hc-badge strong { font-size: 1.15rem; font-weight: 800; }
.hc-badge span { margin-top: 0.12rem; font-size: 0.55rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.hc-body { display: grid; gap: 0.2rem; padding-right: 4.2rem; }
.hc-body em { font-style: normal; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #f1c96b; }
.hc-body strong { font-size: 1.08rem; line-height: 1.25; }
.hc-body span { font-size: 0.82rem; color: #dbe3f5; line-height: 1.35; }
.hc-go { align-self: flex-start; margin-top: auto; padding: 0.4rem 0.9rem; border-radius: 999px; background: #c9962b; color: #14213d; font-weight: 800; font-size: 0.82rem; transition: padding .2s; }
.hc-card--green .hc-go { background: #ffc83d; }
.hc-card:hover .hc-go { padding-right: 1.2rem; }
.hc-all { margin: 0; padding: 0 0.4rem; text-align: right; font-size: 0.85rem; }
.hc-all a { font-weight: 700; }
@keyframes hc-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@media (max-width: 520px) { .hc { margin-left: 0; margin-right: 0; } .hc-sub { display: none; } .hc-item { width: min(17.5rem, 80vw); } }
@media (prefers-reduced-motion: reduce) { .hc-badge { animation: none; } .hc-card, .hc-card::after, .hc-go { transition: none; } }
@media print { .hc { display: none; } }
/* Bande TikTok : même gabarit que la chaîne WhatsApp, aux couleurs sobres de TikTok (noir, touches turquoise et rose). */
.tt-channel { display: flex; align-items: center; gap: 0.9rem; max-width: 60rem; margin: 0.7rem auto 0; padding: 0.85rem 1.1rem; border-radius: var(--radius-md, 12px);
  background: #f3f4f6; border: 1px solid #d5d8de; color: #111827; text-decoration: none; }
.tt-channel:hover { background: #e9ebef; }
.tt-channel-ico { flex: none; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: #111; color: #fff; font-size: 1.3rem;
  box-shadow: -2px -2px 0 #25f4ee, 2px 2px 0 #fe2c55; }
.tt-channel-txt { flex: 1; display: grid; gap: 0.1rem; line-height: 1.3; }
.tt-channel-txt strong { font-size: 1rem; }
.tt-channel-txt span { font-size: 0.88rem; color: #4b5563; }
.tt-channel-go { flex: none; padding: 0.45rem 0.9rem; border-radius: 999px; background: #111; color: #fff; font-weight: 700; font-size: 0.88rem; white-space: nowrap; }
@media (max-width: 520px) { .wa-channel, .tt-channel { margin-left: 16px; margin-right: 16px; } .wa-channel-go, .tt-channel-go { display: none; } }

.legal { max-width: 46rem; margin: 0; line-height: 1.6; }
/* Page confidentialité : sans barre latérale, le texte restait collé à gauche sur grand écran — centré sur desktop. */
@media (min-width: 768px) {
  body.page-confidentialite .page-header, body.page-confidentialite .legal, body.page-conditions-vente .page-header, body.page-conditions-vente .legal { max-width: 46rem; margin-left: auto; margin-right: auto; }
}
.legal h2 { margin: 1.8rem 0 0.5rem; font-size: 1.2rem; }
.legal p, .legal ul { margin: 0 0 0.9rem; }
.legal ul { padding-left: 1.2rem; display: grid; gap: 0.3rem; }
.legal code { padding: 0.05rem 0.35rem; background: var(--color-primary-light); border-radius: 5px; font-size: 0.88em; }
.legal .legal-date { margin-top: 2rem; font-size: 0.82rem; color: var(--color-text-muted); }
.legal h2[id] { scroll-margin-top: 5rem; }
.legal h3 { margin: 1.3rem 0 0.4rem; font-size: 1.02rem; }
.legal-summary { padding: 0.9rem 1.1rem 0.3rem; margin-bottom: 1.2rem; background: var(--color-primary-light); border-radius: 12px; }
.legal-summary h2 { margin-top: 0; }
.legal-toc { margin-bottom: 1rem; }
.legal-toc p { margin-bottom: 0.3rem; }
.legal-toc ol { margin: 0; padding-left: 1.4rem; display: grid; gap: 0.15rem; }
.legal-table { width: 100%; border-collapse: collapse; margin: 0 0 1rem; font-size: 0.92rem; display: block; overflow-x: auto; }
.legal-table th, .legal-table td { padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--color-border, #e3e3e3); text-align: left; vertical-align: top; }
.legal-table th { font-weight: 600; background: var(--color-primary-light); }
.privacy-box { padding: 1rem 1.1rem; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.privacy-box[hidden] { display: none; }
.priv { display: grid; gap: 0.4rem; margin: 0 0 0.8rem; }
.priv div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.35rem 0; border-bottom: 1px dashed var(--color-border-strong); }
.priv dt { color: var(--color-text-muted); }
.priv dd { margin: 0; font-weight: 700; text-align: right; }
.priv-msg { margin: 0 0 0.8rem; padding: 0.5rem 0.7rem; border-radius: 8px; background: #e3f4e8; color: #1f7a4d; font-size: 0.9rem; }
.priv-msg[hidden] { display: none; }
.priv-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.priv-actions .btn { font-size: 0.88rem; }
@media (max-width: 700px) {
  .priv-actions .btn { flex: 1 1 100%; justify-content: center; }
  .site-footer { margin-top: 1rem; font-size: 0.78rem; }
}

/* Bloc replié « En savoir plus » sous le contenu utile d'une page (components/page-more.php) :
   fermé par défaut et discret ; le texte est dans le HTML, donc lu par Google. */
.page-more { margin: 2rem 0 0.5rem; border-top: 1px solid var(--color-border); padding-top: 0.9rem; color: var(--color-text-muted); }
.page-more > summary { display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer; list-style: none; font-size: 0.88rem; font-weight: 600; color: var(--color-text-muted); padding: 0.35rem 0; }
.page-more > summary::-webkit-details-marker { display: none; }
.page-more > summary::before { content: ""; width: 0.45rem; height: 0.45rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 0.2s ease; }
.page-more[open] > summary::before { transform: rotate(45deg); }
.page-more > summary:hover, .page-more > summary:focus-visible { color: var(--color-text); }
.page-more-body { max-width: 46rem; margin-top: 0.6rem; font-size: 0.92rem; line-height: 1.6; color: var(--color-text); }
.page-more-body h2 { margin: 1.2rem 0 0.4rem; font-size: 1rem; }
.page-more-body p, .page-more-body ul, .page-more-body ol { margin: 0 0 0.8rem; }
.page-more-body ul, .page-more-body ol { padding-left: 1.2rem; display: grid; gap: 0.3rem; }
.page-more-body a { color: var(--color-primary-dark); text-decoration: underline; text-underline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .page-more > summary::before { transition: none; } }
.page-more-time { display: inline-block; min-width: 3.4em; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--color-text-muted); }
.page-more-body blockquote { margin: 0 0 0.8rem; padding: 0.6rem 0.9rem; border-left: 3px solid var(--color-border-strong, var(--color-border)); background: var(--color-surface); border-radius: 0 8px 8px 0; font-style: italic; }
.page-more-body blockquote p { margin: 0; }

/* « Pour cette leçon » dans la bulle d'informations du lecteur (audit SEO 2.5, 17/10) : autres documents de la leçon, vidéo, quiz, banque. */
.viewer-lesson-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.82rem;
}
.viewer-lesson-title {
  flex-basis: 100%;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-light, #6b6b6b);
}
.viewer-lesson-links a {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-primary-dark);
  font-weight: 600;
  text-decoration: none;
  background: var(--color-surface, #fff);
}
.viewer-lesson-links a:hover { border-color: var(--color-primary-dark); text-decoration: underline; }
.viewer-lesson-links a[data-kind="video"]::before { content: "▶ "; }

/* Rubriques du site dans le pied de page (audit SEO 2.5) */
.site-footer .footer-explore {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.45rem;
  margin: 0 0 0.45rem;
  font-weight: 600;
}
