/* Styles communs aux pages secondaires du site (confidentialité, assistance, 404) et aux pages de contenu
   (FAQ, guides). La page d'accueil (index.html) garde ses propres styles intégrés : elle a son propre jeu de
   jetons et ne partage que quelques règles avec les autres pages.
   Chaque page peut compléter ces règles dans son propre bloc <style>, placé après ce fichier. */

/* ===== 1. Base commune ===== */

/* Jetons repris de AppColors.swift / AppTheme.swift : fond crème en clair, anthracite en sombre, accent
   Signature. Les pages suivent le réglage « Système » comme l'app. */
:root {
  --bg: #F7F5F0;
  --surface: #FFFFFF;
  --surface-2: #EFECE6;
  --ink: #1B1A1E;
  --ink-2: #5E5B66;
  --line: rgba(27, 26, 30, .10);
  --a-light: #9E3DCF;
  --a-dark: #C96BF7;
  --accent: var(--a-light);
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --serif: "New York", ui-serif, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --v1: color-mix(in srgb, var(--accent) 84%, #2a0d4a);
  --v2: color-mix(in srgb, var(--accent) 60%, #2a0d4a);
  --v3: color-mix(in srgb, var(--accent) 34%, #1f0840);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141316;
    --surface: #1E1C22;
    --surface-2: #26232C;
    --ink: #F3F1F6;
    --ink-2: #A9A5B3;
    --line: rgba(255, 255, 255, .10);
    --accent: var(--a-dark);
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--sans); background: var(--bg); color: var(--ink); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 40px); margin-inline: auto; }
h1, h2 { font-family: var(--serif); font-weight: 700; line-height: 1.12; letter-spacing: -.01em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.btn:hover { transform: translateY(-2px); text-decoration: none; }

/* Fond violet (en-tête et pied de page), comme les sections violettes de l'accueil */
.on-violet { --ink: #fff; --ink-2: rgba(255, 255, 255, .86); --line: rgba(255, 255, 255, .22); --accent: #EDC9FF; color: var(--ink); }
.g-orchid { background: radial-gradient(900px 600px at 88% 8%, rgba(236, 160, 255, .38), transparent 62%), radial-gradient(800px 600px at 4% 96%, rgba(120, 60, 210, .5), transparent 60%), linear-gradient(162deg, var(--v1) 0%, var(--v2) 52%, var(--v3) 100%); }
.g-aube { background: radial-gradient(800px 600px at 96% 4%, rgba(255, 190, 232, .32), transparent 60%), linear-gradient(48deg, var(--v3) 0%, var(--v2) 46%, var(--v1) 100%); }

/* Navigation (identique à l'accueil) */
nav.top { position: sticky; top: 0; z-index: 50; backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom: 1px solid var(--line); }
nav.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 700; font-size: 1.25rem; color: var(--ink); }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.brand:hover { text-decoration: none; }
nav.top .side { display: flex; align-items: center; gap: 22px; font-size: .92rem; }
nav.top .links { display: flex; align-items: center; gap: 22px; }
nav.top .links a { color: var(--ink-2); white-space: nowrap; }
nav.top .links a:hover { color: var(--ink); text-decoration: none; }
nav.top .btn { padding: 9px 18px; font-size: .9rem; white-space: nowrap; }

/* Menu des petits écrans : en dessous de 640 px, les liens ne tiennent plus sur une ligne ; un bouton à trois traits
   les déroule sous la barre (comportement dans assets/site.js) */
.menu-toggle { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.menu-toggle path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.menu-toggle .i-close, nav.top.open .menu-toggle .i-open { display: none; }
nav.top.open .menu-toggle .i-close { display: inline; }
@media (max-width: 640px) {
  nav.top .side { gap: 12px; }
  nav.top .links { display: none; }
  .menu-toggle { display: inline-flex; }
  nav.top.open .links { display: flex; flex-direction: column; align-items: stretch; gap: 0; position: absolute; top: 100%; left: 0; right: 0; padding: 6px 20px 14px; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 18px 30px -20px rgba(0, 0, 0, .35); font-size: 1rem; }
  nav.top.open .links a { display: block; padding: 12px 0; color: var(--ink); }
  nav.top.open .links a + a { border-top: 1px solid var(--line); }
}

/* Bouton « retour en haut », visible après deux écrans de défilement (assets/site.js) */
.to-top { position: fixed; right: 18px; bottom: 18px; z-index: 40; width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--accent); cursor: pointer; box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .4); opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
.to-top.visible { opacity: 1; visibility: visible; }
.to-top path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } }

main { padding: 56px 0 90px; }

/* Pied de page (identique à l'accueil) */
footer { padding: 60px 0 70px; color: var(--ink-2); font-size: .9rem; text-align: center; }
footer .links { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; margin-bottom: 20px; }
footer p { max-width: 52em; margin: 8px auto 0; }

/* ===== 2. Pages de contenu (FAQ, guides) : <body class="doc"> ===== */
/* Limité à .doc pour ne rien changer aux pages secondaires, qui ont leurs propres boutons et en-têtes. */

