/* ================================================================
   Sarcha · éléments communs à toutes les pages
   En-tête (logo, outils : jour / nuit, notifications, panier, compte),
   menu mobile, pied de page, notifications.
   Chargé en dernier sur chaque page (voir harmoniser.py).
   Les couleurs suivent la page : sur l'accueil en diapos, elles suivent
   la diapo affichée (variables --cur-*), ailleurs le thème jour / nuit.
   ================================================================ */
[hidden] { display: none !important; }

/* Surlignage toujours SOUS le texte, y compris celui des lignes voisines (titres sur plusieurs lignes) */
:is(h1, h2, h3, p, blockquote):has(.hl), :has(> .hl) { isolation: isolate; }
.hl { position: relative; z-index: -1; }
/* Le jour, le surlignage est un aplat : on le descend pour qu'il passe sous les lettres
   sans mordre sur la ligne du dessus (la nuit, c'est un dégradé dans le texte : inchangé). */
html[data-theme="jour"] .hl { background-size: 100% 74% !important; background-position: 0 78% !important; background-repeat: no-repeat !important; }

:root, [data-theme="jour"] {
  --sxc-ink: #070A12; --sxc-ink-2: #433F37; --sxc-line: #CFC8BA; --sxc-bg: #FBFAF7; --sxc-panel: #FFFFFF; --sxc-panel-line: #E2DCD0;
  --sxc-accent: #B23F08; --sxc-badge: #FC6512; --sxc-badge-fg: #070A12; --sxc-shadow: 0 18px 40px -16px rgba(7,10,18,.28);
  --sxc-ok: #1F6B3A; --sxc-info: #1E4680; --sxc-err: #B3261E;
}
[data-theme="nuit"] {
  --sxc-ink: #EFEBE3; --sxc-ink-2: #C4BEB1; --sxc-line: rgba(239,235,227,.24); --sxc-bg: #0B0C10; --sxc-panel: #0B101E; --sxc-panel-line: #1C3A5E; /* touche marine : menus et notifications */
  --sxc-accent: #FC6512; --sxc-badge: #FC6512; --sxc-badge-fg: #070A12; --sxc-shadow: 0 18px 40px -16px rgba(0,0,0,.7);
  --sxc-ok: #6FCF97; --sxc-info: #8DB4F0; --sxc-err: #FF8A80;
}

/* ── En-tête : disposition commune (logo centré, liens serrés autour) ── */
.site-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: var(--head-h, 88px);
  padding: 0 var(--gutter, clamp(16px, 4vw, 48px)); z-index: 30; color: var(--cur-ink, var(--ink, var(--sxc-ink))); }
.site-head .nav { display: flex; gap: 26px; align-items: center; font: 500 14px/1 "Space Grotesk", Inter, Arial, sans-serif; letter-spacing: .04em; }
.site-head .nav a { color: var(--cur-ink-2, var(--ink-2, var(--sxc-ink-2))); text-decoration: none; padding: 8px 0; position: relative; }
.site-head .nav a:hover, .site-head .nav a[aria-current] { color: var(--cur-ink, var(--ink, var(--sxc-ink))); }
.site-head .nav--left { grid-column: 1; justify-content: flex-end; padding-right: 38px; }
.site-head .nav--right { grid-column: 3; justify-content: flex-start; padding-left: 38px; }
.site-head .emblem { grid-column: 2; grid-row: 1; display: block; position: relative; }
.site-head .socials { position: absolute; left: var(--gutter, clamp(16px, 4vw, 48px)); top: 50%; transform: translateY(-50%); display: flex; gap: 18px; }
.site-head .socials a { color: var(--cur-ink-2, var(--ink-2, var(--sxc-ink-2))); display: grid; place-items: center; width: 22px; height: 22px; }
.site-head .socials svg { width: 18px; height: 18px; }
.site-head .head-tools { position: absolute; right: var(--gutter, clamp(16px, 4vw, 48px)); top: 50%; transform: translateY(-50%); }
.site-head .menu-btn { display: none; }
@media (max-width: 1080px) {
  .site-head .nav, .site-head .socials { display: none; }
  .site-head .menu-btn { display: inline-flex; position: absolute; left: var(--gutter, 16px); top: 50%; transform: translateY(-50%); }
}

