/* Pages /ressources et /ressources/[slug]. Tout est sous .res, avec les jetons du site
   (--ink, --ink-2, --line, --accent, --font, --gutter). Les valeurs après la virgule servent de repli. */
.res {
  --res-ink: var(--ink, #0D0D0D);
  --res-ink-2: var(--ink-2, #4A4D55);
  --res-line: var(--line, rgba(13, 13, 13, .1));
  --res-accent: var(--accent, #2B4BFF);
  --res-soft: #F0F0EE;
  --res-code-bg: #0D0D0D;
  --res-code-ink: #E6E6E3;
  --res-gutter: var(--gutter, 32px);
  --res-col: 720px;
  --res-wide: 1120px;
  max-width: calc(var(--res-wide) + 2 * var(--res-gutter));
  margin: 0 auto;
  padding: 48px var(--res-gutter) 112px;
  color: var(--res-ink);
  font-family: var(--font, "Familjen Grotesk", system-ui, sans-serif);
}
.res-head, .res-prose, .res-back { max-width: var(--res-col); margin-left: auto; margin-right: auto; }
/* Index : même largeur que l'en-tête et le pied de page, pour que tout s'aligne sur le logo. */
.res.res-index { max-width: var(--max, 1280px); }
.res-index .res-head { margin-left: 0; }

.res-back { margin-bottom: 40px; font-size: 15px; }
.res-back a { text-decoration: none; }
.res-back a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* En-tête */
.res-kicker { font-size: 13px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--res-ink-2); }
.res h1 { margin-top: 16px; font-weight: 500; font-size: 56px; line-height: 1.05; letter-spacing: -0.025em; text-wrap: balance; max-width: none; }
.res-lede { margin-top: 20px; font-size: 20px; line-height: 1.5; color: var(--res-ink-2); }
.res-byline { margin-top: 24px; font-size: 15px; font-weight: 500; }
.res-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding: 0; list-style: none; }
.res-facts li { padding: 6px 12px; border: 1px solid var(--res-line); border-radius: 999px; font-size: 14px; color: var(--res-ink-2); }

/* Texte du guide */
.res-prose { margin-top: 56px; font-size: 18px; line-height: 1.65; }
.res-prose > p:first-child { font-size: 19px; }
.res-prose p + p, .res-prose p + ul, .res-prose ul + p, .res-prose p + ol, .res-prose ul + ul { margin-top: 16px; }
.res-prose section { margin-top: 72px; }
.res-prose h2 { font-weight: 500; font-size: 32px; line-height: 1.15; letter-spacing: -0.015em; margin-bottom: 20px; text-wrap: balance; max-width: none; }
.res-prose h3 { font-weight: 500; font-size: 22px; line-height: 1.25; margin: 40px 0 14px; }
.res-prose ul, .res-prose ol { padding-left: 1.3em; }
.res-prose ul { list-style: disc; }
.res-prose ol { list-style: decimal; }
.res-prose li + li { margin-top: 8px; }
.res-prose li > ul { margin-top: 8px; list-style: circle; }
.res-prose li::marker { color: var(--res-ink-2); }
.res-prose strong { font-weight: 500; color: var(--res-ink); }
.res-prose a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: var(--underline, rgba(13, 13, 13, .4)); }
.res-prose a:hover { text-decoration-color: currentColor; }
.res-prose blockquote { margin-top: 24px; padding: 18px 22px; background: var(--res-soft); border-left: 3px solid var(--res-accent); border-radius: 0 10px 10px 0; font-size: 17px; }
.res-takeaway { margin-top: 32px !important; padding: 18px 22px; border: 1px solid var(--res-line); border-radius: 10px; }
.res-sources { font-size: 15px; color: var(--res-ink-2); }

/* Sommaire */
.res-toc { margin-top: 48px; padding: 28px 32px; border: 1px solid var(--res-line); border-radius: 14px; }
.res-toc h2 { font-size: 22px; margin-bottom: 14px; }
.res-toc ol { font-size: 17px; }
.res-toc li + li { margin-top: 4px; }
.res-toc a { text-decoration: none; }
.res-toc a:hover { text-decoration: underline; }

/* Blocs larges (galerie, vidéos) : plus larges que la colonne de lecture, centrés sur elle */
.res-wide { width: min(var(--res-wide), calc(100vw - 2 * var(--res-gutter))); margin-left: calc(50% - min(var(--res-wide), calc(100vw - 2 * var(--res-gutter))) / 2); }

.res-gallery { margin-top: 32px; }
.res-gallery ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding: 0; list-style: none; }
.res-gallery li + li { margin-top: 0; }
.res-gallery img { width: 100%; height: auto; aspect-ratio: 1087 / 1350; object-fit: cover; border-radius: 12px; background: var(--res-soft); }
.res-gallery figcaption { margin-top: 14px; font-size: 14px; color: var(--res-ink-2); text-align: center; }

