/* ==========================================================================
   DAEMON — /nous-trouver/
   Variables préfixées --nt- pour ne pas entrer en collision avec le thème.
   Remplace les fallbacks par tes tokens globaux si tu en as.
   ========================================================================== */

.nt {
  --nt-bg: var(--color-bg, #0a0b0d);
  --nt-panel: var(--color-panel, #121417);
  --nt-line: var(--color-line, #23272d);
  --nt-text: var(--color-text, #e9ecef);
  --nt-muted: var(--color-muted, #8a929c);
  --nt-run: var(--color-accent, #4ade80);
  --nt-berry: #ff4f8b;
  --nt-agrums: #ffb02e;
  --nt-mate: #7bd88f;
  --nt-mono: var(--font-mono, ui-monospace, "JetBrains Mono", "SF Mono", Menlo, monospace);
  --nt-sans: var(--font-sans, "Inter", system-ui, sans-serif);
  --nt-radius: 6px;

  color: var(--nt-text);
  font-family: var(--nt-sans);
  background: var(--nt-bg);
}

.nt *,
.nt *::before,
.nt *::after { box-sizing: border-box; }

.nt a { color: inherit; }
.nt button { font: inherit; color: inherit; cursor: pointer; }

.nt-wrap {
  width: min(1180px, 100% - 2rem);
  margin-inline: auto;
}

/* --- Hero ----------------------------------------------------------------- */

.nt-hero {
  padding: clamp(3rem, 8vw, 6rem) 0 2.5rem;
  display: grid;
  gap: 1rem;
  max-width: 44rem;
}

.nt-hero h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0;
  font-weight: 700;
}

.nt-hero p {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--nt-muted);
  max-width: 36rem;
}

/* Le "terminal" : élément signature de la page.
   Il affiche la requête puis le résultat de la recherche. */
.nt-term {
  font-family: var(--nt-mono);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--nt-muted);
  background: var(--nt-panel);
  border: 1px solid var(--nt-line);
  border-radius: var(--nt-radius);
  padding: 0.85rem 1rem;
  margin-top: 0.5rem;
  white-space: pre-wrap;
}

.nt-term .cmd { color: var(--nt-text); }
.nt-term .ok { color: var(--nt-run); }
.nt-term .cursor::after {
  content: "▮";
  animation: nt-blink 1s steps(2) infinite;
}

@keyframes nt-blink { 50% { opacity: 0; } }

/* --- Recherche ------------------------------------------------------------ */

.nt-search {
  display: grid;
  gap: 0.75rem;
  padding: 1.25rem;
  background: var(--nt-panel);
  border: 1px solid var(--nt-line);
  border-radius: var(--nt-radius);
  position: relative;
}

.nt-search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
}

.nt-input {
  position: relative;
}

.nt-input input {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--nt-text);
  background: var(--nt-bg);
  border: 1px solid var(--nt-line);
  border-radius: var(--nt-radius);
  padding: 0.8rem 1rem 0.8rem 2.5rem;
}

.nt-input input::placeholder { color: var(--nt-muted); }

.nt-input input:focus-visible,
.nt button:focus-visible,
.nt a:focus-visible {
  outline: 2px solid var(--nt-run);
  outline-offset: 2px;
}

.nt-input svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  translate: 0 -50%;
  width: 1.05rem;
  height: 1.05rem;
  color: var(--nt-muted);
  pointer-events: none;
}

.nt-suggest {
  position: absolute;
  inset: calc(100% + 0.25rem) 0 auto 0;
  background: var(--nt-panel);
  border: 1px solid var(--nt-line);
  border-radius: var(--nt-radius);
  list-style: none;
  margin: 0;
  padding: 0.25rem;
  z-index: 20;
  display: none;
}
.nt-suggest[data-open="true"] { display: block; }
.nt-suggest li {
  padding: 0.55rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95rem;
}
.nt-suggest li small { color: var(--nt-muted); margin-left: 0.4rem; }
.nt-suggest li:hover,
.nt-suggest li[aria-selected="true"] { background: var(--nt-line); }

.nt-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.1rem;
  border-radius: var(--nt-radius);
  border: 1px solid var(--nt-line);
  background: transparent;
  white-space: nowrap;
  transition: border-color 0.15s;
}
.nt-btn:hover { border-color: var(--nt-muted); }
.nt-btn svg { width: 1rem; height: 1rem; }
.nt-btn--primary {
  background: var(--nt-run);
  border-color: var(--nt-run);
  color: #071009;
  font-weight: 600;
}
.nt-btn--primary:hover { filter: brightness(1.08); border-color: var(--nt-run); }
.nt-btn[aria-busy="true"] { opacity: 0.6; pointer-events: none; }

.nt-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.nt-chip {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--nt-line);
  background: transparent;
  font-size: 0.875rem;
  color: var(--nt-muted);
}
.nt-chip[aria-pressed="true"] {
  color: var(--nt-text);
  border-color: var(--nt-text);
}

/* --- Résultats : carte + liste -------------------------------------------- */

.nt-results {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: 1rem;
  margin-top: 1rem;
  min-height: 560px;
}

