/* Things-to-do engine. Brand colours and fonts are injected from the property's config.json
   as CSS variables, so this file is the same for every property. */
:root {
  --primary: #3a4f44;
  --secondary: #71897c;
  --bg: #f1f2f2;
  --accent: #c9a227;
  --surface: #ffffff;
  --text: #1f2a24;
  --muted: #5b6760;
  --line: #d8dddb;
  --font-heading: Georgia, serif;
  --font-body: system-ui, sans-serif;
  --radius: 12px;
  --gutter: 16px;
  --top: 64px; /* height of whatever header sits above the app */
}

body.app { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 16px; line-height: 1.5; }
body.app h1, body.app h2, body.app h3 { font-family: var(--font-heading); font-weight: 700; line-height: 1.2; }
.app button { font: inherit; color: inherit; }

/* Plain header, used by embed.html when a property has no site of its own */
.app-header { height: var(--top); display: flex; align-items: center; gap: 14px; padding: 0 var(--gutter); background: var(--primary); color: #fff; }
.app-header img { height: 40px; width: auto; }
.app-header h1 { margin: 0; font-size: 1.3rem; color: #fff; }

/* ---- Layout: panel + map, filling the screen below the header ---------------------------- */
.app-main { position: relative; }
.panel { background: var(--bg); }
.panel-controls { padding: 14px var(--gutter) 8px; }
.panel-head { margin: 0 0 2px; font-size: 1.35rem; color: var(--primary); }
.intro { margin: 0 0 12px; color: var(--muted); font-size: .92rem; }
.list { padding: 0 var(--gutter) 96px; }
.panel-foot { padding: 0 var(--gutter) 24px; font-size: .78rem; color: var(--muted); }
.map-wrap { display: none; }
#map { width: 100%; height: 100%; }

/* Phone: list by default; the floating button swaps to a full-screen map */
.app-main[data-view="map"] .map-wrap { display: block; position: fixed; inset: var(--top) 0 0 0; z-index: 500; }
.view-fab {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 900;
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border: 0; border-radius: 999px;
  background: var(--text); color: #fff !important; font-weight: 700; box-shadow: 0 6px 18px rgba(0,0,0,.3); cursor: pointer;
}
.view-fab svg { width: 18px; height: 18px; fill: currentColor; }

@media (min-width: 900px) {
  body.app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
  .app-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(360px, 430px) 1fr; }
  .panel { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
  .list { flex: 1; overflow-y: auto; padding-bottom: 16px; }
  .map-wrap, .app-main[data-view="map"] .map-wrap { display: block; position: static; }
  .view-fab { display: none; }
}

/* ---- Controls ------------------------------------------------------------------------------ */
.search-row { display: flex; gap: 8px; margin-bottom: 10px; }
#search {
  flex: 1; min-width: 0; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); font: inherit; font-size: .95rem;
}
#search:focus-visible { outline: 2px solid var(--secondary); outline-offset: 1px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); cursor: pointer; white-space: nowrap; font-size: .85rem;
}
.chip:hover { border-color: var(--secondary); }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip .n { font-size: .74rem; opacity: .65; }
.chip[disabled] { opacity: .4; cursor: default; }
.chip[hidden] { display: none; }
.chip-picks { font-weight: 600; }
.chip-picks[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #1f1a05; }
.chip-more { border-style: dashed; color: var(--primary); font-weight: 600; }
.bands { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.bands .chip { justify-content: center; border: 0; border-radius: 9px; padding: 6px 4px; font-weight: 600; font-size: .8rem; white-space: normal; text-align: center; line-height: 1.2; flex-direction: column; gap: 0; }
.bands .chip .n { font-weight: 400; }
.status-row { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .85rem; min-height: 24px; }
.linklike { background: none; border: 0; padding: 0; color: var(--primary) !important; text-decoration: underline; cursor: pointer; font-size: .85rem; }

/* ---- List ---------------------------------------------------------------------------------- */
.band-head {
  position: sticky; top: 0; z-index: 2; margin: 10px 0 8px; padding: 6px 0;
  background: var(--bg); font-size: 1rem; color: var(--primary);
}
.card {
  display: grid; grid-template-columns: 40px 1fr; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; margin-bottom: 8px; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.card:hover { border-color: var(--secondary); }
.card.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.card.pick { border-left: 4px solid var(--accent); }
.card-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-size: 1.25rem; }
.card-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; }
.card h3 { margin: 0; font-size: 1rem; flex: 1 1 150px; }
.time { flex: none; font-weight: 700; color: var(--primary); font-size: .85rem; white-space: nowrap; }
.time.est { color: var(--muted); font-weight: 600; }
.meta { margin: 2px 0 0; font-size: .8rem; color: var(--muted); }
.pick-badge { color: #7a5f00; font-weight: 600; }
.tag-badge { color: var(--primary); font-weight: 600; }
.desc { margin: 6px 0 8px; font-size: .9rem; }
.pills { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.pill { font-size: .74rem; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.links { display: flex; gap: 14px; font-size: .85rem; }
.links a { color: var(--primary); }
.empty { padding: 24px; text-align: center; color: var(--muted); }

/* Review mode (?review=1) */
.review { margin-top: 8px; padding: 8px; border-radius: 8px; background: #fff7e0; font-size: .78rem; color: #5c4a00; }
.review.bad { background: #fde8e6; color: #7a1f14; }
.review div { margin: 1px 0; }

/* ---- Map markers ----------------------------------------------------------------------------- */
.mk {
  width: 32px; height: 32px; border-radius: 50%; background: var(--surface);
  border: 2px solid var(--primary); display: grid; place-items: center; font-size: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.3); position: relative;
}
.mk.pick { border-color: var(--accent); border-width: 3px; }
.mk.pick::after {
  content: "★"; position: absolute; top: -8px; right: -8px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 11px; line-height: 16px; text-align: center;
}
.mk.active { transform: scale(1.25); box-shadow: 0 0 0 3px var(--primary); }
.mk-home {
  width: 42px; height: 42px; border-radius: 50%; background: var(--primary); border: 3px solid #fff;
  display: grid; place-items: center; box-shadow: 0 1px 6px rgba(0,0,0,.4);
}
.mk-home svg { width: 22px; height: 22px; fill: #fff; }
.leaflet-container { font-family: var(--font-body); }
.leaflet-popup-content { margin: 12px 14px; }
.pop h3 { margin: 0 0 2px; font-size: 1rem; }
.pop p { margin: 4px 0; }
.pop .links a { color: var(--primary); }
