@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/inter-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/inter-500.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/inter-600.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/fraunces-500.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/fraunces-600.woff2") format("woff2");
}

/* Palette matches the root site (../styles.css): deep teal, teal, green, foam. */
:root {
  --deep: #0B2F3A;
  --teal: #0F5E66;
  --green: #2FBF8F;
  --green-text: #13795B;
  --mint: #5FD9AE;
  --ink: #26373D;
  --muted: #3E555C;
  --foam: #F2F8F7;
  --line: #B9D6CF;
  --card-line: #CFE3DE;
  --white: #fff;
  --error: #8E1B2A;
  --shadow: 0 10px 24px rgba(11, 47, 58, 0.10);
  --shadow-soft: 0 2px 6px rgba(11, 47, 58, 0.06);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; color: var(--deep); line-height: 1.2; margin: 0; }
p { margin: 0; }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--deep); }

/* Focus: a dark ring (3:1+ against white) with a soft green halo. */
:focus-visible {
  outline: 3px solid var(--deep);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(47, 191, 143, 0.45);
  border-radius: 6px;
}
.btn:focus-visible, .lang button:focus-visible, .view-toggle button:focus-visible { border-radius: 999px; }
.view-toggle button:focus-visible { border-radius: 12px; }
input:focus-visible { border-radius: 10px; }

.skip {
  position: absolute;
  left: 8px;
  top: 8px;
  transform: translateY(-150%);
  background: var(--deep);
  color: var(--white);
  padding: 10px 14px;
  border-radius: 8px;
  z-index: 20;
}
.skip:focus { transform: none; color: var(--white); }
.visually-hidden,
.skip-list:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-list { position: static; display: inline-block; transform: none; margin-bottom: 12px; }

.app { min-height: 100dvh; display: flex; flex-direction: column; }
/* Embedded in an iframe: hide the branding but keep the h1 for screen readers and the language buttons. */
.is-embed .brand {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.is-embed .site-header { justify-content: flex-end; padding-top: 8px; padding-bottom: 8px; }

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 16px 14px;
  background: var(--white);
  border-top: 5px solid var(--green);
  border-bottom: 1px solid var(--card-line);
}
.brand { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.logo { width: 52px; height: 52px; flex: none; }
.eyebrow {
  margin: 0 0 4px;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green-text);
}
.site-header h1 { font-size: clamp(1.35rem, 3.2vw, 1.8rem); text-wrap: balance; }
.credit { margin-top: 6px; font-size: 0.92rem; }
.credit a { font-weight: 600; }
.site-footer .credit span { display: block; margin-top: 2px; }

.lang { display: flex; flex-wrap: wrap; gap: 8px; }
.lang button {
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--teal);
  background: var(--white);
  color: var(--teal);
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}
.lang button:hover { background: var(--foam); }
.lang button[aria-pressed="true"] {
  background: var(--deep);
  border-color: var(--deep);
  color: var(--white);
}

.intro-bar {
  background: var(--foam);
  border-bottom: 1px solid var(--line);
  padding: 10px 16px 12px;
}
.intro, .full-disclaimer { max-width: 68ch; font-size: 0.95rem; }
.full-disclaimer { margin-bottom: 10px; }
.correction { margin-top: 8px; }
.todo {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--deep);
  background: #fff4cc;
  border: 1px solid #8a6d00;
  border-radius: 999px;
  padding: 2px 8px;
}

