/* Design tokens sampled from the WdW Kwartier festival poster (img/design.png).
   The poster is festival artwork rather than a permanent identity, so a
   rebrand must be a change to this block alone. */
:root {
  --pink: #E492A6;
  --blue: #99CEE1;
  --yellow: #F3C346;
  --ink: #1B1D21;
  --slate: #696E82;
  --chalk: #CACBCD;
  --orange: #DF884F;
  --purple: #704C85;
  --green: #54A855;
  --teal: #5093A5;

  --paper: #FFFCF9;
  --outline: 3px;
  --radius: 14px;
  --shadow-hard: 4px 4px 0 var(--ink);
  --shadow-hard-sm: 2px 2px 0 var(--ink);
  --tap: 44px;

  --font-display: 'Archivo Black', 'Arial Black', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Helvetica Neue', sans-serif;

  --header-h: 60px;
  --filter-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overscroll-behavior: none;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
}

body {
  display: grid;
  grid-template-rows: auto auto 1fr;
  height: 100dvh;
}

/* ---------- Header: full poster energy ---------- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--header-h);
  padding: 8px 14px;
  background: var(--pink) url('../icons/texture-speckle.svg') repeat;
  border-bottom: var(--outline) solid var(--ink);
}

.app-header__actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;       /* buttons keep their size; the title yields instead */
}

.app-header__title {
  margin: 0;
  min-width: 0;         /* allows the flex item to shrink below its content */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: clamp(17px, 5vw, 24px);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--chalk);
  /* Layered shadow echoes the extruded lettering on the poster. */
  text-shadow:
    1px 1px 0 var(--slate), 2px 2px 0 var(--slate), 3px 3px 0 var(--slate),
    4px 4px 0 var(--ink);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 10px 16px;
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-hard-sm);
}

.btn:active { transform: translate(2px, 2px); box-shadow: none; }
.btn--primary { background: var(--yellow); }
.btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.btn svg { width: 20px; height: 20px; }

/* ---------- Filter bar ---------- */
.filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: var(--filter-h);
  padding: 10px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--blue) url('../icons/texture-speckle.svg') repeat;
  border-bottom: var(--outline) solid var(--ink);
}

.filter-bar::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: var(--tap);
  padding: 8px 14px;
  border: var(--outline) solid var(--ink);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
  opacity: 0.55;
}

.chip[aria-pressed="true"] { opacity: 1; box-shadow: var(--shadow-hard-sm); }
.chip:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.chip img { width: 22px; height: 22px; }

.search {
  flex: 1 0 180px;
  min-height: var(--tap);
  padding: 10px 14px;
  border: var(--outline) solid var(--ink);
  border-radius: 999px;
  font: inherit;
  background: #fff;
}

/* ---------- Map: deliberately calm ---------- */
.map { width: 100%; height: 100%; background: #eee; }
.leaflet-container { font-family: var(--font-body); }

.marker { background: none; border: none; }
.marker__button {
  width: 44px; height: 44px; padding: 0;
  border: none; background: none; cursor: pointer;
}
.marker__button img { width: 100%; height: 100%; display: block; }
.marker__button:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.marker--featured .marker__button { width: 56px; height: 56px; }
.marker--dimmed { opacity: 0.35; }

.boundary { fill: var(--pink); fill-opacity: 0.10; stroke: var(--ink); stroke-width: 2; stroke-dasharray: 8 6; }

/* ---------- Bottom sheet ---------- */
.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1000;
  max-height: 88dvh;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: var(--outline) solid var(--ink);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -6px 0 rgba(27, 29, 33, 0.12);
  transform: translateY(102%);
  transition: transform 220ms ease;
  overflow-y: auto;
}

.sheet--peek { transform: translateY(0); max-height: 42dvh; }
.sheet--expanded { transform: translateY(0); max-height: 88dvh; }

.sheet__handle {
  width: 52px; height: 6px; margin: 6px auto 12px;
  border-radius: 3px; background: var(--slate);
}

.sheet__title {
  margin: 0 0 4px;
  padding-right: 92px;   /* keeps the heading clear of the absolute Close button */
  font-family: var(--font-display);
  font-size: 20px;
  text-transform: uppercase;
}

.sheet__image {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover;
  border: var(--outline) solid var(--ink); border-radius: var(--radius);
  background: var(--chalk);
}

.sheet__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; font-weight: 700; }
.sheet__description { margin: 12px 0 6px; line-height: 1.5; }
.sheet__address { margin: 0; color: var(--slate); font-size: 14px; }
.sheet__credit { margin: 4px 0 0; color: var(--slate); font-size: 12px; }
.sheet__close { position: absolute; top: 10px; right: 14px; padding: 6px 12px; min-height: 36px; }
.sheet__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.sheet__hours { width: 100%; border-collapse: collapse; font-size: 14px; }
.sheet__hours td { padding: 3px 0; }
.sheet__hours td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.sheet__hours tr[data-today="true"] { font-weight: 700; }

/* ---------- Badges and toast ---------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge--open { background: var(--green); color: #fff; }
.badge--closed { background: var(--chalk); }
.badge--featured { background: var(--yellow); }

.toast {
  position: fixed;
  left: 50%; bottom: 24px;
  z-index: 1200;
  transform: translateX(-50%);
  max-width: min(92vw, 420px);
  padding: 12px 16px;
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius);
  background: var(--yellow);
  box-shadow: var(--shadow-hard);
  font-weight: 600;
}

.toast[hidden] { display: none; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .sheet { transition: none; }
}

/* ---------- Narrow phones ---------- */
.app-header .btn { padding: 8px 12px; }

/* Icon-only and short-label controls still need a 44px tap target in BOTH
   dimensions — min-height alone leaves a 30px-wide button for "EN". */
.btn--icon { padding: 8px 10px; }
.app-header .btn { min-width: 44px; }

@media (max-width: 430px) {
  .app-header { gap: 8px; padding: 8px 10px; }
  .app-header__title { font-size: 16px; }
}

/* The sheet title receives focus programmatically when a card opens, so screen
   readers announce the venue name. It is a heading, not a control anyone tabs
   to, so it carries no focus ring: Chrome matches :focus-visible on programmatic
   focus, which would otherwise draw a stray box around the title. Keyboard users
   still get a visible ring on the Close button and every link. */
.sheet__title:focus,
.sheet__title:focus-visible { outline: none; }
