:root {
  color-scheme: light;
  --ink: #0c1222;
  --ink-soft: #1a2744;
  --slate: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-soft: #f1f5f9;
  --paper: #eef6fb;
  --white: #ffffff;
  --navy: #0b1f3a;
  --navy-mid: #123056;
  --sky: #0ea5e9;
  --sky-deep: #0284c7;
  --sky-soft: #e0f2fe;
  --green: #059669;
  --amber: #d97706;
  --amber-bg: #fffbeb;
  --shadow-sm: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 8px 24px rgba(15, 47, 84, 0.08);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 10px 30px rgba(15, 47, 84, 0.1);
  --shadow-lg: 0 1px 0 rgba(255, 255, 255, 0.85) inset, 0 18px 44px rgba(11, 31, 58, 0.12);
  --glass: linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0.32));
  --glass-border: rgba(255, 255, 255, 0.74);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "DM Sans", system-ui, -apple-system, sans-serif;
  --display: "Instrument Serif", Georgia, serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f4f7fb;
  --ink-soft: #e4ebf4;
  --slate: #c9d4e2;
  --muted: #b4c2d4;
  --line: #3a4d68;
  --line-soft: #243044;
  --paper: #0a1220;
  --white: #162033;
  --navy: #07101c;
  --navy-mid: #0d1f38;
  --sky-deep: #7dd3fc;
  --sky-soft: #0b2740;
  --amber-bg: #2a1f08;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.45);
  --glass: linear-gradient(180deg, rgba(28, 46, 72, 0.55), rgba(12, 22, 38, 0.42));
  --glass-border: rgba(125, 211, 252, 0.16);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  padding-top: max(1.25rem, calc(env(safe-area-inset-top, 0px) + 0.75rem));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
  padding-bottom: max(2.5rem, calc(env(safe-area-inset-bottom, 0px) + 1rem));
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
}

a { color: var(--sky-deep); text-underline-offset: 2px; }
a:hover { color: var(--navy); }
html[data-theme="dark"] a:hover { color: #e0f2fe; }

.lang-es { display: none; }
html[lang="es"] .lang-en { display: none; }
html[lang="es"] .lang-es { display: inline; }

.topbar {
  max-width: 1080px;
  margin: 0 auto 0.85rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  padding: 0.35rem 0.15rem;
  margin-left: auto;
  margin-right: auto;
  border-radius: 14px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
}

.back {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--sky-deep);
  text-decoration: none;
}
.back:hover { text-decoration: underline; color: var(--navy); }

.report-wait {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}
.report-wait:hover { background: #123056; color: #fff; }
html[data-theme="dark"] .report-wait {
  background: #38bdf8;
  color: #041018;
}
html[data-theme="dark"] .report-wait:hover { background: #7dd3fc; color: #041018; }

.topbar-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--white);
}
.seg button {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.22rem 0.55rem;
  cursor: pointer;
  min-height: 28px;
}
.seg button:hover { color: var(--ink); background: var(--line-soft); }
.seg button.active {
  background: var(--navy);
  color: #fff;
}

.icon-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.icon-btn:hover { background: var(--line-soft); }
.icon-btn .icon-sun { display: none; }
html[data-theme="dark"] .icon-btn .icon-moon { display: none; }
html[data-theme="dark"] .icon-btn .icon-sun { display: block; }

.shell {
  max-width: 1080px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  padding: clamp(1.15rem, 2.4vw, 1.75rem) clamp(1rem, 2.4vw, 1.75rem) 1.5rem;
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sky-deep);
  margin-bottom: 0.2rem;
}

h1 {
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink);
}

.bridge-aka {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.bridge-mx {
  margin-top: 0.15rem;
  color: var(--slate);
  font-size: 0.88rem;
  font-weight: 600;
}

.bridge-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.15rem 0 0.95rem;
}

.bridge-tabs a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 750;
  color: var(--slate);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.45rem 0.8rem;
}
.bridge-tabs a:hover {
  background: var(--line-soft);
  color: var(--ink);
}
.bridge-tabs a.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.15rem;
}

.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--slate);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.38rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
}
.chip:hover { background: var(--line-soft); color: var(--ink); }
.chip.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.sparse {
  margin: 0 0 1rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--amber-bg);
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.85rem;
}
html[data-theme="dark"] .sparse {
  border-color: #92620a;
  color: #fde68a;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.poi {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.95rem 0.95rem 1rem;
  min-width: 0;
}

.poi-has-photo {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.poi-hero {
  grid-column: 1 / -1;
}
.poi-has-thumb .poi-photo img {
  height: 140px;
}
.poi-has-thumb.poi-contain .poi-photo {
  background: #f8fafc;
}
.poi-has-thumb.poi-contain .poi-photo img {
  object-fit: contain;
}
html[data-theme="dark"] .poi-has-thumb.poi-contain .poi-photo {
  background: #162033;
}

@media (min-width: 861px) {
  .poi-hero {
    flex-direction: row;
    align-items: stretch;
  }
  .poi-hero .poi-photo {
    flex: 1.15 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border-radius: 14px 0 0 14px;
  }
  .poi-hero .poi-photo img {
    flex: 1 1 auto;
    height: auto;
    min-height: 220px;
  }
  .poi-hero .poi-body {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

.poi-photo {
  margin: 0;
  position: relative;
  background: #0b1f3a;
  border-radius: 14px 14px 0 0;
  overflow: hidden;
}

.poi-photo img {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center center;
  cursor: zoom-in;
}

.poi-photo figcaption {
  padding: 0.28rem 0.85rem 0.35rem;
  font-size: 0.62rem;
  line-height: 1.35;
  color: var(--muted);
  background: var(--line-soft);
}

/* Fixed lightbox — avoids overflow clipping from card/grid */
.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(7, 16, 28, 0.82);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: zoom-out;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.photo-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}
.photo-lightbox img {
  display: block;
  max-width: min(960px, 94vw);
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  cursor: zoom-out;
}
.photo-lightbox-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(15, 23, 42, 0.75);
  color: #f8fafc;
  font: inherit;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  cursor: pointer;
}
.photo-lightbox-close:hover {
  background: rgba(15, 23, 42, 0.95);
}

.poi-photo figcaption a {
  color: inherit;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 1px;
}

.poi-body {
  padding: 0.75rem 0.95rem 1rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.55rem;
}

.tag {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.18rem 0.42rem;
  border-radius: 6px;
  background: var(--sky-soft);
  color: var(--sky-deep);
}

.poi h2 {
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--ink);
}

