@font-face {
  font-family: Lora;
  src: url('/fonts/lora/lora-latin-400-normal.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Lora;
  src: url('/fonts/lora/lora-latin-500-normal.woff2') format('woff2');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: Lora;
  src: url('/fonts/lora/lora-latin-600-normal.woff2') format('woff2');
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Sans';
  src: url('/fonts/ibm-plex-sans/ibm-plex-sans-latin-400-normal.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Sans';
  src: url('/fonts/ibm-plex-sans/ibm-plex-sans-latin-500-normal.woff2') format('woff2');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Sans';
  src: url('/fonts/ibm-plex-sans/ibm-plex-sans-latin-600-normal.woff2') format('woff2');
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  --stone-canvas: #f2eee6;
  --stone-raised: #faf8f3;
  --stone-soft: #e8e0d3;
  --ink-deep: #17211f;
  --ink-body: #34423e;
  --ink-muted: #596560;
  --water-deep: #274b4f;
  --copper: #a5653f;
  --copper-deep: #78462f;
  --copper-light: #d9a47e;
  --focus-ring: #c88050;
  --on-dark-muted: rgb(250 248 243 / 72%);
  --line-dark: rgb(250 248 243 / 14%);
  --line-light: rgb(23 33 31 / 12%);
  /* Side padding that keeps section content within 1440px while backgrounds run edge to edge */
  --gutter: max(32px, calc((100% - 1440px) / 2));
  --font-display: Lora, Georgia, serif;
  --font-body: 'IBM Plex Sans', 'Segoe UI', sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html {
  background: var(--stone-canvas);
  color: var(--ink-body);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  /* The scrollbar keeps its room while the open plan holds the page still, so nothing shifts sideways */
  scrollbar-gutter: stable;
}

body { min-width: 320px; margin: 0; }

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

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 12px 16px;
  transform: translateY(-160%);
  background: var(--ink-deep);
  color: var(--stone-raised);
  font-weight: 600;
  text-decoration: none;
}

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

.site-header {
  border-bottom: 1px solid var(--line-dark);
  background: var(--ink-deep);
  color: var(--stone-raised);
}

.top-header {
  display: flex;
  width: min(100%, 1512px);
  min-height: 80px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: auto;
  padding: 12px 36px;
}

.site-brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.site-brand-mark,
.footer-arch {
  position: relative;
  width: 32px;
  height: 40px;
  flex: 0 0 auto;
  border: 1.5px solid currentColor;
  border-bottom-width: 4px;
  border-radius: 18px 18px 2px 2px;
}

.site-brand-mark::after {
  position: absolute;
  top: 11px;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--copper-light);
  content: '';
  transform: translateX(-50%);
}

.site-brand-copy { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.site-brand-title { color: var(--stone-raised); font: 600 17px/1.2 var(--font-display); letter-spacing: -.02em; }
.site-brand-subtitle { color: var(--on-dark-muted); font: 600 10px/1.3 var(--font-body); letter-spacing: .12em; text-transform: uppercase; }

.site-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.site-nav a { padding: 10px 14px; color: var(--on-dark-muted); font: 500 13px var(--font-body); text-decoration: none; transition: color .15s; }
.site-nav a:hover { color: var(--stone-raised); text-decoration: underline; text-decoration-color: var(--copper-light); text-underline-offset: 6px; }

.language-control select {
  min-height: 44px;
  padding: 0 36px 0 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #e8e5de;
  color: var(--ink-deep);
  font: 500 14px var(--font-body);
  cursor: pointer;
}

.site-header .language-control select { border-color: var(--line-dark); background: rgb(250 248 243 / 7%); color: var(--stone-raised); }
.site-header .language-control option { background: var(--ink-deep); color: var(--stone-raised); }

.map-view {
  min-height: calc(100dvh - 80px);
  overflow-x: clip;
}

.editorial-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--copper-deep);
  font: 600 11px/1.4 var(--font-body);
  letter-spacing: .14em;
  text-transform: uppercase;
}

.editorial-eyebrow::before { width: 26px; height: 1px; background: currentColor; content: ''; }

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border: 1px solid transparent;
  font: 600 13px/1.2 var(--font-body);
  letter-spacing: .02em;
  text-decoration: none;
  transition: background-color .15s, color .15s;
}