.nt-map {
  border: 1px solid var(--nt-line);
  border-radius: var(--nt-radius);
  overflow: hidden;
  background: var(--nt-panel);
  min-height: 420px;
}

.nt-map .leaflet-container {
  background: var(--nt-panel);
  font-family: var(--nt-sans);
}
.nt-map .leaflet-control-attribution {
  background: rgba(10, 11, 13, 0.7);
  color: var(--nt-muted);
  font-size: 10px;
}
.nt-map .leaflet-control-attribution a { color: var(--nt-muted); }
.nt-map .leaflet-bar a {
  background: var(--nt-panel);
  color: var(--nt-text);
  border-color: var(--nt-line);
}
.nt-map .leaflet-popup-content-wrapper,
.nt-map .leaflet-popup-tip {
  background: var(--nt-panel);
  color: var(--nt-text);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}
.nt-map .leaflet-popup-content { margin: 0.75rem 1rem; font-size: 0.9rem; }
.nt-map .leaflet-popup-content strong { display: block; margin-bottom: 0.2rem; }
.nt-map .leaflet-popup-close-button { color: var(--nt-muted); }

/* Marqueur : point "running" */
.nt-pin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--nt-run);
  border: 2px solid var(--nt-bg);
  box-shadow: 0 0 0 2px var(--nt-run), 0 0 18px rgba(74, 222, 128, 0.5);
}
.nt-pin--active { transform: scale(1.35); }
.nt-pin--user {
  background: var(--nt-text);
  box-shadow: 0 0 0 2px var(--nt-text);
}

.nt-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 640px;
  overflow: auto;
  padding-right: 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: var(--nt-line) transparent;
}

.nt-count {
  font-family: var(--nt-mono);
  font-size: 0.8rem;
  color: var(--nt-muted);
  padding: 0 0.25rem 0.25rem;
}

.nt-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 1rem;
  padding: 1rem;
  background: var(--nt-panel);
  border: 1px solid var(--nt-line);
  border-radius: var(--nt-radius);
  text-align: left;
  width: 100%;
  transition: border-color 0.15s;
}
.nt-card:hover,
.nt-card[data-active="true"] { border-color: var(--nt-run); }

.nt-card h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
}

.nt-card .type {
  grid-column: 1;
  font-size: 0.85rem;
  color: var(--nt-muted);
}

.nt-card .dist {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
  font-family: var(--nt-mono);
  font-size: 0.85rem;
  color: var(--nt-run);
  white-space: nowrap;
}
.nt-card .dist:empty { display: none; }

.nt-card address {
  grid-column: 1 / -1;
  font-style: normal;
  font-size: 0.925rem;
  line-height: 1.45;
  color: var(--nt-text);
}

.nt-card .foot {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.nt-flav {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--nt-muted);
}
.nt-flav::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
}
.nt-flav--frozen-berry { --c: var(--nt-berry); }
.nt-flav--frozen-agrums { --c: var(--nt-agrums); }
.nt-flav--mate-tonic { --c: var(--nt-mate); }

.nt-perso {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--nt-run);
  color: var(--nt-run);
}

.nt-card .go {
  margin-left: auto;
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--nt-text);
  border-bottom: 1px solid var(--nt-muted);
  padding-bottom: 1px;
}
.nt-card .go:hover { border-color: var(--nt-run); }

/* État vide */
.nt-empty {
  display: grid;
  gap: 0.75rem;
  padding: 1.5rem;
  border: 1px dashed var(--nt-line);
  border-radius: var(--nt-radius);
  color: var(--nt-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}
.nt-empty strong { color: var(--nt-text); }
.nt-empty .nt-btn { justify-self: start; }

/* --- Devenir hôte ---------------------------------------------------------- */

.nt-host {
  margin: clamp(3rem, 8vw, 6rem) 0;
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid var(--nt-line);
  border-radius: var(--nt-radius);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
}
.nt-host h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.01em;
}
.nt-host p { margin: 0; color: var(--nt-muted); line-height: 1.5; max-width: 40rem; }

/* --- FAQ ------------------------------------------------------------------- */

.nt-faq { margin-bottom: clamp(3rem, 8vw, 6rem); max-width: 44rem; }
.nt-faq h2 { font-size: 1.5rem; margin: 0 0 1rem; }
.nt-faq details {
  border-top: 1px solid var(--nt-line);
  padding: 0.9rem 0;
}
.nt-faq details:last-child { border-bottom: 1px solid var(--nt-line); }
.nt-faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.nt-faq summary::-webkit-details-marker { display: none; }
.nt-faq summary::after { content: "+"; color: var(--nt-muted); }
.nt-faq details[open] summary::after { content: "–"; }
.nt-faq details p { margin: 0.6rem 0 0; color: var(--nt-muted); line-height: 1.55; }

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

@media (max-width: 860px) {
  .nt-results { grid-template-columns: 1fr; min-height: 0; }
  .nt-map { height: 360px; min-height: 0; }
  .nt-list { max-height: none; overflow: visible; }
  .nt-host { grid-template-columns: 1fr; }
  .nt-search-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .nt-term .cursor::after { animation: none; }
  .nt * { transition: none !important; }
}
