/* BravRez visual identity: fixed top banner, phone drawer, footer logo (preview only).
   Loaded after theme.css: every colour comes from the --bv-* variables. Without JS (and so without
   data-theme) the dark values apply: every "dark only" rule uses :root:not([data-theme=light]). */

html { scroll-padding-top: 80px; }
/* Some pages (articles) set overflow-x: hidden on html and body, which turns body into a scroll
   container and breaks position: sticky. clip hides the overflow without that side effect. */
html:root, html:root body { overflow-x: clip; }

/* ---------- Banner shell ---------- */
.tf-header.bv-bandeau {
  position: sticky;
  top: 0 !important; /* main.js moves the header off-screen on scroll: neutralised here */
  width: 100%;
  padding: 0;
  z-index: 1000;
  background: var(--bv-surface);
  background: color-mix(in srgb, var(--bv-surface) 94%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: none;
}
/* Light only: nearly opaque, so the banner does not turn grey over the dark home scene */
[data-theme=light] .tf-header.bv-bandeau {
  background: color-mix(in srgb, var(--bv-surface) 98%, transparent);
}
.bv-barre {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 72px;
  padding: 0 20px;
  transition: height .2s ease;
}
.bv-serre .bv-barre { height: 58px; }
.bv-barre::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1.5px;
  background: var(--bv-trait);
  pointer-events: none;
}
:root:not([data-theme=light]) .bv-barre::after { box-shadow: 0 0 8px rgba(165, 139, 255, .55); }