.button-primary { background: var(--copper-light); color: var(--ink-deep); }
.button-primary:hover { background: #e7b996; }
.button-ghost { border-color: currentColor; color: inherit; }
.button-ghost:hover { background: rgb(127 127 127 / 12%); }

/* First screen: the plan and the presentation side by side, on the dark ground of the header */
.map-section {
  /* Narrower sides than the other sections: the plan gets the room */
  padding: 28px max(24px, calc((100% - 1440px) / 2)) 0;
  background: var(--ink-deep);
  color: var(--stone-raised);
}

.explorer-shell {
  display: grid;
  width: 100%;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 32px;
}

.explorer-panel { display: flex; min-width: 0; flex-direction: column; padding: 16px 0 4px; }
.map-section .editorial-eyebrow { color: var(--copper-light); }

.map-section h1 {
  margin: 18px 0 20px;
  color: var(--stone-raised);
  font: 400 clamp(34px, 2.8vw, 42px)/1.06 var(--font-display);
  letter-spacing: -.04em;
  text-wrap: balance;
}

.hero-summary {
  margin: 0;
  color: var(--on-dark-muted);
  font-size: 16px;
  line-height: 1.65;
  text-wrap: pretty;
}

.phase-legend { display: flex; flex-direction: column; margin-top: 28px; border-top: 1px solid var(--line-dark); }

.phase-item {
  display: grid;
  width: 100%;
  grid-template-columns: 14px 1fr;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border: 0;
  border-bottom: 1px solid var(--line-dark);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.phase-swatch { width: 10px; height: 28px; border-radius: 8px 8px 2px 2px; background: currentColor; }
.phase-califal { color: #86afb6; }
.phase-taifa { color: #c9825a; }
.phase-almohade { color: #dcb162; }
.phase-copy { display: flex; flex-direction: column; gap: 2px; }
.phase-title { color: var(--stone-raised); font-size: 14px; font-weight: 600; }
.phase-period { color: var(--on-dark-muted); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.phase-item:hover .phase-title { text-decoration: underline; text-underline-offset: 3px; }
.phase-item[aria-pressed="false"] .phase-swatch { background: transparent; box-shadow: inset 0 0 0 2px currentColor; }
.phase-item[aria-pressed="false"] .phase-title { color: var(--on-dark-muted); text-decoration: line-through; }

/* A glimpse of the gallery under the legend: three photos framed as arches */
.hero-glimpse {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
  padding-top: 28px;
  color: inherit;
  text-decoration: none;
}

.hero-glimpse-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hero-glimpse-photos img { width: 100%; height: 92px; border-radius: 999px 999px 3px 3px; object-fit: cover; transition: transform .2s; }
.hero-glimpse:hover .hero-glimpse-photos img { transform: translateY(-3px); }
.hero-glimpse-copy { display: flex; flex-direction: column; gap: 3px; }
.hero-glimpse-title { font: 500 17px/1.25 var(--font-display); }
.hero-glimpse-text { color: var(--on-dark-muted); font-size: 12px; }
.hero-glimpse:hover .hero-glimpse-title { text-decoration: underline; text-decoration-color: var(--copper-light); text-underline-offset: 4px; }

.map-frame { min-width: 0; overflow: hidden; overflow: clip; border: 1px solid rgb(250 248 243 / 10%); background: #24302d; box-shadow: 0 30px 60px rgb(0 0 0 / 32%); }
/* Beside a taller presentation the plan grows to match it */
@media (min-width: 1081px) {
  .map-frame { display: flex; flex-direction: column; }
  .map-stage { flex: 1 0 auto; }
}
.map-toolbar { display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 24px; padding: 0 24px; color: var(--stone-raised); border-bottom: 1px solid rgb(250 248 243 / 12%); }
.map-frame-label { font: 500 16px var(--font-display); }
.map-point-count { color: rgb(250 248 243 / 72%); font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.map-exit-button { display: none; min-height: 40px; padding: 8px 12px; border: 1px solid rgb(250 248 243 / 55%); background: transparent; color: var(--stone-raised); font: 600 12px var(--font-body); cursor: pointer; }
.map-exit-button:hover { background: rgb(250 248 243 / 12%); }
.map-exit-button:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.map-section[data-map-mode="expanded"] .map-exit-button { display: inline-flex; align-items: center; }
.map-section[data-map-mode="compact"] .map-open-button { display: flex; }

/* The open plan is a mode of its own: the page holds still and steps back, inert (map-view.mjs) */
body:has(.map-section[data-map-mode="expanded"]) { overflow: hidden; }
/* Darkened rather than faded, so the dark header and band do not turn grey over the light page */
body:has(.map-section[data-map-mode="expanded"]) :is(.site-header, .map-view > :not(.map-section), .site-footer) { filter: brightness(.45) saturate(.7); transition: filter .2s; }

.map-stage {
  position: relative;
  width: 100%;
  height: clamp(420px, calc(100dvh - 200px), 760px);
  isolation: isolate;
  /* clip, unlike hidden, cannot be scrolled by focus or scrollIntoView, which would shift the map layers */
  overflow: hidden;
  overflow: clip;
  background: #0e171a;
}

/* Drawn above the map layers, which would otherwise cover an outline */
.map-stage[tabindex="-1"]:focus { outline: none; }
.map-stage[tabindex="-1"]:focus-visible::after { position: absolute; z-index: 45; inset: 0; box-shadow: inset 0 0 0 3px var(--focus-ring); content: ''; pointer-events: none; }
.map-open-button { position: absolute; inset: 0; z-index: 3; display: none; align-items: flex-end; justify-content: center; padding: 18px; border: 0; background: linear-gradient(transparent 55%, rgb(23 33 31 / 42%)); cursor: pointer; }
.map-open-button span { padding: 11px 17px; border-bottom: 3px solid var(--copper); background: var(--stone-raised); color: var(--ink-deep); font: 600 13px var(--font-body); }
.map-open-button:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: -5px; }
.map-error { position: absolute; inset: 0; z-index: 40; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; background: #24302d; color: var(--stone-raised); text-align: center; }
.map-error-message { max-width: 34ch; margin: 0; font: 500 clamp(18px, 3vw, 26px)/1.25 var(--font-display); }
.map-error-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.map-error-actions button { min-height: 44px; padding: 10px 16px; border: 1px solid rgb(250 248 243 / 70%); background: var(--stone-raised); color: var(--ink-deep); font: 600 13px var(--font-body); cursor: pointer; }
.map-error-actions button:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.map-error-exit-button { display: none; }
.map-section[data-map-mode="expanded"] .map-error-exit-button { display: inline-block; }
.map-section[data-map-error] .map-error { display: flex; }
.map-section[data-map-error] .map-open-button,
.map-section[data-map-error] .map-exit-button { display: none; }


/* Key facts under the plan, still on the dark ground */
.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 32px 56px;
  padding: 36px var(--gutter) 48px;
  background: var(--ink-deep);
  color: var(--stone-raised);
}

.hero-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--line-dark); }
.hero-fact { display: flex; flex-direction: column; gap: 8px; padding: 20px 24px 0 0; }
.hero-fact + .hero-fact { padding-left: 24px; border-left: 1px solid var(--line-dark); }
.fact-value { margin: 0; color: var(--stone-raised); font: 500 clamp(22px, 2vw, 30px)/1.1 var(--font-display); letter-spacing: -.03em; }
.fact-label { color: var(--on-dark-muted); font: 500 11px/1.45 var(--font-body); letter-spacing: .06em; text-transform: uppercase; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.section-heading h2,
.guide-heading h2,
.monument-copy h2,
.history-heading h2,
.visit-copy h2 {
  margin: 18px 0 18px;
  color: var(--ink-deep);
  font: 400 clamp(30px, 3vw, 46px)/1.12 var(--font-display);
  letter-spacing: -.04em;
  text-wrap: balance;
}

/* How the plan works */
.guide-section {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(0, 2fr);
  gap: 32px 72px;
  padding: 88px var(--gutter) 80px;
}

.guide-description { margin: 0; color: var(--ink-muted); font-size: 15px; line-height: 1.7; text-wrap: pretty; }
.guide-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 0; padding: 0; background: var(--line-light); list-style: none; }
.guide-step { padding: 30px 26px 32px; background: var(--stone-raised); }
.guide-step-number { color: var(--copper-deep); font: 500 34px/1 var(--font-display); letter-spacing: -.04em; }
.guide-step h3 { margin: 22px 0 10px; color: var(--ink-deep); font: 500 20px/1.25 var(--font-display); letter-spacing: -.02em; }
.guide-step p { margin: 0; color: var(--ink-muted); font-size: 14px; line-height: 1.65; }

.map-hint { display: grid; grid-column: 2; grid-template-columns: 32px 1fr; align-items: start; gap: 14px; }
.map-hint-icon { display: grid; width: 32px; height: 38px; place-items: center; border: 1px solid var(--line-light); border-bottom-width: 3px; border-radius: 17px 17px 3px 3px; color: var(--copper-deep); font: 20px/1 var(--font-display); }
.map-hint p { max-width: 82ch; margin: 0; color: var(--ink-muted); font-size: 13px; line-height: 1.6; text-wrap: pretty; }

/* The monument: an arched photograph beside the long text */
.monument-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 48px 88px;
  padding: 96px var(--gutter);
  background: var(--stone-raised);
}

.monument-figure { margin: 0; }
.monument-figure img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; border-radius: 999px 999px 4px 4px; object-fit: cover; box-shadow: 0 30px 60px rgb(23 33 31 / 18%); }

.monument-figure figcaption,
.history-figure figcaption,
.visit-figure figcaption {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: var(--ink-muted);
  font-size: 12px;
  letter-spacing: .02em;
}

.monument-figure figcaption::before,
.history-figure figcaption::before,
.visit-figure figcaption::before { width: 20px; height: 1px; flex: 0 0 auto; background: var(--copper); content: ''; }

.monument-copy { max-width: 620px; }
.monument-copy p { margin: 0 0 16px; color: var(--ink-body); font-size: 15px; line-height: 1.75; text-wrap: pretty; }
.monument-copy .monument-lead { color: var(--ink-deep); font: 400 20px/1.6 var(--font-display); }

.monument-quote { margin: 30px 0; padding: 4px 0 4px 26px; border-left: 3px solid var(--copper); }
.monument-copy .monument-quote p { margin: 0 0 12px; color: var(--ink-deep); font: italic 400 22px/1.5 var(--font-display); }
.monument-quote footer { color: var(--ink-muted); font: 600 11px var(--font-body); letter-spacing: .12em; text-transform: uppercase; }

.monument-highlights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 34px 0 0; padding: 26px 0 0; border-top: 1px solid var(--line-light); list-style: none; }
.monument-highlights li { display: flex; flex-direction: column; gap: 12px; }
.monument-highlight-mark { width: 22px; height: 28px; border: 1.5px solid var(--copper); border-bottom-width: 3px; border-radius: 12px 12px 2px 2px; }
.monument-highlight-copy { display: flex; flex-direction: column; gap: 4px; }
.monument-highlight-title { color: var(--ink-deep); font: 600 14px/1.3 var(--font-body); }
.monument-highlight-text { color: var(--ink-muted); font-size: 13px; line-height: 1.55; }

/* Gallery: one large photograph and four smaller ones */
.gallery-section { padding: 96px var(--gutter); }
.section-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; gap: 0 72px; margin-bottom: 40px; }
.section-heading .editorial-eyebrow { grid-column: 1 / -1; }
.section-heading h2 { margin-bottom: 0; }
.section-heading p { margin: 0; color: var(--ink-muted); font-size: 15px; line-height: 1.7; text-wrap: pretty; }

.gallery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: clamp(200px, 19vw, 270px); gap: 12px; }
.gallery-item { position: relative; margin: 0; overflow: hidden; background: var(--ink-deep); }
.gallery-item:first-child { grid-column: span 2; grid-row: span 2; }
.gallery-item img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.gallery-item:hover img { transform: scale(1.04); }

