/* Ayudamia — mangrove teal, lagoon ink, guanacaste-flower yellow.
   One display face (Bricolage Grotesque) for the sentence-search; Atkinson Hyperlegible for
   everything you read on a phone in bright sun. */

@font-face { font-family: "Bricolage"; font-weight: 600; font-display: swap; src: url(fonts/bricolage-grotesque-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Bricolage"; font-weight: 800; font-display: swap; src: url(fonts/bricolage-grotesque-latin-800-normal.woff2) format("woff2"); }
@font-face { font-family: "Atkinson"; font-weight: 400; font-display: swap; src: url(fonts/atkinson-hyperlegible-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Atkinson"; font-weight: 700; font-display: swap; src: url(fonts/atkinson-hyperlegible-latin-700-normal.woff2) format("woff2"); }

:root {
  --bg: #f1f6f5;          /* morning mist over the estuary */
  --surface: #ffffff;
  --ink: #10343a;         /* lagoon */
  --muted: #4b666b;
  --line: #d3e1df;
  --brand: #0b6e66;       /* mangrove */
  --brand-ink: #ffffff;
  --brand-soft: #dcefec;
  --sun: #f0a92e;         /* guanacaste / cortez amarillo bloom */
  --sun-soft: #fde9c2;
  --wa: #157a43;
  --danger: #a3302a;
  --radius: 14px;
  --display: "Bricolage", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --text: "Atkinson", "Verdana", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1d20; --surface: #11292d; --ink: #e3efed; --muted: #9db6b4; --line: #24403f;
    --brand: #3db3a6; --brand-ink: #062522; --brand-soft: #173a39; --sun: #f3b84b; --sun-soft: #3d3218;
    --wa: #3cc47a; --danger: #ff8a80; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #0b1d20; --surface: #11292d; --ink: #e3efed; --muted: #9db6b4; --line: #24403f;
    --brand: #3db3a6; --brand-ink: #062522; --brand-soft: #173a39; --sun: #f3b84b; --sun-soft: #3d3218;
    --wa: #3cc47a; --danger: #ff8a80; color-scheme: dark;
  }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1.0625rem/1.55 var(--text);
}
a { color: var(--brand); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 6px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------------------------------------------------------------- frame */
.top, main, .foot { width: 100%; max-width: 780px; margin: 0 auto; padding-inline: 16px; }
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: max(14px, env(safe-area-inset-top)); padding-bottom: 6px;
}
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 30px; height: 30px; }
.brand-word { font: 800 1.35rem/1 var(--display); letter-spacing: -0.02em; }
.top-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

.link-btn {
  background: none; border: 0; padding: 8px 10px; border-radius: 999px; cursor: pointer;
  color: var(--muted); text-decoration: none; font-size: .95rem;
}
.link-btn:hover { color: var(--ink); background: var(--brand-soft); }
.link-btn.inline { padding: 0; color: var(--brand); text-decoration: underline; }
.pill-btn {
  background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 999px;
  padding: 10px 18px; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-block;
}
.pill-btn:hover { filter: brightness(1.08); }
.pill-btn:disabled { opacity: .55; cursor: progress; }
.ghost-btn {
  background: transparent; color: var(--ink); border: 1.5px solid var(--line); border-radius: 999px;
  padding: 9px 16px; cursor: pointer; font-weight: 700;
}
.ghost-btn:hover { border-color: var(--brand); }
.small { font-size: .9rem; padding: 6px 12px; }

/* ---------------------------------------------------------------- the sentence search */
.hero { padding: clamp(28px, 7vw, 64px) 0 10px; }
.ask {
  display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .3em; row-gap: 4px;
  font: 800 clamp(2.4rem, 9vw, 4.6rem)/1.02 var(--display); letter-spacing: -0.035em;
}
.ask-lead { color: var(--ink); white-space: nowrap; }
.ask-field { position: relative; flex: 1 1 8ch; min-width: 0; display: flex; align-items: baseline; }
.ask input {
  width: 100%; min-width: 0; border: 0; background: transparent; color: var(--brand);
  font: inherit; letter-spacing: inherit; padding: 0 1.1em 4px 0;
  border-bottom: 5px solid var(--sun); border-radius: 0; caret-color: var(--brand);
  -webkit-appearance: none; appearance: none;
}
.ask input::placeholder { color: color-mix(in srgb, var(--muted) 55%, transparent); font-weight: 600; }
.ask input::-webkit-search-cancel-button { display: none; }
.ask input:focus { outline: none; border-bottom-color: var(--brand); }
.ask-clear {
  position: absolute; right: 0; bottom: .32em; width: 1em; height: 1em; font-size: .55em;
  border: 0; background: var(--brand-soft); color: var(--ink); border-radius: 50%; cursor: pointer; line-height: 1;
}
.tagline { margin: 14px 0 0; color: var(--muted); max-width: 46ch; }

.notice {
  margin: 14px 0 0; padding: 10px 14px; background: var(--sun-soft); border-left: 4px solid var(--sun);
  border-radius: 8px; font-size: .95rem;
}

/* ---------------------------------------------------------------- filters */
.filters { margin-top: 22px; padding: 10px 0 6px; }
.chips {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 16px 6px;
  margin-inline: -16px; scroll-padding-inline: 16px;
}
.chips::-webkit-scrollbar { display: none; }
@media (min-width: 760px) { .chips { flex-wrap: wrap; overflow: visible; } }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px; cursor: pointer;
  font-size: .93rem; white-space: nowrap;
}
.chip[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip:disabled { opacity: .4; cursor: default; }
.chip-n { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip[aria-checked="true"] .chip-n { color: inherit; opacity: .75; }
.filter-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 6px; }
.count { margin: 0; color: var(--muted); font-size: .95rem; }
.area select {
  border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 30px 6px 12px;
  font-size: .93rem; -webkit-appearance: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px; background-repeat: no-repeat;
}

/* ---------------------------------------------------------------- results: a directory, not a card grid */
.results { padding-bottom: 40px; outline: none; }
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.entry {
  display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 16px 0;
  border-bottom: 1px solid var(--line); scroll-margin-top: 16px;
}
.entry.is-open { background: var(--surface); margin-inline: -16px; padding-inline: 16px; border-radius: var(--radius); border-bottom-color: transparent; box-shadow: 0 0 0 1px var(--line); }
.entry-icon {
  width: 44px; height: 44px; display: grid; place-items: center; font-size: 1.35rem;
  background: var(--brand-soft); border-radius: 12px;
}
.entry-main { min-width: 0; }
.entry-name { margin: 0; font: 600 1.22rem/1.25 var(--display); letter-spacing: -0.01em; }
.entry-meta { margin: 3px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: .9rem; }
.meta-area::before { content: "⌖ "; }
.meta-rating { color: var(--ink); }
.stars { color: var(--sun); letter-spacing: 1px; }
.entry-desc { margin: 6px 0 0; max-width: 62ch; }
mark { background: none; color: inherit; box-shadow: inset 0 -0.42em 0 var(--sun-soft); border-radius: 2px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.act {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: 999px;
  font-weight: 700; font-size: .95rem; text-decoration: none; cursor: pointer; border: 1.5px solid transparent;
}
.act-glyph { font-size: 1.05em; line-height: 1; }
.act-call { background: var(--brand); color: var(--brand-ink); }
.act-wa { background: transparent; color: var(--wa); border-color: currentColor; }
.act-more { background: transparent; color: var(--muted); border-color: var(--line); }
.act:hover { filter: brightness(1.07); }

.details { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.photo { width: 100%; max-height: 320px; object-fit: cover; border-radius: 10px; margin-bottom: 12px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); font-size: .92rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts .phone { display: block; }
.reviews-wrap h4 { margin: 18px 0 8px; font: 600 1.02rem var(--display); }
.reviews { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.review { border-left: 3px solid var(--sun); padding-left: 12px; }
.review-head { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: .9rem; color: var(--muted); }
.review-author { color: var(--ink); font-weight: 700; }
.review-body { margin: 2px 0 0; white-space: pre-line; }
.muted { color: var(--muted); }
.details-foot { margin-top: 16px; display: flex; justify-content: flex-end; }

.review-form { margin-top: 12px; }
.review-form summary { display: inline-block; list-style: none; }
.review-form summary::-webkit-details-marker { display: none; }
.review-form details[open] summary { margin-bottom: 10px; }
.rate { border: 0; padding: 0; margin: 0 0 8px; display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.rate legend { float: left; width: 100%; font-size: .92rem; color: var(--muted); margin-bottom: 2px; }
.rate input { position: absolute; opacity: 0; }
.rate label { font-size: 1.7rem; color: var(--line); cursor: pointer; line-height: 1; }
.rate input:checked ~ label, .rate label:hover, .rate label:hover ~ label { color: var(--sun); }
.rate input:focus-visible + label { outline: 3px solid var(--sun); border-radius: 4px; }

.empty { padding: 34px 0; max-width: 52ch; }
.empty h2 { font: 600 1.4rem var(--display); margin: 0 0 6px; }
.empty-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* ---------------------------------------------------------------- forms & dialogs */
.dlg { border: 0; padding: 0; border-radius: 18px; width: min(560px, calc(100vw - 24px)); background: var(--surface); color: var(--ink); }
.dlg::backdrop { background: rgb(6 30 33 / .55); }
.dlg-body { padding: 22px; display: grid; gap: 12px; }
.dlg h2 { margin: 0; font: 600 1.5rem/1.2 var(--display); }
.dlg p { margin: 0; color: var(--muted); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.field { display: grid; gap: 4px; font-size: .95rem; }
.field > span { font-weight: 700; }
.field small { color: var(--muted); }
.field input, .field select, .field textarea, .review-form textarea {
  width: 100%; border: 1.5px solid var(--line); background: var(--bg); border-radius: 10px; padding: 10px 12px;
}
.field input:focus, .field select:focus, .field textarea:focus, .review-form textarea:focus { border-color: var(--brand); outline: none; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 8px; font-size: .95rem; }
.form-msg { min-height: 1.2em; margin: 0; color: var(--danger); font-size: .93rem; }
.form-msg:empty { display: none; }

.toast {
  position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; z-index: 20; max-width: calc(100vw - 32px);
}

.foot { padding-top: 24px; padding-bottom: max(32px, env(safe-area-inset-bottom)); color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); }
.foot p { margin: 4px 0; }

@media (prefers-reduced-motion: no-preference) {
  .entry.is-open .details { animation: open .18s ease-out; }
  @keyframes open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
}
