@tailwind base;
@tailwind components;
@tailwind utilities;

/* Champs de formulaire du back-office */
@layer components {
  .admin-field {
    @apply w-full border border-gray-300 rounded-lg text-sm transition focus:ring-2 focus:ring-lime-200 focus:border-lime-500 focus:outline-none;
  }
  .admin-input    { @apply admin-field h-10 px-3; }
  .admin-textarea { @apply admin-field px-3 py-2; }
  .admin-select   { @apply admin-field h-10 pl-3 pr-9 bg-white appearance-none cursor-pointer; }
}

/* Système des pages publiques. Échelle typo : 12 · 14 · 16 · 18 · 20 · 36 · 48 · 72.
   Espacement : 4 · 8 · 16 · 24 · 32 · 48 · 64 · 96. */
@layer components {
  .page-section   { @apply py-16 md:py-24; }
  .page-container { @apply max-w-7xl mx-auto px-6 lg:px-8; }

  .eyebrow         { @apply font-display text-xs font-medium uppercase tracking-[0.08em] text-dark-500; }
  .eyebrow-inverse { @apply font-display text-xs font-medium uppercase tracking-[0.08em] text-dark-300; }
  .section-title   { @apply font-display font-bold text-dark-900; font-size: clamp(2.25rem, 4.5vw, 4rem); line-height: 1.02; letter-spacing: -0.035em; }
  .section-lead    { @apply text-lg leading-relaxed text-dark-600; }

  .surface-card { @apply rounded-2xl bg-white p-8 ring-1 ring-dark-900/5; }
}

/* ── Home : effets éditoriaux ─────────────────────────────────────────── */

/* Grain : texture de bruit très légère sur les sections sombres */
.grain {
  position: relative;
  isolation: isolate;
}

.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(/%23n)'/%3E%3C/svg%3E");
}

/* Révélation mot par mot (split_reveal_controller) */
.split .split-word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.split .split-inner {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 600ms var(--ease-out);
  transition-delay: calc(var(--i) * 30ms);
}

.split.is-in .split-inner {
  transform: translateY(0);
}


/* Bandeau qui défile, légèrement incliné */
.ticker {
  transform: rotate(-1.5deg) scale(1.02);
}

.ticker-track {
  animation: marquee 40s linear infinite;
}

.ticker-track--reverse {
  animation-direction: reverse;
}

/* Cartes empilées : chaque carte se colle en haut et la suivante vient la recouvrir */
.stack-card {
  position: sticky;
  top: calc(6rem + var(--i) * 1.25rem);
}

/* Ligne qui se trace avec le défilement (--progress posé par scroll_fx_controller) */
.draw-line {
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
}

/* Texte fantôme qui glisse avec le défilement */
.ghost-text {
  -webkit-text-stroke: 1px rgba(33, 33, 33, 0.12);
  color: transparent;
  transform: translateX(calc((0.5 - var(--progress, 0.5)) * 30vw));
  will-change: transform;
}

