/* ============================================================
   SHVJA — thème commun à toutes les pages
   Fusion de deux inspirations :
   - éditoriale (titres capitales serif, ornements, ambiance sombre)
   - énergique (menu avec burger + logo centré + pastilles d'action,
     cartes photo à gros titres, boutons pilule avec flèche)
   Chargé en dernier sur chaque page.
   ============================================================ */

:root {
  --shv-serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --shv-impact: 'Bebas Neue', 'Arial Narrow', sans-serif;
  --shv-vert: #3ddc84;
  --shv-vert-fonce: #1f9a57;
  --shv-creme: #f3eee6;
  --shv-fond: #0a0908;
  --shv-nav-h: 68px;
}

/* ---------- Ornements d'angle ---------- */
.ornements { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
.ornements i {
  position: absolute; width: 64px; height: 64px;
  background: url('/img/ornement.svg') center / contain no-repeat; opacity: 0.5;
}
.ornements i:nth-child(1) { top: calc(var(--shv-nav-h) + 12px); left: 12px; }
.ornements i:nth-child(2) { top: calc(var(--shv-nav-h) + 12px); right: 12px; transform: scaleX(-1); }
.ornements i:nth-child(3) { bottom: 12px; left: 12px; transform: scaleY(-1); }
.ornements i:nth-child(4) { bottom: 12px; right: 12px; transform: scale(-1, -1); }
@media (max-width: 700px) {
  .ornements i { width: 40px; height: 40px; opacity: 0.4; }
  .ornements i:nth-child(1), .ornements i:nth-child(2) { display: none; }
}

/* ---------- Menu ---------- */
.shv-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: var(--shv-nav-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 1.4rem;
  background: linear-gradient(to bottom, #0a0908f2, #0a0908cc);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid #ffffff12;
  font-family: 'DM Sans', sans-serif;
}
.shv-gauche { display: flex; align-items: center; gap: 1.4rem; min-width: 0; }
.shv-burger {
  width: 44px; height: 44px; flex-shrink: 0; border: none; border-radius: 6px; cursor: pointer;
  background: #ffffff14; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
}
.shv-burger span { display: block; width: 22px; height: 2.5px; border-radius: 2px; background: var(--shv-creme); transition: transform .3s, opacity .3s; }
.shv-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.shv-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.shv-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }
.shv-liens { display: flex; gap: 1.3rem; }
.shv-liens a, .shv-pill {
  font-family: var(--shv-impact); font-size: 1.15rem; letter-spacing: 0.06em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap;
}
.shv-liens a { color: #e9e3d8cc; transition: color .2s; }
.shv-liens a:hover, .shv-liens a[aria-current="page"] { color: var(--shv-vert); }
.shv-logo { display: flex; align-items: center; gap: 0.55rem; text-decoration: none; justify-self: center; }
.shv-logo img { height: 40px; width: auto; }
.shv-logo span { font-family: var(--shv-serif); font-weight: 600; font-size: 1.35rem; letter-spacing: 0.3em; color: var(--shv-vert); }
.shv-actions { display: flex; justify-content: flex-end; gap: 0.6rem; }

/* Pastilles (boutons pilule) */
.shv-pill {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.45rem 0.95rem 0.35rem; border-radius: 6px;
  background: var(--shv-vert); color: #06120a; transition: transform .2s, background .2s;
}
.shv-pill:hover { transform: translateY(-2px); background: #6ff5a8; }
.shv-pill-clair { background: #f3eee61f; color: var(--shv-creme); }
.shv-pill-clair:hover { background: #f3eee633; }
.shv-fleche { display: inline-block; width: 1.05em; height: 0.8em; margin-top: -0.12em;
  background: currentColor; -webkit-mask: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 18"%3E%3Cpath d="M2 9h17M12 2l8 7-8 7M7 2l8 7-8 7" fill="none" stroke="black" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"/%3E%3C/svg%3E') center/contain no-repeat;
          mask: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 18"%3E%3Cpath d="M2 9h17M12 2l8 7-8 7M7 2l8 7-8 7" fill="none" stroke="black" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"/%3E%3C/svg%3E') center/contain no-repeat; }

/* Tiroir (menu burger) */
.shv-tiroir {
  position: fixed; inset: var(--shv-nav-h) 0 0 0; z-index: 99;
  background: #0a0908f7; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  display: flex; flex-direction: column; justify-content: center; padding: 2rem 8vw;
  opacity: 0; visibility: hidden; transform: translateY(-12px); transition: opacity .3s, transform .3s, visibility .3s;
}
.shv-tiroir.ouvert { opacity: 1; visibility: visible; transform: none; }
.shv-tiroir a.grand {
  font-family: var(--shv-serif); font-weight: 500; text-transform: uppercase; text-decoration: none;
  font-size: clamp(1.9rem, 5vw, 3.2rem); line-height: 1.25; color: var(--shv-creme); letter-spacing: 0.02em;
  display: flex; align-items: baseline; gap: 1rem; border-bottom: 1px solid #ffffff10; padding: 0.35rem 0;
}
.shv-tiroir a.grand small { font-family: 'DM Sans', sans-serif; font-size: 0.75rem; letter-spacing: 0.2em; color: var(--shv-vert); }
.shv-tiroir a.grand:hover { color: var(--shv-vert); }
.shv-tiroir-bas { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 2rem; align-items: center; }
.shv-tiroir-bas .theme-tiroir {
  font: inherit; font-size: 0.85rem; cursor: pointer; color: var(--shv-creme);
  background: none; border: 1px solid #ffffff2a; border-radius: 999px; padding: 0.5rem 1rem;
}
.shv-tiroir-bas .devise { width: 100%; margin-top: 1.4rem; font-family: var(--shv-serif); font-size: 1.1rem; color: #e9e3d899; letter-spacing: 0.06em; }

/* Les anciens menus et boutons de thème sont remplacés */
body > nav:not(.shv-nav), nav.navbar, body > .theme-toggle { display: none !important; }

@media (max-width: 900px) {
  .shv-liens, .shv-pill-clair { display: none; }
}
@media (max-width: 700px) {
  :root { --shv-nav-h: 60px; }
  .shv-nav { padding: 0 0.8rem; }
  .shv-burger { width: 40px; height: 40px; }
  .shv-logo img { height: 32px; }
  .shv-logo span { font-size: 1.05rem; letter-spacing: 0.22em; }
  .shv-pill { font-size: 1rem; padding: 0.4rem 0.7rem 0.3rem; }
  .shv-pill .long { display: none; }
}
@media (min-width: 701px) { .shv-pill .court { display: none; } }

/* ---------- Titres : capitales serif, tailles raisonnables ---------- */
.section-title, .form-title, .code-screen h1, .wordmark, .recap-badge {
  font-family: var(--shv-serif) !important;
  font-weight: 500 !important;
  text-transform: uppercase;
  letter-spacing: 0.03em !important;
  font-variant-numeric: lining-nums;
}
.section-title {
  font-size: clamp(1.7rem, 3.6vw, 2.7rem) !important;
  background: none !important;
  -webkit-text-fill-color: var(--shv-creme) !important;
  color: var(--shv-creme) !important;
}
.form-title { font-size: clamp(1.6rem, 3.4vw, 2.5rem) !important; }
.wordmark { letter-spacing: 0.3em !important; }

/* Les pages gardent leur contenu sous le nouveau menu */
body { scroll-padding-top: var(--shv-nav-h); }

/* ---------- Thème clair ---------- */
[data-theme="light"] .shv-nav { background: #f2f4f0f2; border-bottom-color: #0000001a; }
[data-theme="light"] .shv-liens a { color: #000000b3; }
[data-theme="light"] .shv-burger { background: #0000000f; }
[data-theme="light"] .shv-burger span { background: #0a0a0a; }
[data-theme="light"] .shv-logo span { color: #0d6b30; }
[data-theme="light"] .shv-pill-clair { background: #0000000f; color: #0a0a0a; }
[data-theme="light"] .shv-tiroir { background: #f2f4f0f7; }
[data-theme="light"] .shv-tiroir a.grand { color: #0a0a0a; border-bottom-color: #0000001a; }
[data-theme="light"] .shv-tiroir-bas .theme-tiroir { color: #0a0a0a; border-color: #00000033; }
[data-theme="light"] .section-title { -webkit-text-fill-color: #0a0a0a !important; color: #0a0a0a !important; }
[data-theme="light"] .ornements i { filter: brightness(0.55); }

/* Page Suivi : l'ancien menu prenait de la place dans la page, le nouveau est fixe */
body:has(#code-screen) { padding-top: var(--shv-nav-h); }

/* Le fondu d'entrée des pages ne doit pas utiliser de « transform » sur body :
   sinon le menu fixe et le tiroir défilent avec la page au lieu de rester en place. */
@keyframes shvEntree { from { opacity: 0; } to { opacity: 1; } }
body { animation: shvEntree 0.35s ease both !important; transform: none !important; }
.shv-tiroir .shv-pill-clair { display: inline-flex !important; }
