/* =====================================================================
   city.css  ·  Per-destination page template (Bali, and future cities)
   Reuses tokens, nav, footer, type scale, .btn-dark, .stat-item and the
   .region-map / .region-mapwrap shell from site.css.
   Namespaces: .citymap* / .cmk* / .citystats / .cityphones / .citystops / .legend
   ===================================================================== */

/* ---------- Category color tokens (legend + dots; shared by hero + list) ---------- */
:root {
  --cat-temple:   #1E7E70;   /* Temples & worship */
  --cat-nature:   #2FA28D;   /* Nature & views */
  --cat-coast:    #2563A8;   /* Beaches & coast (accessible blue) */
  --cat-heritage: #155A4F;   /* Palaces & heritage */
  --cat-culture:  #C9A24B;   /* Museums & culture */
}
@media (prefers-color-scheme: dark) {
  :root {
    --cat-temple:   #45BAA6;
    --cat-nature:   #5FC2AE;
    --cat-coast:    #6AA6E6;
    --cat-heritage: #3FA994;
    --cat-culture:  #DDBC6A;
  }
}

/* ---------- Hero map: photo-backed, brand-washed ---------- */
/* The map reuses .region-map > .region-mapwrap from site.css.
   We give the wrapper a Bali-photo aspect ratio and turn it into a
   positioning container so the colored category markers scale with it. */
.citymap-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1400 / 878;          /* matches bali-map.jpg pixel ratio */
  border-radius: var(--r-card);
  overflow: hidden;
  box-shadow: var(--shadow-h);
  container-type: inline-size;        /* markers size against the map, not the viewport */
}
/* the local map photo, washed by .region-mapwrap::after (from site.css) */
.citymap-wrap .region-mapimg { z-index: 0; }
.citymap-wrap::after {
  content: "";
  position: absolute; inset: 0;
  background: var(--brand);
  mix-blend-mode: color;
  opacity: .42;
  pointer-events: none;
  z-index: 1;
}

/* ---------- Category markers ---------- */
.cmk {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 16px; height: 16px;
  border: 0; background: none; padding: 0;
  cursor: pointer; z-index: 2;
  /* generous, invisible touch target without growing the visible dot */
  --hit: 24px;
}
.cmk::before {                          /* >=24px touch/click area */
  content: "";
  position: absolute; top: 50%; left: 50%;
  width: var(--hit); height: var(--hit);
  transform: translate(-50%, -50%);
}
.cmk-dot {
  display: grid; place-items: center;
  width: 100%; height: 100%;
  border-radius: 50%;
  background: var(--c, var(--accent));
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
  transition: transform .12s var(--ease-out-soft);
}
.cmk:hover { z-index: 6; }
.cmk:focus-visible { outline: none; z-index: 6; }
.cmk:hover .cmk-dot,
.cmk:focus-visible .cmk-dot { transform: scale(1.35); }
.cmk:focus-visible .cmk-dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--accent)) 45%, transparent), 0 1px 5px rgba(0,0,0,.4); }

/* rank-0 / top spot: a touch larger, the only one with an inline icon + always-on name */
.cmk--top { width: 22px; height: 22px; z-index: 5; }
.cmk--top .cmk-dot {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c, var(--accent)) 28%, transparent), 0 1px 5px rgba(0,0,0,.4);
}
.cmk-ic { width: 62%; height: 62%; fill: #fff; display: block; }
/* always-on label for the top spot; sits above the dot so it never clips the map's bottom edge */
.cmk--top .rmk-name {
  position: absolute;
  bottom: calc(100% + 5px); left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: .66rem; font-weight: 700; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.9);
  pointer-events: none; z-index: 6;
}

/* ---------- Hover popover (reuses .rmk-pop visual language from site.css) ---------- */
.cmk .rmk-pop {
  position: absolute;
  bottom: calc(100% + 9px); left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: max-content; max-width: 220px;
  background: var(--surface); color: var(--on-2);
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-h);
  padding: .5rem .7rem;
  font-size: .72rem; line-height: 1.45; text-align: left;
  opacity: 0; pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 7;
}
.cmk .rmk-pop::after {
  content: ""; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--surface);
}
/* flip below for markers near the top edge */
.cmk.rmk--pb .rmk-pop { bottom: auto; top: calc(100% + 9px); }
.cmk.rmk--pb .rmk-pop::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--surface); }
.cmk:hover .rmk-pop,
.cmk:focus-visible .rmk-pop { opacity: 1; transform: translateX(-50%); }
.rmk-pop b { color: var(--on); font-weight: 700; }
/* "Look Around" badge (only rendered when vr=1; Bali has none) */
.rmk-pop-vr {
  display: inline-block; margin-left: .4rem;
  font-size: .56rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--accent); border-radius: 50px;
  padding: 0 6px;
}