/* ── En-tête : logo à fond blanc, sans cercle autour ───────────── */
.site-head .emblem { width: 64px; height: 64px; }
.site-head .emblem::before { display: none !important; }
.site-head .emblem img { width: 100%; height: 100%; object-fit: contain; }
.site-head .emblem .logo-mono { display: none !important; }
.site-head .head-tools { display: flex; align-items: center; gap: 8px; }

/* Boutons d'outils (cloche, panier) : même trait fin que le bouton Jour / Nuit */
.sx-tool { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; background: transparent;
  color: var(--cur-ink-2, var(--ink-2, var(--sxc-ink-2))); border: 1px solid var(--cur-line-2, var(--line-2, var(--sxc-line))); border-radius: 0;
  cursor: pointer; text-decoration: none; transition: color .2s, border-color .2s; }
.sx-tool:hover, .sx-tool:focus-visible, .sx-tool[aria-expanded="true"] { color: var(--cur-ink, var(--ink, var(--sxc-ink))); border-color: currentColor; }
.sx-tool svg { width: 17px; height: 17px; }
.sx-badge { position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: grid; place-items: center;
  background: var(--sxc-badge); color: var(--sxc-badge-fg); font: 700 11px/1 "Space Grotesk", Arial, sans-serif; box-shadow: 0 0 0 2px var(--cur-bg, var(--bg, var(--sxc-bg))); }

/* ── Panneau des notifications (s'ouvre depuis la cloche) ──────── */
.sx-notif { position: relative; }
.sx-notif-panel { position: absolute; top: calc(100% + 12px); right: -8px; z-index: 70; width: min(360px, calc(100vw - 32px));
  background: var(--sxc-panel); color: var(--sxc-ink); border: 1px solid var(--sxc-panel-line); box-shadow: var(--sxc-shadow);
  font: 400 14px/1.5 Inter, Arial, sans-serif; transform-origin: top right; animation: sxc-ouvre .22s ease; }
@keyframes sxc-ouvre { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
.sx-np-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--sxc-panel-line); }
.sx-np-head b { font: 600 13px/1 "Space Grotesk", Arial, sans-serif; letter-spacing: .14em; text-transform: uppercase; }
.sx-np-head button { background: none; border: 0; padding: 0; color: var(--sxc-ink-2); font: 500 12.5px/1.2 Inter, Arial, sans-serif; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.sx-np-head button:hover { color: var(--sxc-ink); }
.sx-np-list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow: auto; }
.sx-np-list li + li { border-top: 1px solid var(--sxc-panel-line); }
.sx-np-list a { display: grid; grid-template-columns: 10px 1fr; gap: 4px 12px; padding: 14px 16px; color: var(--sxc-ink); text-decoration: none; }
.sx-np-list a:hover, .sx-np-list a:focus-visible { background: color-mix(in srgb, var(--sxc-ink) 6%, transparent); color: var(--sxc-ink); }
.sx-np-list i { grid-row: span 3; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--sxc-accent); }
.sx-np-list .lu i { background: transparent; box-shadow: inset 0 0 0 1px var(--sxc-line); }
.sx-np-list strong { font: 600 14.5px/1.3 "Space Grotesk", Arial, sans-serif; }
.sx-np-list span { color: var(--sxc-ink-2); }
.sx-np-list small { color: var(--sxc-ink-2); font-size: 12px; }
.sx-np-vide { padding: 22px 16px; color: var(--sxc-ink-2); text-align: center; }

