/* =========================================================
   VoxelSprites - Tool / Convert / Use-case pages
   Direction visuelle : reprend la grammaire de landing.css (eyebrow
   mono, vs-headline serif italique sur "mot accent", boutons noirs
   solides, dividers fins, accent rotatif par section). On surcharge
   uniquement ce qui est spécifique à ces landing pages SEO :
   FAQ accordéon, grid features, cross-link cards.

   Préfixe local : .vs-tool-*
   ========================================================= */

body.vs-tool {
  background: var(--vs-bg);
  color: var(--vs-text);
  min-height: 100vh;
}

/* Shell - réutilise vs-l-main par défaut, mais on garantit le padding
   au cas où la page n'aurait pas la classe vs-l-main. */
.vs-tool-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Hero ---------- */
.vs-tool-hero {
  /* Variation du hero landing : pas de stage 3D à droite, donc on passe
     en single-column centré-gauche, avec moins de padding-top que la
     landing (page outil = lecture, pas wow effect). */
  display: block;
  padding: 64px 0 72px;
  min-height: auto;
}
.vs-tool-hero .vs-l-hero__col { max-width: 760px; }
.vs-tool-tagline {
  font-size: 22px;
  line-height: 1.45;
  color: var(--vs-text);
  font-weight: 500;
  margin: 0;
}
.vs-tool-desc {
  color: var(--vs-text-muted);
  line-height: 1.65;
  font-size: 16px;
  margin: 0;
  max-width: 680px;
}

/* ---------- Features grid ---------- */
.vs-tool-feature-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  /* Cf. .vs-tool-hub-grid : min(280px, 100%) + min-width: 0 ⇒ FR/EN même
     nombre de colonnes même quand un titre est plus long dans une langue. */
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 24px;
}
.vs-tool-feature {
  border: 1px solid var(--vs-border);
  border-radius: var(--vs-r-md);
  padding: 22px 24px;
  background: var(--vs-surface-1);
  transition: border-color 140ms var(--vs-ease), transform 140ms var(--vs-ease);
  min-width: 0;
  overflow-wrap: break-word;
}
.vs-tool-feature:hover {
  border-color: var(--vs-text);
  transform: translateY(-2px);
}
.vs-tool-feature h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.vs-tool-feature p {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--vs-text-muted);
  margin: 0;
}

/* ---------- Showcase ---------- */
.vs-tool-showcase-note {
  color: var(--vs-text-muted);
  font-size: 15px;
  line-height: 1.6;
  max-width: 760px;
  margin: 8px 0 0;
}

/* ---------- FAQ ---------- */
.vs-tool-faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 920px;
}
.vs-tool-faq-item {
  border: 1px solid var(--vs-border);
  border-radius: var(--vs-r-md);
  background: var(--vs-surface-1);
  padding: 0;
  overflow: hidden;
  transition: border-color 140ms var(--vs-ease);
}
.vs-tool-faq-item[open] {
  border-color: var(--vs-text);
}
.vs-tool-faq-item summary {
  font-size: 16px;
  font-weight: 600;
  padding: 18px 22px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.vs-tool-faq-item summary::-webkit-details-marker { display: none; }
.vs-tool-faq-item summary::after {
  content: '+';
  font-size: 22px;
  font-weight: 400;
  color: var(--vs-text-muted);
  flex-shrink: 0;
  line-height: 1;
  transition: transform 140ms var(--vs-ease);
}
.vs-tool-faq-item[open] summary::after {
  content: '−';
  color: var(--vs-text);
}
.vs-tool-faq-answer {
  padding: 0 22px 20px;
}
.vs-tool-faq-answer p {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--vs-text-muted);
}

/* ---------- Cross links cards ---------- */
.vs-tool-cross-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 16px;
}
.vs-tool-cross-card { min-width: 0; }
.vs-tool-cross-card a {
  display: block;
  border: 1px solid var(--vs-border);
  border-radius: var(--vs-r-md);
  padding: 22px 24px;
  background: var(--vs-surface-1);
  color: inherit;
  text-decoration: none;
  position: relative;
  transition: border-color 140ms var(--vs-ease), transform 140ms var(--vs-ease);
  overflow-wrap: break-word;
}
.vs-tool-cross-card a:hover {
  border-color: var(--vs-text);
  transform: translateY(-2px);
}
.vs-tool-cross-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.vs-tool-cross-card p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--vs-text-muted);
  margin: 0 0 14px;
}
.vs-tool-cross-arrow {
  position: absolute;
  top: 22px;
  right: 22px;
  font-size: 18px;
  color: var(--vs-text-muted);
  transition: color 140ms var(--vs-ease), transform 140ms var(--vs-ease);
}
.vs-tool-cross-card a:hover .vs-tool-cross-arrow {
  color: var(--vs-text);
  transform: translateX(4px);
}

