/* ==============================
   Cithron – style.css (patch mobile v2)
   Palette: #FFD633 (primary), #5BAE3C (leaf), #1F2A44 (ink), #F7F7F7 (bg)
   Fonts: Poppins (titles), Inter (text) – chargées depuis HTML
   Objectifs: burger visible <900px + menu déroulant, CTA en bas des cartes,
   emplacements images (hero & produits), responsive + dark-mode
================================ */

/* 0) Variables & Reset */
:root{
  --primary:#FFD633;  /* Jaune citron */
  --leaf:#5BAE3C;     /* Vert feuille */
  --ink:#1F2A44;      /* Bleu nuit */
  --bg:#F7F7F7;       /* Gris clair */
  --light:#FFFFFF;

  --success:#4CAF50; --warning:#F59E0B; --danger:#EF4444; --info:#3B82F6;

  --ff-sans: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --ff-display: Poppins, Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  --fs-300:.875rem; --fs-400:1rem; --fs-500:1.125rem; --fs-600:1.25rem;
  --fs-700:clamp(1.5rem, 2.5vw, 2rem); --fs-800:clamp(2rem,4vw,3rem);

  --radius:16px; --radius-sm:12px; --radius-lg:20px;
  --shadow:0 10px 24px rgba(0,0,0,.08); --shadow-sm:0 4px 12px rgba(0,0,0,.06);
  --container:1140px; --gutter:20px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
html{scroll-behavior:smooth}
body{font-family:var(--ff-sans); color:var(--ink); background:var(--bg); line-height:1.55}
img,svg{max-width:100%; height:auto; display:block}
:focus-visible{outline:3px solid var(--leaf); outline-offset:2px}

/* 1) Typography & Links */
h1,h2,h3,h4{font-family:var(--ff-display); margin:0 0 .6rem; letter-spacing:-.01em}
h1{font-size:var(--fs-800)}
h2{font-size:var(--fs-700)}
h3{font-size:var(--fs-600)}
p{margin:.5rem 0 1rem; font-size:var(--fs-400)}
small{font-size:var(--fs-300)}
a{color:var(--ink); text-underline-offset:3px}
a:hover{opacity:.85}
.kicker{color:#5c6a80; font-weight:700; text-transform:uppercase; font-size:.8rem; letter-spacing:.08em}

/* 2) Layout helpers */
.container{max-width:var(--container); margin:0 auto; padding:0 var(--gutter)}
.section{padding:48px 0}
.grid{display:grid; gap:18px; grid-template-columns:repeat(auto-fit, minmax(260px, 1fr))}
.wrap{display:grid; grid-template-columns:1.15fr .85fr; gap:28px; align-items:center}
.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}.mt-4{margin-top:32px}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}.mb-4{margin-bottom:32px}
.p-1{padding:8px}.p-2{padding:16px}.p-3{padding:24px}
.text-center{text-align:center}