.gallery-item figcaption {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 48px 20px 18px;
  background: linear-gradient(transparent, rgb(10 15 14 / 88%) 60%);
  color: var(--stone-raised);
}

.gallery-item-title { font: 500 20px/1.2 var(--font-display); letter-spacing: -.02em; }
.gallery-item:first-child .gallery-item-title { font-size: 28px; }
.gallery-item-text { color: rgb(250 248 243 / 82%); font-size: 13px; line-height: 1.5; }

.history-section {
  display: grid;
  grid-template-columns: minmax(260px, .7fr) minmax(0, 1.3fr);
  gap: 80px;
  padding: 96px var(--gutter);
  background: var(--stone-soft);
}

.history-heading { align-self: start; max-width: 440px; }
.history-intro { margin: 0; color: var(--ink-muted); font-size: 15px; line-height: 1.7; text-wrap: pretty; }
.history-figure { margin: 36px 0 0; }
.history-figure img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; border-radius: 160px 160px 4px 4px; object-fit: cover; }

.history-timeline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; align-self: start; background: rgb(23 33 31 / 13%); }
.history-card { min-height: 420px; padding: 28px 24px 30px; background: var(--stone-soft); }
.history-date { display: flex; align-items: baseline; gap: 7px; margin-bottom: 72px; color: var(--copper-deep); }
.history-century-number { font: 500 44px var(--font-display); letter-spacing: -.05em; }
.history-century-label { font: 600 9px var(--font-body); letter-spacing: .13em; text-transform: uppercase; }
.history-card h3 { margin: 0 0 14px; color: var(--ink-deep); font: 500 21px/1.25 var(--font-display); letter-spacing: -.025em; }
.history-card p { margin: 0; color: var(--ink-muted); font-size: 13px; line-height: 1.65; text-wrap: pretty; }
.history-card .history-detail { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgb(23 33 31 / 13%); color: var(--ink-body); font-size: 12px; }