/* ---------- Logo ---------- */
.bv-logo-lien { display: inline-flex; align-items: center; flex: none; line-height: 0; }
.bv-barre .bv-logo { height: 36px; width: auto; transition: height .2s ease; }
.bv-serre .bv-logo { height: 30px; }
:root:not([data-theme=light]) .bv-logo .bv-nom { filter: url(#bv-halo); }
:root:not([data-theme=light]) .bv-logo .bv-ijin { filter: url(#bv-halo-ijin); }
.bv-anime .bv-ijin { animation: bv-flotte 3.4s ease-in-out infinite; }
.bv-anime .bv-ij-yeux { transform-box: fill-box; transform-origin: center; animation: bv-cligne 5.5s infinite; }
@keyframes bv-flotte { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.5px); } }
@keyframes bv-cligne { 0%, 94%, 100% { transform: scaleY(1); } 96.5% { transform: scaleY(.15); } }

/* ---------- Menu ---------- */
.bv-nav { flex: 1 1 auto; align-self: stretch; display: flex; justify-content: center; }
.bv-menu { display: flex; align-items: stretch; gap: 4px; list-style: none; margin: 0; padding: 0; }
.bv-it { position: relative; display: flex; align-items: center; }
.bv-lien {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 11px;
  border: 0; border-radius: 8px;
  background: none;
  color: var(--bv-gris);
  font: inherit; font-size: 13.5px; line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: color .15s, background-color .15s;
}
.bv-lien:hover, .bv-lien[aria-current=page], .bv-it.ouvert > .bv-lien { color: var(--bv-texte); }
.bv-it.ouvert > .bv-lien { background: color-mix(in srgb, var(--bv-texte) 7%, transparent); }
.bv-lien[aria-current=page] .bv-i { stroke: var(--bv-orange); }
.bv-lien:focus-visible, .bv-rond:focus-visible, .bv-panneau a:focus-visible, .bv-tiroir a:focus-visible,
.bv-logo-lien:focus-visible { outline: 2px solid var(--bv-lien); outline-offset: 2px; }
.bv-i { width: 17px; height: 17px; flex: none; }
.bv-fl { width: 14px; height: 14px; margin-left: -3px; fill: none; stroke: currentColor; stroke-width: 2; }

/* ---------- Actions on the right ---------- */
.bv-actions { display: inline-flex; gap: 8px; flex: none; margin-left: auto; }
.bv-nav + .bv-actions { margin-left: 0; }
.bv-rond {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--bv-bordure); border-radius: 9px;
  background: none;
  color: var(--bv-texte);
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.bv-rond:hover { border-color: var(--bv-gris); background: color-mix(in srgb, var(--bv-texte) 6%, transparent); }
.bv-theme .bv-soleil { display: none; }
[data-theme=light] .bv-theme .bv-lune { display: none; }
[data-theme=light] .bv-theme .bv-soleil { display: inline; }
.bv-burger { display: none; }
/* The toggle needs JS: hide it without */
:root:not(.bv-js) .bv-theme { display: none; }

/* ---------- Panels (Services, Articles) ---------- */
.bv-panneau { position: absolute; top: 100%; left: -6px; z-index: 5; display: none; padding-top: 10px; }
.bv-it.ouvert > .bv-panneau { display: block; }
/* Without JS: open on hover and keyboard focus */
:root:not(.bv-js) .bv-sous:hover > .bv-panneau,
:root:not(.bv-js) .bv-sous:focus-within > .bv-panneau { display: block; }
.bv-pan-in {
  display: grid; gap: 2px;
  min-width: 250px; margin: 0; padding: 8px; list-style: none;
  background: var(--bv-surface);
  border: 1px solid var(--bv-bordure); border-radius: 12px;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .55);
}
[data-theme=light] .bv-pan-in { box-shadow: 0 18px 40px -14px rgba(18, 26, 46, .3); }
.bv-pan-large { min-width: 340px; }
.bv-pan-in a {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px 8px 8px; border-radius: 9px;
  color: var(--bv-texte); text-decoration: none;
}
.bv-pan-in li:first-child a { background: color-mix(in srgb, var(--bv-texte) 6%, transparent); }
.bv-pan-in a:hover { background: color-mix(in srgb, var(--bv-texte) 10%, transparent); }
.bv-pan-in b { display: block; font-weight: 500; font-size: 13.5px; color: var(--bv-texte); }
.bv-pan-in small { display: block; margin-top: 2px; font-size: 12px; color: var(--bv-gris); }

/* Planet: round badge holding a drawing, coloured by --c */
.bv-pl {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--c);
  border: 1.5px solid color-mix(in srgb, var(--c) 70%, transparent);
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%);
}
.bv-pl svg { width: 62%; height: 62%; }
:root:not([data-theme=light]) .bv-pl { box-shadow: 0 0 10px -2px color-mix(in srgb, var(--c) 70%, transparent); }
[data-theme=light] .bv-pl {
  color: color-mix(in srgb, var(--c) 55%, #1a1a2a);
  border-color: color-mix(in srgb, var(--c) 60%, #1a1a2a);
}

/* ---------- Intermediate widths: icons only, one line ---------- */
@media (min-width: 992px) and (max-width: 1199px) {
  .bv-menu .bv-lien span {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .bv-fl { display: none; }
  .bv-lien { padding: 9px 10px; }
}

/* ---------- Phone: logo, theme button and burger ---------- */
@media (max-width: 991.98px) {
  .bv-barre { height: 58px; padding: 0 14px; justify-content: space-between; }
  .bv-barre .bv-logo, .bv-serre .bv-logo { height: 28px; }
  .bv-nav { display: none; }
  .bv-burger { display: inline-flex; }
  .bv-rond { width: 34px; height: 34px; }
}
@media (max-width: 575.98px) { .bv-recherche { display: none; } }

/* ---------- Phone drawer ---------- */
.bv-tiroir { background: var(--bv-fond); color: var(--bv-texte); }
.bv-tiroir .canvas-header { padding: 14px 20px; }
.bv-tiroir .canvas-body { padding: 8px 20px 24px; }
.bv-tiroir .bv-fermer { font-size: 12px; }
.bv-rub {
  display: flex; align-items: center; gap: 9px;
  margin: 14px 0 6px; padding: 0;
  font-weight: 600; font-size: 15px; color: var(--bv-texte); text-decoration: none;
}
.bv-rub .bv-i { width: 18px; height: 18px; stroke: var(--bv-orange); }
.bv-sousliste { display: grid; gap: 4px; margin: 0 0 4px; padding: 0 0 0 4px; list-style: none; }
.bv-sousliste a { display: flex; align-items: center; gap: 10px; padding: 3px 0; color: var(--bv-gris); text-decoration: none; }
.bv-sousliste b { font-weight: 500; font-size: 14px; color: var(--bv-texte); }

/* ---------- Footer logo: one image per theme ---------- */
.bv-pied { display: block; height: 40px; width: auto; }
.bv-pied-clair { display: none; }
[data-theme=light] .bv-pied-sombre { display: none; }
[data-theme=light] .bv-pied-clair { display: block; }

/* ---------- Fewer animations ---------- */
@media (prefers-reduced-motion: reduce) {
  .bv-anime .bv-ijin, .bv-anime .bv-ij-yeux { animation: none; }
  .tf-header.bv-bandeau, .bv-barre, .bv-barre .bv-logo, .bv-lien, .bv-rond { transition: none; }
}
