/* Bandeau site (.ha-site-header) — préfixé pour ne pas entrer en conflit avec map.php (.topbar). */

/* Bandeau flottant pleine largeur : sticky, vitré, ombre — sans rétrécir au millieu de page */
.ha-site-header {
  position: sticky;
  top: max(14px, env(safe-area-inset-top, 0px));
  z-index: 100;
  box-sizing: border-box;
  width: 100%;
  margin: 14px 0 0;
  border-radius: 0;
  border: none;
  border-bottom: var(--ha-header-border, 1px solid rgba(255, 255, 255, 0.1));
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.38);
  background: var(--ha-header-bar-bg, rgba(11, 26, 43, 0.82));
  background-image: var(--ha-header-bar-bg-img, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: visible;
}

/* En-tête fixe au flux (non flottante / non sticky) */
.ha-site-header.ha-site-header--static {
  position: relative;
  top: auto;
  margin: 0;
  box-shadow: none;
}

.ha-site-header .ha-menu-toggle {
  display: none;
  font-size: 24px;
  cursor: pointer;
  color: #f5c400;
}

.ha-site-header .ha-topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "logo nav tools";
  align-items: center;
  column-gap: 16px;
  padding: 14px clamp(18px, 4vw, 30px);
  background: var(--ha-header-topbar-bg, transparent);
  border-bottom: none;
  border-radius: 0;
  color: var(--ha-header-text-fg, inherit);
}

.ha-site-header .ha-topbar-left {
  grid-area: logo;
  flex-shrink: 0;
  justify-self: start;
  border-radius: 0;
  overflow: visible;
}

.ha-site-header .ha-topbar-left a {
  display: inline-block;
  line-height: 0;
  border-radius: 0;
}

.ha-site-header .ha-topbar-left img {
  height: var(--ha-header-logo-max-h, 30px);
  max-height: var(--ha-header-logo-max-h, 30px);
  width: auto;
  max-width: var(--ha-header-logo-max-w, 168px);
  display: block;
  object-fit: contain;
  border-radius: 0;
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.25));
}

.ha-site-header.ha-client-chrome .ha-topbar-left img {
  max-width: var(--ha-header-logo-max-w, none);
}

.ha-site-header.ha-client-chrome .ha-client-site-title {
  display: inline-block;
  max-width: min(420px, 72vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--ha-header-text-fg, inherit);
  text-decoration: none;
  line-height: 1.25;
  padding: 4px 0;
}

.ha-site-header.ha-client-chrome .ha-client-site-title:hover {
  opacity: 0.92;
}

.ha-site-header.ha-client-chrome .ha-topbar-brand-link--inline,
.ha-site-header.ha-client-chrome .ha-topbar-brand-link--stacked {
  display: inline-flex;
  text-decoration: none;
  max-width: min(520px, 92vw);
}

.ha-site-header.ha-client-chrome .ha-topbar-brand-link--inline {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  line-height: 1.2;
}

.ha-site-header.ha-client-chrome .ha-topbar-brand-link--stacked {
  flex-direction: column;
  align-items: center;
  gap: 6px;
  line-height: 0;
  max-width: min(420px, 88vw);
}

.ha-site-header.ha-client-chrome .ha-topbar-brand-link--stacked .ha-client-site-title {
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  padding: 0;
}

.ha-site-header--logo-align-left .ha-topbar-brand-link--inline,
.ha-site-header--logo-align-left .ha-topbar-brand-link--stacked {
  align-items: flex-start;
}

.ha-site-header--logo-align-left .ha-topbar-brand-link--stacked .ha-client-site-title,
.ha-site-header--logo-align-left .ha-topbar-brand-link--inline .ha-client-site-title {
  text-align: left;
}

.ha-site-header--logo-align-right .ha-topbar-brand-link--inline,
.ha-site-header--logo-align-right .ha-topbar-brand-link--stacked {
  align-items: flex-end;
}

.ha-site-header--logo-align-right .ha-topbar-brand-link--stacked .ha-client-site-title,
.ha-site-header--logo-align-right .ha-topbar-brand-link--inline .ha-client-site-title {
  text-align: right;
}

.ha-site-header.ha-client-chrome .ha-topbar-brand-link--inline .ha-client-site-title {
  line-height: 1.25;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  padding: 0;
}

.ha-site-header--logo-align-center .ha-topbar {
  position: relative;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  grid-template-areas:
    "head"
    "nav";
}

.ha-site-header--logo-align-center .ha-topbar-left {
  grid-area: head;
  justify-self: center;
  width: 100%;
  display: flex;
  justify-content: center;
}

.ha-site-header--logo-align-center .ha-topbar-nav {
  grid-area: nav;
  justify-self: center;
}

.ha-site-header--logo-align-center .ha-topbar-tools {
  position: absolute;
  top: 14px;
  right: clamp(18px, 4vw, 30px);
  z-index: 2;
  grid-area: unset;
  justify-self: end;
}

