/* Capsite — section Zone desservie (préfixe .csz- pour éviter les collisions avec css/style.css) */

.csz {
  --csz-bg: var(--bg-soft, #f3f7fd);
  --csz-bg-blue: var(--bg-blue, #eaf2ff);
  --csz-card: var(--card, #ffffff);
  --csz-line: var(--line, #c9d5e8);
  --csz-line-strong: var(--line-strong, #8da2c4);
  --csz-text: var(--text, #111827);
  --csz-text-soft: var(--text-soft, #1f2937);
  --csz-muted: var(--muted, #374151);
  --csz-blue: var(--blue, #0842b5);
  --csz-blue-hover: var(--blue-hover, #062f87);
  --csz-blue-bright: var(--blue-bright, #1a6dff);
  --csz-green: var(--green, #0a5c30);
  --csz-green-bg: var(--green-bg, #e6f4ec);
  --csz-font-display: var(--font-display, "Lexend", "Atkinson Hyperlegible Next", ui-sans-serif, system-ui, sans-serif);
  --csz-font-body: var(--font-body, "Atkinson Hyperlegible Next", ui-sans-serif, system-ui, sans-serif);
  --csz-radius: var(--radius, 18px);
  --csz-shadow: var(--shadow, 0 1px 2px rgba(17, 24, 39, .06), 0 8px 24px -10px rgba(17, 24, 39, .16));
  --csz-wrap: var(--wrap, 1160px);

  background: var(--csz-bg);
  color: var(--csz-text-soft);
  font-family: var(--csz-font-body);
  font-size: clamp(1.125rem, 1.05rem + .25vw, 1.1875rem);
  line-height: 1.65;
  padding: clamp(48px, 6vw, 88px) 0 72px;
}

.csz *, .csz *::before, .csz *::after { box-sizing: border-box; }
.csz a { color: var(--csz-blue); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.csz a:hover { color: var(--csz-blue-hover); }
.csz h2, .csz h3 { font-family: var(--csz-font-display); font-weight: 650; line-height: 1.2; letter-spacing: -.01em; color: var(--csz-text); margin: 0; text-wrap: balance; }
.csz p { margin: 0; text-wrap: pretty; }
.csz :focus-visible { outline: 4px solid var(--csz-blue-bright); outline-offset: 3px; border-radius: 6px; }

.csz-wrap { width: min(100% - 40px, var(--csz-wrap)); margin-inline: auto; }

.csz-head { display: grid; gap: 16px; margin-bottom: 28px; max-width: 760px; justify-items: start; }
.csz-eyebrow {
  display: inline-block; font-size: 1rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--csz-blue); padding: 6px 14px; border-radius: 999px; background: var(--csz-bg-blue); border: 1px solid #b9cdf0;
}
.csz-title { font-size: clamp(2rem, 4.2vw, 2.75rem); }
.csz-title em { font-style: normal; color: var(--csz-blue); }
.csz-lede { font-size: clamp(1.1875rem, 1.1rem + .35vw, 1.3rem); max-width: 62ch; }

/* ----- Onglets ----- */
.csz-tabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  background: #fff; padding: 8px; border-radius: 22px; border: 1px solid var(--csz-line); box-shadow: var(--csz-shadow);
}
.csz-tab {
  appearance: none; border: 2px solid transparent; background: transparent; color: var(--csz-text);
  border-radius: 16px; padding: 16px 12px; cursor: pointer; text-align: center;
  font: 700 1.05rem/1.25 var(--csz-font-display);
  transition: background .25s, color .25s, border-color .25s;
  display: grid; gap: 8px; justify-items: center;
}
.csz-tab svg { width: 36px; height: 36px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.csz-tab small { font-family: var(--csz-font-body); font-weight: 600; font-size: .92rem; color: var(--csz-muted); }
.csz-tab:hover { background: var(--csz-bg-blue); }
.csz-tab[aria-selected="true"] { background: var(--csz-blue); color: #fff; border-color: var(--csz-blue); }
.csz-tab[aria-selected="true"] small { color: #dbe7ff; }

/* ----- Panneaux ----- */
.csz-panels { margin-top: 22px; }
.csz-panel {
  display: none;
  background: var(--csz-card);
  border: 1px solid var(--csz-line);
  border-radius: 22px;
  box-shadow: var(--csz-shadow);
  overflow: hidden;
  animation: csz-rise .4s ease;
}
.csz-panel.is-on { display: block; }
.csz-panel--split.is-on { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); }
@keyframes csz-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.csz-copy { padding: clamp(22px, 3vw, 32px); display: grid; gap: 14px; align-content: start; }
.csz-copy h3 { font-size: clamp(1.45rem, 2.3vw, 1.8rem); }
.csz-kicker { font-size: .9rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; color: var(--csz-green); }
.csz-kicker.is-blue { color: var(--csz-blue); }

.csz-aside {
  font-size: 1.05rem; padding: 14px 16px; border-radius: 14px;
  background: var(--csz-bg-blue); border: 1px solid #b9cdf0;
}
.csz-address {
  display: grid; gap: 2px; padding: 14px 16px; border-radius: 14px;
  background: #fff; border: 1px dashed var(--csz-line-strong);
}
.csz-address strong { font-family: var(--csz-font-display); font-size: 1.15rem; color: var(--csz-text); }

.csz-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.csz-btn,
.csz a.csz-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: fit-content;
  min-height: 56px; padding: 12px 22px; font: 700 1.125rem/1.2 var(--csz-font-body);
  color: #fff; background: var(--csz-blue); border: 2px solid var(--csz-blue); border-radius: 14px;
  cursor: pointer; text-decoration: none; box-shadow: 0 2px 0 rgba(6, 47, 135, .5);
}
.csz-btn:hover,
.csz a.csz-btn:hover { background: var(--csz-blue-hover); border-color: var(--csz-blue-hover); color: #fff; text-decoration: none; }

/* ----- Onglet À domicile : recherche + carte ----- */
.csz-home { display: grid; gap: 0; }
.csz-search {
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--csz-line);
  background: #fff;
}
.csz-search h3 { font-size: 1.15rem; margin-bottom: 4px; }
.csz-search-hint { color: var(--csz-muted); font-size: 1.02rem; margin-bottom: 12px; }
.csz-form { display: flex; gap: 10px; flex-wrap: wrap; }
.csz-form input[type="text"] {
  flex: 1 1 200px; min-height: 56px; padding: 12px 16px;
  font: 600 1.125rem/1.3 var(--csz-font-body);
  border: 2px solid var(--csz-line-strong); border-radius: 14px; color: var(--csz-text); background: #fff;
}
.csz-form input[type="text"]::placeholder { color: #6b7280; font-weight: 500; }
.csz-form input[type="text"]:focus { border-color: var(--csz-blue); outline: none; box-shadow: 0 0 0 4px rgba(26,109,255,.2); }
.csz-result { margin-top: 12px; padding: 12px 16px; border-radius: 14px; font-weight: 600; display: none; }
.csz-result.is-on { display: block; }
.csz-result.is-ok { background: var(--csz-green-bg); color: var(--csz-green); border: 1px solid #9fd4b4; }
.csz-result.is-info { background: var(--csz-bg-blue); color: var(--csz-blue-hover); border: 1px solid #b9cdf0; }

.csz-home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr);
  min-height: 460px;
}
.csz-map-wrap { position: relative; min-height: 460px; background: #d9e4f2; }
.csz-map { height: 100%; min-height: 460px; width: 100%; background: #d9e4f2; }
.csz-legend {
  position: absolute; z-index: 500; left: 12px; bottom: 12px;
  background: rgba(255,255,255,.95); border: 1px solid var(--csz-line); border-radius: 14px;
  padding: 10px 14px; font-size: .95rem; font-weight: 600; box-shadow: var(--csz-shadow);
  display: grid; gap: 6px;
}
.csz-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 8px; vertical-align: -2px; }
.csz-legend .csz-swatch-zone { background: #0a5c30; opacity: .55; border: 2px solid #0a5c30; }
.csz-legend .csz-swatch-atelier { background: var(--csz-blue); border-radius: 50%; }

.csz-side { padding: 20px 20px 18px; display: flex; flex-direction: column; gap: 12px; border-left: 1px solid var(--csz-line); }
.csz-side h3 { font-size: 1.12rem; }
.csz-communes { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.csz-communes li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border-radius: 14px; background: #fff; border: 2px solid var(--csz-line);
  font-weight: 700; cursor: pointer;
}
.csz-communes li:hover, .csz-communes li.is-active {
  border-color: var(--csz-green); background: var(--csz-green-bg);
}
.csz-communes li.is-active { box-shadow: 0 0 0 3px rgba(10,92,48,.15); }
.csz-badge {
  flex: none; font-size: .78rem; font-weight: 750; letter-spacing: .03em; text-transform: uppercase;
  color: var(--csz-green); background: #fff; border: 1px solid #9fd4b4; border-radius: 999px; padding: 4px 8px;
}

.csz-visual { min-height: 380px; background: var(--csz-bg); position: relative; }
.csz-visual .csz-map { min-height: 380px; }

.csz-remote {
  min-height: 380px; height: 100%;
  display: grid; place-items: center; padding: 28px;
  background:
    radial-gradient(circle at 30% 30%, rgba(26,109,255,.16), transparent 40%),
    radial-gradient(circle at 70% 70%, rgba(10,92,48,.14), transparent 40%),
    #eaf2ff;
}
.csz-remote-card {
  width: min(100%, 320px); background: #fff; border-radius: 20px; border: 1px solid var(--csz-line);
  box-shadow: var(--csz-shadow); padding: 22px; display: grid; gap: 12px; text-align: center; justify-items: center;
}
.csz-screen {
  width: 100%; height: 140px; border-radius: 12px; background: #0e1b33; position: relative; overflow: hidden;
}
.csz-screen::before, .csz-screen::after {
  content: ""; position: absolute; left: 16px; right: 16px; height: 8px; border-radius: 4px; background: #3d6fd6;
}
.csz-screen::before { top: 22px; width: 50%; animation: csz-blink 2.8s ease-in-out infinite; }
.csz-screen::after { top: 42px; background: #7ee2a8; width: 70%; animation: csz-blink 2.8s ease-in-out infinite .4s; }
.csz-bars { position: absolute; left: 16px; right: 16px; top: 64px; display: grid; gap: 8px; }
.csz-bars span { display: block; height: 8px; border-radius: 4px; background: #244078; }
.csz-bars span:nth-child(1) { width: 80%; }
.csz-bars span:nth-child(2) { width: 62%; }
.csz-bars span:nth-child(3) { width: 74%; }
@keyframes csz-blink { 50% { opacity: .45; } }

.csz-pin {
  width: 22px; height: 22px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  border: 3px solid #fff; background: var(--csz-green); box-shadow: 0 2px 8px rgba(17,24,39,.28);
}
.csz-pin--atelier {
  width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  border: 3px solid #fff; background: var(--csz-blue); box-shadow: 0 2px 8px rgba(17,24,39,.28);
}
.csz .leaflet-popup-content-wrapper { border-radius: 14px; box-shadow: var(--csz-shadow); font-family: var(--csz-font-body); }
.csz .leaflet-popup-content { margin: 14px 16px; font-size: 1.05rem; line-height: 1.45; color: var(--csz-text); }
.csz .leaflet-popup-content .csz-pop-title { font-family: var(--csz-font-display); font-weight: 700; font-size: 1.15rem; margin: 0 0 4px; }
.csz .leaflet-popup-content .csz-pop-ok { color: var(--csz-green); font-weight: 750; margin: 0; }

@media (max-width: 860px) {
  .csz-tabs { grid-template-columns: 1fr; }
  .csz-tab { grid-template-columns: auto 1fr; text-align: left; justify-items: start; align-items: center; column-gap: 12px; padding: 12px 14px; }
  .csz-tab svg { grid-row: span 2; width: 28px; height: 28px; }
  .csz-panel--split.is-on { grid-template-columns: 1fr; }
  .csz-home-grid { grid-template-columns: 1fr; min-height: 0; }
  .csz-side { border-left: 0; border-top: 1px solid var(--csz-line); }
  .csz-map-wrap, .csz-map, .csz-visual, .csz-visual .csz-map, .csz-remote { min-height: 320px; }
}

@media (prefers-reduced-motion: reduce) {
  .csz-panel { animation: none; }
  .csz-tab, .csz-communes li { transition: none; }
  .csz-screen::before, .csz-screen::after { animation: none; }
}

.csz-legend .csz-swatch-outer { background: rgba(8, 66, 181, .22); border: 2px dashed #0842b5; }
.csz a.csz-btn-ghost, .csz-btn-ghost {
  color: var(--csz-blue); background: #fff; border-color: var(--csz-blue); box-shadow: none;
}
.csz a.csz-btn-ghost:hover, .csz-btn-ghost:hover {
  color: #fff; background: var(--csz-blue); border-color: var(--csz-blue);
}
.csz-cities { margin-top: 18px; font-size: 1.05rem; max-width: 75ch; }