/* ---------- Media block (screenshot / demo) entre hero et "How it works"
 * Bloc optionnel ajouté 2026-05-14 sur les pages outils individuelles via
 * $toolPage['media'] dans _tool_layout.php. Aspect 16/9 fixe pour grille
 * uniforme. Vidéos autoplay/loop/muted/playsinline = comportement "GIF
 * intelligent" sans bloquer la policy autoplay des browsers. ---------- */
.vs-tool-media-block {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px 8px;
}
.vs-tool-media-block__inner {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--vs-r-lg, 16px);
  overflow: hidden;
  background:
    repeating-linear-gradient(45deg,
      var(--vs-surface-2) 0 8px,
      var(--vs-surface-1) 8px 16px);
  border: 1px solid var(--vs-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.vs-tool-media-block__inner img,
.vs-tool-media-block__inner video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (max-width: 720px) {
  .vs-tool-media-block { padding: 0 20px 4px; }
  .vs-tool-media-block__inner { border-radius: var(--vs-r-md); }
}

/* ---------- Hub index (catalogue) ---------- */
.vs-tool-hub-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  /* min-width: 0 sur les items + minmax(0, ...) sur les tracks ⇒ le grid ne
     se laisse plus pousser par un mot non-wrappable (ex: "voxel-to-sprite-
     sheet"). Sans ça, FR et EN affichaient un nombre de cols différent à
     cause d'un titre intrinsèquement plus large dans une des deux langues. */
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 20px;
}
.vs-tool-hub-card { min-width: 0; }
.vs-tool-hub-card a {
  display: block;
  border: 1px solid var(--vs-border);
  border-radius: var(--vs-r-md);
  padding: 28px 28px 24px;
  background: var(--vs-surface-1);
  color: inherit;
  text-decoration: none;
  height: 100%;
  position: relative;
  transition: border-color 140ms var(--vs-ease), transform 140ms var(--vs-ease);
  overflow-wrap: break-word;
  overflow: hidden;  /* nécessaire pour clip le __media qui déborde via margin: négatif */
}
.vs-tool-hub-card a:hover {
  border-color: var(--vs-text);
  transform: translateY(-2px);
}

/* Image / GIF d'illustration en haut de la carte (ajoutée 2026-05-14).
 * Margin négatif annule le padding du <a> côté top + gauche/droite pour que
 * le média touche les bords. Le bottom margin (20px) crée l'espace avec
 * l'eyebrow/h3. aspect-ratio fixe = grille uniforme même quand les sources
 * ont des ratios différents. object-fit: cover évite la déformation. */
.vs-tool-hub-card__media {
  display: block;
  margin: -28px -28px 20px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background:
    repeating-linear-gradient(45deg,
      var(--vs-surface-2) 0 8px,
      var(--vs-surface-1) 8px 16px);
  border-bottom: 1px solid var(--vs-border);
}
.vs-tool-hub-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 380ms var(--vs-ease);
}
.vs-tool-hub-card a:hover .vs-tool-hub-card__media img {
  transform: scale(1.04);
}
.vs-tool-hub-card .vs-eyebrow {
  display: block;
  margin-bottom: 14px;
}
.vs-tool-hub-card h3 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  line-height: 1.2;
}
.vs-tool-hub-card p {
  color: var(--vs-text-muted);
  line-height: 1.55;
  font-size: 14.5px;
  margin: 0 0 18px;
}
.vs-tool-hub-card .vs-tool-hub-link {
  font-weight: 600;
  font-size: 14px;
  color: var(--vs-text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 140ms var(--vs-ease);
}
.vs-tool-hub-card a:hover .vs-tool-hub-link { gap: 10px; }

/* Lang switch + drapeaux : déplacés dans _main_nav.php (CSS inline) pour
   être autoportables sur toutes les pages, y compris legacy. */

/* ---------- Responsive tweaks ---------- */
@media (max-width: 720px) {
  .vs-tool-main { padding: 0 20px; }
  .vs-tool-hero { padding: 40px 0 48px; }
  .vs-tool-feature-grid,
  .vs-tool-cross-grid,
  .vs-tool-hub-grid {
    grid-template-columns: 1fr;
  }
  .vs-tool-faq-item summary { padding: 16px 18px; font-size: 15px; }
  .vs-tool-faq-answer { padding: 0 18px 16px; }
}