/* Carte de ciblage sur fond sombre */
.targeting-map--dark .targeting-parcel[data-state="base"] { fill: #2d2d33; }
.targeting-map--dark .targeting-parcel[data-state="off"] { fill: #2a2a30; opacity: 0.6; }
.targeting-map--dark .targeting-parcel[data-state="on-1"],
.targeting-map--dark .targeting-parcel[data-state="on-2"],
.targeting-map--dark .targeting-parcel[data-state="on-3"] { fill: #c0cf23; }
.targeting-map--dark .targeting-scan { fill: rgba(192, 207, 35, 0.7); }
.targeting-map--dark .targeting-count { color: #fff; }
.targeting-map--dark .targeting-criterion { border-color: rgba(255, 255, 255, 0.12); background-color: rgba(255, 255, 255, 0.04); color: #b8b8c0; }
.targeting-map--dark .targeting-criterion[data-active="true"] { border-color: #c0cf23; background-color: rgba(192, 207, 35, 0.12); color: #fff; }
.targeting-map--dark .targeting-criterion[data-active="true"] svg { color: #c0cf23; }
.targeting-map--dark figcaption { color: #91919d; }

/* Carte des modes de ciblage : un état par mode, piloté par targeting_modes_controller */
.tm-parcel {
  fill: #e4e6dc;
  stroke: transparent;
  stroke-width: 3;
  transition: fill 500ms var(--ease-out), stroke 300ms ease-out;
}

.tm[data-mode="contextual"] .tm-parcel[data-crop="a"] { fill: #c0cf23; }
.tm[data-mode="contextual"] .tm-parcel[data-crop="b"] { fill: #f4f6c9; }
.tm[data-mode="geolocated"] .tm-parcel[data-in="1"] { fill: #c0cf23; }
.tm[data-mode="retargeting"] .tm-parcel[data-visited="1"] { fill: #c0cf23; stroke: #636d13; }
.tm[data-mode="weather"] .tm-parcel { fill: #c0cf23; transition-delay: calc(var(--col) * 50ms); }

.tm-radius,
.tm-pin {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0.3);
  transition: opacity 300ms ease-out, transform 700ms var(--ease-out);
}

.tm[data-mode="geolocated"] .tm-radius,
.tm[data-mode="geolocated"] .tm-pin {
  opacity: 1;
  transform: scale(1);
}

.tm-weather {
  opacity: 0;
  transition: opacity 300ms ease-out;
}

.tm[data-mode="weather"] .tm-weather { opacity: 1; }

.tm-label { display: none; }
.tm[data-mode="contextual"] .tm-label[data-mode="contextual"],
.tm[data-mode="geolocated"] .tm-label[data-mode="geolocated"],
.tm[data-mode="retargeting"] .tm-label[data-mode="retargeting"],
.tm[data-mode="weather"] .tm-label[data-mode="weather"] { display: inline; }

/* Illustrations des problèmes : se dessinent quand le bloc apparaît (.reveal.visible) */
.ill-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.ill-pop {
  transform: scale(0);
  transform-box: fill-box;
  transform-origin: center;
}

.ill-grow {
  transform: scaleY(0);
  transform-box: fill-box;
  transform-origin: bottom;
}

.ill-drop {
  opacity: 0;
  transform: translateY(-18px);
}

/* Boucle de 3 s : l'illustration se joue, tient, puis recommence */
.reveal.visible .ill-draw { animation: ill-draw 3s var(--ease-out) infinite; animation-delay: calc(var(--d, 0ms) * 0.7); }
.reveal.visible .ill-pop  { animation: ill-pop 3s cubic-bezier(0.34, 1.56, 0.64, 1) infinite; animation-delay: calc(var(--d, 0ms) * 0.7); }
.reveal.visible .ill-grow { animation: ill-grow 3s var(--ease-out) infinite; animation-delay: calc(var(--d, 0ms) * 0.7); }
.reveal.visible .ill-drop { animation: ill-drop 3s var(--ease-out) infinite; animation-delay: calc(var(--d, 0ms) * 0.7); }

@keyframes ill-draw { 0% { stroke-dashoffset: 1; } 25%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes ill-pop  { 0% { transform: scale(0); } 12%, 85% { transform: scale(1); } 100% { transform: scale(0); } }
@keyframes ill-grow { 0% { transform: scaleY(0); } 20%, 85% { transform: scaleY(1); } 100% { transform: scaleY(0); } }
@keyframes ill-drop { 0% { opacity: 0; transform: translateY(-18px); } 15%, 75% { opacity: 1; transform: translateY(0); } 90%, 100% { opacity: 0; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  .ill-draw { stroke-dashoffset: 0; }
  .ill-pop { transform: none; }
  .ill-grow { transform: none; }
  .ill-drop { opacity: 1; transform: none; }
  .reveal.visible :is(.ill-draw, .ill-pop, .ill-grow, .ill-drop) { animation: none; }
}

/* Maquettes des héros : les éléments arrivent l'un après l'autre, en boucle de 6 s.
   Les délais --d posés dans les vues sont compressés pour un démarrage rapide. */
.sms-bubble {
  opacity: 0;
  transform: translateY(10px);
  animation: sms-in 6s var(--ease-out) infinite;
  animation-delay: calc(var(--d, 0s) * 0.55 + 0.15s);
}

@keyframes sms-in {
  0% { opacity: 0; transform: translateY(10px); }
  6%, 80% { opacity: 1; transform: translateY(0); }
  88%, 100% { opacity: 0; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .sms-bubble { animation: none; opacity: 1; transform: none; }
}

/* Lien avec soulignement qui s'étend */
.link-grow {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-size: 100% 2px;
  background-position: 0 100%;
  transition: background-size var(--duration-base) var(--ease-out);
}

.link-grow:hover {
  background-size: 100% 0.35em;
  background-position: 0 90%;
}

/* Couverture de magazine posée de trois quarts */
.cover-tilt {
  transform: perspective(1200px) rotateY(-14deg) rotateX(4deg);
  box-shadow:
    30px 40px 60px -30px rgba(33, 33, 33, 0.45),
    inset -2px 0 4px rgba(0, 0, 0, 0.15);
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  .tm-parcel, .tm-radius, .tm-pin { transition: none; }
  .ghost-text { transform: none; }
  .draw-line { transform: none; }
}

/* Base styles */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Rythme des animations : une seule courbe de décélération, trois durées */
:root {
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 500ms;
}

/* Focus clavier visible partout (le clic souris n'affiche pas d'anneau) */
@layer base {
  h1, h2, h3 {
    text-wrap: balance;
  }

  /* Titres en Outfit, texte courant en Inter */
  h1, h2, h3, h4 {
    font-family: 'Outfit', 'Inter', system-ui, sans-serif;
  }

  [data-theme="nexio"] :is(h1, h2, h3, h4) {
    font-family: inherit;
  }

  p {
    text-wrap: pretty;
  }

  a:focus-visible,
  button:focus-visible,
  [role="button"]:focus-visible,
  summary:focus-visible {
    outline: 2px solid #636d13;
    outline-offset: 3px;
    border-radius: 0.5rem;
  }

  .bg-dark-900 :focus-visible,
  .bg-dark-950 :focus-visible,
  #navbar :focus-visible {
    outline-color: #c0cf23;
  }
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #ffffff;
  color: #212121;
}

/* Scroll animations */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger-1 { transition-delay: 40ms; }
.stagger-2 { transition-delay: 80ms; }
.stagger-3 { transition-delay: 120ms; }
.stagger-4 { transition-delay: 160ms; }
.stagger-5 { transition-delay: 200ms; }
.stagger-6 { transition-delay: 240ms; }
.stagger-7 { transition-delay: 280ms; }
.stagger-8 { transition-delay: 320ms; }

/* Stat numbers */
.stat-number {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

/* Marquee */
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.marquee-track {
  animation: marquee 35s linear infinite;
}

.marquee-track:hover {
  animation-play-state: paused;
}

/* Card hover */
.card-hover {
  transition:
    transform var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out);
}

.card-hover:hover {
  box-shadow: 0 12px 32px -20px rgba(33, 33, 33, 0.25);
}

/* Nav */
.nav-blur {
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.nav-scrolled {
  background: rgba(21, 21, 23, 0.95);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, #c0cf23 0%, #9ab01a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Boutons : survol = légère élévation, appui = retour au sol, désactivé = atténué */
.btn-primary,
.btn-secondary,
.btn-dark {
  transition:
    background-color var(--duration-fast) ease-out,
    box-shadow var(--duration-base) var(--ease-out),
    transform var(--duration-base) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn-primary {
  background-color: #c0cf23;
  color: #212121;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 1px 2px rgba(33, 33, 33, 0.08);
}



.btn-primary:hover {
  background-color: #a7b51c;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 1px 2px rgba(33, 33, 33, 0.08);
}

.btn-secondary {
  background-color: #eeeef0;
  color: #212121;
}

.btn-secondary:hover {
  background-color: #d9d9de;
}

.btn-dark {
  background-color: #212121;
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(33, 33, 33, 0.2);
}

.btn-dark:hover {
  background-color: #434349;
}

.btn-primary:active,
.btn-secondary:active,
.btn-dark:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 1px 2px rgba(33, 33, 33, 0.12);
  transition-duration: 80ms;
}

.btn-primary:disabled,
.btn-dark:disabled,
.btn-primary[aria-disabled="true"],
.btn-dark[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Hero gradient mesh */
.hero-mesh {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(ellipse 100% 80% at 60% 0%, rgba(192, 207, 35, 0.08), transparent 50%),
    radial-gradient(ellipse 80% 60% at 100% 50%, rgba(192, 207, 35, 0.05), transparent 50%);
}

/* Trame de points discrète, fondue vers le bas */
.hero-mesh::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgba(33, 33, 33, 0.09) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 30%, transparent 75%);
}

/* Les halos flous des heros dérivent lentement */
.hero-mesh > .blur-3xl {
  animation: ambient-drift 22s ease-in-out infinite alternate;
}

.hero-mesh > .blur-3xl:nth-of-type(2n) {
  animation-duration: 28s;
  animation-direction: alternate-reverse;
}

@keyframes ambient-drift {
  0% { translate: 0 0; scale: 1; }
  50% { translate: -40px 30px; scale: 1.08; }
  100% { translate: 30px -20px; scale: 0.96; }
}


/* Diagonal section */
.diagonal-section {
  clip-path: polygon(0 5%, 100% 0, 100% 100%, 0 100%);
  margin-top: -5%;
  padding-top: calc(5% + 5rem);
}

/* Stats card glow */
.stats-card {
  box-shadow:
    0 0 0 1px rgba(192, 207, 35, 0.1),
    0 25px 50px -12px rgba(0, 0, 0, 0.1);
}

/* Book/Magazine shadow */
.book-shadow {
  box-shadow:
    8px 8px 20px rgba(0, 0, 0, 0.25),
    4px 4px 8px rgba(0, 0, 0, 0.15),
    inset -2px 0 4px rgba(0, 0, 0, 0.1);
  transform: perspective(1000px) rotateY(-2deg);
  transition:
    transform var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out);
}


/* Floating animation */
@keyframes float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -6px; }
}

.float {
  animation: float 8s ease-in-out infinite;
}

/* Carte de ciblage : chaque critère activé ne garde allumées que les parcelles qui le remplissent */
.targeting-parcel {
  fill: #eeeef0;
  transition: fill 450ms var(--ease-out), opacity 450ms var(--ease-out);
}

.targeting-parcel[data-state="base"] { fill: #e4e6dc; }
.targeting-parcel[data-state="on-1"],
.targeting-parcel[data-state="on-2"],
.targeting-parcel[data-state="on-3"] { fill: #c0cf23; }
.targeting-parcel[data-state="off"] { fill: #eeeef0; opacity: 0.55; }

.targeting-scan {
  fill: rgba(167, 181, 28, 0.55);
  opacity: 0;
}

.targeting-scan.is-scanning {
  animation: targeting-scan 650ms ease-in-out;
}

@keyframes targeting-scan {
  0% { opacity: 0; translate: 0 0; }
  15%, 85% { opacity: 1; }
  100% { opacity: 0; translate: 368px 0; }
}

.targeting-criterion {
  transition: border-color var(--duration-base) ease-out, background-color var(--duration-base) ease-out, color var(--duration-base) ease-out;
}

.targeting-criterion svg {
  opacity: 0.25;
  transition: opacity var(--duration-base) ease-out;
}

.targeting-criterion[data-active="true"] {
  border-color: #c0cf23;
  background-color: #fafbe8;
  color: #212121;
}

.targeting-criterion[data-active="true"] svg {
  opacity: 1;
  color: #636d13;
}

/* Point « en direct » des badges : halo fixe, sans clignotement */
.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background-color: #a7b51c;
  box-shadow: 0 0 0 4px rgba(192, 207, 35, 0.22);
}



/* Page 404 : le tracteur traverse le champ et trace les sillons derrière lui */
.nf-tractor {
  animation: nf-drive 9s linear infinite;
}

.nf-furrow {
  stroke-dasharray: 800;
  stroke-dashoffset: 800;
  animation: nf-plough 9s linear infinite;
}

.nf-wheel {
  transform-box: fill-box;
  transform-origin: center;
  animation: nf-spin 1.2s linear infinite;
}

@keyframes nf-drive {
  from { transform: translateX(-120px); }
  to { transform: translateX(880px); }
}

@keyframes nf-plough {
  0%, 12% { stroke-dashoffset: 800; }
  92%, 100% { stroke-dashoffset: 0; }
}

@keyframes nf-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .nf-tractor { animation: none; transform: translateX(560px); }
  .nf-furrow { animation: none; stroke-dashoffset: 240; }
  .nf-wheel { animation: none; }
}

/* Mouvement réduit : le contenu apparaît sans glisser, rien ne flotte ni ne défile */
@media (prefers-reduced-motion: reduce) {
  .reveal { transform: none; transition: opacity var(--duration-base) linear; }
  .float,
  .marquee-track,
  .hero-mesh > .blur-3xl { animation: none; }
  .card-hover:hover,
  .book-shadow:hover,
  .selection-card:hover,
  .btn-primary:hover,
  .btn-dark:hover { transform: none; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #f7f7f8; }
::-webkit-scrollbar-thumb { background: #d9d9de; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #b8b8c0; }

/* ══════════════════════════════════════════════════════════════
   CONFIGURATOR STYLES
   ══════════════════════════════════════════════════════════════ */

/* Step indicator */
.step-indicator {
  transition:
    background-color var(--duration-base) var(--ease-out),
    color var(--duration-base) var(--ease-out),
    transform var(--duration-base) var(--ease-out);
}

.step-indicator.active {
  transform: scale(1.05);
}

/* Form steps */
.form-step {
  display: none;
  animation: fadeInStep 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-step.active {
  display: block;
}

@keyframes fadeInStep {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Selection cards */
.selection-card {
  transition:
    border-color var(--duration-fast) ease-out,
    background-color var(--duration-fast) ease-out,
    box-shadow var(--duration-base) var(--ease-out),
    transform var(--duration-base) var(--ease-out);
  cursor: pointer;
}

.selection-card:active {
  transform: scale(0.98);
}

.selection-card:hover {
  border-color: #c0cf23;
}

.selection-card.selected {
  border-color: #c0cf23;
  background: #fafbe8;
  box-shadow: 0 0 0 2px #c0cf23;
}

.selection-card.selected .check-icon {
  opacity: 1;
  transform: scale(1);
}

.check-icon {
  opacity: 0;
  transform: scale(0.5);
  transition:
    opacity var(--duration-fast) ease-out,
    transform var(--duration-base) cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Range slider */
input[type="range"] {
  -webkit-appearance: none;
  height: 8px;
  background: #eeeef0;
  border-radius: 4px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  background: #c0cf23;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(192, 207, 35, 0.4);
  transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
  width: 28px;
  height: 28px;
  background: #c0cf23;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 12px rgba(192, 207, 35, 0.4);
}

/* France departments map */
.departement {
  fill: #eeeef0;
  stroke: #ffffff;
  stroke-width: 1;
  transition: fill var(--duration-fast) ease-out;
  cursor: pointer;
}

.departement:hover {
  fill: #dde656;
}

.departement.selected {
  fill: #c0cf23;
}

/* Region groups - subtle region borders */
.region {
  stroke: #d9d9de;
  stroke-width: 0.5;
}

/* Form inputs */
.form-input {
  transition:
    border-color var(--duration-fast) ease-out,
    box-shadow var(--duration-fast) ease-out;
}

.form-input:focus {
  border-color: #a7b51c;
  box-shadow: 0 0 0 3px rgba(192, 207, 35, 0.25);
}
/* Blog article body — styles appliques au HTML rendu depuis le Markdown
   (BlogPosts::MarkdownRenderer).
   Optimise pour la lecture : 19-20px de base, line-height genereux, espacements aeres. */
.article-content {
  @apply text-gray-700;
  font-size: 1.1875rem;       /* 19px */
  line-height: 1.75;
}
.article-content > *:first-child { margin-top: 0; }
.article-content > * + * { @apply mt-6; }
.article-content h1 { @apply text-4xl font-bold text-gray-900 mt-14 mb-5 leading-tight tracking-tight; }
.article-content h2 { @apply text-3xl font-bold text-gray-900 mt-12 mb-5 leading-tight tracking-tight; }
.article-content h3 { @apply text-2xl font-bold text-gray-900 mt-10 mb-4 leading-snug; }
.article-content h4 { @apply text-xl font-bold text-gray-900 mt-8 mb-3; }

/* Anchor links sur les headings (visibles au hover du heading) */
.article-content h2,
.article-content h3,
.article-content h4 {
  position: relative;
  scroll-margin-top: 100px; /* compense la navbar fixed lors d'un saut #anchor */
}
.article-content .anchor-link {
  @apply text-gray-300 hover:text-lime-600 ml-2 font-normal no-underline;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.article-content h2:hover .anchor-link,
.article-content h3:hover .anchor-link,
.article-content h4:hover .anchor-link,
.article-content .anchor-link:focus {
  opacity: 1;
}

/* Drop cap (lettrine) sur le premier paragraphe du premier wrapper.
   Span injecte cote serveur par BlogPosts::ContentDecorator. */
.article-content.has-drop-cap .drop-cap {
  @apply text-gray-900 font-bold;
  font-size: 4.5rem;
  line-height: 0.85;
  float: left;
  margin: 0.25rem 0.75rem 0 0;
  padding: 0;
}
.article-content p  { line-height: 1.75; }
.article-content a  { @apply text-lime-700 underline underline-offset-4 decoration-lime-300 hover:text-lime-800 hover:decoration-lime-500; }
.article-content strong { @apply text-gray-900 font-semibold; }
.article-content ul, .article-content ol { @apply pl-6 space-y-2; }
.article-content ul { @apply list-disc; }
.article-content ol { @apply list-decimal; }
.article-content li { line-height: 1.7; }
.article-content blockquote {
  @apply border-l-4 border-lime-400 pl-5 italic text-gray-600 my-8;
  font-size: 1.25rem;
}
.article-content img,
.article-content figure {
  @apply rounded-lg my-8 max-w-full h-auto;
}
.article-content figcaption { @apply text-sm text-gray-500 italic text-center mt-2; }
.article-content pre {
  @apply bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto text-sm my-8;
}
.article-content code {
  @apply bg-gray-100 text-gray-800 px-1.5 py-0.5 rounded text-sm font-mono;
}
.article-content pre code { @apply bg-transparent text-gray-100 p-0; }
.article-content hr { @apply border-gray-200 my-10; }
.article-content table {
  @apply w-full text-left border-collapse my-8;
  font-size: 1rem;
}
.article-content thead th { @apply bg-gray-50 text-gray-900 font-semibold border-b-2 border-gray-200 px-4 py-3; }
.article-content tbody td { @apply border-b border-gray-100 px-4 py-3 align-top; }


/* ============================================================
   Theme Nexio — scope a [data-theme="nexio"] (page /etudes only)
   Bascule la palette lime DPS vers le gradient cyan/violet Nexio
   et adapte le contenu light vers un fond dark Nexio.
   Place a la fin du fichier pour gagner la cascade contre les
   utilities Tailwind a specificite egale.
   ============================================================ */

[data-theme="nexio"] {
  background: #0B0B14;
  color: #fff;
  position: relative;
  overflow-x: hidden;
}

/* Grille subtile en arriere-plan */
[data-theme="nexio"]::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(124, 58, 237, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 183, 224, 0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}
/* Le ::before grid est en z-index: 0, le contenu naturel passe au-dessus sans override. */

/* --- Override gradient-text (defini en lime plus haut) en gradient Nexio --- */
[data-theme="nexio"] .gradient-text {
  background: linear-gradient(135deg, #00B7E0 0%, #7C3AED 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* --- Accents lime DPS -> gradient/teintes Nexio --- */
[data-theme="nexio"] .text-lime-400,
[data-theme="nexio"] .text-lime-500,
[data-theme="nexio"] .text-lime-700 { color: #A78BFA; }
[data-theme="nexio"] .text-lime-600 { color: #00B7E0; }

[data-theme="nexio"] .bg-lime-400,
[data-theme="nexio"] .bg-lime-500 { background: linear-gradient(135deg, #00B7E0 0%, #7C3AED 100%); color: white; }
[data-theme="nexio"] .hover\:bg-lime-300:hover,
[data-theme="nexio"] .hover\:bg-lime-600:hover { background: linear-gradient(135deg, #33C6E6 0%, #9333EA 100%); }
[data-theme="nexio"] .bg-lime-400\/5  { background-color: rgba(124, 58, 237, 0.08); }
[data-theme="nexio"] .bg-lime-400\/10 { background-color: rgba(0, 183, 224, 0.12); }
[data-theme="nexio"] .bg-lime-400\/15 { background-color: rgba(0, 183, 224, 0.18); }
[data-theme="nexio"] .bg-lime-400\/20 { background-color: rgba(124, 58, 237, 0.22); }
[data-theme="nexio"] .bg-lime-400\/25 { background-color: rgba(124, 58, 237, 0.28); }
[data-theme="nexio"] .bg-lime-400\/30 { background-color: rgba(124, 58, 237, 0.32); }
[data-theme="nexio"] .bg-lime-500\/10 { background-color: rgba(124, 58, 237, 0.12); }
[data-theme="nexio"] .bg-lime-500\/20 { background-color: rgba(124, 58, 237, 0.22); }
[data-theme="nexio"] .bg-lime-50 { background-color: rgba(124, 58, 237, 0.10); }
[data-theme="nexio"] .bg-lime-200 { background-color: rgba(167, 139, 250, 0.25); }

[data-theme="nexio"] .border-lime-400 { border-color: #7C3AED; }
[data-theme="nexio"] .border-lime-400\/20 { border-color: rgba(124, 58, 237, 0.30); }
[data-theme="nexio"] .border-lime-100,
[data-theme="nexio"] .border-lime-200 { border-color: rgba(167, 139, 250, 0.30); }
[data-theme="nexio"] .hover\:border-lime-400:hover { border-color: #A78BFA; }

[data-theme="nexio"] [class*="from-lime"][class*="to-lime"] {
  background-image: linear-gradient(to right, #00B7E0 0%, #7C3AED 100%);
}

[data-theme="nexio"] .focus\:ring-lime-200:focus { --tw-ring-color: rgba(0, 183, 224, 0.35); }
[data-theme="nexio"] .focus\:border-lime-500:focus { border-color: #7C3AED; }

/* --- Boutons --- */
[data-theme="nexio"] .btn-primary {
  background: linear-gradient(135deg, #00B7E0 0%, #7C3AED 100%);
  color: white;
  box-shadow: 0 10px 30px -8px rgba(124, 58, 237, 0.55);
}
[data-theme="nexio"] .btn-primary:hover {
  background: linear-gradient(135deg, #33C6E6 0%, #9333EA 100%);
  box-shadow: 0 16px 44px -8px rgba(124, 58, 237, 0.70);
}
[data-theme="nexio"] .btn-outline {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}
[data-theme="nexio"] .btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(167, 139, 250, 0.5);
}

/* --- Backgrounds --- */
[data-theme="nexio"] .bg-dark-50  { background-color: rgba(255, 255, 255, 0.04); }
[data-theme="nexio"] .bg-dark-100 { background-color: rgba(255, 255, 255, 0.06); }
[data-theme="nexio"] .bg-dark-900 { background-color: rgba(11, 11, 20, 0.92); }
/* bg-white des grandes sections (section.bg-white) => fondu dans le theme dark */
[data-theme="nexio"] section.bg-white { background-color: transparent; }
[data-theme="nexio"] .peer-checked\:bg-lime-50 { background-color: rgba(167, 139, 250, 0.95); }

/* === CARDS (bg-white + border-2 + rounded-2xl) => surface violet pale + texte violet fonce === */
[data-theme="nexio"] .bg-white.border-2.rounded-2xl,
[data-theme="nexio"] .bg-white.border.rounded-2xl,
[data-theme="nexio"] .bg-white.border-2.rounded-xl,
[data-theme="nexio"] .bg-white.border.rounded-xl {
  background-color: rgba(199, 184, 250, 0.95);
  border-color: rgba(124, 58, 237, 0.30);
}
[data-theme="nexio"] .bg-white.border-2.rounded-2xl .text-dark-900,
[data-theme="nexio"] .bg-white.border.rounded-2xl .text-dark-900,
[data-theme="nexio"] .bg-white.border-2.rounded-xl .text-dark-900,
[data-theme="nexio"] .bg-white.border.rounded-xl .text-dark-900 { color: #1E1B4B; }
[data-theme="nexio"] .bg-white.border-2.rounded-2xl .text-dark-800,
[data-theme="nexio"] .bg-white.border.rounded-2xl .text-dark-800,
[data-theme="nexio"] .bg-white.border-2.rounded-xl .text-dark-800,
[data-theme="nexio"] .bg-white.border.rounded-xl .text-dark-800 { color: #2E1065; }
[data-theme="nexio"] .bg-white.border-2.rounded-2xl .text-dark-700,
[data-theme="nexio"] .bg-white.border.rounded-2xl .text-dark-700,
[data-theme="nexio"] .bg-white.border-2.rounded-xl .text-dark-700,
[data-theme="nexio"] .bg-white.border.rounded-xl .text-dark-700 { color: #312E81; }
[data-theme="nexio"] .bg-white.border-2.rounded-2xl .text-dark-600,
[data-theme="nexio"] .bg-white.border.rounded-2xl .text-dark-600,
[data-theme="nexio"] .bg-white.border-2.rounded-xl .text-dark-600,
[data-theme="nexio"] .bg-white.border.rounded-xl .text-dark-600 { color: #3730A3; }
[data-theme="nexio"] .bg-white.border-2.rounded-2xl .text-dark-500,
[data-theme="nexio"] .bg-white.border.rounded-2xl .text-dark-500,
[data-theme="nexio"] .bg-white.border-2.rounded-xl .text-dark-500,
[data-theme="nexio"] .bg-white.border.rounded-xl .text-dark-500 { color: #4338CA; }
[data-theme="nexio"] .bg-white.border-2.rounded-2xl .text-dark-400,
[data-theme="nexio"] .bg-white.border.rounded-2xl .text-dark-400,
[data-theme="nexio"] .bg-white.border-2.rounded-xl .text-dark-400,
[data-theme="nexio"] .bg-white.border.rounded-xl .text-dark-400 { color: #4F46E5; }
[data-theme="nexio"] .bg-white.border-2.rounded-2xl .text-lime-700,
[data-theme="nexio"] .bg-white.border.rounded-2xl .text-lime-700,
[data-theme="nexio"] .bg-white.border-2.rounded-xl .text-lime-700,
[data-theme="nexio"] .bg-white.border.rounded-xl .text-lime-700 { color: #7C3AED; }

/* === HOMOGÉNÉISATION DES ÉLÉMENTS INTERNES DES CARDS === */

/* Badges colorés à l'intérieur des cards (ex: "-60%", "EARLY BIRD") */
[data-theme="nexio"] .bg-white.border-2.rounded-xl .bg-lime-100,
[data-theme="nexio"] .bg-white.border-2.rounded-2xl .bg-lime-100 { background-color: rgba(124, 58, 237, 0.20); }
[data-theme="nexio"] .bg-white.border-2.rounded-xl .text-lime-800,
[data-theme="nexio"] .bg-white.border-2.rounded-2xl .text-lime-800 { color: #5B21B6; }

/* Mini-thumbnail document (rectangle illustration) — fond + lignes placeholder en violet pâle */
[data-theme="nexio"] .bg-white.border-2.rounded-xl .bg-dark-50,
[data-theme="nexio"] .bg-white.border-2.rounded-2xl .bg-dark-50 { background-color: rgba(255, 255, 255, 0.60); }
[data-theme="nexio"] .bg-white.border-2.rounded-xl .bg-dark-200,
[data-theme="nexio"] .bg-white.border-2.rounded-2xl .bg-dark-200 { background-color: rgba(124, 58, 237, 0.25); }

/* Barre supérieure du mini-thumbnail (gradient lime ou gris selon année) — homogénéise en cyan/violet */
[data-theme="nexio"] [class*="from-dark-3"][class*="to-dark-4"],
[data-theme="nexio"] [class*="from-dark-300"][class*="to-dark-400"] {
  background-image: linear-gradient(to right, #00B7E0 0%, #7C3AED 100%);
}

/* Bouton "+" (état non sélectionné) sur les cards à choisir */
[data-theme="nexio"] label.cursor-pointer .bg-dark-100 { background-color: rgba(124, 58, 237, 0.20); }
[data-theme="nexio"] label.cursor-pointer .bg-dark-100.text-dark-500,
[data-theme="nexio"] label.cursor-pointer .bg-dark-100 svg { color: #4338CA; }

/* Stepper wizard (Formule / Compléments / Envoi) — états inactifs en violet pâle */
[data-theme="nexio"] .step-circle { background-color: rgba(167, 139, 250, 0.20); color: rgba(167, 139, 250, 0.95); }
[data-theme="nexio"] .step-label { color: rgba(167, 139, 250, 0.80); }
/* Ligne de connexion entre les steps */
[data-theme="nexio"] [data-study-form-target="stepIndicator"] + .bg-dark-200 { background-color: rgba(167, 139, 250, 0.25); }

/* Navbar Nexio : dark opaque solide, fine bordure violette discrète en bas */
[data-theme="nexio"] nav#navbar {
  background-color: #0B0B14;
  backdrop-filter: none;
  border-bottom: 1px solid rgba(124, 58, 237, 0.20);
  box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.5), 0 8px 24px -12px rgba(124, 58, 237, 0.15);
}

/* --- Couleurs de texte --- */
[data-theme="nexio"] .text-dark-900 { color: #ffffff; }
[data-theme="nexio"] .text-dark-800 { color: rgba(255, 255, 255, 0.92); }
[data-theme="nexio"] .text-dark-700 { color: rgba(255, 255, 255, 0.85); }
[data-theme="nexio"] .text-dark-600 { color: rgba(255, 255, 255, 0.75); }
[data-theme="nexio"] .text-dark-500 { color: rgba(255, 255, 255, 0.65); }
[data-theme="nexio"] .text-dark-400 { color: rgba(255, 255, 255, 0.55); }
[data-theme="nexio"] .text-dark-300 { color: rgba(255, 255, 255, 0.40); }
[data-theme="nexio"] .text-dark-200 { color: rgba(255, 255, 255, 0.25); }
[data-theme="nexio"] .text-dark-100 { color: rgba(255, 255, 255, 0.15); }
[data-theme="nexio"] .hover\:text-dark-900:hover { color: #fff; }

/* --- Bordures --- */
[data-theme="nexio"] .border-dark-100 { border-color: rgba(255, 255, 255, 0.08); }
[data-theme="nexio"] .border-dark-200 { border-color: rgba(255, 255, 255, 0.12); }
[data-theme="nexio"] .border-dark-300 { border-color: rgba(255, 255, 255, 0.18); }
[data-theme="nexio"] .border-dark-400 { border-color: rgba(255, 255, 255, 0.25); }
[data-theme="nexio"] .hover\:border-dark-400:hover,
[data-theme="nexio"] .hover\:border-dark-900:hover { border-color: rgba(167, 139, 250, 0.55); }
[data-theme="nexio"] .peer-checked\:border-lime-400 { border-color: #A78BFA; }

/* --- Hero mesh --- */
[data-theme="nexio"] .hero-mesh::before { display: none; }

[data-theme="nexio"] .hero-mesh {
  background:
    radial-gradient(ellipse at top right, rgba(124, 58, 237, 0.18), transparent 55%),
    radial-gradient(ellipse at bottom left, rgba(0, 183, 224, 0.18), transparent 55%);
}

/* --- Logo 5P glow --- */
[data-theme="nexio"] .logo-5p-hero {
  filter: drop-shadow(0 20px 50px rgba(124, 58, 237, 0.45));
}

/* --- Inputs / forms : glass dark + texte clair --- */
[data-theme="nexio"] input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
[data-theme="nexio"] select,
[data-theme="nexio"] textarea {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}
[data-theme="nexio"] input::placeholder,
[data-theme="nexio"] textarea::placeholder { color: rgba(255, 255, 255, 0.40); }
[data-theme="nexio"] label { color: rgba(255, 255, 255, 0.92); }

/* Bouton "Precedent" du wizard : glass dark au lieu de blanc plein */
[data-theme="nexio"] button[data-study-form-target="prevBtn"] {
  background-color: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.15);
}
[data-theme="nexio"] button[data-study-form-target="prevBtn"]:hover {
  background-color: rgba(255, 255, 255, 0.10);
  border-color: rgba(167, 139, 250, 0.55);
  color: #fff;
}

/* Cards selectionnees (peer-checked) : glow violet */
[data-theme="nexio"] .peer:checked + .h-full,
[data-theme="nexio"] .peer:checked ~ .h-full {
  background-color: rgba(124, 58, 237, 0.18);
  border-color: #A78BFA;
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.45), 0 10px 30px -10px rgba(124, 58, 237, 0.40);
}

/* ============================================================
   Theme Agryco — scope a [data-theme="agryco"] (lead magnets ebook)
   Co-branding Agryco Services : jaune tournesol #FFD302 + ink
   #343B45. Variables CSS pour reutilisation, utilities pour
   coller au pattern Tailwind.
   ============================================================ */

[data-theme="agryco"] {
  --agryco-yellow: #FFD302;
  --agryco-yellow-soft: rgba(255, 211, 2, 0.12);
  --agryco-yellow-border: rgba(255, 211, 2, 0.45);
  --agryco-ink: #343B45;
}

[data-theme="agryco"] .text-agryco-ink { color: var(--agryco-ink); }
[data-theme="agryco"] .text-agryco-yellow { color: var(--agryco-yellow); }
[data-theme="agryco"] .bg-agryco-yellow { background-color: var(--agryco-yellow); }
[data-theme="agryco"] .bg-agryco-yellow-soft { background-color: var(--agryco-yellow-soft); }
[data-theme="agryco"] .bg-agryco-ink { background-color: var(--agryco-ink); }
[data-theme="agryco"] .border-agryco-yellow { border-color: var(--agryco-yellow); }
[data-theme="agryco"] .ring-agryco-yellow { --tw-ring-color: var(--agryco-yellow); }
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

/* Pagy pagination styling */
.pagy nav {
  display: flex;
  gap: 0.25rem;
}

.pagy nav a,
.pagy nav span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.15s;
}

.pagy nav a {
  background: white;
  color: #374151;
  border: 1px solid #e5e7eb;
}

.pagy nav a:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.pagy nav span.current {
  background: #c0cf23;
  color: #212121;
  border: 1px solid #c0cf23;
}

.pagy nav span.gap {
  background: transparent;
  border: none;
  color: #9ca3af;
}

.pagy nav a[aria-disabled="true"],
.pagy nav span.disabled {
  opacity: 0.5;
  pointer-events: none;
}
