:root {
  --ink: #0a0a0a;
  --body: #3a3a3a;
  --muted: #6a6a6a;
  --hairline: #e5e5e5;
  --canvas: #fffaf0;
  --surface-soft: #faf5e8;
  --surface-card: #f5f0e0;
  --surface-strong: #ebe6d6;
  --pink: #ff4d8b;
  --teal: #1a3a3a;
  --lavender: #b8a4ed;
  --peach: #ffb084;
  --ochre: #e8b94a;
  --mint: #a4d4c5;
  --coral: #ff6b5a;
  --white: #ffffff;
  --max-width: 1280px;
}

* { box-sizing: border-box; }

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

button, a { -webkit-tap-highlight-color: transparent; }

button { font: inherit; }

a { color: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--white);
  background: var(--ink);
  transform: translateY(-180%);
}

.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

.masthead,
.map-section,
.destination {
  width: min(calc(100% - 48px), var(--max-width));
  margin-inline: auto;
}

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(220px, 4fr);
  gap: 48px;
  align-items: end;
  padding: 48px 0 32px;
}

.masthead h1,
.destination__header h2 {
  margin: 0;
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.masthead h1 { max-width: 760px; font-size: clamp(36px, 4.8vw, 60px); }

.masthead__stamp {
  display: grid;
  width: 220px;
  aspect-ratio: 1;
  justify-self: end;
  place-content: center;
  border-radius: 50%;
  background: var(--pink);
  text-align: center;
  transform: rotate(6deg);
}

.masthead__stamp span { font-size: 72px; font-weight: 500; line-height: .9; letter-spacing: -.08em; }
.masthead__stamp small { margin-top: 12px; font-size: 13px; font-weight: 600; letter-spacing: .12em; }

.eyebrow,
.copy-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.map-section {
  padding: 40px;
  border-radius: 24px;
  background: var(--surface-soft);
}

.destination__header,
.nearby__heading {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  align-items: flex-end;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin: 28px 0 24px;
  color: var(--body);
  font-size: 13px;
}

.legend span { display: inline-flex; gap: 8px; align-items: center; }
.legend__dot { width: 12px; height: 12px; border: 2px solid var(--ink); border-radius: 50%; }
.legend__dot--s { background: var(--pink); }
.legend__dot--a { background: var(--teal); }
.legend__dot--b { background: var(--lavender); }
.legend__dot--c { background: var(--ochre); }

.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: stretch; }

.map-stage {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 24px;
  background: var(--canvas);
}