/* Controls */
.controls { padding: 14px 16px 4px; display: grid; gap: 12px; }
.controls label, .controls legend {
  font-weight: 600;
  color: var(--deep);
}
.controls legend { padding: 0 4px; margin-left: -4px; }
fieldset {
  margin: 0;
  padding: 12px 14px 14px;
  border: 1px solid var(--card-line);
  border-radius: 16px;
  background: var(--white);
  min-width: 0;
}
.search label:not(.visually-hidden), .age-field label, .near label { display: block; margin-bottom: 6px; }
input[type="search"], input[type="text"], input[type="number"] {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1.5px solid var(--teal);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 1rem; /* 16px+ keeps iOS from zooming in on focus */
}
input::placeholder { color: #566a71; opacity: 1; }
input[aria-invalid="true"] { border-color: var(--error); border-width: 2px; }
.controls-bar { display: flex; flex-wrap: nowrap; gap: 8px; align-items: center; }
.filters-toggle { flex: 1 1 auto; min-width: 0; justify-content: flex-start; gap: 10px; }
#clear { flex: 0 0 auto; white-space: nowrap; }
.filters-toggle .icon { width: 22px; height: 22px; flex: none; }
.filters-toggle[aria-expanded="true"] { background: var(--foam); border-color: var(--deep); color: var(--deep); }
.count {
  margin-left: auto;
  min-width: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--deep);
  color: var(--white);
  font-size: 0.85rem;
  text-align: center;
  line-height: 26px;
}
.filters-panel { display: grid; gap: 12px; }
.filters-panel .search { margin-bottom: 4px; }
.filter-grid { display: grid; gap: 8px; margin-top: 4px; }
.check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 6px 12px;
  border: 1.5px solid var(--card-line);
  border-radius: 12px;
  font-weight: 500;
  cursor: pointer;
}
.age-field { flex: 1 1 18rem; min-width: min(100%, 18rem); }
.age-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.age-head label { margin-bottom: 0; }
input[type="range"] {
  width: 100%;
  min-height: 44px;
  margin: 4px 0 0;
  accent-color: var(--teal);
}
.more-wrap { margin: 4px 0 16px; }
.check:hover { border-color: var(--teal); }
.check:has(input:checked) { background: var(--foam); border-color: var(--teal); }
.check input { width: 1.4rem; height: 1.4rem; flex: none; accent-color: var(--teal); }
.hint, .status { color: var(--muted); font-size: 0.92rem; margin-top: 6px; }
.status:empty { display: none; }
.status { font-weight: 500; }
.error { color: var(--error); font-weight: 600; min-height: 0; }
.error:empty { display: none; }
.near-actions { display: grid; gap: 4px; margin-top: 4px; justify-items: start; }
#place-form { margin-top: 14px; }
.place-row { display: flex; flex-wrap: wrap; gap: 8px; }
.place-row input { flex: 1 1 12rem; min-width: 0; width: auto; }
#place-note { margin-top: 8px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--teal);
  background: var(--white);
  color: var(--teal);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover { background: var(--foam); color: var(--deep); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: var(--white); }
.btn.primary:hover { background: var(--deep); border-color: var(--deep); color: var(--white); }
.btn.ghost { background: transparent; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.65; cursor: progress; }

/* On phones the filters live behind a clear button with a count of active ones. */
.is-collapsed { display: none; }

.view-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 8px 16px 0;
  padding: 4px;
  background: var(--foam);
  border: 1px solid var(--card-line);
  border-radius: 14px;
}
.view-toggle button {
  min-height: 44px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--teal);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.view-toggle button[aria-pressed="true"] {
  background: var(--deep);
  color: var(--white);
}

.workspace { display: block; }
.results { padding: 8px 16px 24px; }
.results h2 { font-size: 1.35rem; margin: 8px 0 8px; text-wrap: balance; }
.sort-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 4px 0 8px;
  padding: 4px;
  background: var(--foam);
  border: 1px solid var(--card-line);
  border-radius: 14px;
}
.sort-toggle button {
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--teal);
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}
.sort-toggle button[aria-pressed="true"] { background: var(--deep); color: var(--white); }
.near-status { margin: 0 0 8px; }
#summary { margin-bottom: 12px; color: var(--muted); font-weight: 500; }
.group-help { color: var(--muted); margin: 0 0 8px; }
.shop-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; }
.group-title { font-size: 1.15rem; margin: 16px 0 8px; }