.ha-site-header--logo-align-right .ha-topbar {
  grid-template-columns: 1fr auto auto;
  grid-template-areas: "nav logo tools";
}

.ha-site-header--logo-align-right .ha-topbar-left {
  grid-area: logo;
  justify-self: end;
}

.ha-site-header--logo-align-right .ha-topbar-nav {
  grid-area: nav;
  justify-self: start;
}

.ha-site-header--logo-align-right .ha-topbar-tools {
  grid-area: tools;
  justify-self: end;
}

.ha-site-header--logo-align-left .ha-topbar-left {
  grid-area: logo;
  justify-self: start;
}

.ha-site-header .ha-topbar-nav {
  grid-area: nav;
  display: flex;
  gap: 25px;
  justify-content: center;
  justify-self: center;
}

.ha-site-header .ha-topbar-nav a {
  color: var(--ha-header-nav-fg, #fff);
  text-decoration: none;
  font-weight: 500;
}

.ha-site-header .ha-topbar-nav a:hover {
  color: var(--ha-header-nav-hover, #f5c400);
}

.ha-site-header .ha-nav-item {
  position: relative;
  display: flex;
  align-items: center;
}

.ha-site-header .ha-nav-item--has-sub .ha-nav-parent {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ha-header-nav-fg, #fff);
  text-decoration: none;
  font-weight: 500;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.ha-site-header .ha-nav-item--has-sub .ha-nav-parent:hover,
.ha-site-header .ha-nav-item--has-sub .ha-nav-parent:focus-visible {
  color: var(--ha-header-nav-hover, #f5c400);
}

.ha-site-header .ha-nav-caret {
  font-size: 0.72em;
  opacity: 0.85;
  line-height: 1;
}

.ha-site-header .ha-nav-sub {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 180px;
  margin-top: 0;
  padding: 8px 0;
  border-radius: 10px;
  background: rgba(11, 26, 43, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  z-index: 120;
}

/* Pont invisible : garder le sous-menu ouvert en glissant depuis le parent */
.ha-site-header .ha-nav-sub::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 12px;
}

.ha-site-header .ha-nav-item--has-sub:hover .ha-nav-sub,
.ha-site-header .ha-nav-item--has-sub:focus-within .ha-nav-sub,
.ha-site-header .ha-nav-item--has-sub.ha-nav-item--open .ha-nav-sub {
  display: block;
}

.ha-site-header .ha-nav-sub-link {
  display: block;
  padding: 9px 16px;
  color: var(--ha-header-nav-fg, #fff) !important;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}

.ha-site-header .ha-nav-sub-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ha-header-nav-hover, #f5c400) !important;
}

.ha-site-header .ha-topbar-tools {
  grid-area: tools;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  flex-shrink: 0;
  gap: 10px;
  justify-self: end;
  margin-left: auto;
}

.ha-site-header .translate-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--ha-translate-box-bg, #fff);
  border: var(--ha-translate-box-border, 1px solid rgba(0, 0, 0, 0.12));
  padding: 5px 8px;
  border-radius: 8px;
  color: var(--ha-translate-box-fg, #1a1410);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.ha-site-header .translate-icon-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ha-header-tools-fg, #f5c400);
}

.ha-site-header .translate-svg {
  display: block;
}

.ha-site-header .translate-help-text {
  color: var(--ha-translate-box-fg, #1a1410);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  max-width: 118px;
  line-height: 1.2;
}

.ha-site-header .ha-page-translate-select {
  background: var(--ha-translate-box-bg, #fff);
  color: var(--ha-translate-box-fg, #1a1410);
  border: 1px solid rgba(0, 0, 0, 0.15);
  padding: 5px 22px 5px 8px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  max-width: min(136px, 38vw);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.google-translate-hidden-host {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.goog-te-banner-frame.skiptranslate {
  display: none !important;
}

.goog-logo-link,
.goog-te-gadget span {
  display: none !important;
}

.skiptranslate iframe {
  display: none !important;
}

body {
  top: 0 !important;
}

@media (max-width: 700px) {

  .ha-site-header .ha-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #f5c400;
    user-select: none;
    border-radius: 8px;
    -webkit-tap-highlight-color: transparent;
  }

  .ha-site-header .ha-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
  }

  .ha-site-header .ha-topbar {
    display: flex;
    justify-content: flex-start;
    position: relative;
    z-index: 300;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    overflow: visible;
  }

  .ha-site-header .ha-topbar-left {
    flex: 1 1 auto;
    min-width: 0;
    max-width: calc(100% - var(--ha-mobile-header-tools-w, 148px));
    justify-self: auto;
    overflow: hidden;
  }

  .ha-site-header .ha-topbar-left a {
    display: block;
    max-width: 100%;
  }

  .ha-site-header .ha-topbar-left img {
    max-width: 100% !important;
    max-height: min(var(--ha-header-logo-max-h, 56px), 22vw, 96px) !important;
    height: auto !important;
    width: auto;
  }

  .ha-site-header .ha-topbar-tools {
    flex: 0 0 auto;
    flex-shrink: 0;
    gap: 6px;
    justify-self: auto;
    margin-left: auto;
    position: relative;
    z-index: 5;
  }

  .ha-site-header--logo-align-center .ha-topbar {
    justify-content: flex-end;
    align-items: center;
    min-height: 52px;
  }

  /* Centrer la marque dans l’espace à gauche des outils (évite chevauchement titre / traduction). */
  .ha-site-header--logo-align-center .ha-topbar-left {
    position: absolute;
    left: clamp(12px, 3vw, 18px);
    right: calc(var(--ha-mobile-header-tools-w, 148px) + 6px);
    top: 50%;
    transform: translateY(-50%);
    flex: none;
    width: auto;
    max-width: none;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    overflow: hidden;
  }

  .ha-site-header--logo-align-center .ha-topbar-left a {
    pointer-events: auto;
    max-width: 100%;
  }

  .ha-site-header--logo-align-center .ha-topbar-tools {
    position: relative;
    top: auto;
    right: auto;
    margin-left: auto;
  }

  .ha-site-header.ha-client-chrome .ha-topbar:has(.ha-topbar-brand-link--stacked) {
    min-height: calc(min(var(--ha-header-logo-max-h, 56px), 20vw, 72px) + 2.75rem);
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .ha-site-header.ha-client-chrome .ha-topbar-brand-link--stacked {
    max-width: 100%;
    gap: 4px;
  }

  .ha-site-header.ha-client-chrome .ha-topbar-brand-link--stacked img {
    max-height: min(var(--ha-header-logo-max-h, 56px), 20vw, 72px) !important;
    height: auto !important;
    width: auto !important;
    max-width: min(72vw, 240px) !important;
  }

  .ha-site-header.ha-client-chrome .ha-topbar-brand-link--stacked .ha-client-site-title {
    font-size: clamp(0.82rem, 3.6vw, 1.05rem);
    line-height: 1.2;
    max-width: 100%;
    text-align: center;
    overflow-wrap: anywhere;
  }

  .ha-site-header .ha-topbar-nav {
    display: none;
    box-sizing: border-box;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    margin: 0;
    padding: 8px 0;
    background: rgba(11, 26, 43, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-top: none;
    border-radius: 0 0 14px 14px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
    z-index: 10050;
    max-height: min(70vh, 420px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ha-site-header .ha-topbar-nav.active {
    display: flex;
  }

  /* Au-dessus des iframes/overlays Google Translate — ne pas mettre position:relative ici : ça annule sticky et le bandeau remonte en haut du document quand on a défilé. */
  .ha-site-header.ha-mobile-nav-open {
    z-index: 2147483646;
  }

  .ha-site-header .ha-topbar-nav a {
    display: block;
    padding: 14px 20px;
    color: #fff !important;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
  }

  .ha-site-header .ha-topbar-nav .ha-nav-item {
    display: block;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .ha-site-header .ha-topbar-nav .ha-nav-item--has-sub .ha-nav-parent {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 14px 20px;
    color: #fff !important;
    font-weight: 600;
    text-align: center;
  }

  .ha-site-header .ha-topbar-nav .ha-nav-sub {
    position: static;
    transform: none;
    display: none;
    min-width: 0;
    width: 100%;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: rgba(0, 0, 0, 0.18);
  }

  .ha-site-header .ha-topbar-nav .ha-nav-item--has-sub.ha-nav-item--open .ha-nav-sub {
    display: block;
  }

  .ha-site-header .ha-topbar-nav .ha-nav-sub-link {
    padding: 12px 20px 12px 28px;
    font-size: 0.95em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    text-align: left;
  }

  .ha-site-header .ha-topbar-nav .ha-nav-sub-link:last-child {
    border-bottom: none;
  }

  .ha-site-header .ha-topbar-nav a:last-child,
  .ha-site-header .ha-topbar-nav .ha-nav-item:last-child {
    border-bottom: none;
  }

  .ha-site-header .translate-help-text {
    display: none;
  }

  .ha-site-header .ha-page-translate-select {
    max-width: 3.6rem;
    padding: 5px 16px 5px 6px;
  }
}

:root {
  --ha-site-header-stack-h: 0px;
}

/* Panneau imbriqué (bloc dans bloc) : sous-cartes en une colonne sur smartphone — le HTML publié
   pose grid-template-columns en inline ; !important permet de l’outrepasser au breakpoint mobile. */
@media (max-width: 700px) {
  .nested-panel-grid {
    grid-template-columns: 1fr !important;
  }
}