.spain-map { display: block; width: 100%; height: auto; color: var(--ink); }
.map-land { fill: var(--peach); stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.map-land--island { fill: var(--mint); stroke-width: 2; }
.map-pattern { fill: url(#map-dots); stroke: none; }
.map-inset { fill: var(--surface-card); stroke: var(--hairline); stroke-width: 2; }
.map-inset__label { fill: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .08em; }
.map-clay { opacity: .9; }
.map-clay--pink { fill: var(--pink); }
.map-clay--ochre { fill: var(--ochre); }

.map-pin { cursor: pointer; }
.map-pin__target { fill: transparent; }
.map-pin__ring { fill: var(--canvas); stroke: var(--ink); stroke-width: 3; }
.map-pin__core { stroke: var(--ink); stroke-width: 1.5; }
.map-pin[data-tier="S"] .map-pin__core { fill: var(--pink); }
.map-pin[data-tier="A"] .map-pin__core { fill: var(--teal); }
.map-pin[data-tier="B"] .map-pin__core { fill: var(--lavender); }
.map-pin[data-tier="C"] .map-pin__core { fill: var(--ochre); }
.map-pin[data-tier="A"] .map-pin__rank { fill: var(--white); }
.map-pin__rank { fill: var(--ink); font-size: 10px; font-weight: 700; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.map-pin__label {
  fill: var(--ink);
  paint-order: stroke;
  stroke: var(--canvas);
  stroke-width: 5px;
  stroke-linejoin: round;
  font-size: 12px;
  font-weight: 600;
  text-anchor: middle;
  pointer-events: none;
}

.map-pin:hover .map-pin__ring,
.map-pin:focus .map-pin__ring { stroke-width: 5; }
.map-pin.is-active .map-pin__ring { fill: var(--ink); filter: url(#soft-lift); }
.map-pin.is-active .map-pin__core { stroke: var(--white); stroke-width: 2; }
.map-pin.is-active .map-pin__label { font-weight: 700; }

.hub-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 24px;
  border-radius: 24px;
  color: var(--white);
  background: var(--teal);
}

.hub-panel h3 { margin: 0; font-size: 20px; line-height: 1.2; }
.hub-panel p { margin-top: 8px; color: #d8e4e1; font-size: 13px; }
.hub-destinations { display: grid; gap: 8px; margin-top: 20px; }

.hub-destination {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 12px;
  color: var(--white);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.hub-destination:hover { color: var(--ink); background: var(--canvas); }
.hub-destination__rank { font-size: 12px; font-weight: 700; }
.hub-destination__name { min-width: 0; font-size: 13px; font-weight: 600; line-height: 1.3; }

.destination {
  margin-top: 64px;
  padding-bottom: 64px;
  scroll-margin-top: 24px;
}

.destination__header { padding-bottom: 24px; border-bottom: 1px solid var(--hairline); }
.destination__header h2 { font-size: clamp(32px, 4.6vw, 56px); }
.destination__local { margin: 8px 0 0; color: var(--muted); font-size: 18px; }

.destination__actions { display: flex; gap: 12px; align-items: center; }

.mobile-detail-close,
.mobile-detail-backdrop { display: none; }

.type-badge {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface-card);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.destination__body {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(300px, 5fr);
  gap: 40px;
  padding-top: 32px;
  align-items: start;
}

.destination__figure { min-width: 0; margin: 0; }
.destination-gallery { position: relative; min-width: 0; }
.destination-gallery__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 24px;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  touch-action: pan-x pan-y;
}
.destination-gallery__track::-webkit-scrollbar { display: none; }
.destination-gallery__slide {
  min-width: 0;
  height: 100%;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.gallery-preview-trigger {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: var(--surface-card);
  cursor: zoom-in;
  touch-action: pan-x pan-y;
}
.destination-gallery__slide > img,
.gallery-preview-trigger img {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--surface-card);
  object-fit: cover;
  object-position: center center;
}
.gallery-control {
  position: absolute;
  z-index: 1;
  top: 50%;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(10,10,10,.18);
  border-radius: 50%;
  place-items: center;
  color: var(--ink);
  background: rgba(255,250,240,.9);
  box-shadow: 0 4px 16px rgba(10,10,10,.12);
  transform: translateY(-50%);
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.gallery-control[hidden] { display: none; }
.gallery-control:disabled { opacity: .38; cursor: default; }
.gallery-control:not(:disabled):hover { background: var(--canvas); }
.gallery-control--previous { left: 12px; }
.gallery-control--next { right: 12px; }
.gallery-progress { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 10px; }
.gallery-indicators { display: flex; gap: 6px; align-items: center; min-height: 18px; }
.gallery-indicators span { width: 6px; height: 6px; border: 1px solid var(--ink); border-radius: 50%; background: transparent; }
.gallery-indicators span.is-active { width: 18px; border-radius: 999px; background: var(--ink); }
.gallery-counter { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.destination__figure figcaption { margin-top: 10px; color: var(--muted); font-size: 12px; }
.destination__figure figcaption a { text-underline-offset: 3px; }

body.lightbox-open { overflow: hidden; }
.image-lightbox {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 16px;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  color: var(--white);
  background: rgba(10,10,10,.96);
}
.image-lightbox[hidden] { display: none; }
.lightbox__toolbar { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.lightbox__title { margin: 0; font-size: clamp(18px, 3vw, 28px); font-weight: 500; line-height: 1.2; letter-spacing: -.02em; }
.lightbox__counter { margin: 6px 0 0; color: rgba(255,255,255,.72); font-size: 13px; font-variant-numeric: tabular-nums; }
.lightbox__close,
.lightbox__control {
  display: grid;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 50%;
  place-items: center;
  color: var(--white);
  background: rgba(10,10,10,.5);
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.lightbox__close { font-size: 28px; line-height: 1; }
.lightbox__close:hover,
.lightbox__control:not(:disabled):hover { background: rgba(255,255,255,.16); }
.lightbox__stage { position: relative; min-width: 0; min-height: 0; }
.lightbox__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  width: 100%;
  height: 100%;
  overflow: auto hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  touch-action: pan-x pan-y;
}
.lightbox__track::-webkit-scrollbar { display: none; }
.lightbox__slide { display: grid; min-width: 0; min-height: 0; place-items: center; scroll-snap-align: start; scroll-snap-stop: always; }
.lightbox__slide img { display: block; width: 100%; height: 100%; object-fit: contain; }
.lightbox__control { position: absolute; z-index: 1; top: 50%; transform: translateY(-50%); }
.lightbox__control[hidden] { display: none; }
.lightbox__control:disabled { opacity: .34; cursor: default; }
.lightbox__control--previous { left: 8px; }
.lightbox__control--next { right: 8px; }
.lightbox__credit { min-height: 18px; margin: 0; color: rgba(255,255,255,.7); font-size: 12px; text-align: center; overflow-wrap: anywhere; }
.lightbox__credit a { color: var(--white); text-underline-offset: 3px; }

.destination__copy { display: grid; min-width: 0; gap: 24px; }
.destination__copy section { min-width: 0; }
.destination__copy p { margin: 0; color: var(--body); line-height: 1.72; }
.destination__copy .copy-label { margin-bottom: 6px; color: var(--ink); }

.nearby {
  margin-top: 48px;
  padding: 32px;
  border-radius: 24px;
  background: var(--lavender);
}

.nearby__heading h3 { margin: 0; font-size: 22px; line-height: 1.2; }
.attractions-list { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 0; padding: 0; list-style: none; }
.attractions-list li { padding: 8px 14px; border: 1px solid rgba(10,10,10,.22); border-radius: 999px; background: rgba(255,250,240,.48); font-size: 14px; }

.source-link {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-top: 24px;
  font-weight: 600;
  text-underline-offset: 4px;
}

@media (max-width: 1023px) {
  .masthead { grid-template-columns: minmax(0, 1fr) 180px; }
  .masthead__stamp { width: 180px; }
  .map-section { padding: 32px; }
  .map-layout { grid-template-columns: 1fr; }
  .hub-panel { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; }
  .hub-destinations { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0; }
  .destination__body { grid-template-columns: 1fr 1fr; gap: 28px; }
}

@media (max-width: 767px) {
  body.mobile-detail-open,
  body.lightbox-open { overflow: hidden; }

  .masthead,
  .map-section,
  .destination { width: min(calc(100% - 32px), var(--max-width)); }
  .masthead { grid-template-columns: 1fr; padding: 28px 0 20px; }
  .masthead h1 { font-size: clamp(34px, 10vw, 44px); }
  .masthead__stamp { display: none; }
  .map-section { padding: 16px; border-radius: 16px; }
  .destination__header,
  .nearby__heading { align-items: flex-start; flex-direction: column; }
  .legend {
    flex-wrap: nowrap;
    gap: 8px 20px;
    margin: 16px 0;
    padding-bottom: 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .legend::-webkit-scrollbar,
  .map-stage::-webkit-scrollbar { display: none; }
  .legend span { flex: 0 0 auto; }
  .map-layout { gap: 12px; }
  .map-stage {
    height: 420px;
    min-height: 0;
    overflow: auto hidden;
    border-radius: 16px;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }
  .spain-map { width: 720px; max-width: none; height: auto; min-height: 0; }
  .map-pin__target { r: 37px; }
  .map-pin__label { display: none; }
  .map-pin[data-tier="S"] .map-pin__label { display: block; font-size: 18px; }
  .hub-panel { display: block; padding: 14px 16px; border-radius: 16px; }
  .hub-panel__heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; }
  .hub-panel__heading .eyebrow { display: none; }
  .hub-panel h3 { font-size: 18px; }
  .hub-panel p { margin: 0; white-space: nowrap; }
  .hub-destinations { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
  .hub-destination {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
    min-width: 0;
    min-height: 64px;
    padding: 8px 10px;
    align-content: center;
  }
  .hub-destination__rank { font-size: 10px; }
  .hub-destination__name { overflow-wrap: anywhere; font-size: 12px; line-height: 1.35; }
  .hub-destination:only-child { grid-column: 1 / -1; }
  .destination { margin-top: 64px; padding-bottom: 64px; }
  .destination__body { grid-template-columns: 1fr; gap: 20px; padding-top: 20px; }
  .type-badge { white-space: normal; }
  .nearby { margin-top: 32px; padding: 24px; border-radius: 16px; }
  .mobile-detail-backdrop {
    display: block;
    position: fixed;
    z-index: 40;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(10, 10, 10, .48);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 180ms ease, visibility 180ms ease;
  }
  .mobile-detail-backdrop.is-visible { opacity: 1; visibility: visible; pointer-events: auto; }

  .js .destination {
    position: fixed;
    z-index: 50;
    right: 4px;
    bottom: calc(4px + env(safe-area-inset-bottom));
    left: 4px;
    width: auto;
    max-height: calc(100dvh - 8px - env(safe-area-inset-bottom));
    margin: 0;
    padding: 0 clamp(16px, 4vw, 24px) calc(20px + env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--hairline);
    border-radius: 20px;
    background: var(--canvas);
    box-shadow: 0 18px 60px rgba(10, 10, 10, .28);
    transform: translateY(calc(100% + 32px));
    visibility: hidden;
    pointer-events: none;
    transition: transform 220ms ease, visibility 220ms ease;
  }
  .js .destination.is-mobile-open { transform: translateY(0); visibility: visible; pointer-events: auto; }
  .js .destination__header {
    position: sticky;
    z-index: 2;
    top: 0;
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
    padding: 14px 0 12px;
    background: var(--canvas);
  }
  .js .destination__header > div:first-child { min-width: 0; flex: 1; }
  .js .destination__header h2 { font-size: clamp(28px, 8vw, 38px); overflow-wrap: anywhere; }
  .js .destination__local { margin-top: 4px; font-size: 14px; }
  .js .destination__actions { flex: 0 0 auto; }
  .js .type-badge { display: none; }
  .js .mobile-detail-close {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    padding: 6px 8px;
    border: 1px solid var(--ink);
    border-radius: 12px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--ink);
    background: var(--surface-card);
    cursor: pointer;
  }
  .js .mobile-detail-close span:first-child { font-size: 22px; line-height: .7; }
  .js .mobile-detail-close span:last-child { margin-top: 4px; font-size: 9px; font-weight: 700; }
  .js .destination__body { min-width: 0; gap: 20px; padding-top: 16px; }
  .js .destination__figure { min-width: 0; }
  .js .destination-gallery__track {
    height: clamp(160px, 32dvh, 260px);
    aspect-ratio: auto;
    border-radius: 16px;
  }
  .js .gallery-control { width: 44px; height: 44px; }
  .js .gallery-control--previous { left: 8px; }
  .js .gallery-control--next { right: 8px; }
  .js .gallery-progress { margin-top: 8px; }
  .js .destination__figure figcaption { font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
  .js .destination__copy { gap: 18px; }
  .js .destination__copy p { font-size: clamp(15px, 4vw, 17px); line-height: 1.68; }
  .js .destination__copy .copy-label { margin-bottom: 4px; font-size: 11px; }
  .js .nearby { margin-top: 24px; padding: 16px; }
  .js .nearby__heading { gap: 4px; }
  .js .nearby__heading h3 { font-size: 21px; }
  .js .attractions-list { gap: 8px; margin-top: 16px; }
  .js .attractions-list li { padding: 7px 10px; font-size: 13px; }
  .js .source-link { margin-top: 20px; font-size: 14px; }
  .image-lightbox { gap: 12px; padding: max(12px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
  .lightbox__toolbar { padding-inline: 4px; }
  .lightbox__title { font-size: 18px; }
  .lightbox__close,
  .lightbox__control { width: 44px; height: 44px; }
  .lightbox__control--previous { left: 4px; }
  .lightbox__control--next { right: 4px; }
}

@media (max-width: 420px) {
  .masthead h1 { font-size: 34px; }
  .map-section { padding: 16px; }
  .legend { display: flex; }
  .map-stage { height: 420px; min-height: 0; }
  .spain-map { min-height: 0; }
}

@media (max-width: 767px) and (orientation: landscape) {
  .js .destination__body { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: start; }
  .js .destination-gallery__track { height: clamp(150px, 48dvh, 240px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