.maps {
  display: inline-block;
  margin-top: 0.22rem;
  font-size: 0.82rem;
  font-weight: 750;
  color: var(--sky-deep);
  text-decoration: none;
}
.maps:hover { text-decoration: underline; }

.note {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.filter-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 1.5rem 0.5rem;
  font-size: 0.9rem;
}

.callout {
  margin-top: 1.25rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: var(--sky-soft);
  border: 1px solid #bae6fd;
  color: var(--slate);
  font-size: 0.82rem;
  line-height: 1.5;
}
html[data-theme="dark"] .callout {
  border-color: #1e4a66;
}
.callout strong {
  display: block;
  color: var(--ink);
  margin-bottom: 0.2rem;
}

.page-foot {
  max-width: 1080px;
  margin: 0.9rem auto 0;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}
.page-foot a { color: var(--sky-deep); font-weight: 650; text-decoration: none; }
.page-foot a:hover { text-decoration: underline; }

@media (max-width: 860px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  body {
    padding-top: max(0.85rem, calc(env(safe-area-inset-top, 0px) + 0.65rem));
    padding-right: max(0.7rem, env(safe-area-inset-right, 0px));
    padding-bottom: max(1.75rem, calc(env(safe-area-inset-bottom, 0px) + 0.85rem));
    padding-left: max(0.7rem, env(safe-area-inset-left, 0px));
  }
  .shell { padding: 1rem 0.85rem 1.15rem; border-radius: 16px; }
  .grid { grid-template-columns: 1fr; }
  .bridge-tabs a, .chip { min-height: 36px; }
  .seg button {
    min-height: 44px;
    min-width: 44px;
    padding: 0.35rem 0.7rem;
  }
  .icon-btn {
    width: 44px;
    height: 44px;
  }
  .back {
    font-size: 0.95rem;
    padding: 0.45rem 0.2rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .photo-lightbox { transition: none; }
}

html:not([data-theme="dark"]) body {
  background:
    radial-gradient(1100px 480px at 0% -8%, rgba(70, 128, 168, 0.88), transparent 58%),
    radial-gradient(900px 420px at 100% -4%, rgba(253, 186, 116, 0.72), transparent 54%),
    radial-gradient(700px 420px at 50% 110%, rgba(45, 212, 191, 0.16), transparent 55%),
    linear-gradient(105deg, #6f8faf 0%, #8eabc4 38%, #d6e2ee 72%, #f1e8d8 100%);
}
html:not([data-theme="dark"]) .shell,
html:not([data-theme="dark"]) .poi {
  background: var(--glass);
  border-color: var(--glass-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(1.55);
  -webkit-backdrop-filter: blur(20px) saturate(1.55);
}
html:not([data-theme="dark"]) .seg,
html:not([data-theme="dark"]) .chip,
html:not([data-theme="dark"]) .bridge-tabs a,
html:not([data-theme="dark"]) .icon-btn {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.4));
  border-color: var(--glass-border);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
}
html:not([data-theme="dark"]) .chip.active,
html:not([data-theme="dark"]) .seg button.active,
html:not([data-theme="dark"]) .bridge-tabs a.active {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.58));
  color: #0c1222;
  border-color: var(--glass-border);
  box-shadow: 0 1px 0 #fff inset;
}
html:not([data-theme="dark"]) .callout {
  background: linear-gradient(180deg, rgba(224, 242, 254, 0.7), rgba(255, 255, 255, 0.4));
  border-color: rgba(186, 230, 253, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(1100px 520px at 0% -10%, rgba(56, 189, 248, 0.28), transparent 58%),
    radial-gradient(900px 460px at 100% -8%, rgba(99, 102, 241, 0.22), transparent 55%),
    linear-gradient(180deg, #071018 0%, #050b14 42%, #08111c 100%);
}
html[data-theme="dark"] .shell,
html[data-theme="dark"] .poi {
  background: var(--glass);
  border-color: var(--glass-border);
  box-shadow: 0 1px 0 rgba(186, 230, 253, 0.18) inset, 0 12px 36px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(22px) saturate(1.45);
  -webkit-backdrop-filter: blur(22px) saturate(1.45);
}
html[data-theme="dark"] .seg,
html[data-theme="dark"] .chip,
html[data-theme="dark"] .bridge-tabs a,
html[data-theme="dark"] .icon-btn {
  background: linear-gradient(180deg, rgba(28, 46, 72, 0.55), rgba(12, 22, 38, 0.42));
  border-color: var(--glass-border);
}
html[data-theme="dark"] .chip.active,
html[data-theme="dark"] .seg button.active {
  background: linear-gradient(180deg, rgba(125, 211, 252, 0.95), rgba(56, 189, 248, 0.78));
  color: #041018;
  border-color: rgba(125, 211, 252, 0.4);
}
html[data-theme="dark"] .callout {
  background: linear-gradient(180deg, rgba(14, 42, 62, 0.7), rgba(12, 22, 38, 0.45));
  border-color: rgba(125, 211, 252, 0.2);
}