/* ---------- Legend band (directly under the map) ---------- */
.legend { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.leg { display: inline-flex; align-items: center; gap: .45rem; font-size: .78rem; color: var(--on-2); }
.leg i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.citymap-legend { max-width: 1200px; margin: 0 auto; padding: 1.5rem 3rem 0; }

/* ---------- Numbers bar ---------- */
.citystats {
  display: grid;
  grid-template-columns: repeat(var(--cells, 3), 1fr);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.citystats .stat-item {
  display: block;                     /* override homepage flex stat-item */
  border-left: 1px solid var(--border);
  padding: 1.75rem 2.5rem;
}
.citystats .stat-item:first-child { border-left: 0; }

/* ---------- App screens ---------- */
.cityphones {
  display: flex; gap: 0; justify-content: center;
  padding: 3.5rem 2rem 4rem;
  border-top: 1px solid var(--border);
  background: var(--surface-p);
}
.cityphones .cityphone { display: flex; flex-direction: column; align-items: center; }
.cityphones .phone { width: clamp(120px, 15vw, 178px); }
.cityphones .cp1 .phone { transform: rotate(-6deg) translateY(12px); }
.cityphones .cp2 { z-index: 2; }
.cityphones .cp3 .phone { transform: rotate(6deg) translateY(12px); }
.cityphones .cp1 { margin-right: -22px; z-index: 1; }
.cityphones .cp3 { margin-left: -22px; z-index: 1; }
.cityphones .spot-caption { margin-top: 1.5rem; }

/* ---------- Stops list (grouped by category) ---------- */
.citystops { padding: 4rem 3rem 5rem; max-width: 1000px; margin: 0 auto; }
.citystops h2 { text-align: center; margin: 0 auto 2.5rem; }
.citystops-group { margin-bottom: 2rem; break-inside: avoid; }
.citystops-group h3 {
  font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .6rem;
}
.citystops-group ul { columns: 3 200px; column-gap: 2rem; list-style: none; }
.citystops-group li { font-size: .9rem; color: var(--on-2); line-height: 1.9; break-inside: avoid; }

/* ---------- More destinations ---------- */
.city-more-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem;
  margin-top: 2rem;
}
.city-more-row { display: flex; flex-wrap: wrap; gap: .4rem .85rem; }
.city-more-row a { font-size: .85rem; color: var(--on-2); transition: color .15s; }
.city-more-row a:hover { color: var(--on); }
.city-more-row a:not(:last-child)::after { content: "·"; margin-left: .85rem; color: var(--on-3); }

/* ---------- Responsive (follows homepage breakpoints) ---------- */
@media (max-width: 1100px) {
  .citystats .stat-item { padding: 1.5rem 2rem; }
}
@media (max-width: 860px) {
  .citymap-legend { padding: 1.25rem 2.5rem 0; }
  .citystops { padding: 3rem 2.5rem 3.5rem; }
}
@media (max-width: 640px) {
  .citymap-legend { padding: 1.25rem 1.5rem 0; }
  .citystats { grid-template-columns: 1fr 1fr; }
  .citystats .stat-item { padding: 1.5rem 1.5rem; }
  .citystats .stat-item:nth-child(odd) { border-left: 0; }
  .citystats .stat-item:nth-child(n+3) { border-top: 1px solid var(--border); }
  .cityphones { padding: 2.75rem 1rem 3rem; }
  .cityphones .phone { width: clamp(104px, 28vw, 150px); }
  .cityphones .cp1 { margin-right: -18px; }
  .cityphones .cp3 { margin-left: -18px; }
  .cityphones .spot-caption { margin-top: 1.1rem; }
  .citystops { padding: 3rem 1.5rem 3.5rem; }
  .citystops-group ul { columns: 2 130px; }
}
@media (max-width: 520px) {
  .cmk { width: 13px; height: 13px; }
  .cmk--top { width: 18px; height: 18px; }
  .cmk .rmk-pop { max-width: 150px; font-size: .66rem; padding: .4rem .55rem; }
  .cmk--top .rmk-name { font-size: .6rem; }
}
@media (max-width: 400px) {
  .cmk { width: 11px; height: 11px; }     /* ~11px dot, touch target stays >=24px via ::before */
  .cmk--top { width: 16px; height: 16px; }
  .cityphones .phone { width: clamp(92px, 30vw, 124px); }
  .cityphones .cp1 { margin-right: -14px; }
  .cityphones .cp3 { margin-left: -14px; }
}

/* ---------- Motion (only active with the page's IntersectionObserver) ---------- */
.reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity var(--dur-base) var(--ease-out-soft), transform var(--dur-base) var(--ease-out-soft);
  transition-delay: var(--rd, 0ms);
}
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .cmk-dot { transition: none !important; }
}

