/*
 * Site skin for the directory preview embedded at /directory.
 *
 * The preview began as a standalone app with its own chrome (logo header,
 * white filter strip). Embedded in edventures.co that chrome is redundant:
 * this stylesheet hides it, lifts the filters out of the frame so they sit
 * directly on the page background as site-style pill controls, and lets the
 * map + card rail fill the rest of the embed as the page's main event.
 *
 * Loaded after the page's own <style> block, so plain overrides win. The
 * <link> is injected by scripts/sync-directory-preview.mjs; if a selector
 * here stops matching the upstream preview markup, fix it there too.
 */

:root {
  /* Match the site's exact palette (app/globals.css) so the embed is seamless. */
  --sand: #f4ecdd;
  --sand-2: #ece0c9;
  --line: rgba(46, 70, 54, 0.16);
  --muted: #6b6250;
}

html,
body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  background: var(--sand);
}

/* Standalone app chrome: the surrounding page already introduces the
   directory, so the embedded logo header only repeats it. */
body > header {
  display: none;
}

/* --- Filter bar: detached from the frame, one row of aligned site pills --- */

.bar {
  position: static;
  background: transparent;
  border-bottom: none;
  padding: 4px 4px 20px;
  gap: 12px;
  row-gap: 12px;
  align-items: center;
  justify-content: center;
}

.seg {
  background: #fff;
  border-color: var(--line);
  box-shadow: 0 1px 2px rgba(34, 31, 26, 0.06);
}

.seg button {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
}

.seg button.on {
  background: var(--forest);
  color: var(--sand);
}

/* Each labelled control becomes a single pill: label and value side by
   side, so every filter shares one height and baseline with the toggles. */
.field {
  flex-direction: row;
  align-items: center;
  gap: 7px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 5px 0 15px;
  box-shadow: 0 1px 2px rgba(34, 31, 26, 0.06);
}

.field label {
  font-size: 9.5px;
  color: var(--muted);
  white-space: nowrap;
}

select,
input {
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 10px 8px 10px 2px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 26px;
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%232e4636' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    no-repeat right 10px center;
}

/* The child-age number input: quiet the native spinners so it reads as a
   pill like everything else. */
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
  text-align: center;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

select:focus-visible,
input:focus-visible,
.seg button:focus-visible,
.morebtn:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
}

.morebtn {
  padding: 10px 18px;
  border-radius: 999px;
  border-color: var(--line);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(34, 31, 26, 0.06);
}

/* The result count leads the row (order -1 beats its in-bar DOM slot);
   dropping its margin-left:auto lets the whole bar center. */
.count {
  order: -1;
  margin: 0;
  font-size: 13.5px;
}

/* --- More-filters: a floating card, not a strip glued to the frame ------- */

.more {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px 24px;
  margin: -6px 4px 20px;
  gap: 20px 28px;
  box-shadow: 0 14px 40px rgba(34, 31, 26, 0.08);
}

.chipbtn {
  padding: 7px 14px;
}

/* --- Map + cards: the main event, framed and filling the embed ----------- */

.layout {
  flex: 1;
  min-height: 0;
  height: auto;
  margin: 0 4px 6px;
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 3px rgba(34, 31, 26, 0.06);
}

.rail {
  background: #fbf6ea;
  padding: 18px;
  gap: 16px;
}

@media (max-width: 860px) {
  /* Narrow screens scroll the whole page (upstream stacks map over cards),
     so release the fixed-viewport flex column. */
  html,
  body {
    height: auto;
  }

  body {
    display: block;
  }

  .layout {
    height: auto;
  }

  .count {
    text-align: center;
  }

  #map {
    height: 52vh;
    min-height: 340px;
  }
}