/* Planning the visit: practical details beside the Google map */
.visit-section {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 48px 64px;
  padding: 96px var(--gutter);
  background: var(--stone-raised);
}

.visit-intro { margin: 0; color: var(--ink-muted); font-size: 15px; line-height: 1.7; text-wrap: pretty; }
.visit-details { margin: 30px 0 0; border-top: 1px solid var(--line-light); }
.visit-detail { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line-light); }
.visit-detail dt { padding-top: 2px; color: var(--copper-deep); font: 600 11px/1.4 var(--font-body); letter-spacing: .1em; text-transform: uppercase; }
.visit-detail dd { margin: 0; color: var(--ink-deep); font-size: 15px; line-height: 1.5; }
.visit-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; color: var(--ink-deep); }
.visit-actions .button-primary { background: var(--ink-deep); color: var(--stone-raised); }
.visit-actions .button-primary:hover { background: var(--water-deep); }

.visit-map { position: relative; min-height: 480px; overflow: hidden; border: 1px solid var(--line-light); background: var(--stone-soft); box-shadow: 0 24px 48px rgb(23 33 31 / 10%); }
.visit-map-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.visit-transport { display: grid; grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--stone-soft); }
.visit-figure { margin: 0; }
.visit-figure img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.visit-figure figcaption { margin: 0; padding: 12px 20px; background: var(--stone-soft); }
.visit-routes { padding: 44px 48px; }
.visit-routes h3 { margin: 0 0 22px; color: var(--ink-deep); font: 500 26px/1.2 var(--font-display); letter-spacing: -.03em; }
.visit-routes ul { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.visit-routes li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-top: 1px solid var(--line-light); }
.visit-route-title { color: var(--ink-deep); font: 600 14px var(--font-body); }
.visit-route-text { color: var(--ink-muted); font-size: 14px; line-height: 1.6; }