/* ── Messages éphémères : ils sortent de la cloche ─────────────── */
.sx-toasts { position: fixed; z-index: 80; top: calc(var(--head-h, 88px) - 6px); right: var(--gutter, 24px); display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.sx-toast { pointer-events: auto; display: grid; grid-template-columns: 4px 1fr auto; gap: 0 14px; align-items: start; padding: 14px 14px 14px 0;
  background: var(--sxc-panel); color: var(--sxc-ink); border: 1px solid var(--sxc-panel-line); box-shadow: var(--sxc-shadow);
  font: 400 14px/1.5 Inter, Arial, sans-serif; transform-origin: top right; animation: sxc-toast .35s cubic-bezier(.2,.75,.2,1); }
.sx-toast::before { content: ""; align-self: stretch; margin: -14px 0; background: var(--sxc-accent); }
.sx-toast.ok::before { background: var(--sxc-ok); } .sx-toast.info::before { background: var(--sxc-info); } .sx-toast.err::before { background: var(--sxc-err); }
.sx-toast strong { display: block; font: 600 14.5px/1.3 "Space Grotesk", Arial, sans-serif; margin-bottom: 2px; }
.sx-toast span { color: var(--sxc-ink-2); }
.sx-toast a { color: var(--sxc-ink); text-decoration: underline; text-underline-offset: 3px; }
.sx-toast button { background: none; border: 0; padding: 2px 4px; color: var(--sxc-ink-2); font-size: 18px; line-height: 1; cursor: pointer; }
.sx-toast button:hover { color: var(--sxc-ink); }
.sx-toast.part { animation: sxc-rentre .4s cubic-bezier(.6,0,.8,.4) forwards; }
@keyframes sxc-toast { from { opacity: 0; transform: translateY(-14px) scale(.6); } }
@keyframes sxc-rentre { to { opacity: 0; transform: translateY(-30px) scale(.3); } }

/* ── Menu mobile ───────────────────────────────────────────────── */
.drawer .socials { position: static; transform: none; margin-top: 18px; gap: 26px; display: flex; }

/* ── Pied de page commun ───────────────────────────────────────── */
.sx-pied { display: grid; justify-items: center; gap: 12px; width: 100%; max-width: 1240px; margin: 0 auto; padding: 22px 16px 26px;
  border-top: 1px solid var(--line-2, var(--sxc-line)); text-align: center; font: 400 13px/1.5 Inter, Arial, sans-serif; color: inherit; }
.sx-pied a { color: inherit; text-decoration: none; }
.sx-pied a:hover, .sx-pied a:focus-visible { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.sx-pied-reseaux { display: flex; gap: 22px; justify-content: center; }
.sx-pied-reseaux a { display: grid; place-items: center; width: 24px; height: 24px; opacity: .8; }
.sx-pied-reseaux a:hover { opacity: 1; text-decoration: none; }
.sx-pied-reseaux svg { width: 18px; height: 18px; }
.sx-pied-l1, .sx-pied-l2 { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; }
.sx-pied-l1 { font: 500 14px/1.4 "Space Grotesk", Arial, sans-serif; }
.sx-pied-l2 { font-size: 12px; opacity: .85; }
.sx-pied-l1 > * + *::before, .sx-pied-l2 > * + *::before { content: "·"; display: inline-block; margin: 0 12px; opacity: .7; text-decoration: none; }
.sx-pied address { font-style: normal; }

@media (max-width: 1080px) { .site-head .head-tools { gap: 6px; } }
/* Bouton Jour / Nuit du menu mobile */
.sx-theme-tiroir { display: none; align-items: center; gap: 10px; margin-top: 6px; padding: 12px 18px; background: transparent; color: inherit;
  border: 1px solid currentColor; font: 600 13px/1 "Space Grotesk", Arial, sans-serif; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; }
.sx-theme-tiroir svg { width: 16px; height: 16px; }
.sx-theme-tiroir .i-sun, [data-theme="nuit"] .sx-theme-tiroir .i-moon { display: none; }
[data-theme="nuit"] .sx-theme-tiroir .i-sun { display: block; }
@media (max-width: 600px) {
  .site-head .head-tools .theme-btn { display: none !important; }
  .sx-theme-tiroir { display: inline-flex; }
  .site-head .emblem { width: 50px; height: 50px; }
  .sx-tool { width: 34px; height: 34px; }
  .sx-toasts { left: 16px; right: 16px; width: auto; }
}
@media (prefers-reduced-motion: reduce) { .sx-notif-panel, .sx-toast, .sx-toast.part { animation: none !important; } }