/* 3) Header / Nav */
.topbar{position:sticky; top:0; z-index:50; background:var(--light); border-bottom:1px solid #e8e8e8}
.topbar .container{position:relative} /* pour positionner le menu mobile */
.nav{display:flex; align-items:center; justify-content:space-between; padding:14px 0}
.brand{display:flex; align-items:center; gap:12px; font-weight:800; letter-spacing:.3px; text-decoration:none; color:var(--ink)}
.brand .name{font-family:var(--ff-display); font-size:1.25rem}
.brand svg{width:40px; height:40px}
.tag{background:var(--primary); color:#111; font-weight:700; padding:.2rem .55rem; border-radius:999px; font-size:.8rem}
.tag2{background:var(--ink); color:#fff; font-weight:700; padding:.2rem .55rem; border-radius:999px; font-size:.8rem}
.menu{display:flex; gap:18px; align-items:center}
.menu a{color:var(--ink); text-decoration:none; font-weight:600}
.menu .cta{background:var(--ink); color:var(--light); padding:.65rem 1rem; border-radius:12px}
.burger{display:none; background:none; border:0; font-size:1.6rem; padding:8px 10px; line-height:1; cursor:pointer}

/* 4) Hero & Badges */
.hero{background:linear-gradient(180deg, #FFF6CC 0%, #FFF 60%)}
.badges{display:flex; gap:10px; flex-wrap:wrap; margin:1rem 0}
.badge{display:inline-flex; align-items:center; gap:8px; background:var(--light); border:1px solid #eee; padding:.45rem .7rem; border-radius:999px; font-size:.85rem}

/* 5) Cards & Buttons */
.card{background:var(--light); border:1px solid #eee; border-radius:var(--radius); box-shadow:var(--shadow); padding:20px}
.btn{display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:.85rem 1.1rem; border-radius:14px; text-decoration:none; font-weight:700; border:0; cursor:pointer; transition:transform .06s ease, box-shadow .2s}
.btn:active{transform:translateY(1px)}
.btn.primary{background:var(--ink); color:var(--light)}
.btn.secondary{background:var(--primary); color:#111}
.btn.outline{background:transparent; border:2px solid var(--ink); color:var(--ink)}
.btn.ghost{background:transparent; color:var(--ink)}
.btn[disabled]{opacity:.55; cursor:not-allowed}

/* 6) Forms */
label{font-weight:600; display:inline-block; margin:.4rem 0 .2rem}
.input, input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea{
  width:100%; padding:.75rem .8rem; border:1px solid #e0e0e0; border-radius:12px; background:var(--light); color:var(--ink); font-family:var(--ff-sans); font-size:var(--fs-400)
}
textarea{min-height:120px; resize:vertical}
input:focus, select:focus, textarea:focus{outline:3px solid rgba(91,174,60,.25); border-color:var(--leaf)}
.input-row{display:grid; gap:12px; grid-template-columns:repeat(12, 1fr)}
.input-col-6{grid-column:span 6}
.input-col-4{grid-column:span 4}
.input-col-12{grid-column:span 12}

/* 7) Tables */
.table{width:100%; border-collapse:separate; border-spacing:0; background:var(--light); border:1px solid #eee; border-radius:12px; overflow:hidden}
.table th,.table td{padding:.8rem .9rem; text-align:left}
.table thead th{background:#fafafa; font-weight:700}
.table tbody tr+tr td{border-top:1px solid #f0f0f0}
.table tbody tr:hover{background:#fffaf0}

/* 8) Feature blocks & CTA band */
.features{display:grid; gap:16px; grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}
.feature{background:var(--light); border:1px solid #eee; border-radius:14px; padding:16px}
.cta-band{background:var(--ink); color:var(--light); border-radius:18px; padding:28px; display:flex; align-items:center; justify-content:space-between; gap:14px}

/* 9) FAQ */
details{background:var(--light); border:1px solid #eee; border-radius:12px; padding:12px 14px}
details+details{margin-top:10px}
summary{cursor:pointer; font-weight:700}

/* 10) Modal */
.modal{position:fixed; inset:0; display:none; place-items:center; background:rgba(0,0,0,.45); z-index:100}
.modal.open{display:grid}
.modal__card{background:var(--light); border-radius:16px; width:min(560px, 92vw); box-shadow:var(--shadow); padding:20px}

/* 11) Footer */
footer{background:#0f1726; color:#e8eef7; margin-top:40px}
footer a{color:#e8eef7; text-decoration:none}
.footgrid{display:grid; grid-template-columns:1.1fr .9fr; gap:20px; padding:28px 0}

/* 12) Utilities */
.bg-primary{background:var(--primary)} .bg-ink{background:var(--ink)} .bg-leaf{background:var(--leaf)} .bg-light{background:var(--light)}
.text-primary{color:var(--primary)} .text-ink{color:var(--ink)} .text-leaf{color:var(--leaf)}
.rounded{border-radius:var(--radius)} .rounded-sm{border-radius:var(--radius-sm)} .rounded-lg{border-radius:var(--radius-lg)}
.shadow{box-shadow:var(--shadow)} .shadow-sm{box-shadow:var(--shadow-sm)}
.hover-rise{transition:transform .18s ease, box-shadow .18s}
.hover-rise:hover{transform:translateY(-2px); box-shadow:0 14px 28px rgba(0,0,0,.12)}

/* 13) Image placeholders (hero & produits) */
.product-media, .hero-media{width:100%; border-radius:12px; overflow:hidden; background:#fff7cc; border:1px solid #eee}
.product-media img, .hero-media img{width:100%; height:100%; object-fit:cover; display:block}
.aspect-16x9{aspect-ratio:16/9}

/* Reset des marges par défaut de <figure> pour éviter le débordement dans les cartes */
figure { margin: 0; }

/* Option : seulement nos blocs médias (si tu préfères ne pas toucher globalement à <figure>) */
.product-media, .hero-media { margin: 0; }

/* Un petit rythme vertical propre dans les cartes */
.card .product-media, .card .hero-media { margin: 0 0 12px 0; }

/* 14) Cartes produits: CTA collés en bas */
.grid > .card{display:flex; flex-direction:column;}
.grid > .card .cta-row{margin-top:auto; display:flex; flex-direction:row;}
.card p:last-of-type{margin-bottom:.5rem}

/* 15) Responsive –
   IMPORTANT: on utilise des valeurs px (pas de var() dans @media) */
@media (max-width: 900px){
  .wrap{grid-template-columns:1fr}
  .menu{display:none}
  .burger{display:block}
  .menu.open{
    position:absolute; left:0; right:0; top:100%;
    background:var(--light);
    border-bottom:1px solid #eee;
    box-shadow:0 6px 20px rgba(0,0,0,.08);
    padding:10px var(--gutter);
    display:flex; flex-direction:column; align-items:flex-start; gap:12px;
  }
  .footgrid{grid-template-columns:1fr}
  .input-col-6,.input-col-4{grid-column:span 12}
}
@media (max-width: 600px){
  h1{font-size:2rem}
}

/* 16) Dark mode auto */
@media (prefers-color-scheme: dark){
  body{background:#0b1221; color:#e8eef7;}
  .topbar{background:#0f1726; border-color:#17213a}
  .menu .cta{background:var(--primary); color:#111}
  .card, .price, .feature, details, .modal__card{background:#0f1726; border-color:#17213a}
  .table{background:#0f1726; border-color:#17213a}
  .table thead th{background:#111a2e}
  .table tbody tr:hover{background:#0e1a2e}
  .cta-band{background:#111a2e}
  .badge{color:#111}
}
/* Vidéo pleine largeur et responsive */
.video-hero { margin: 0; }
.video-responsive {
  width: 100%;
  height: auto;            /* garde les proportions */
  display: block;
  background: #000;
  border-radius: 12px;
}

.pricecolonnes {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 600px){
  .pricecolonnes {grid-template-columns: repeat(1, minmax(0, 1fr));}
}
/* Si le navigateur supporte aspect-ratio, verrouille en 16:9 propre */
@supports (aspect-ratio: 16/9) {
  .video-responsive { aspect-ratio: 16 / 9; }
}

.video-caption { color: #5c6a80; margin-top: .5rem; text-align: center; }

/* Petits écrans : bord à bord si tu veux un rendu “plein écran” */
@media (max-width: 600px){
  .video-hero { margin-left: 0; margin-right: 0; }
  .video-responsive { border-radius: 0; } /* optionnel : pas d'arrondis sur mobile */
}
/* Éditeur bien distinct de la liste */
.card.accent{ border:2px solid #FFD633; background:#fffdf0; }
.btn-batch{ display:flex; gap:8px; flex-wrap:wrap; margin:.25rem 0 .5rem; }
.btn-batch .btn{ padding:6px 10px; }
.btn.danger{ background:#e53e3e; color:#fff; } /* si non défini chez toi */
.btn.ghost{ background:#fff; border:1px solid #e7e7e7; }

/*MOBILE*/
  /* --- Tutoriel : garde tout dans le viewport mobile --- */
  /* 1) Images / vidéos responsives */
  .tutorial img,
  .tutorial video,
  .tutorial iframe,
  .tutorial svg { max-width: 100%; height: auto; display: block; }

  /* 2) Grilles : une colonne sur mobile */
  @media (max-width: 900px) {
    .tutorial .grid-2,
    .tutorial .grid-3,
    .tutorial .grid-4 { grid-template-columns: 1fr; }
  }

  /* 3) Code / JSON : pas de débordement horizontal */
  .tutorial pre {
    max-width: 100%;
    overflow-x: auto;            /* scroll horizontal si vraiment nécessaire */
    white-space: pre;            /* garde l’alignement */
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
  }
  .tutorial pre code {
    display: block;
    white-space: inherit;        /* hérite de <pre> */
    word-break: normal;
  }

  /* 4) Tableaux : wrapper scrollable */
  .tutorial .table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tutorial .table-wrap > table { min-width: 640px; } /* ajuste si besoin */

  /* 5) Mots trop longs / URLs */
  .tutorial p,
  .tutorial li,
  .tutorial .content { overflow-wrap: anywhere; }

  /* 6) Sécurité anti “100vw + padding” et autres surprises */
  .tutorial main,
  .tutorial .section { overflow-x: clip; }

  /* 7) Dernier filet de sécurité (à garder en bas) */
  @media (max-width: 900px){
    .tutorial .container { padding-inline: 12px; }
  }


/* --- Table en cartes sur mobile --- */
@media (max-width: 720px){
  .table.responsive { border-collapse: separate; border-spacing: 0; }
  .table.responsive thead { 
    /* on masque l'entête, les libellés arrivent via ::before */
    display: none; 
  }
  .table.responsive, 
  .table.responsive tbody, 
  .table.responsive tr, 
  .table.responsive td, 
  .table.responsive th {
    display: block;
    width: 100%;
  }
  .table.responsive tbody { margin: 0; padding: 0; }

  .table.responsive tr {
    background: #fff;
    border: 1px solid #e7e7e7;
    border-radius: 12px;
    padding: 10px 12px;
    margin: 0 0 12px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,.04);
  }

  .table.responsive td {
    border: 0;
    padding: 8px 0;
    display: grid;
    grid-template-columns: 42% 1fr; /* libellé / valeur */
    gap: 8px;
    align-items: start;
    overflow-wrap: anywhere;
  }

  .table.responsive td::before {
    /*content: attr(data-label);*/
    font-weight: 600;
    color: #667085;
  }

  /* La rangée actions devient une ligne de boutons */
  .table.responsive td.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 10px;
    margin-top: 6px;
    border-top: 1px dashed #e7e7e7;
  }
}

/* Carousel */
.carousel{ position:relative; overflow:hidden; }
.carousel-track{ display:flex; height:100%; width:100%; transition:transform .35s ease; }
.carousel-track > figure{ margin:0; flex:0 0 100%; height:100%;
  display:flex; align-items:center; justify-content:center; background:#fff; }
.carousel-track img{ width:100%; height:100%; object-fit:contain; }

.carousel-nav{ position:absolute; top:50%; transform:translateY(-50%);
  width:40px; height:40px; border:0; border-radius:50%;
  background:rgba(0,0,0,.55); color:#fff; font-size:22px; line-height:1; cursor:pointer;
  display:flex; align-items:center; justify-content:center; box-shadow:0 4px 14px rgba(0,0,0,.2); }
.carousel-nav.prev{ left:-8px; } .carousel-nav.next{ right:-8px; }
.carousel-nav:hover{ background:rgba(0,0,0,.7); }

.carousel-fullscreen{ position:absolute; right:-8px; bottom:8px; width:40px; height:40px;
  border:0; border-radius:50%; cursor:pointer; background:rgba(0,0,0,.55); color:#fff;
  display:flex; align-items:center; justify-content:center; font-size:18px; }
.carousel-fullscreen:hover{ background:rgba(0,0,0,.7); }

.carousel-dots{ position:absolute; left:50%; bottom:8px; transform:translateX(-50%); display:flex; gap:6px; }
.carousel-dots button{ width:8px; height:8px; border-radius:50%; border:0; background:#cbd5e1; opacity:.7; cursor:pointer; }
.carousel-dots button[aria-current="true"]{ background:#334155; opacity:1; }

.carousel:fullscreen,.carousel:-webkit-full-screen{ background:#000; }
.carousel:fullscreen .carousel-track > figure,
.carousel:-webkit-full-screen .carousel-track > figure{ background:#000; }
.carousel:fullscreen img,.carousel:-webkit-full-screen img{ object-fit:contain; }

/* Optionnel: si ta classe aspect-16x9 force une hauteur fixe, assure un bon rendu fullscreen */
.carousel:fullscreen{ width:100vw; height:100vh; aspect-ratio:auto; }

/* Fallback lightbox plein écran */
.carousel-lightbox{ position:fixed; inset:0; background:#000; 
  display:grid; place-items:center; z-index:9999; }
.carousel-lightbox[hidden]{ display:none; }
.carousel-lightbox img{ max-width:100vw; max-height:100dvh; object-fit:contain;
  touch-action: pan-y pinch-zoom; }

.clb-prev,.clb-next,.clb-close{
  position:fixed; border:0; background:rgba(0,0,0,.55); color:#fff;
  width:44px; height:44px; border-radius:50%; display:flex; align-items:center; justify-content:center;
}
.clb-prev{ left:10px; top:50%; transform:translateY(-50%); }
.clb-next{ right:10px; top:50%; transform:translateY(-50%); }
.clb-close{ right:10px; top:10px; font-size:22px; }
.clb-prev:hover,.clb-next:hover,.clb-close:hover{ background:rgba(0,0,0,.75); }

/* Divider simple */
.divider{
  --divider-color: #d0d5dd; /* plus marqué */
  margin: 24px 0;
  border: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--divider-color), transparent);
}

/* Divider accent (lime/jaune citron à gauche) */
.divider_accent{
  position: relative;
  margin: 24px 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), transparent);
  border-radius: 2px;
}