.site-footer { padding: 72px var(--gutter) 32px; background: var(--ink-deep); color: var(--on-dark-muted); }
.footer-main { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 48px; padding-bottom: 48px; border-bottom: 1px solid var(--line-dark); }
.footer-about p { max-width: 42ch; margin: 22px 0 0; font-size: 14px; line-height: 1.7; }
.footer-column { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.footer-column h2 { margin: 0 0 12px; color: var(--copper-light); font: 600 11px/1.4 var(--font-body); letter-spacing: .14em; text-transform: uppercase; }
.footer-column p { margin: 0 0 8px; font-size: 14px; line-height: 1.6; }
.footer-column a { padding: 4px 0; color: var(--stone-raised); font-size: 14px; text-decoration: none; text-underline-offset: 4px; }
.footer-column a:hover { text-decoration: underline; }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; padding-top: 26px; }
.footer-arch { width: 18px; height: 24px; color: var(--copper-light); border-bottom-width: 3px; }
.footer-location,
.footer-rights { font: 500 11px var(--font-body); letter-spacing: .06em; text-transform: uppercase; }
.footer-rights { margin-left: auto; }
.footer-source { color: var(--stone-raised); font: 600 13px var(--font-body); }

/* On short screens the glimpse would make the presentation taller than the plan, pushing it below the fold */
@media (min-width: 1081px) and (max-height: 860px) {
  .hero-glimpse { display: none; }
}

@media (max-width: 1180px) {
  .explorer-shell { grid-template-columns: 280px minmax(0, 1fr); gap: 28px; }
  .site-nav a { padding-inline: 10px; }
}