/* ===== CITY PAGE: hero text spacing + spots panel ===== */
.s-region .region-text { display: flex; flex-direction: column; gap: 1.25rem; align-items: flex-start; }
.s-region .region-text > * { margin: 0; }
.city-spots { padding: calc(58px + 4rem) 5rem 4rem 2rem; }
.cs-legend { margin-bottom: 2rem; }
.cs-group { margin-bottom: 1.75rem; }
.cs-cat { display: flex; align-items: center; gap: .5rem; font-size: .68rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--on-2); margin: 0 0 .35rem; }
.cs-cat i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.cs-group ul { list-style: none; }
.cs-item { display: grid; grid-template-columns: auto 1fr; gap: .65rem; padding: .65rem 0; border-top: 1px solid var(--border); }
.cs-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-top: .4rem; flex: none; }
.cs-name { display: block; font-weight: 600; font-size: .92rem; color: var(--on); }

/* hero teaser chips: a flex-wrap row of bordered pills per category */
.cs-chips { display: flex; flex-wrap: wrap; gap: .4rem .5rem; }
.cs-chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .7rem;
  border: 1px solid var(--border); border-radius: 50px;
  font-size: .8rem; font-weight: 500; color: var(--on-2);
  background: var(--surface);
}
.cs-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.cs-more {
  display: inline-flex; align-items: center;
  margin-top: 1.5rem;
  font-size: .82rem; font-weight: 600; color: var(--on-2);
  border-bottom: 1px solid var(--border);
  transition: color .15s, border-color .15s;
}
.cs-more:hover { color: var(--on); border-color: var(--on); }
.cs-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

@media (max-width: 860px) { .city-spots { padding: 2rem 2.5rem 3rem; } }
@media (max-width: 520px) { .city-spots { padding: 1.5rem 1.5rem 2.5rem; } }

/* ===== Full stops list: leading category dot per item ===== */
.citystops .cs-legend { max-width: 700px; margin: 0 auto 2.5rem; justify-content: center; }
.citystops-group h3 { display: flex; align-items: center; gap: .5rem; }
.citystops-group h3 i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.citystops-group li { line-height: 1.7; }
.citystops-group li::before {
  content: ""; display: inline-block;
  width: 7px; height: 7px; margin-right: .55rem; border-radius: 50%;
  background: var(--c); vertical-align: middle;
}

/* ===== Where to walk: area cards (reuse .why-card look) ===== */
.s-area { border-top: 1px solid var(--border); padding: 5rem 3rem; max-width: 1200px; margin: 0 auto; }
.s-area .display-md { text-align: center; margin: 0 auto; }
.s-area .italic-sub { text-align: center; margin: 1rem auto 2.75rem; max-width: 52ch; }
.area-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; }
.area-card {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 2rem 1.75rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-r);
}
.area-card h3 {
  font-family: var(--font-serif);
  font-style: italic; font-weight: 500; font-size: 1.15rem;
  letter-spacing: -.01em;
  color: var(--on); margin-bottom: .55rem;
}
.area-card p { font-size: .875rem; color: var(--on-2); line-height: 1.8; }

/* ===== Final CTA band ===== */
.cta-band { border-top: 1px solid var(--border); padding: 5rem 3rem; text-align: center; }
.cta-band .display-md { margin: 0 auto .75rem; }
.cta-band .italic-sub { margin: 0 auto 2rem; }
.cta-band .btn-dark { align-self: center; }
.cta-band .cta-note { margin-top: 1.1rem; font-size: .78rem; color: var(--on-3); }

@media (max-width: 860px) {
  .s-area { padding: 3.5rem 2.5rem; }
  .cta-band { padding: 4rem 2.5rem; }
}
@media (max-width: 640px) {
  .s-area { padding: 3rem 1.5rem; }
  .area-grid { grid-template-columns: 1fr; }
  .cta-band { padding: 3.5rem 1.5rem; }
}

/* city hero photo (non-spots destinations) */
.city-photo { aspect-ratio: 4 / 3; }
.city-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
