/* Guide/wiki stylesheet — deliberately separate from the app's Tailwind
   bundle (guide pages must not load the whole app, see ADR 0007). Values
   match the CURRENT brand tokens read from levoila-front/tailwind.config.js
   (plum-600/700 rebrand, DS 2026 / T-079).

   T-147 : gabarit v2 — layout deux colonnes (article + rail sticky), héros
   avant/après (slider signature Voilà, mécanique dans guide.js), cartes CTA
   claires (linen + bordure plum, jamais de fond sombre — règle DS), FAQ en
   accordéon natif, barre CTA sticky mobile, hub magazine. */

:root {
  --cream: #fafaf9;
  --linen: #ffffff;
  --paper: #e7e5e4;
  --highlight: #f3e8ff;
  --ink: #1c1917;
  --ink-soft: #57534e;
  --ink-faint: #78716c;
  --plum: #9333ea;
  --plum-hover: #7e22ce;
  --plum-border: rgba(147, 51, 234, 0.35);
  --success: #15803d;
  --shadow-soft: 0 1px 2px rgba(28, 27, 24, 0.04), 0 4px 16px rgba(28, 27, 24, 0.06);
  --shadow-lifted: 0 2px 6px rgba(28, 27, 24, 0.08), 0 12px 32px rgba(28, 27, 24, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--plum-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--plum);
}

img {
  max-width: 100%;
}

/* ── Header ─────────────────────────────────────────────────────────────── */

/* 18-08 (Romain) : même chrome que le header de la landing de l'app —
   fond crème flouté, bordure encre légère, rangée centrée max 1280,
   wordmark SVG à 24px. */
.guide-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 250, 249, 0.8); /* cream/80 */
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(28, 25, 23, 0.1);
}

.guide-header-row {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
}

.guide-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.guide-logo img {
  height: 24px;
  width: auto;
  display: block;
}

.guide-logo-dot {
  color: var(--plum);
}

.guide-header-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.guide-header-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
}

.guide-header-link:hover {
  color: var(--ink);
}

/* ── Boutons CTA ────────────────────────────────────────────────────────── */

.guide-cta-btn {
  display: inline-block;
  background: var(--plum);
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 22px;
  border-radius: 9999px;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s ease, transform 0.1s ease;
}

.guide-cta-btn:hover {
  background: var(--plum-hover);
  color: #ffffff;
}

.guide-cta-btn:active {
  transform: scale(0.97);
}

.guide-cta-btn-small {
  font-size: 13px;
  padding: 8px 16px;
}

/* ── Layout article ─────────────────────────────────────────────────────── */

.guide-main {
  max-width: 1140px;
  margin: 0 auto;
  padding: 32px 20px 72px;
}

.guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
}

.guide-aside {
  display: none;
}

@media (min-width: 1024px) {
  .guide-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .guide-aside {
    display: block;
  }

  .guide-aside-sticky {
    position: sticky;
    top: 84px;
    display: grid;
    gap: 20px;
  }
}

.guide-article {
  max-width: 760px;
  min-width: 0;
}

