/* ============================================================
   Sostenutoo — Doigtés d'instruments : styles du moteur réutilisable
   Utilisé par toutes les pages /public/doigtes-*.html
   ============================================================ */
:root {
  --fg-primary: #1e293b;
  --fg-primary-dark: #0f172a;
  --fg-accent: #2563eb;
  --fg-success: #22c55e;
  --fg-bg: #f8fafc;
  --fg-surface: #ffffff;
  --fg-border: #e2e8f0;
  --fg-text: #1e293b;
  --fg-text-soft: #64748b;
  --fg-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--fg-bg); color: var(--fg-text); line-height: 1.6;
}
.fg-page { max-width: 860px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }

/* Header */
.fg-header {
  display: flex; align-items: center; gap: 1rem;
  max-width: 860px; margin: 0 auto; padding: 1rem 1.25rem;
}
.fg-logo { font-weight: 800; font-size: 1.15rem; color: var(--fg-primary); text-decoration: none; letter-spacing: -.5px; }
.fg-back { margin-left: auto; color: var(--fg-accent); text-decoration: none; font-size: .92rem; font-weight: 500; }
.fg-back:hover { text-decoration: underline; }

/* Titles */
.fg-h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.5px; margin-bottom: .5rem; }
.fg-lead { color: var(--fg-text-soft); font-size: 1.02rem; margin-bottom: 1.5rem; }
.fg-h2 { font-size: 1.25rem; font-weight: 700; margin: 2.25rem 0 .85rem; }

/* Interactive tool */
.fg-interactive {
  background: var(--fg-surface); border: 1px solid var(--fg-border);
  border-radius: 16px; box-shadow: var(--fg-shadow); padding: 1.5rem; margin-bottom: 1rem;
}
.fg-display { display: flex; align-items: center; justify-content: center; gap: 2.75rem; flex-wrap: wrap; min-height: 240px; }
.fg-diagram { display: flex; align-items: center; justify-content: center; min-width: 140px; min-height: 220px; }
.fg-info { text-align: center; min-width: 140px; }
.fg-notebig { font-size: 2.75rem; font-weight: 800; color: var(--fg-primary); line-height: 1; }
.fg-sounds { color: var(--fg-text-soft); font-size: .9rem; margin: .35rem 0 1rem; min-height: 1.2em; }
.fg-play {
  background: var(--fg-primary); color: #fff; border: none; border-radius: 10px;
  padding: .6rem 1.15rem; font-size: .95rem; font-weight: 600; cursor: pointer; transition: .15s;
}
.fg-play:hover { background: var(--fg-primary-dark); transform: translateY(-1px); }

/* Mini-portée (clé de sol) : la note écrite dessinée sur une portée */
.fg-staffwrap { display: flex; justify-content: center; margin: .45rem 0 .2rem; }
.fg-staff { height: 94px; width: auto; max-width: 100%; display: block; }
.fg-staff-line { stroke: #94a3b8; stroke-width: 1.4; stroke-linecap: round; }
.fg-staff-clef { fill: var(--fg-primary); stroke: none; }
.fg-staff-note { fill: var(--fg-primary); }
.fg-staff-acc { stroke: var(--fg-primary); stroke-width: 1.7; stroke-linecap: round; }
.fg-staff-8va { fill: var(--fg-primary); font: italic 700 12px Georgia, 'Times New Roman', serif; text-anchor: middle; }

/* Pistons (cuivres) — schéma épuré : la pastille descend quand le piston est enfoncé */
.fg-valves { display: flex; gap: 1.7rem; align-items: flex-start; padding: 1rem 0 .5rem; }
.fg-valve { position: relative; width: 34px; height: 120px; }
.fg-valve-casing { position: absolute; inset: 0; border: 1.5px solid var(--fg-border); border-radius: 17px; background: transparent; }
.fg-valve-stem { display: none; }
.fg-valve-btn {
  position: absolute; left: 50%; transform: translateX(-50%); top: 4px;
  width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--fg-text-soft); background: var(--fg-surface);
  display: flex; align-items: center; justify-content: center;
  transition: top .22s cubic-bezier(.34,1.2,.64,1), background .18s, border-color .18s;
}
.fg-valve-btn span { font-size: .82rem; font-weight: 600; color: var(--fg-text-soft); }
.fg-valve.on .fg-valve-btn { top: 90px; background: var(--fg-primary); border-color: var(--fg-primary); }
.fg-valve.on .fg-valve-btn span { color: #fff; }

/* Flûte à bec — schéma épuré : contour fin, trou bouché = plein, ouvert = vide, demi = moitié */
.fg-recorder { display: flex; justify-content: center; align-items: flex-start; gap: 20px; padding: .5rem 0; }
.fg-rec-thumbwrap { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 50px; }
.fg-rec-thumblabel { font-size: .62rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-text-soft); }
.fg-rec-body {
  position: relative; width: 36px; min-height: 300px;
  border: 1.5px solid var(--fg-border); border-radius: 18px 18px 7px 7px; background: var(--fg-surface);
  display: flex; flex-direction: column; align-items: center; padding-top: 56px; gap: 17px;
}
.fg-rec-window { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); width: 8px; height: 9px; border: 1.5px solid var(--fg-border); border-radius: 2px; }
.fg-h { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--fg-primary); background: var(--fg-surface); box-sizing: border-box; transition: background .15s; }
.fg-h.closed { background: var(--fg-primary); }
.fg-h.half { background: linear-gradient(90deg, var(--fg-primary) 50%, var(--fg-surface) 50%); }

