/* ==========================================================================
   Sydney-Guide · Styles
   ========================================================================== */

:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f2f2f5;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --hairline: rgba(0, 0, 0, 0.08);
  --accent: #0071e3;
  --accent-soft: rgba(0, 113, 227, 0.1);
  --glass: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.7);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.06), 0 24px 60px rgba(0, 0, 0, 0.14);
  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 14px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --stage-h: min(64dvh, 620px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #2c2c2e;
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #8e8e93;
    --hairline: rgba(255, 255, 255, 0.1);
    --accent: #2997ff;
    --accent-soft: rgba(41, 151, 255, 0.16);
    --glass: rgba(30, 30, 32, 0.66);
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
}

button { font: inherit; color: inherit; letter-spacing: inherit; }
img { display: block; max-width: 100%; }
a { color: var(--accent); }

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  border: 0.5px solid var(--glass-border);
  box-shadow: var(--shadow-md);
}

/* --------------------------------------------------------------------------
   Bühne mit Karte
   -------------------------------------------------------------------------- */
.stage {
  position: relative;
  height: var(--stage-h);
  min-height: 420px;
  overflow: hidden;
  background: #eef0f2;
}
@media (prefers-color-scheme: dark) { .stage { background: #17181b; } }

.map { position: absolute; inset: 0; z-index: 0; }

.map-fade {
  position: absolute;
  inset: 0 0 auto 0;
  height: calc(var(--safe-t) + 200px);
  background: linear-gradient(to bottom, var(--bg) 0%, color-mix(in srgb, var(--bg) 55%, transparent) 55%, transparent 100%);
  opacity: 0.85;
  pointer-events: none;
}

.hero {
  position: absolute;
  top: calc(var(--safe-t) + 12px);
  left: calc(var(--safe-l) + 12px);
  right: calc(var(--safe-r) + 12px);
  max-width: 420px;
  padding: 16px 20px 17px;
  border-radius: var(--r-lg);
  animation: rise 0.9s var(--ease) backwards 0.1s;
}
.hero {
  transition: padding 0.5s var(--ease), border-radius 0.5s var(--ease), max-width 0.5s var(--ease);
}
.hero__title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero__eyebrow, .hero__sub {
  max-height: 3em;
  overflow: hidden;
  transition: max-height 0.5s var(--ease), opacity 0.3s ease, margin 0.5s var(--ease);
}
.hero__title { transition: font-size 0.5s var(--ease); }
.hero.is-compact { padding: 9px 18px 10px 10px; border-radius: 16px; max-width: 168px; cursor: pointer; }
.hero__row { display: flex; align-items: center; gap: 2px; }
.hero__back {
  display: grid; place-items: center;
  width: 0; height: 32px; padding: 0; margin: 0;
  border: 0; border-radius: 999px; background: transparent; color: var(--accent, #0a84ff);
  opacity: 0; overflow: hidden; pointer-events: none; cursor: pointer;
  transition: width 0.4s var(--ease), opacity 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}
.hero__back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.hero.is-compact .hero__back { width: 30px; opacity: 1; pointer-events: auto; }
.hero.is-compact:active { transform: scale(0.97); }
.hero.is-compact .hero__title { font-size: 22px; }
.hero.is-compact .hero__eyebrow,
.hero.is-compact .hero__sub { max-height: 0; opacity: 0; margin: 0; }
.hero__eyebrow {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text-2);
}
.hero__title {
  margin: 0;
  font-family: "SF Pro Display", var(--font);
  font-size: 34px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.028em;
}
.hero__sub {
  margin: 4px 0 0;
  font-size: 15px;
  line-height: 1.35;
  color: var(--text-2);
  letter-spacing: -0.012em;
}

.map-tools {
  position: absolute;
  right: calc(var(--safe-r) + 12px);
  bottom: 76px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2;
}
.tool {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s var(--ease);
}
.tool:active { transform: scale(0.92); }
.tool svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#btnLocate svg { fill: var(--accent); stroke: none; }
.tool.is-loading svg { animation: pulse 1s ease-in-out infinite; }

/* Peek-Karte nach Pin-Tipp */
.peek {
  position: absolute;
  left: calc(var(--safe-l) + 12px);
  right: calc(var(--safe-r) + 68px);
  bottom: 66px;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 8px 8px;
  border-radius: 20px;
  text-align: left;
  cursor: pointer;
  z-index: 3;
  box-shadow: var(--shadow-lg);
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.45s var(--spring), opacity 0.25s ease;
}
.peek[hidden] { display: flex; transform: translateY(24px) scale(0.96); opacity: 0; pointer-events: none; }
.peek:active { transform: scale(0.98); }
.peek__img {
  width: 56px;
  height: 56px;
  border-radius: 13px;
  object-fit: cover;
  flex: none;
  background: var(--surface-2);
}
.peek__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.peek__meta { font-size: 12.5px; color: var(--text-2); font-weight: 500; letter-spacing: -0.005em; }
.peek__name {
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.peek__chev svg { width: 18px; height: 18px; fill: none; stroke: var(--text-3); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* --------------------------------------------------------------------------
   Pins
   -------------------------------------------------------------------------- */
.pin {
  --size: 42px;
  width: var(--size);
  height: var(--size);
  border: 0;
  padding: 0;
  border-radius: 50%;
  background: var(--pin-bg, #fff);
  display: grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 6px 16px rgba(0, 0, 0, 0.16);
  transition: transform 0.45s var(--spring), opacity 0.3s ease, box-shadow 0.3s ease;
  transform-origin: 50% 100%;
}
.pin__emoji { display: block; transform: translateY(1px); }
.pin:hover { transform: scale(1.08); }
.pin.is-active {
  transform: scale(1.32) translateY(-4px);
  box-shadow: 0 0 0 3px var(--accent), 0 10px 26px rgba(0, 0, 0, 0.24);
}
.pin.is-hidden { opacity: 0; transform: scale(0.4); pointer-events: none; }
.pin.is-pop { animation: pop 0.55s var(--spring) both; }
.mapboxgl-marker:has(.pin.is-active) { z-index: 5; }
@media (prefers-color-scheme: dark) {
  .pin {
    --pin-bg: #2c2c2e;
    box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.14), 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 18px rgba(0, 0, 0, 0.5);
  }
  .pin.is-active { box-shadow: 0 0 0 3px var(--accent), 0 10px 26px rgba(0, 0, 0, 0.6); }
}

/* --------------------------------------------------------------------------
   Inhalt (schiebt sich wie ein Sheet über die Karte)
   -------------------------------------------------------------------------- */
.content {
  position: relative;
  z-index: 4;
  margin-top: -28px;
  background: var(--bg);
  border-radius: 28px 28px 0 0;
  padding: 0 calc(var(--safe-r) + 16px) 8px calc(var(--safe-l) + 16px);
}
.content::before {
  /* Griff */
  content: "";
  display: block;
  width: 36px;
  height: 5px;
  border-radius: 3px;
  background: var(--text-3);
  opacity: 0.35;
  margin: 8px auto 0;
}

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 0 calc(-16px - var(--safe-r)) 0 calc(-16px - var(--safe-l));
  padding: 14px calc(var(--safe-r) + 16px) 12px calc(var(--safe-l) + 16px);
  transition: background 0.3s ease, box-shadow 0.3s ease, padding 0.3s var(--ease);
}
.bar.is-stuck {
  padding-top: calc(var(--safe-t) + 10px);
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  box-shadow: 0 0.5px 0 var(--hairline);
}

/* Segmented Control */
.segmented {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 440px;
  margin: 0 auto;
  padding: 3px;
  border-radius: 12px;
  background: rgba(118, 118, 128, 0.12);
  isolation: isolate;
}
@media (prefers-color-scheme: dark) { .segmented { background: rgba(118, 118, 128, 0.24); } }
.segmented button {
  position: relative;
  z-index: 1;
  appearance: none;
  border: 0;
  background: none;
  height: 34px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
  cursor: pointer;
  transition: color 0.2s ease;
}
.segmented button[aria-selected="true"] { font-weight: 600; }
.segmented button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.segmented__thumb {
  position: absolute;
  z-index: 0;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc((100% - 6px) / 4);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
  transform: translateX(calc(var(--i, 0) * 100%));
  transition: transform 0.4s var(--ease);
}
@media (prefers-color-scheme: dark) { .segmented__thumb { background: #636366; } }

.intro {
  max-width: 640px;
  margin: 18px auto 2px;
  padding: 0 4px;
}
.intro__title {
  margin: 0 0 4px;
  font-family: "SF Pro Display", var(--font);
  font-size: 28px;
  line-height: 1.14;
  font-weight: 700;
  letter-spacing: -0.026em;
}
.intro p {
  margin: 0;
  font-size: 17px;
  line-height: 1.47;
  color: var(--text-2);
}
.count {
  max-width: 640px;
  margin: 2px auto 14px;
  padding: 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: -0.005em;
}

/* --------------------------------------------------------------------------
   Bildkarten
   -------------------------------------------------------------------------- */
.cards {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 640px;
  display: grid;
  gap: 20px;
}

.card {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  cursor: pointer;
  scroll-margin-top: calc(var(--safe-t) + 76px);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), opacity 0.35s ease;
  animation: rise 0.7s var(--ease) backwards;
  animation-delay: calc(var(--n, 0) * 60ms + 150ms);
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 2.5px var(--accent);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.card.is-active { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card.is-active::after { opacity: 1; }
.card.is-flash::after { animation: flash 1.2s ease; }
.card[hidden] { display: none; }

.gallery {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
}
.gallery__track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__track img {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  scroll-snap-align: center;
  user-select: none;
  -webkit-user-drag: none;
}
.gallery__dots {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.22);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.gallery__dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transition: background 0.25s ease, transform 0.25s ease;
}
.gallery__dots i.on { background: #fff; }

.card__badge {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  pointer-events: none;
}

.card__body { padding: 18px 20px 20px; }
.card__meta {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: -0.005em;
}
.card__meta .cat { color: var(--accent); }
.card__name {
  margin: 2px 0 0;
  font-family: "SF Pro Display", var(--font);
  font-size: 24px;
  line-height: 1.17;
  font-weight: 700;
  letter-spacing: -0.024em;
}

.tip {
  margin: 14px 0 0;
  padding: 14px 16px 15px;
  border-radius: 16px;
  background: var(--surface-2);
}
.tip__label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-2);
  margin-bottom: 3px;
}
.tip__text { margin: 0; font-size: 16px; line-height: 1.45; letter-spacing: -0.016em; }

.card__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 46px;
  padding: 0 14px;
  border-radius: var(--r-md);
  border: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.012em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s ease;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn--soft { background: var(--accent-soft); color: var(--accent); }
.btn--soft:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.btn--primary { background: var(--accent); color: #fff; width: 100%; }

.empty {
  text-align: center;
  color: var(--text-2);
  padding: 40px 0;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px calc(var(--safe-r) + 24px) calc(var(--safe-b) + 36px) calc(var(--safe-l) + 24px);
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-3);
}
.footer p { margin: 0; }
.footer__small { margin-top: 6px !important; font-size: 11px; }
.footer a { color: inherit; }

/* --------------------------------------------------------------------------
   Mapbox-Feinschliff
   Logo + Quellenangabe bleiben sichtbar (Lizenz), sitzen aber dezent knapp
   über dem Blatt – nie unter Glas-Elementen.
   -------------------------------------------------------------------------- */
.mapboxgl-ctrl-bottom-left,
.mapboxgl-ctrl-bottom-right { bottom: var(--map-ctrl-b, 34px); }
.mapboxgl-ctrl-bottom-left { left: var(--safe-l); }
.mapboxgl-ctrl-bottom-right { right: var(--safe-r); }
.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl { margin: 0 0 0 14px !important; }
/* Mapbox-Logo muss laut Nutzungsbedingungen sichtbar bleiben – nur dezent eingefärbt, nicht versteckt */
.mapboxgl-ctrl-logo { opacity: 0.45; filter: grayscale(1); transform: scale(0.85); transform-origin: left bottom; transition: opacity .2s; }
.mapboxgl-ctrl-logo:hover, .mapboxgl-ctrl-logo:focus-visible { opacity: 0.8; }
@media (prefers-color-scheme: dark) {
  .mapboxgl-ctrl-logo { filter: grayscale(1) brightness(1.6); opacity: 0.4; }
}
.mapboxgl-ctrl-attrib.mapboxgl-compact {
  margin: 0 14px 0 0 !important;
  font-size: 11px;
  background: var(--glass) !important;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-radius: 12px !important;
  min-height: 22px;
}
.mapboxgl-ctrl-attrib.mapboxgl-compact-show { padding: 3px 26px 3px 8px; }
.mapboxgl-ctrl-attrib.mapboxgl-compact-show a { color: var(--text) !important; }
.mapboxgl-ctrl-attrib-button { background-color: transparent !important; opacity: 0.6; }
@media (prefers-color-scheme: dark) {
  .mapboxgl-ctrl-attrib-button { filter: invert(1); }
}
.mapboxgl-user-location-dot, .mapboxgl-user-location-dot::before { background-color: var(--accent); }

/* --------------------------------------------------------------------------
   Passwortsperre
   -------------------------------------------------------------------------- */
.lock {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  backdrop-filter: blur(30px) saturate(160%);
}
.lock[hidden] { display: none; }
.lock__card {
  width: min(360px, 100%);
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: 28px 24px 22px;
  text-align: center;
}
.lock__emoji { font-size: 44px; }
.lock__card h2 { margin: 8px 0 4px; font-size: 24px; letter-spacing: -0.024em; }
.lock__card p { margin: 0 0 18px; color: var(--text-2); font-size: 15px; }
.lock__card input {
  width: 100%;
  height: 48px;
  border-radius: var(--r-md);
  border: 0;
  background: var(--surface-2);
  padding: 0 16px;
  font: inherit;
  color: var(--text);
  margin-bottom: 10px;
  outline: none;
}
.lock__card input:focus { box-shadow: 0 0 0 3px var(--accent-soft), inset 0 0 0 1px var(--accent); }
.lock__error { min-height: 1.4em; margin: 10px 0 0 !important; color: #ff3b30 !important; font-size: 13px !important; }
.lock.is-shake .lock__card { animation: shake 0.45s ease; }

/* --------------------------------------------------------------------------
   Größere Screens: Karte rechts fixiert, Liste links
   -------------------------------------------------------------------------- */
@media (min-width: 960px) {
  body {
    display: grid;
    grid-template-columns: minmax(420px, 520px) 1fr;
    grid-template-rows: 1fr auto;
  }
  .stage {
    grid-column: 2;
    grid-row: 1 / span 2;
    position: sticky;
    top: 0;
    height: 100dvh;
    margin: 0;
  }
  .content {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
    border-radius: 0;
    padding-top: 20px;
  }
  .content::before { display: none; }
  .footer { grid-column: 1; grid-row: 2; }
  .peek { bottom: 46px; }
  .map-tools { bottom: 56px; }
  .stage { --map-ctrl-b: 12px; }
  .bar.is-stuck { padding-top: 12px; }
}

/* --------------------------------------------------------------------------
   Animationen
   -------------------------------------------------------------------------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes pop {
  0% { opacity: 0; transform: scale(0.3) translateY(8px); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes pulse { 50% { opacity: 0.35; } }
@keyframes flash {
  0%, 100% { opacity: 0; }
  20%, 60% { opacity: 1; }
}
@keyframes shake {
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