.guide-breadcrumb {
  font-size: 13px;
  color: var(--ink-faint);
  margin-bottom: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guide-breadcrumb a {
  color: var(--ink-soft);
  text-decoration: none;
}

.guide-breadcrumb a:hover {
  color: var(--plum-hover);
  text-decoration: underline;
}

.guide-breadcrumb-sep {
  margin: 0 4px;
}

h1 {
  font-weight: 800;
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 10px;
}

.guide-meta {
  font-size: 13px;
  color: var(--ink-faint);
  margin: 0 0 20px;
}

/* ── Héros avant/après (signature Voilà) ────────────────────────────────── */

.guide-hero {
  margin: 0 0 28px;
}

.reveal {
  position: relative;
  width: 100%;
  max-height: 560px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.reveal img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Avant que guide.js pose le clip inline : l'« après » plein cadre (le rendu
   vaut mieux qu'une photo terne si le JS ne charge pas). */
.reveal-after-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.reveal.is-animating .reveal-after-clip {
  transition: clip-path 1200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-tag {
  position: absolute;
  top: 12px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  backdrop-filter: blur(4px);
  z-index: 2;
}

.reveal-tag-before {
  left: 12px;
  background: rgba(28, 25, 23, 0.75);
}

.reveal-tag-after {
  right: 12px;
  background: rgba(147, 51, 234, 0.9);
}

.reveal-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(28, 27, 24, 0.18);
  z-index: 3;
}

.reveal.is-animating .reveal-handle {
  transition: left 1200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 9999px;
  background: var(--linen);
  color: var(--ink);
  cursor: ew-resize;
  box-shadow: var(--shadow-lifted);
}

.reveal-knob:focus-visible {
  outline: 2px solid var(--plum);
  outline-offset: 2px;
}

.guide-hero-caption {
  font-size: 13px;
  color: var(--ink-faint);
  margin-top: 8px;
  text-align: center;
}

/* ── Contenu ────────────────────────────────────────────────────────────── */

.guide-content h2 {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 44px 0 12px;
  scroll-margin-top: 84px;
}

.guide-content h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 28px 0 8px;
}

.guide-content p {
  margin: 0 0 16px;
}

.guide-content ul,
.guide-content ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.guide-content li {
  margin-bottom: 6px;
}

/* Tableaux : défilement horizontal contenu dans la carte (mobile). */
.guide-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 24px;
  font-size: 14px;
}

.guide-content th,
.guide-content td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--paper);
}

.guide-content th {
  font-weight: 700;
  background: var(--highlight);
}

@media (max-width: 640px) {
  .guide-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.guide-intro {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.guide-price-notice {
  font-size: 13px;
  color: var(--ink-soft);
  background: var(--highlight);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 0 0 24px;
}

/* ── Galerie d'appui (optionnelle) ──────────────────────────────────────── */

.guide-gallery {
  display: grid;
  gap: 12px;
  margin: 28px 0;
}

.guide-gallery-multi {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.guide-gallery-item {
  margin: 0;
}

.guide-gallery-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}

.guide-gallery-item figcaption {
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 6px;
}

/* ── Cartes CTA (règle DS : fond clair, accents plum) ───────────────────── */

.guide-cta-card {
  background: var(--linen);
  border: 1px solid var(--plum-border);
  border-radius: 18px;
  padding: 24px;
  margin: 36px 0;
  box-shadow: var(--shadow-soft);
}

.guide-cta-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--highlight);
  color: var(--plum-hover);
  margin-bottom: 12px;
}

.guide-cta-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}

.guide-cta-text {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 16px;
}

.guide-cta-card-compact {
  margin: 0;
  padding: 20px;
}

.guide-cta-card-compact .guide-cta-title {
  font-size: 16px;
}

.guide-cta-card-compact .guide-cta-btn {
  display: block;
}

.guide-cta-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--highlight);
  border-radius: 14px;
  padding: 14px 18px;
  margin: 32px 0;
}

.guide-cta-inline p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

/* ── Sommaire (rail latéral) ────────────────────────────────────────────── */

.guide-toc {
  background: var(--linen);
  border: 1px solid var(--paper);
  border-radius: 14px;
  padding: 16px 18px;
}

.guide-toc-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin: 0 0 8px;
}

.guide-toc ol {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
}

.guide-toc li {
  margin-bottom: 6px;
}

.guide-toc a {
  color: var(--ink-soft);
  text-decoration: none;
}

.guide-toc a:hover {
  color: var(--plum-hover);
  text-decoration: underline;
}

/* ── FAQ ────────────────────────────────────────────────────────────────── */

.guide-faq {
  margin: 40px 0 0;
}

.guide-faq h2 {
  font-size: 23px;
  margin: 0 0 14px;
}

