/* ── Variables ──────────────────────────────────────────────────────────── */
:root {
  --fhf-blue:        rgb(58,  94, 226);
  --fhf-blue-deep:   rgb(41,  90, 244);
  --fhf-blue-light:  rgb(135,155, 234);
  --fhf-purple:      rgb(137, 82, 173);
  --fhf-purple-pill: rgb(148, 74, 178);
  --fhf-purple-soft: rgb(237,219, 249);
  --fhf-red:         rgb(235, 72,  63);
  --fhf-text:        rgb(106,104, 110);
  --fhf-bg:          #FFFFFF;
  --fhf-bg-soft:     #F5F5F5;
  --fhf-bg-legend:   #FFFFFF;
  --fhf-border:      rgba(0,0,0,.08);
  --radius-pill:     999px;
  --radius-card:     35px;
  --radius-card-web: 30px;
  --pill-h:          55px;
  --font-sans:       "DM Sans", system-ui, sans-serif;
  --shadow-card:     0 4px 12px rgba(0,0,0,.08);
  --shadow-pill:     0 2px 6px  rgba(0,0,0,.10);
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  color: var(--fhf-text);
  background: var(--fhf-bg);
}
#app { display: block; min-height: 100vh; }

/* ── Widget shell ───────────────────────────────────────────────────────── */
.ws {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 2vw, 32px);
  padding: clamp(16px,2vw,24px) clamp(16px,4vw,24px);
  max-width: 1328px;
  margin: 0 auto;
}

/* Hero */
.ws__hero {
  background: var(--fhf-blue);
  color: #fff;
  border-radius: var(--radius-card-web);
  padding: clamp(28px,3.5vw,56px) clamp(32px,4vw,64px);
  display: grid;
  grid-template-columns: minmax(0,1.2fr) minmax(0,1fr);
  gap: clamp(20px,3vw,48px);
  align-items: start;
  box-shadow: var(--shadow-card);
}
.ws__hero-title {
  margin: 0;
  font-size: clamp(36px,4vw,64px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.02em;
}
.ws__hero-body {
  margin: 0;
  font-size: clamp(15px,1.2vw,18px);
  line-height: 1.45;
  font-weight: 500;
}
@media (max-width: 720px) {
  .ws__hero { grid-template-columns: 1fr; gap: 18px; }
}

/* Map */
.ws__map-wrap {
  position: relative;
  width: 100%;
  height: clamp(360px, 60vh, 720px);
  background: var(--fhf-bg-soft);
}
.ws__map {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-card-web);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.ws__map-pill {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 5;
}
@media (max-width: 720px) {
  .ws__map-pill { right: 16px; }
}

/* Bottom panels */
.ws__bottom {
  display: grid;
  gap: clamp(16px,1.5vw,24px);
  align-items: stretch;
}
.ws__bottom[hidden] { display: none; }
.ws__panel[hidden] { display: none; }
.ws__bottom[data-state="region-only"] { grid-template-columns: 1fr; }
.ws__bottom[data-state="region-ght"]  { grid-template-columns: 1fr 1fr; }
@media (max-width: 720px) {
  .ws__bottom[data-state="region-ght"] { grid-template-columns: 1fr; }
}
.ws__panel {
  min-height: clamp(280px,36vh,486px);
  border-radius: var(--radius-card-web);
  overflow: hidden;
  min-width: 0;
}

/* Legend (dans le hero) */
.ws__legend {
  display: grid;
  grid-template-columns: minmax(0,1.6fr) minmax(0,1fr);
  gap: clamp(20px,3vw,48px);
  font-size: clamp(13px,1vw,16px);
  font-weight: 500;
  color: #fff;
}
@media (max-width: 720px) {
  .ws__legend { grid-template-columns: 1fr; }
}
.ws__legend-col { display: flex; flex-direction: column; gap: 10px; }
.ws__legend-item {  color: var(--fhf-text); display: flex; align-items: center; gap: 10px; line-height: 1.4; }
.ws__legend-item strong { font-weight: 800; margin-right: 4px; }
.ws__legend-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-block;
}
.ws__legend-icon--chu {
  background: #f59e0b;
  border-radius: 50%;
}

/* ── Pill dropdown (sélecteur de région) ───────────────────────────────── */
.pill { position: relative; }
.pill__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: var(--pill-h);
  min-width: 220px;
  width: min(320px, calc(100vw - 32px));
  padding: 0 20px;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  background: var(--fhf-purple-pill);
  cursor: pointer;
  box-shadow: var(--shadow-pill);
  transition: box-shadow .15s;
}
.pill__option {
  padding: 8px 24px;
  font-size: 18px;
  font-weight: 600;
  color: var(--fhf-text);
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  line-height: 1.15;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  transition: background .12s ease;
}
.pill__toggle:hover { box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.pill__arrow {
  background: #fff;
  color: var(--fhf-purple-pill);
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .16s ease;
}
.pill__toggle[aria-expanded="true"] .pill__arrow { transform: rotate(180deg); }
.pill__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(0,0,0,.14);
  list-style: none;
  margin: 0;
  padding: 8px 0;
  max-height: 320px;
  overflow-y: auto;
  z-index: 100;
}

.pill__label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
.pill__option:hover,
.pill__option[aria-selected="true"],
.pill__option--selected {
  background: var(--fhf-purple-soft);
  color: var(--fhf-purple);
}