/* Flûte traversière — schéma SVG (clé pleine = bouchée, contour = ouverte) */
.fg-flute { width: 470px; max-width: 100%; height: auto; }
.fg-fl-key { fill: var(--fg-surface); stroke: var(--fg-primary); stroke-width: 6; stroke-linejoin: round; transition: fill .15s; }
.fg-fl-key.on { fill: var(--fg-primary); }

/* Clarinette — schéma vertical */
.fg-clarinet { height: 360px; max-width: 100%; width: auto; display: block; margin: 0 auto; }
.fg-cl-sep { stroke: var(--fg-primary); stroke-width: 6; stroke-linecap: round; }

/* Saxophone — schéma (repris d'une vectorisation 1024×1536) */
.fg-saxophone { height: 460px; max-width: 100%; width: auto; display: block; margin: 0 auto; }
.fg-sax-key { fill: var(--fg-surface); stroke: var(--fg-primary); stroke-width: 6; stroke-linejoin: round; stroke-linecap: round; transition: fill .15s; }
.fg-sax-key.on { fill: var(--fg-primary); }
.fg-sax-fine .fg-sax-key { stroke-width: 3.8; }
.fg-sax-guide { fill: none; stroke: #9aa0a5; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 20 16; }
.fg-sax-detail { fill: none; stroke: var(--fg-primary); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.fg-sax-ink { fill: var(--fg-primary); stroke: none; }

/* Hautbois — diagramme vectoriel pré-rendu (un seul schéma, touches vides) */
.fg-oboe { height: 400px; max-width: 100%; width: auto; display: block; margin: 0 auto; }
.fg-oboe .fg-fl-key { stroke-width: 3.4; }
.fg-oboe .fg-fl-key.half { fill: url(#fg-oboe-half); }

/* Note selector */
.fg-noteselect {
  display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin-top: 1.5rem;
  border-top: 1px solid var(--fg-border); padding-top: 1.25rem;
}
.fg-note {
  border: 1px solid var(--fg-border); background: var(--fg-surface); color: var(--fg-text);
  border-radius: 8px; padding: .4rem .6rem; font-size: .9rem; font-weight: 600; cursor: pointer; transition: .12s; min-width: 48px;
}
.fg-note:hover { border-color: var(--fg-accent); color: var(--fg-accent); }
.fg-note.active { background: var(--fg-primary); color: #fff; border-color: var(--fg-primary); }

/* Toolbar */
.fg-toolbar { display: flex; justify-content: center; margin: 1rem 0 0; }
.fg-btn {
  background: var(--fg-surface); border: 1px solid var(--fg-border); color: var(--fg-text);
  border-radius: 10px; padding: .6rem 1.1rem; font-size: .92rem; font-weight: 600; cursor: pointer;
}
.fg-btn:hover { border-color: var(--fg-accent); color: var(--fg-accent); }

/* Full chart table */
.fg-chart { margin-top: 2.5rem; }
.fg-charttitle { font-size: 1.1rem; font-weight: 700; margin-bottom: .85rem; }
/* Grille de mini-schémas (note + dessin du doigté) */
.fg-chart-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; margin-top: 1.25rem; }
.fg-chart-cell { border: 1px solid var(--fg-border); border-radius: 10px; padding: .55rem .35rem .45rem; background: var(--fg-surface); text-align: center; box-shadow: var(--fg-shadow); break-inside: avoid; cursor: pointer; transition: border-color .12s, transform .12s; }
.fg-chart-cell:hover { border-color: var(--fg-accent); transform: translateY(-2px); }
.fg-chart-note { font-weight: 700; font-size: .92rem; margin-bottom: .35rem; color: var(--fg-primary); }
.fg-chart-diag { height: 140px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.fg-chart-diag svg { max-width: 130px; max-height: 140px; width: auto !important; height: auto !important; }
.fg-chart-diag .fg-valves { transform: scale(0.62); }
.fg-chart-diag .fg-recorder { transform: scale(0.42); }

/* Content */
.fg-prose p { margin-bottom: .9rem; color: #334155; }
.fg-prose ul { margin: 0 0 .9rem 1.25rem; color: #334155; }
.fg-faq dt { font-weight: 700; margin-top: 1rem; }
.fg-faq dd { margin: .25rem 0 0; color: #334155; }

/* CTA */
.fg-cta {
  margin: 2.5rem 0 1rem; padding: 1.5rem; border-radius: 16px;
  background: linear-gradient(135deg, #1e293b, #0f172a); color: #fff; text-align: center;
}
.fg-cta h3 { font-size: 1.15rem; margin-bottom: .4rem; }
.fg-cta p { color: #cbd5e1; margin-bottom: 1rem; font-size: .95rem; }
.fg-cta a {
  display: inline-block; background: #fff; color: var(--fg-primary); text-decoration: none;
  font-weight: 700; padding: .65rem 1.4rem; border-radius: 10px;
}

/* Maillage / related */
.fg-related { margin-top: 2.5rem; border-top: 1px solid var(--fg-border); padding-top: 1.25rem; }
.fg-related h3 { font-size: 1rem; margin-bottom: .75rem; }
.fg-related .fg-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.fg-related a {
  border: 1px solid var(--fg-border); border-radius: 999px; padding: .4rem .9rem;
  text-decoration: none; color: var(--fg-text); font-size: .88rem; background: var(--fg-surface);
}
.fg-related a:hover { border-color: var(--fg-accent); color: var(--fg-accent); }
.fg-footnote { margin-top: 2rem; color: var(--fg-text-soft); font-size: .82rem; }

/* Hub : grille d'instruments */
.fg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; margin: 1.5rem 0 1rem; }
.fg-card {
  display: block; text-decoration: none; color: var(--fg-text); background: var(--fg-surface);
  border: 1px solid var(--fg-border); border-radius: 14px; padding: 1.1rem 1.25rem; box-shadow: var(--fg-shadow); transition: .15s;
}
.fg-card:hover { border-color: var(--fg-accent); transform: translateY(-2px); }
.fg-card-name { font-weight: 700; font-size: 1.05rem; margin-bottom: .15rem; }
.fg-card-sub { color: var(--fg-text-soft); font-size: .85rem; }
.fg-card.soon { opacity: .65; cursor: default; }
.fg-card.soon:hover { border-color: var(--fg-border); transform: none; }
.fg-card.soon .fg-card-sub { color: var(--fg-accent); font-weight: 600; }

@media (max-width: 560px) {
  .fg-display { gap: 1.25rem; }
  .fg-notebig { font-size: 2.4rem; }
  .fg-rec-body { min-height: 272px; }
}

/* Print = chart imprimable propre */
@media print {
  .fg-header, .fg-interactive, .fg-toolbar, .fg-cta, .fg-related, .fg-back, .fg-footnote { display: none !important; }
  .fg-chart { margin: 0; }
  .fg-chart-cell { box-shadow: none; break-inside: avoid; }
  body { background: #fff; }
}