.guide-faq-item {
  background: var(--linen);
  border: 1px solid var(--paper);
  border-radius: 14px;
  margin-bottom: 10px;
  overflow: hidden;
}

.guide-faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 15px 44px 15px 18px;
  font-weight: 700;
  font-size: 15px;
  position: relative;
}

.guide-faq-item summary::-webkit-details-marker {
  display: none;
}

.guide-faq-item summary::after {
  content: '';
  position: absolute;
  right: 18px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--ink-faint);
  border-bottom: 2px solid var(--ink-faint);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.15s ease;
}

.guide-faq-item[open] summary::after {
  transform: translateY(-30%) rotate(-135deg);
}

.guide-faq-answer {
  padding: 0 18px 16px;
  font-size: 14px;
  color: var(--ink-soft);
}

/* ── « À lire ensuite » + cartes du hub ─────────────────────────────────── */

.guide-related {
  border-top: 1px solid var(--paper);
  padding-top: 28px;
  margin-top: 40px;
}

.guide-related h2 {
  font-size: 20px;
  margin: 0 0 14px;
}

.guide-card-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.guide-card {
  display: flex;
  flex-direction: column;
  background: var(--linen);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.guide-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lifted);
  color: var(--ink);
}

.guide-card-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  background: var(--paper);
}

.guide-card-img-empty {
  background: linear-gradient(135deg, var(--highlight), var(--paper));
}

.guide-card-body {
  display: block;
  padding: 14px 16px 16px;
}

.guide-card-title {
  display: block;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
  margin-bottom: 6px;
}

.guide-card:hover .guide-card-title {
  color: var(--plum-hover);
}

.guide-card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  color: var(--ink-soft);
}

/* ── Hub ────────────────────────────────────────────────────────────────── */

.guide-hub-hero {
  display: grid;
  gap: 28px;
  align-items: center;
  margin-bottom: 40px;
}

@media (min-width: 900px) {
  .guide-hub-hero {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 48px;
  }
}

.guide-eyebrow {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--plum-hover);
  margin: 0 0 10px;
}

.guide-hub-hero h1 {
  margin-bottom: 12px;
}

.guide-hub-hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.guide-hub-hero-hint {
  font-size: 13px;
  color: var(--ink-faint);
}

.guide-hub-hero .guide-hero {
  margin: 0;
}

.guide-hub-section {
  margin: 44px 0 0;
}

.guide-hub-section h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}

.guide-card-grid-3 {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

/* Bloc « Ils sont sur Voilà » injecté par server.mjs (liste simple). */
.guide-related ul {
  margin: 0;
  padding-left: 20px;
}

/* ── Barre CTA sticky (mobile) ──────────────────────────────────────────── */

.guide-stickybar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--paper);
  box-shadow: 0 -4px 16px rgba(28, 27, 24, 0.08);
  transform: translateY(105%);
  transition: transform 0.25s ease;
}

.guide-stickybar.is-visible {
  transform: translateY(0);
}

.guide-stickybar-text {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.guide-stickybar .guide-cta-btn {
  flex-shrink: 0;
}

/* Le rail latéral porte déjà le CTA permanent en desktop. */
@media (min-width: 1024px) {
  .guide-stickybar {
    display: none;
  }
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

.guide-footer {
  border-top: 1px solid var(--paper);
  background: var(--linen);
  text-align: center;
  padding: 32px 20px 44px;
}

.guide-footer-brand {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 14px;
}

.guide-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  font-size: 13px;
}

.guide-footer-links a {
  color: var(--ink-faint);
  text-decoration: none;
}

.guide-footer-links a:hover {
  color: var(--plum-hover);
  text-decoration: underline;
}

/* ── Divers ─────────────────────────────────────────────────────────────── */

@media (max-width: 540px) {
  .guide-main {
    padding: 24px 16px 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal.is-animating .reveal-after-clip,
  .reveal.is-animating .reveal-handle,
  .guide-stickybar,
  .guide-card {
    transition: none;
  }
}
