/* ==========================================================================
   Annuaire ViewSurf — feuille de style
   Thème clair : fond blanc, texte bleu nuit, touches de rouge sur l'essentiel
   ========================================================================== */

:root {
  --white: #ffffff;
  --navy: #001b39;         /* texte principal */
  --navy-soft: #173961;    /* texte secondaire */
  --navy-faint: #556b9e;   /* texte tertiaire / placeholders */
  --navy-pale: #dfe4ee;    /* bordures */
  --surface: #f5f7fb;      /* fonds de panneaux */
  --surface-hover: #eceff7;
  --red: #d60725;          /* accent : ce qui compte */
  --red-dark: #6a0a19;
  --red-pale: #f7e3e2;
  --radius-sm: 6px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(12, 31, 63, 0.05), 0 8px 24px rgba(12, 31, 63, 0.06);
  --max-width: 960px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--white);
  color: var(--navy);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.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;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--white);
  color: var(--navy);
  padding: 2.75rem 1.5rem 0;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red); /* red, lightened for contrast on navy */
}

.site-header h1 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.site-header .subtitle {
  margin: 0 0 1.75rem;
  max-width: 40em;
  color: var(--navy-soft);
  font-size: 0.98rem;
}

/* ---------- Layout ---------- */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.75rem 1.5rem 4rem;
}

/* ---------- Toolbar ---------- */

.toolbar {
  background: var(--surface);
  border: 1px solid var(--navy-pale);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.search-row input[type="search"] {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font-size: 1rem;
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--navy-pale);
  border-radius: var(--radius-sm);
}

.search-row input[type="search"]::placeholder {
  color: var(--navy-faint);
}

.search-row input[type="search"]:focus {
  border-color: var(--navy-soft);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.9rem;
  margin-top: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1 1 160px;
  min-width: 140px;
}

.field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--navy-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field select {
  width: 100%;
  padding: 0.55rem 0.6rem;
  font-size: 0.92rem;
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--navy-pale);
  border-radius: var(--radius-sm);
}

.btn-ghost {
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy-soft);
  background: transparent;
  border: 1px solid var(--navy-pale);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  height: fit-content;
}

.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--navy);
}

.types-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--navy-pale);
}

.chip {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy-soft);
  background: var(--white);
  border: 1px solid var(--navy-pale);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.chip:hover {
  border-color: var(--navy-soft);
  color: var(--navy);
}

.chip.is-active {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}

.chip.is-active:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
}

/* ---------- Summary ---------- */

.summary {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin: 0 0 1rem;
  padding: 0 0.2rem;
  font-size: 0.95rem;
  color: var(--navy-soft);
}

.summary p { margin: 0; }

.count {
  color: var(--red);
  font-size: 1.15rem;
  font-weight: 800;
}

/* ---------- Results ---------- */

.results {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.group {
  border: 1px solid var(--navy-pale);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
}

.group-header {
  padding: 0.7rem 1.1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--navy-pale);
}

.breadcrumb {
  margin: 0;
  font-size: 0.82rem;
  color: var(--navy-soft);
}

.breadcrumb .sep {
  margin: 0 0.35em;
  color: var(--navy-faint);
}

.breadcrumb .ville-name {
  color: var(--navy);
  font-weight: 700;
  font-size: 0.95rem;
}

.links {
  list-style: none;
  margin: 0;
  padding: 0.3rem 1.1rem;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--surface);
}

.link-item:last-child { border-bottom: none; }

.badge {
  flex: 0 0 auto;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--navy-soft);
  background: var(--surface);
  border: 1px solid var(--navy-pale);
  border-radius: 999px;
  min-width: 4.6em;
  text-align: center;
}

.label {
  flex: 1 1 auto;
  color: var(--navy);
  font-size: 0.94rem;
}

.open-link {
  flex: 0 0 auto;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--red);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
}

.open-link:hover {
  color: var(--red-dark);
  border-bottom-color: var(--red-dark);
}

/* ---------- Empty state ---------- */

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--navy-soft);
  font-size: 0.98rem;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--red);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.link-btn:hover { color: var(--red-dark); }

/* ---------- Footer ---------- */

.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem 2.5rem;
  color: var(--navy-faint);
  font-size: 0.82rem;
}

.site-footer a {
  color: var(--navy-soft);
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .site-header { padding: 2rem 1.1rem 0; }
  main { padding: 1.25rem 1.1rem 3rem; }
  .filter-row { flex-direction: column; align-items: stretch; }
  .btn-ghost { width: 100%; }
  .link-item { flex-wrap: wrap; }
  .open-link { margin-left: auto; }
}