/* Fichier : site_v3/public/static/css/fiches_methode.css
   Fiches de méthode en pop-up des pages de notion (2026-11-01) : fraction_home.php
   puis pythagore_home.php. Même mécanique partout (.fm-modal, ouverture par
   [data-modal-target]) ; la couleur de la notion vient de --fm-c, posée sur la
   page ; sans elle, indigo (valeur de repli dans chaque var(), car ce fichier se
   charge après le <style> de la page). Une fiche = une phrase d'entrée, puis des cas
   numérotés, souvent en sections dépliables (<details class="fm-case">) dont le
   titre montre le calcul à faire. */
.fm-modal { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px; }
.fm-modal.is-open { display: flex; }
.fm-modal-backdrop { position: absolute; inset: 0; background: rgba(16,27,45,.55); }
.fm-modal-panel { position: relative; background: #fff; border-radius: 22px; width: min(680px, 100%); max-height: min(88vh, 820px); overflow-y: auto; box-shadow: 0 24px 60px -14px rgba(15,23,42,.35); }
.fm-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 24px 28px 6px; position: sticky; top: 0; background: #fff; z-index: 1; }
.fm-modal-title { display: flex; align-items: center; gap: 10px; font-family: 'Lexend', sans-serif; font-size: 1.1rem; font-weight: 700; color: #0f172a; margin: 0; }
.fm-modal-title i { color: var(--fm-c, #4f46e5); font-size: 1.2rem; }
.fm-modal-close { width: 32px; height: 32px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border: none; background: #f1f5f9; border-radius: 50%; color: #64748b; cursor: pointer; }
.fm-modal-close:hover { background: #e2e8f0; color: #1e293b; }
.fm-modal-body { padding: 4px 28px 26px; }
@media (max-width: 520px) { .fm-modal { padding: 10px; } .fm-modal-header { padding: 18px 18px 6px; } .fm-modal-body { padding: 4px 18px 20px; } }
.fm-lead { font-size: .93rem; color: #334155; line-height: 1.6; margin: 0 0 6px; }
/* Un cas = un numéro, un titre, une phrase, le calcul. Séparés par un filet. */
.fm-case { padding: 16px 0 14px; border-top: 1px solid #e2e8f0; }
.fm-case:first-of-type { border-top: 0; padding-top: 10px; }
.fm-case-h { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-family: 'Lexend', sans-serif; font-size: .95rem; font-weight: 700; color: #0f172a; }
.fm-case-h b { width: 24px; height: 24px; border-radius: 50%; background: var(--fm-c, #4f46e5); color: #fff; font-size: .78rem; display: inline-grid; place-items: center; flex-shrink: 0; }
.fm-case p { font-size: .92rem; color: #334155; line-height: 1.6; margin: 0 0 8px; }
/* Un long calcul passe à la ligne après un « = » ou un « + » : interligne large pour que les lignes ne se touchent pas. */
.fm-calc { padding: 2px 0; font-size: 1.02rem; line-height: 2.7; }
.fm-calc + p, .fm-calc + .fm-calc { margin-top: 2px; }
.fm-calc .katex { font-size: 1.1em; }
/* Tables de multiplication : 12 repéré dans les deux listes. */
.fm-tables { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; margin: 2px 0 10px; font-size: .9rem; color: #334155; }
.fm-tables span:nth-child(odd) { font-weight: 600; white-space: nowrap; }
.fm-tables span:nth-child(even) { display: flex; flex-wrap: wrap; gap: 4px; }
.fm-tables i { font-style: normal; min-width: 28px; text-align: center; padding: 2px 6px; border-radius: 7px; background: #f1f5f9; font-variant-numeric: tabular-nums; }
.fm-tables i.hit { background: var(--fm-c, #4f46e5); color: #fff; font-weight: 700; }
.fm-note { margin: 10px 0 0; padding: 10px 12px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; font-size: .86rem; color: #475569; line-height: 1.55; }
.fm-note p { margin: 0 0 6px; font-size: inherit; color: inherit; }


/* Fiche Addition (2026-11-01, auteur : « trop long ») : un cas par section
   dépliable ; fermée, on voit le titre et le calcul à faire. */
details.fm-case { padding: 0; border-top: 1px solid #e2e8f0; }
details.fm-case:first-of-type { border-top: 1px solid #e2e8f0; padding-top: 0; }
details.fm-case > summary { list-style: none; cursor: pointer; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 12px 4px; margin: 0; border-radius: 10px; transition: background .15s; }
details.fm-case > summary::-webkit-details-marker { display: none; }
details.fm-case > summary:hover { background: #f8fafc; }
details.fm-case > summary:focus-visible { outline: 2px solid var(--fm-c, #4f46e5); outline-offset: 2px; }
.fm-t { flex: 1 1 auto; }
.fm-ex { font-family: 'Source Sans 3', sans-serif; font-weight: 400; color: #334155; font-size: .95rem; white-space: nowrap; }
.fm-sep { font-size: .85rem; color: #64748b; margin: 0 4px; }
.fm-chev { color: #94a3b8; font-size: .8rem; transition: transform .2s; }
details.fm-case[open] .fm-chev { transform: rotate(180deg); }
.fm-case-b { padding: 2px 4px 14px 38px; }
@media (max-width: 520px) { .fm-t { flex-basis: calc(100% - 60px); } .fm-ex { margin-left: 34px; flex: 1; } .fm-case-b { padding-left: 4px; } }

.fm-warn { margin-top: 14px; background: #fffbeb; border-color: #fde68a; color: #92400e; }

.fm-list { margin: 0 0 8px; padding-left: 20px; font-size: .92rem; color: #334155; line-height: 1.6; list-style: disc; }

/* Rédaction type (Pythagore) : chaque ligne avec son rôle à gauche (le triangle,
   le théorème, on remplace…) ; sur mobile, le rôle passe au-dessus de la ligne. */
.fm-rd { display: grid; grid-template-columns: 118px 1fr; gap: 4px 14px; margin: 8px 0 4px; }
.fm-rd dt { font-family: 'Lexend', sans-serif; font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #94a3b8; padding-top: 7px; }
.fm-rd dd { margin: 0; font-size: .93rem; color: #1e293b; line-height: 2; }
.fm-rd dd .katex { font-size: 1.05em; }
.fm-rd dd .katex-html { white-space: nowrap; }   /* une égalité ne se coupe pas en deux lignes */
/* Une lettre en LaTeX dans une étiquette garde sa casse : « On enlève b », pas « B »
   (Équations, 2026-11-05). */
.fm-rd dt .katex { text-transform: none; letter-spacing: 0; font-size: 1.25em; }
@media (max-width: 520px) { .fm-rd { grid-template-columns: 1fr; gap: 0; } .fm-rd dt { padding-top: 8px; } }
/* Énoncé + petite figure à droite (la figure passe au-dessus sur mobile). */
.fm-st { display: flex; flex-wrap: wrap-reverse; align-items: center; gap: 10px 18px; margin: 4px 0 6px; }
.fm-st > p { flex: 1 1 240px; margin: 0; }
.fm-st > svg { flex: 0 0 auto; width: 140px; height: auto; }
.fm-fig { display: flex; justify-content: center; margin: 6px 0 10px; }
.fm-fig svg { width: 210px; height: auto; }
ol.fm-list { list-style: decimal; }
