/* ── LEAFLET OVERRIDES ── */
.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22) !important;
}
.leaflet-control-zoom a {
  background: #1D1D1B !important;
  color: #CB9866 !important;
  border: none !important;
  font-weight: 500;
}
.leaflet-control-zoom a:hover {
  background: #2d2d2b !important;
}
.leaflet-control-attribution {
  font-size: 10px !important;
  background: rgba(242, 233, 220, 0.85) !important;
}
.leaflet-marker-icon {
  background: none !important;
  border: none !important;
}

/* ── RESET & BASE ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:           #F2E9DC;
  --primary:      #1D1D1B;
  --accent:       #CB9866;
  --accent-dark:  #4B5D39;
  --accent-light: #E5D0B0;
  --cyan:         #6CC3C6;
  --blue:         #588093;
  --pink:         #C998C5;
  --overlay-bg:   rgba(29, 29, 27, 0.70);
  --font:         'Outfit', sans-serif;
  --header-h:     52px;
  --radius:       14px;
  --marker-size:  48px;
}

html,
body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--primary);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── HEADER ── */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header-back {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.80);
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.01em;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.header-back:hover { color: #fff; }
.header-back svg   { width: 14px; height: 14px; flex-shrink: 0; }

/* ── MAP ── */
#map {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(100% - var(--header-h));
}

/* ── MARKER ── */
.poi-marker {
  position: relative;
  width: var(--marker-size);
  height: var(--marker-size);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.2, 0.64, 1);
  -webkit-tap-highlight-color: transparent;
}
.poi-marker:active,
.poi-marker.active { transform: scale(1.15); }

.poi-marker-circle {
  width: var(--marker-size);
  height: var(--marker-size);
  border-radius: 50%;
  border: 3px solid var(--accent);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.38), 0 0 0 1.5px rgba(203, 152, 102, 0.25);
  background-color: var(--accent-light);
  background-size: cover;
  background-position: center 60%;
  background-repeat: no-repeat;
  transition: box-shadow 0.2s ease;
}
.poi-marker.active .poi-marker-circle,
.poi-marker:active .poi-marker-circle {
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45), 0 0 0 3px var(--accent);
}

.poi-marker-tail {
  position: absolute;
  bottom: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 9px solid var(--accent);
  pointer-events: none;
}

/* ── OVERLAY ── */
#overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
#overlay.visible { opacity: 1; pointer-events: all; }

/* ── MODAL ── */
#modal {
  background: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  transform: translateY(64px);
  transition: transform 0.3s cubic-bezier(0.34, 1.08, 0.64, 1);
  position: relative;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
#modal.open { transform: translateY(0); }

@media (min-width: 600px) {
  #overlay { align-items: center; padding: 24px; }
  #modal {
    border-radius: var(--radius);
    max-height: 88vh;
    transform: translateY(24px) scale(0.97);
  }
  #modal.open { transform: translateY(0) scale(1); }
}

/* ── CLOSE ── */
#close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: none;
  background: rgba(29, 29, 27, 0.09);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--primary);
  cursor: pointer;
  z-index: 10;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
  font-family: var(--font);
}
#close-btn:hover  { background: rgba(29, 29, 27, 0.16); }
#close-btn:active { background: rgba(29, 29, 27, 0.22); }

/* ── VIDEO SHORTS (9:16) ── */
.video-wrap {
  width: 100%;
  background: #111;
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}
.video-inner {
  position: relative;
  width: min(100%, calc(60vh * 9 / 16));
  aspect-ratio: 9 / 16;
  max-height: 60vh;
  flex-shrink: 0;
}
@media (min-width: 600px) {
  .video-inner {
    width: min(55%, calc(50vh * 9 / 16));
    max-height: 50vh;
  }
}

.video-skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, #1a1a1a 30%, #2a2520 50%, #1a1a1a 70%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.video-skeleton svg { opacity: 0.25; }

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

#yt-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}
#yt-player iframe { width: 100%; height: 100%; display: block; border: none; }

#yt-fallback {
  position: absolute;
  inset: 0;
  display: none;
  text-decoration: none;
  z-index: 3;
}
#yt-fallback.visible { display: block; }
#yt-fallback-thumb   { width: 100%; height: 100%; object-fit: cover; display: block; }

.yt-fallback-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.30);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.play-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.play-btn svg { width: 22px; height: 22px; margin-left: 3px; }

.yt-label {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: 0.05em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* ── POI INFO ── */
.poi-info { padding: 16px 20px 4px; }

#poi-name {
  font-size: 21px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--primary);
}
#poi-role {
  font-size: 13px;
  font-weight: 400;
  color: #888;
  margin-top: 5px;
}

.tappa-link {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: rgba(88, 128, 147, 0.35);
  text-underline-offset: 2px;
  transition: color 0.15s, text-decoration-color 0.15s;
}
.tappa-link:hover {
  color: var(--accent-dark);
  text-decoration-color: var(--accent-dark);
}

.divider {
  height: 1px;
  background: rgba(29, 29, 27, 0.07);
  margin: 12px 20px 0;
}

/* ── NAV BUTTON ── */
#nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 14px 20px 22px;
  padding: 14px 20px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  letter-spacing: 0.03em;
  transition: background 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
#nav-btn:hover  { background: #2d2d2b; }
#nav-btn:active { transform: scale(0.98); background: #333; }
#nav-btn svg    { width: 16px; height: 16px; flex-shrink: 0; }

#modal::-webkit-scrollbar       { width: 4px; }
#modal::-webkit-scrollbar-track { background: transparent; }
#modal::-webkit-scrollbar-thumb { background: var(--accent-light); border-radius: 2px; }
