/* She's Eating It map. Colors from the site's theme (PRD-023, Design): cream #f2e2a1, tans #d9c98f and #c2b47f,
   browns #5a4c33 and #402d15, red-orange #d94b2b. Text in red-orange uses a darker shade for contrast (WCAG AA). */
:root {
  --cream: #f2e2a1;
  --cream-soft: #f8efcb;
  --paper: #fffaf0;
  --tan: #d9c98f;
  --tan-dark: #c2b47f;
  --brown: #5a4c33;
  --ink: #402d15;
  --accent: #d94b2b;
  --accent-ink: #b5391e;
  --head: "DIN Next", "DIN Alternate", "Barlow", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --body: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { font: 15px/1.4 var(--body); color: var(--ink); background: var(--paper); -webkit-text-size-adjust: 100%; }
button, input { font: inherit; color: inherit; }
a { color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[hidden] { display: none !important; }

/* FR-14: the page fills the fixed Wix box and never scrolls; only the list and the card scroll inside. */
.app { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }

.bar { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--cream); border-bottom: 1px solid var(--tan-dark); }
.title { margin: 0; font: 700 18px/1.1 var(--head); letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; }
.region-name { color: var(--accent-ink); }
.region-name:not(:empty)::before { content: "· "; color: var(--brown); }
.search { flex: 1 1 auto; max-width: 420px; margin-left: auto; }
.search input { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--tan-dark); border-radius: 19px; background: var(--paper); font-size: 16px; }
.search input::placeholder { color: #7a6a4c; }
.tabs { display: none; }

.panes { display: grid; grid-template-columns: minmax(250px, 320px) minmax(0, 1fr); min-height: 0; }
.list-pane { overflow-y: auto; overscroll-behavior: contain; border-right: 1px solid var(--tan); background: var(--paper); }
.count { margin: 0; padding: 10px 14px; font-weight: 700; color: var(--brown); border-bottom: 1px solid var(--tan); position: sticky; top: 0; background: var(--paper); }
.count .show-all { margin-left: 4px; }
.list { list-style: none; margin: 0; padding: 0; }
.list button { display: block; width: 100%; padding: 10px 14px; border: 0; border-bottom: 1px solid #efe4c4; background: none; text-align: left; cursor: pointer; }
.list button:hover, .list button[aria-current="true"] { background: var(--cream-soft); }
.list .name { display: block; font-weight: 700; }
.list .meta { display: block; font-size: 13px; color: var(--brown); }

.map-pane { position: relative; min-height: 0; min-width: 0; }
.map { position: absolute; inset: 0; background: #f6ecd0; }
.map-msg { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--brown); background: var(--cream-soft); }

/* FR-5: the card. */
.card { position: absolute; top: 12px; left: 12px; z-index: 3; width: 320px; max-height: calc(100% - 24px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--paper); border: 1px solid var(--tan-dark); border-radius: 12px; box-shadow: 0 6px 24px rgba(64, 45, 21, .25); }
.card:focus { outline: none; }
.card-close { position: absolute; top: 6px; right: 6px; z-index: 1; width: 36px; height: 36px; border: 0; border-radius: 18px; background: rgba(255, 250, 240, .9); font-size: 24px; line-height: 1; cursor: pointer; }
.card-photo { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px 12px 0 0; background: var(--cream-soft); }
.card-body { padding: 14px 16px 16px; }
.card-name { margin: 0 32px 4px 0; font: 700 20px/1.2 var(--head); }
.card-desc { margin: 0 0 4px; }
.card-town { margin: 0 0 12px; font-size: 13px; color: var(--brown); }
.card-links { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.card-links a { padding: 7px 12px; border: 1px solid var(--tan-dark); border-radius: 16px; background: var(--cream-soft); color: var(--ink); font-size: 14px; font-weight: 700; text-decoration: none; }
.card-links a:hover { background: var(--cream); }
.card-dir { display: block; padding: 10px 12px; border-radius: 8px; background: var(--accent-ink); color: #fff; font-weight: 700; text-align: center; text-decoration: none; }
.card-dir:hover { background: #9c2f17; }
.card-also { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--tan); font-size: 13px; color: var(--brown); }
.card-also button { margin: 4px 4px 0 0; padding: 4px 10px; border: 1px solid var(--tan-dark); border-radius: 14px; background: none; cursor: pointer; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 5px 12px; font-size: 12px; color: var(--brown); background: var(--cream); border-top: 1px solid var(--tan-dark); }
.foot a { color: var(--ink); }
.link-button { padding: 0; border: 0; background: none; color: var(--ink); text-decoration: underline; cursor: pointer; font-size: 12px; }
.button { padding: 8px 16px; border: 0; border-radius: 8px; background: var(--accent-ink); color: #fff; font-weight: 700; cursor: pointer; }

.fail { position: fixed; inset: 0; z-index: 10; display: grid; place-content: center; gap: 12px; padding: 24px; text-align: center; background: var(--paper); }
.fail p { margin: 0; font-size: 17px; }

.credits { max-width: min(520px, calc(100% - 32px)); border: 1px solid var(--tan-dark); border-radius: 12px; background: var(--paper); color: var(--ink); font-size: 14px; }
.credits::backdrop { background: rgba(64, 45, 21, .35); }
.credits h2 { margin: 0 0 8px; font: 700 18px var(--head); }
.credits ul { margin: 0 0 14px; padding-left: 18px; }
.credits li { margin-bottom: 6px; }

/* Map controls in the site's colors. FR-11: the credit line stays open. */
.maplibregl-ctrl-attrib { background: rgba(255, 250, 240, .85) !important; font-size: 11px; }
.maplibregl-ctrl-attrib a { color: var(--ink); }
.hover-label .maplibregl-popup-content { padding: 4px 10px; border-radius: 12px; background: var(--ink); color: var(--paper); font-weight: 700; font-size: 13px; box-shadow: none; }
.hover-label .maplibregl-popup-tip { display: none; }

/* Phones and narrow boxes: Map / List tabs instead of two columns (FR-14). */
@media (max-width: 699px) {
  .bar { flex-wrap: wrap; gap: 8px; padding: 8px; }
  .title { font-size: 15px; flex: 1 1 auto; }
  .search { order: 3; flex: 1 1 100%; max-width: none; }
  .search input { height: 40px; }
  .tabs { display: flex; gap: 0; border: 1px solid var(--tan-dark); border-radius: 18px; overflow: hidden; }
  .tab { padding: 6px 14px; border: 0; background: var(--paper); font-weight: 700; cursor: pointer; white-space: nowrap; }
  .tab[aria-selected="true"] { background: var(--ink); color: var(--paper); }
  .panes { grid-template-columns: minmax(0, 1fr); }
  .list-pane { border-right: 0; }
  .app[data-view="map"] .list-pane { display: none; }
  .app[data-view="list"] .map-pane { display: none; }
  .card { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 78%; border-radius: 14px 14px 0 0; border-width: 1px 0 0; }
  .card-photo { max-height: 160px; }
  .foot { font-size: 11px; padding: 4px 8px; }
  .maplibregl-ctrl-attrib { font-size: 10px; }
}
@media (max-width: 380px) {
  .title { font-size: 13px; }
}
/* A short phone box (Wix's default is 342 × 388 px): one header row, so the map keeps its room. */
@media (max-width: 699px) and (max-height: 520px) {
  .title { display: none; }
  .bar { flex-wrap: nowrap; padding: 6px 8px; }
  .search { order: 0; flex: 1 1 auto; }
  .search input { height: 34px; }
  .tab { padding: 5px 10px; }
  .card { max-height: 88%; }
  .card-body { padding: 10px 12px 12px; }
  .card-name { font-size: 18px; }
  .card-links a { padding: 5px 10px; }
  .card-dir { padding: 8px; }
}