.shop {
  border: 1px solid var(--card-line);
  border-left: 5px solid var(--card-line);
  border-radius: 16px;
  padding: 14px 14px 12px;
  background: var(--white);
  box-shadow: var(--shadow-soft);
  scroll-margin: 12px;
}
.shop.is-selected {
  border-color: var(--teal);
  border-left-color: var(--green);
  box-shadow: var(--shadow);
  background: var(--foam);
}
.shop-name { font-size: 1.3rem; line-height: 1.25; overflow-wrap: anywhere; }
.address { margin: 2px 0 0; }
.meta { margin: 2px 0 10px; color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 10px; padding: 0; }
.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--white);
  color: var(--deep);
  border: 1px solid var(--line);
}
.badge.yes { background: #E5F7F1; border-color: #6FBFA5; color: #084536; }
.badge.unknown { background: var(--foam); border-style: dashed; }
.verified { font-size: 0.9rem; color: var(--muted); margin: 12px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions .btn { flex: 1 1 auto; }
details { margin-top: 8px; }
summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  color: var(--teal);
}
details p { margin: 4px 0 8px; white-space: pre-wrap; }

.site-footer {
  margin-top: auto;
  padding: 16px 16px 28px;
  border-top: 1px solid var(--card-line);
  background: var(--white);
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}
.site-footer:focus { outline: none; box-shadow: none; }

/* Map */
.map-panel { padding: 8px 16px 16px; }
#map {
  height: 68dvh;
  min-height: 280px;
  border-radius: 16px;
  border: 1px solid var(--card-line);
  background: var(--foam);
}
.leaflet-container a { color: var(--teal); }
.leaflet-control-zoom a {
  width: 44px !important;
  height: 44px !important;
  line-height: 44px !important;
  font-size: 20px !important;
  color: var(--deep) !important;
}
.leaflet-container:focus-visible { border-radius: 16px; }
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large { background-color: rgba(15, 94, 102, 0.35); }
.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background-color: rgba(11, 47, 58, 0.92);
  color: #fff;
  font-weight: 600;
}
.pin-wrap { background: transparent; border: 0; }
.pin {
  display: block;
  width: 18px;
  height: 18px;
  margin: 7px;
  border-radius: 50%;
  background: #0F5E66;
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px #0F5E66;
}
.pin-wrap.is-selected .pin {
  width: 22px;
  height: 22px;
  margin: 5px;
  background: #2FBF8F;
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px #0B2F3A;
}
.leaflet-popup-content { font-family: var(--sans); font-size: 0.95rem; line-height: 1.4; }
.popup-title { font-weight: 700; color: #0B2F3A; font-family: var(--serif); font-size: 1.05rem; }
.popup-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.popup-actions a { font-weight: 600; padding: 6px 0; }

.workspace[data-view="list"] .map-panel { display: none; }
.workspace[data-view="map"] .results { display: none; }

@media (min-width: 600px) and (max-width: 899px) {
  .filter-grid { grid-template-columns: 1fr; }
  .age-field { grid-column: 1; }
}

@media (min-width: 900px) {
  .app { height: 100dvh; }
  .site-header { padding: 18px 28px 14px; }
  .controls { padding-left: 28px; padding-right: 28px; grid-template-columns: minmax(16rem, 1fr) auto; align-items: end; }
  .controls-bar { justify-content: flex-start; }
  .filters-toggle { flex: 0 0 auto; }
  .filters-panel { grid-column: 1 / -1; }
  .filters-panel.is-collapsed { display: none; }
  .filter-grid {
    display: grid;
    grid-template-columns: minmax(16rem, 1fr) auto;
    align-items: center;
    gap: 12px;
  }
  .filter-grid .search { grid-column: 1 / -1; margin: 0; }
  .age-field { display: flex; align-items: center; gap: 16px; min-width: 0; margin: 0; }
  .age-head { flex: 0 0 auto; }
  .age-field input[type="range"] { flex: 1 1 12rem; width: auto; min-width: 10rem; margin: 0; }
  .filter-grid .check { justify-self: start; }
  .view-toggle { display: none; }
  .workspace {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(22rem, 34rem) minmax(0, 1fr);
  }
  .workspace[data-view="list"] .map-panel,
  .workspace[data-view="map"] .results { display: block; }
  .results { overflow: auto; padding: 8px 20px 28px; }
  .map-panel { padding: 12px 20px 20px 0; min-height: 0; }
  #map { height: 100%; min-height: 0; }
  .site-footer { padding: 14px 28px 18px; }
}

@media (min-width: 1200px) {
  .controls { grid-template-columns: minmax(18rem, 36rem) auto; }
}

@media (max-width: 899px) {
  .workspace[data-view="map"] .map-panel { display: block; }
  .workspace[data-view="list"] .results { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (forced-colors: active) {
  .shop.is-selected { border-width: 3px; }
  .pin { border: 3px solid CanvasText; }
}
