/*
 * Le menu commun du site (accueil, vidéos, exercices, espace famille, pages légales).
 * Ordinateur : barre en haut. Téléphone : barre en bas avec de grandes icônes.
 * Le balisage est écrit deux fois, à l'identique : src/Menu.tsx (applications) et api/_lib/menu.ts (pages du serveur).
 * Préfixe sb- : aucun conflit avec les styles des applications.
 */
@font-face { font-family: "Baloo 2"; src: url("/fonts/Baloo2.ttf") format("truetype"); font-weight: 400 800; font-display: swap; }

.sb-menu {
  --sb-fond: rgba(255, 249, 236, .94); --sb-trait: #f0e4c8; --sb-encre: #17445c; --sb-discret: #5b7385;
  --sb-actif: #f9e27d; --sb-survol: #f6ecd2; --sb-bas: #fff;
  position: sticky; top: 0; z-index: 50; background: var(--sb-fond); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--sb-trait); font-family: "Baloo 2", system-ui, sans-serif;
}
.sb-menu * { box-sizing: border-box; }
.sb-in { max-width: 64rem; margin: 0 auto; padding: 0 1.25rem; display: flex; align-items: center; gap: 1.25rem; height: 4.25rem; }
.sb-logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; margin-right: auto; color: var(--sb-encre); }
.sb-logo img { width: 2.6rem; height: auto; }
.sb-logo span { font-size: 1.25rem; font-weight: 700; line-height: 1.1; }
.sb-onglets { display: flex; gap: .25rem; }
.sb-onglet { display: flex; align-items: center; gap: .4rem; text-decoration: none; color: var(--sb-encre); font-weight: 700; font-size: 1.05rem; padding: .45rem .85rem; border-radius: 999px; }
.sb-onglet svg, .sb-compte svg, .sb-bas svg { width: 1.2rem; height: 1.2rem; flex: none; }
.sb-onglet:hover { background: var(--sb-survol); }
.sb-onglet[aria-current="page"] { background: var(--sb-actif); }
.sb-compte { display: flex; align-items: center; gap: .45rem; text-decoration: none; font-weight: 700; color: #fff; background: #17445c; padding: .5rem 1rem; border-radius: 999px; white-space: nowrap; }
.sb-menu a:focus-visible, .sb-bas a:focus-visible { outline: 3px solid #4cc3bf; outline-offset: 2px; }

.sb-bas { display: none; }
@media (max-width: 760px) {
  .sb-onglets { display: none; }
  .sb-in { height: 3.6rem; gap: .75rem; }
  .sb-logo img { width: 2.2rem; }
  .sb-logo span { font-size: 1.05rem; }
  .sb-compte span { display: none; }
  .sb-compte { padding: .55rem; }
  .sb-bas {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    background: var(--sb-bas, #fff); border-top: 1px solid #eadfc4; padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom));
    font-family: "Baloo 2", system-ui, sans-serif;
  }
  .sb-bas a { display: flex; flex-direction: column; align-items: center; gap: .1rem; text-decoration: none; font-weight: 700; font-size: .8rem; color: #5b7385; padding: .3rem 0; border-radius: 12px; }
  .sb-bas svg { width: 1.6rem; height: 1.6rem; }
  .sb-bas a[aria-current="page"] { color: #17445c; background: #f9e27d; }
  body:has(.sb-bas) { padding-bottom: 4.75rem; }
}

/* Exercices en thème sombre (l'application suit le réglage de l'appareil) */
@media (prefers-color-scheme: dark) {
  .sb-auto { --sb-fond: rgba(14, 42, 56, .94); --sb-trait: #2b5b72; --sb-encre: #fff8e1; --sb-survol: #17445c; --sb-actif: #ffe783; }
  .sb-auto .sb-onglet[aria-current="page"] { color: #17445c; }
  .sb-auto .sb-compte { background: #ffe783; color: #17445c; }
  .sb-bas.sb-auto { background: #17445c; border-top-color: #2b5b72; }
  .sb-bas.sb-auto a { color: #b5d0da; }
  .sb-bas.sb-auto a[aria-current="page"] { color: #17445c; }
}