/* Variante bleue (sélecteur GHT dans le panel stats) */
.pill--blue .pill__toggle {
  background: #fff;
  color: var(--fhf-blue-deep);
  font-size: clamp(13px, 1.4vw, 17px);
  width: 100%;
  min-width: 0;
}
.pill--blue .pill__arrow {
  background: var(--fhf-blue-deep);
  color: #fff;
}

/* ── Region info card ───────────────────────────────────────────────────── */
.rinfo {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-card-web);
  overflow: hidden;
  background: var(--fhf-blue);
  color: #fff;
  box-shadow: var(--shadow-card);
}
.rinfo__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.rinfo__gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(10,42,140,.78) 0%,
    rgba(10,42,140,.30) 35%,
    rgba(0,0,0,.55) 100%);
}
.rinfo__body {
  position: relative;
  z-index: 1;
  padding: clamp(20px,5vw,38px);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}
.rinfo__title {
  margin: 0 0 8px;
  font-size: clamp(32px,3.6vw,56px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -.02em;
  overflow-wrap: break-word;
}
.rinfo__subtitle {
  margin: 0;
  font-size: clamp(16px,1.6vw,22px);
  font-weight: 700;
  opacity: .95;
}
.rinfo__pathologies { display: flex; flex-direction: column; gap: 14px; }
.rinfo__patholabel  { margin: 0 0 4px; font-size: 18px; font-weight: 700; line-height: 1.2; opacity: .95; }
.rinfo__patholist   { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.rinfo__pathchip {
  background: #fff;
  color: var(--fhf-purple-pill);
  min-height: var(--pill-h);
  display: inline-flex;
  align-items: center;
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 16px;
  box-shadow: var(--shadow-pill);
}

/* ── GHT stats panel ────────────────────────────────────────────────────── */
.gstat {
  background: var(--fhf-blue-deep);
  color: #fff;
  border-radius: var(--radius-card);
  padding: clamp(16px, 3vw, 23px) clamp(16px, 3vw, 23px) clamp(20px, 4vw, 38px);
  box-shadow: var(--shadow-card);
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.gstat__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.gstat__head .pill { flex: 1 1 auto; min-width: 0; }
.gstat__name {
  margin: 0;
  font-size: clamp(20px,2vw,28px);
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}
.gstat__support { margin: 0; font-size: 14px; font-weight: 600; color: #fff; }
.gstat__fiche {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  color: var(--fhf-blue-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: var(--shadow-pill);
  transition: filter .12s ease, transform .12s ease;
}
.gstat__fiche:hover {   color: #fff;
  background: var(--fhf-blue-deep); }
.gstat__badges[hidden] { display: none; }
.gstat__badges { display: flex; flex-wrap: wrap; gap: 10px; }
.gstat__badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border-radius: 16px;
  padding: 10px 16px;
  min-width: 80px;
  box-shadow: var(--shadow-pill);
}
.gstat__badge-count { font-size: 22px; font-weight: 800; color: var(--fhf-blue); line-height: 1; }
.gstat__badge-label { font-size: 11px; font-weight: 500; color: var(--fhf-text); text-align: center; margin-top: 4px; }
.gstat__extra-title { margin: 0; font-size: 16px; font-weight: 800; color: var(--fhf-blue); }
.gstat__extra-body  { font-size: 14px; line-height: 1.5; }
.statsp__stack            {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: clamp(20px, 2vw, 36px);
  row-gap: clamp(16px, 1.6vw, 24px);
  align-content: start;
}
.statsp__sep,
.statsp__row:first-child  {     grid-column: 1 / -1; }
.statsp__row              { display: flex; flex-direction: column; gap: 2px; }
.statsp__line             { display: flex; align-items: baseline; gap: 10px; flex-wrap: nowrap; }
.statsp__num              { font-size: 32px; font-weight: 800; line-height: 1; letter-spacing: -0.01em; }
.statsp__lbl              { font-size: 17px; font-weight: 600; line-height: 1.18; opacity: .95; }
.statsp__lbl--inline      { font-size: 32px; font-weight: 800; letter-spacing: -0.01em; line-height: 1; opacity: 1; }
.statsp__row--pop .statsp__num,
.statsp__row--pop .statsp__lbl--inline { font-size: clamp(22px,4.2vw,28px); letter-spacing: -0.02em; white-space: nowrap; }
.statsp__row--pop .statsp__line { gap: 6px; }
.statsp__sep              { margin: 4px 0 -2px; font-size: 20px; font-weight: 700; opacity: .95; }
.gstat__contacts    { font-size: 13px; }
.gstat__contacts h4 { margin: 0 0 8px; font-size: 14px; color: var(--fhf-text); }
.gstat__contacts ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.gstat__contact-kind { font-weight: 700; margin-right: 6px; }
.gstat__contacts a  { color: var(--fhf-blue); }

/* ── Google Maps : popups ───────────────────────────────────────────────── */
.gm-style .gm-style-iw,
.gm-style .gm-style-iw-c {
  padding: 10px 14px !important;
  background: #fff !important;
  border: 0 !important;
  box-shadow: 0 2px 8px #00000024 !important;
  border-radius: 10px !important;
  max-width: none !important;
}
.gm-style .gm-style-iw-tc     { display: none !important; }
.gm-style .gm-style-iw-d      { overflow: visible !important; padding: 0 !important; }
.gm-style-iw button.gm-ui-hover-effect { display: none !important; }

/* Macro labels (noms des GHT) */
.ght-macro-label {
  background: rgba(148,74,178,.9);
  color: #fff;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}