.doc .btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; padding: 15px 28px; border-radius: 999px; background: var(--accent); color: #fff; box-shadow: 0 14px 34px -14px var(--accent); transition: transform .2s; }
.doc .on-violet .btn { background: #fff; color: #4A1D78; box-shadow: 0 14px 34px -14px rgba(0, 0, 0, .5); }
/* Le menu reste sur fond clair : bouton violet, comme sur l'accueil */
.doc nav.top .btn { background: var(--accent); color: #fff; }

/* En-tête : chemin de navigation, titre, chapeau, date de mise à jour */
.doc-head { padding: 40px 0 56px; }
.crumbs { font-size: .86rem; color: var(--ink-2); margin-bottom: 26px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li + li::before { content: "›"; margin-right: 6px; opacity: .7; }
.crumbs a { color: var(--ink-2); }
.crumbs a:hover { color: var(--ink); }
.crumbs [aria-current] { color: var(--ink); }
.doc-head h1 { font-size: clamp(2rem, 4.6vw, 3rem); }
.doc-head .lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--ink-2); margin-top: 16px; max-width: 36em; }
.doc-head .meta { margin-top: 18px; font-size: .86rem; color: var(--ink-2); }

.doc main { padding: 48px 0 90px; }

/* Texte des articles */
.prose { font-size: 1.05rem; line-height: 1.7; }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); margin-top: 2.2em; scroll-margin-top: 84px; }
.prose h3 { font-family: var(--sans); font-size: 1.12rem; font-weight: 700; margin-top: 1.6em; scroll-margin-top: 84px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .45em; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.prose .table-wrap { overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose thead th { font-weight: 700; border-bottom-width: 2px; }
.prose figure { margin-top: 1.6em; }
.prose figcaption { font-size: .88rem; color: var(--ink-2); margin-top: 8px; text-align: center; }
.prose .note { background: var(--accent-soft); border-radius: 14px; padding: 14px 18px; font-size: .97rem; }

/* Sommaire */
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px 22px; font-size: .95rem; }
.toc .eyebrow { margin-bottom: 8px; }
.toc ol { padding-left: 1.2em; }
.toc li + li { margin-top: .3em; }
.toc a { text-decoration: none; }

/* Encadré « Avec Spinfolio » : texte, bouton et capture d'écran */
.callout { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 26px; }
.prose .callout { margin-top: 2em; }
.callout .eyebrow { margin-bottom: 6px; }
.callout h2, .callout h3 { font-family: var(--serif); font-size: 1.35rem; margin-top: 0; }
.callout p { color: var(--ink-2); font-size: .98rem; margin-top: 8px; }
.callout .btn { margin-top: 16px; padding: 12px 22px; font-size: .95rem; }
.callout a.btn { text-decoration: none; }
.callout img { width: 150px; height: auto; border-radius: 22px; box-shadow: 0 18px 40px -18px rgba(8, 2, 18, .55); }
@media (max-width: 640px) { .callout { grid-template-columns: 1fr; } .callout img { justify-self: center; } }

/* Questions fréquentes : une question par <details> */
.faq-group + .faq-group { margin-top: 2.4em; }
.faq-group h2 { margin-bottom: .4em; }
.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; scroll-margin-top: 72px; } /* sous le menu fixe, à l'ouverture par lien */
.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.4rem; line-height: 1; flex: none; }
.faq details[open] summary::after { content: "−"; }
.faq .answer { margin-top: 10px; color: var(--ink-2); }
.faq .answer > * + * { margin-top: .7em; }

/* Mode d'emploi : une fiche dépliable par fonction, comme dans la section de l'accueil d'où il vient
   (fiches produites par update_manual.py à partir du guide de l'app) */
.manual { --gold-1: #FAC747; --gold-acc: #F2AD2E; }
.manual .manual-group h2 { margin-bottom: .6em; }
.manual details { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; margin-top: 10px; }
.manual details summary { cursor: pointer; list-style: none; padding: 16px 52px 16px 20px; font-weight: 600; position: relative; }
.manual details summary::-webkit-details-marker { display: none; }
.manual details summary::after { content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 1.5rem; font-weight: 300; color: var(--accent); transition: transform .25s; }
.manual details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.manual details .body { padding: 0 20px 20px; color: var(--ink-2); font-size: 1rem; }
.manual details .body ol { margin: 10px 0 0 20px; padding-left: 0; }
.manual details .body li { margin-bottom: 4px; }
.manual details .body .tip { margin-top: 12px; background: var(--accent-soft); border-radius: 12px; padding: 10px 14px; color: var(--ink); font-size: .94rem; }
/* Pastilles « Deluxe » (disque d'or, symbole #deluxe-disc de la page) et « Compte Discogs » */
.manual .badge { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; margin-left: 8px; font-size: .64rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #4D2605; background: linear-gradient(135deg, var(--gold-1), var(--gold-acc)); padding: 3px 9px; border-radius: 99px; }
.manual .badge svg { width: 1.2em; height: 1.2em; flex: none; fill: currentColor; }
.manual .badge.acc { color: var(--ink-2); background: var(--surface-2); }
@media (prefers-reduced-motion: reduce) { .manual details summary::after { transition: none; } }

/* Articles liés et liste des guides */
.related { margin-top: 64px; }
.related h2 { font-size: 1.5rem; margin-bottom: 18px; }
.cards { list-style: none; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.cards a { display: block; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; color: var(--ink); transition: border-color .2s; }
.cards a:hover { text-decoration: none; border-color: var(--accent); }
.cards strong { display: block; font-family: var(--serif); font-size: 1.15rem; line-height: 1.25; }
.cards span { display: block; margin-top: 8px; font-size: .92rem; color: var(--ink-2); }
/* Dans un article (liste des guides) : sans le retrait, l'espacement et le soulignement des listes et liens du texte */
.prose .cards { padding-left: 0; }
.prose .cards li + li { margin-top: 0; }
.prose .cards a { text-decoration: none; }

/* Bandeau final d'invitation */
.cta-band { margin-top: 64px; border-radius: 26px; padding: 40px 28px; text-align: center; background: var(--surface); border: 1px solid var(--line); }
.cta-band h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.cta-band p { margin: 10px auto 0; max-width: 34em; color: var(--ink-2); }
.cta-band .btn { margin-top: 22px; }

@media (prefers-reduced-motion: reduce) { .doc .btn, .cards a { transition: none; } }