.res-reels { margin-top: 32px; margin-bottom: 32px; }
.res-reels ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding: 0; list-style: none; max-width: 900px; margin: 0 auto; }
.res-reels li + li { margin-top: 0; }
.res-reels video { width: 100%; height: auto; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 12px; background: #111; }
.res-reels figcaption { margin-top: 12px; font-size: 15px; line-height: 1.45; color: var(--res-ink-2); }

/* Demandes à copier */
.res-step p { margin-bottom: 24px; }
.res-prompt { margin-top: 8px; background: var(--res-code-bg); color: var(--res-code-ink); border-radius: 14px; overflow: hidden; }
.res-prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 12px 12px 20px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.res-prompt-title { font-size: 15px; font-weight: 500; color: #FAFAFA; }
.res-copy { flex: none; min-height: 40px; padding: 0 16px; border: 0; border-radius: 8px; background: #FAFAFA; color: var(--res-accent); font: 500 15px/1 var(--font, system-ui, sans-serif); cursor: pointer; transition: background-color 150ms ease; }
.res-copy:hover { background: #FFFFFF; }
.res-copy:focus-visible { outline: 2px solid var(--scale, #8C9BFF); outline-offset: 2px; }
.res-copy.is-copied { background: var(--res-accent); color: #FFFFFF; }
.res-prompt-body { margin: 0; padding: 20px; max-height: 28rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 13.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--res-code-ink); }
.res-prompt-body:focus-visible { outline: 2px solid var(--scale, #8C9BFF); outline-offset: -2px; }
.res-prompt-body code { font: inherit; }

/* Bandeau final */
.res-cta { margin-top: 112px; padding: 48px; border-radius: 18px; background: var(--night-bg, #0B0C14); color: var(--night-ink, #F3F3F1); }
.res-cta h2 { max-width: 30em; font-weight: 500; font-size: 30px; line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; }
.res-cta-sub { margin-top: 12px; max-width: 44em; font-size: 20px; line-height: 1.45; text-wrap: balance; }
.res-cta-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 28px; }
.res-cta .btn { margin: 0; }
.res-btn-2 { display: inline-flex; align-items: center; min-height: 52px; padding: 0 22px; border: 1px solid rgba(243, 243, 241, .35); border-radius: 8px; color: inherit; font-size: 17px; font-weight: 500; text-decoration: none; transition: border-color 150ms ease; }
.res-btn-2:hover { border-color: rgba(243, 243, 241, .8); }

/* Index : liste des ressources */
.res-list { margin-top: 56px; padding: 0; list-style: none; display: grid; gap: 24px; }
.res-card-link { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 40px; align-items: center; padding: 16px; border: 1px solid var(--res-line); border-radius: 18px; color: inherit; text-decoration: none; transition: border-color 150ms ease; }
.res-card-link:hover { border-color: var(--res-ink-2); }
.res-card-img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; background: #0B0C14; }
.res-card-body { padding-right: 24px; }
.res-card-cat { font-size: 13px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--res-accent); }
.res-card-title { margin-top: 12px; font-weight: 500; font-size: 30px; line-height: 1.15; letter-spacing: -0.015em; text-wrap: balance; max-width: none; }
.res-card-text { margin-top: 14px; font-size: 17px; line-height: 1.55; color: var(--res-ink-2); }
.res-card-meta { display: flex; align-items: center; gap: 20px; margin-top: 24px; font-size: 15px; color: var(--res-ink-2); }
.res-card-go { color: var(--res-ink); font-weight: 500; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--underline, rgba(13, 13, 13, .4)); }
.res-card-link:hover .res-card-go { text-decoration-color: currentColor; }

@media (max-width: 1023px) {
  .res-gallery ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Bandeau final : le bouton principal sur toute la largeur, les deux autres côte à côte (pas de bouton seul sur sa ligne). */
  .res-cta-actions .btn { flex: 1 1 100%; }
  .res-btn-2 { flex: 1 1 0; justify-content: center; }
  .res-card-link { grid-template-columns: 1fr; gap: 24px; }
  .res-card-body { padding: 0 8px 8px; }
}
@media (max-width: 767px) {
  .res { --res-gutter: 16px; padding-top: 32px; padding-bottom: 80px; }
  .res h1 { font-size: 38px; line-height: 1.08; }
  .res-lede { font-size: 18px; }
  .res-prose { font-size: 17px; margin-top: 40px; }
  .res-prose section { margin-top: 56px; }
  .res-prose h2 { font-size: 26px; }
  .res-toc { padding: 20px 20px 20px 18px; }
  .res-gallery ul { gap: 10px; }
  .res-reels ul { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 72%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
  .res-reels li { scroll-snap-align: start; }
  .res-prompt-head { padding-left: 16px; }
  .res-prompt-body { padding: 16px; font-size: 13px; max-height: 24rem; }
  .res-cta { margin-top: 80px; padding: 28px 22px; }
  .res-cta h2 { font-size: 23px; }
  .res-cta-sub { font-size: 17px; }
  .res-cta-actions .btn, .res-btn-2 { flex: 1 1 100%; width: 100%; justify-content: center; }
  .res-card-title { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .res-copy, .res-btn-2, .res-card-link { transition: none; }
}

/* Assemblage : appel vers l'audit express dans le bandeau final */
.res-cta { --focus: var(--scale, #8C9BFF); }
.res-cta-note { margin-top: 16px; max-width: 40em; font-size: 17px; line-height: 1.5; color: var(--night-ink-2, #A3A6AD); }
@media (max-width: 767px) { .res-cta-note { font-size: 16px; } }
