/* ============================================================
   The Local List — coming soon (www.etlocal.com)
   Direction A "The Yellow Pages" — tokens verbatim from brief a
   v2: tri-color hero, stronger veil + tile filter, success modal
   ============================================================ */

:root {
  --paper: #F6F0E4;
  --card: #FFFDF6;
  --ink: #2B2620;
  --muted: #6B6156;
  --vermilion: #C0431D;
  --verified: #3E5C4B; /* palette only — unused on this page */
  --map-bg: #E9DFC8;
  --street: #F8F3E6;
  --border: 1px solid var(--ink);
  --radius: 8px;
  --font-serif: 'Lora', Georgia, 'Times New Roman', serif;
  --font-sans: 'Source Sans 3', 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Background map (decorative, interaction off) ---------- */

#map {
  position: fixed;
  inset: 0;
  z-index: 0;
  /* Tile-failure fallback: paper + street grid, always present below tiles */
  background-color: var(--map-bg);
  background-image:
    repeating-linear-gradient(0deg, transparent 0 78px, var(--street) 78px 88px),
    repeating-linear-gradient(90deg, transparent 0 98px, var(--street) 98px 108px);
}

/* Warm the OSM tiles toward the paper palette (v2: softer, less busy) */
.leaflet-tile-pane {
  filter: sepia(0.35) saturate(0.55) contrast(0.85) brightness(1.06);
}

/* Keep attribution, styled small/muted, bottom-right (Leaflet default corner) */
.leaflet-control-attribution {
  font-family: var(--font-sans);
  font-size: 10px;
  color: var(--muted);
  background: rgba(246, 240, 228, 0.75);
}
.leaflet-control-attribution a { color: var(--muted); }

/* ---------- Veil between map and foreground (v2: stronger) ---------- */

.veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center,
    rgba(246, 240, 228, 0.45) 0%,
    rgba(246, 240, 228, 0.85) 100%);
}

/* Filter unsupported → the veil alone carries readability (v2) */
@supports not (filter: sepia(1)) {
  .veil { background: radial-gradient(ellipse at center,
    rgba(246, 240, 228, 0.50) 0%,
    rgba(246, 240, 228, 0.88) 100%); }
}

/* ---------- Foreground stack ---------- */

.foreground {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  max-width: 560px;
  margin: 0 auto;
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: opacity 0.6s ease;
}

body.loading .foreground { opacity: 0; }

/* Eyebrow: 24px 1px ink rule centered above, 11px uppercase muted */
.eyebrow-rule {
  display: block;
  width: 24px;
  border-top: 1px solid var(--ink);
  margin: 0 auto 12px;
}

.eyebrow {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* Hero (v2: tri-color brand spans — fixed brand values, not tokens) */
.hero {
  margin: 0 0 16px;
  font-family: 'Lora', serif;
  font-weight: 600;
  font-size: 72px;
  line-height: 1.05;
  color: #111111;
}
.hero-et    { color: #38b000; }  /* brand green (v2.1) */
.hero-local { color: #111111; }  /* black */
.hero-com   { color: #4A4A4A; }  /* dark grey */

/* Tagline + sub-line */
.tagline {
  margin: 0 auto 8px;
  max-width: 460px;
  font-size: 20px;
  line-height: 1.5;
  color: var(--muted);
}

.subline {
  margin: 0;
  max-width: 460px;
  font-size: 17px;
  line-height: 1.5;
  color: var(--muted);
}

/* v2.1: white outline behind the 4 small texts (readability over tiles) */
.eyebrow, .tagline, .subline, .foreground footer {
  filter: drop-shadow(1px 0 0 white) drop-shadow(0 1px 0 white)
          drop-shadow(-1px 0 0 white) drop-shadow(0 -1px 0 white);
}

/* ---------- Email notify form ---------- */

.notify {
  margin-top: 28px;
  width: 100%;
  max-width: 420px;
}

#notify-form {
  display: flex;
  gap: 8px;
  width: 100%;
}

#notify-email {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--ink);
  background: var(--card);
  border: var(--border);
  border-radius: var(--radius);
}

#notify-email::placeholder { color: var(--muted); }

#notify-email:focus { outline: 2px solid var(--vermilion); outline-offset: 1px; }

#notify-email.invalid { border-color: var(--vermilion); }

#notify-form button {
  height: 48px;
  padding: 0 20px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  color: var(--card);
  background: var(--vermilion);
  border: var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
}

#notify-form button:disabled { opacity: 0.6; cursor: default; }

.form-error {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--vermilion);
}