@media (max-width: 1080px) {
  .site-nav { display: none; }
  .explorer-shell { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .explorer-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    grid-template-areas: "eyebrow legend" "title legend" "summary glimpse";
    align-items: start;
    column-gap: 48px;
    padding-top: 8px;
  }
  .explorer-panel > .editorial-eyebrow { grid-area: eyebrow; }
  .explorer-panel > h1 { grid-area: title; }
  .explorer-panel > .hero-summary { grid-area: summary; }
  .phase-legend { grid-area: legend; margin-top: 0; }
  .hero-glimpse { grid-area: glimpse; align-self: end; }
  .hero-band { grid-template-columns: minmax(0, 1fr); }
  .hero-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-fact:nth-child(3) { padding-left: 0; border-left: 0; }
  .guide-section,
  .history-section,
  .monument-section,
  .visit-section { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .map-hint { grid-column: auto; }
  .monument-figure { width: min(100%, 520px); justify-self: center; }
  .monument-copy { max-width: none; }
  .section-heading { grid-template-columns: minmax(0, 1fr); }
  .section-heading p { margin-top: 16px; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: clamp(200px, 32vw, 300px); }
  .history-heading { max-width: none; }
  .history-figure img { max-height: 360px; border-radius: 4px; }
  .visit-map { min-height: 400px; }
  .footer-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  :root { --gutter: 18px; }
  .top-header { min-height: 72px; padding: 12px 18px; gap: 12px; }
  .site-brand-title { font-size: 14px; }
  .site-brand-subtitle { font-size: 8px; }
  .site-brand-mark { width: 26px; height: 34px; }
  .language-control select { min-height: 44px; max-width: 120px; padding-inline: 8px; font-size: 12px; }
  .map-section { padding: 22px var(--gutter) 0; }
  .explorer-shell { gap: 20px; }
  .explorer-panel { display: flex; padding: 0; }
  .map-section h1 { margin: 14px 0 14px; font-size: clamp(32px, 9vw, 40px); }
  .hero-summary { font-size: 15px; line-height: 1.6; }
  .phase-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 20px; border-top: 0; }
  .phase-item { grid-template-columns: 8px minmax(0, 1fr); gap: 8px; padding: 8px 10px; border: 1px solid var(--line-dark); }
  .phase-swatch { width: 7px; height: 24px; }
  .phase-title { font-size: 12px; }
  .phase-period { font-size: 10px; }
  .hero-glimpse { display: none; }
  .map-frame { margin-inline: calc(-1 * var(--gutter)); }
  .map-toolbar { min-height: 56px; padding-inline: 16px; }
  .map-point-count { font-size: 9px; letter-spacing: .08em; text-align: right; }
  .map-section[data-map-mode="expanded"] .map-point-count { display: none; }
  .hero-band { gap: 28px; padding-block: 28px 40px; }
  .hero-fact,
  .hero-fact + .hero-fact { padding: 16px 12px 0 0; border-left: 0; }
  .hero-actions .button { flex: 1 1 100%; }
  .guide-section,
  .gallery-section,
  .monument-section,
  .history-section,
  .visit-section { padding-block: 60px; }
  .guide-steps { grid-template-columns: minmax(0, 1fr); }
  .guide-step { padding: 24px 20px; }
  .monument-highlights { grid-template-columns: minmax(0, 1fr); }
  .monument-copy .monument-lead { font-size: 18px; }
  .gallery-grid { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; }
  .gallery-item:first-child { grid-column: auto; grid-row: auto; }
  .gallery-item img { height: auto; aspect-ratio: 3 / 2; }
  .history-timeline { grid-template-columns: 1fr; }
  .history-card { min-height: 0; padding: 22px 0; }
  .history-date { margin-bottom: 18px; }
  .visit-detail { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .visit-map { min-height: 340px; }
  .visit-transport { grid-template-columns: minmax(0, 1fr); }
  .visit-routes { padding: 28px 20px; }
  .visit-routes li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .footer-main { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .footer-rights { margin-left: 0; }
}

@media (max-width: 680px) and (orientation: portrait) {
  .map-section[data-map-mode="compact"] .map-stage { width: min(72%, 280px); height: auto; aspect-ratio: 3 / 2; margin: 16px auto; box-shadow: 0 12px 28px rgb(10 17 15 / 22%); }
  .map-section[data-map-mode="compact"][data-map-error] .map-stage { width: 100%; margin: 0; }
}

@media (max-width: 680px), (orientation: landscape) and (max-height: 600px) and (max-width: 960px) {
  .map-section[data-map-mode="expanded"] .map-frame {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    width: 100vw;
    height: 100dvh;
    margin: 0;
    border: 0;
    flex-direction: column;
    overflow: hidden;
  }
  .map-section[data-map-mode="expanded"] .map-toolbar { width: 100%; flex: 0 0 auto; }
  .map-section[data-map-mode="expanded"] .map-stage {
    width: 100%;
    height: auto;
    min-height: 0;
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-item img,
  .hero-glimpse-photos img { transition: none; }
}