/* ---------- Success modal (v2 — replaces the inline success card) ----------
   Direction A tokens: card bg, 1px ink border, 8px radius, no shadow.
   Backdrop = semi-transparent ink. */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(43, 38, 32, 0.55);
}

.modal-backdrop[hidden] { display: none; }

.modal {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: var(--border);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  text-align: center;
}

.modal-title {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.2;
  color: var(--ink);
}

.modal-body {
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
}

.modal-close {
  height: 44px;
  padding: 0 24px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  color: var(--card);
  background: var(--vermilion);
  border: var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.modal-close:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- Social row ---------- */

.social {
  margin-top: 24px;
  display: flex;
  gap: 8px;
}

.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--ink);
}

.social a svg { width: 20px; height: 20px; }

.social a:hover { color: var(--vermilion); }

.social a:focus-visible { outline: 2px solid var(--vermilion); outline-offset: 2px; }

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

.foreground footer {
  margin-top: auto;
  padding-top: 24px;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- Placeholder business pins (dot + label chip) ---------- */

.ll-pin-icon {
  background: transparent;
  border: none;
  pointer-events: none;
}

.ll-pin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.ll-pin.on { opacity: 1; }

.ll-pin-dot {
  position: relative;
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--vermilion);
  border: 1px solid var(--ink);
}

.ll-pin-dot::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  border-radius: 50%;
  background: var(--card);
}

.ll-pin-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.25;
  background: var(--card);
  border: var(--border);
  border-radius: var(--radius);
  padding: 4px 8px;
  white-space: nowrap;
}

.ll-pin-name {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 12px;
  color: var(--ink);
}

.ll-pin-trade {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ---------- Visually hidden (accessible label) ---------- */

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

/* ---------- Language selector (v2.1) ----------
   Fixed top-right chip above map/veil; dropdown lists all 20 languages.
   z-index 5: above the foreground (2), below the modal (10). */

.lang-switch {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 5;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper);
  border: var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.lang-btn:hover { background: var(--card); }
.lang-btn:focus-visible { outline: 2px solid var(--vermilion); outline-offset: 2px; }

.lang-flag { font-size: 16px; line-height: 1; }

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  width: 200px;
  max-height: min(70vh, 620px);
  overflow-y: auto;
  background: var(--card);
  border: var(--border);
  border-radius: var(--radius);
}

.lang-menu[hidden] { display: none; }

.lang-menu [role="option"] {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 4px 10px;
  font-size: 14px;
  color: var(--ink);
  border-radius: 6px;
  cursor: pointer;
}

.lang-menu [role="option"]:hover,
.lang-menu [role="option"]:focus {
  background: var(--paper);
  outline: none;
}

.lang-menu [role="option"][aria-selected="true"] {
  font-weight: 700;
  background: var(--paper);
}

/* ---------- Responsive: mobile below 480px ---------- */

@media (max-width: 479px) {
  .foreground { padding: 20px; }

  .lang-switch { top: 12px; right: 12px; }
  .lang-btn { height: 32px; padding: 0 10px; font-size: 13px; }
  .lang-flag { font-size: 14px; }

  .hero { font-size: 40px; }

  .tagline { font-size: 17px; max-width: 300px; }
  .subline { font-size: 16px; max-width: 300px; }

  .notify { max-width: 320px; }

  #notify-form { flex-direction: column; }
  #notify-form button { width: 100%; }

  .ll-pin-dot { width: 10px; height: 10px; }
  .ll-pin-name { font-size: 11px; }
  .ll-pin-trade { display: none; }

  .foreground footer { font-size: 13px; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .foreground { transition: none; }
  .ll-pin { transition: none; }
}
