:root {
  --marianum-blue: #0070b8;
  --marianum-blue-dark: #004f86;
  --marker-blue: #53c7f5;
  --ink: #222222;
  --muted: #6d6d6d;
  --line: #dddddd;
  --surface: #ffffff;
  --surface-soft: #f6f6f6;
  --accent-warm: #8a8a8a;
  --shadow: 0 12px 26px rgba(0, 0, 0, 0.1);
  --radius: 4px;
  --content-width: 860px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
}

.navcontainer {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid #e5e5e5;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.navcontainer nav {
  max-width: 1180px;
  margin: 0 auto;
}

#site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

#site-nav a {
  display: flex;
  align-items: center;
  min-height: 54px;
  padding: 0 18px;
  color: #161616;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease;
}

#site-nav a:hover,
#site-nav a.active {
  color: #ffffff;
  background: var(--marianum-blue);
}

.search-icon {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.search-icon::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: -4px;
  width: 7px;
  height: 2px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: left center;
}

.hamburger-icon-container {
  position: fixed;
  top: 10px;
  right: 12px;
  z-index: 60;
  display: none;
  width: 42px;
  height: 38px;
  border: 1px solid #dddddd;
  border-radius: 2px;
  background: #ffffff;
  cursor: pointer;
}

.hamburger-icon,
.hamburger-icon::before,
.hamburger-icon::after {
  position: absolute;
  left: 10px;
  width: 20px;
  height: 2px;
  background: #222222;
  transition: transform 180ms ease, opacity 180ms ease;
}

.hamburger-icon {
  top: 18px;
}

.hamburger-icon::before,
.hamburger-icon::after {
  content: "";
  left: 0;
}

.hamburger-icon::before {
  top: -7px;
}

.hamburger-icon::after {
  top: 7px;
}

.hamburger-icon-container.is-open .hamburger-icon {
  background: transparent;
}

.hamburger-icon-container.is-open .hamburger-icon::before {
  transform: translateY(7px) rotate(45deg);
}

.hamburger-icon-container.is-open .hamburger-icon::after {
  transform: translateY(-7px) rotate(-45deg);
}

.guide-page {
  min-height: 100vh;
  background: #ffffff;
}

.guide-layout {
  display: grid;
  grid-template-columns: minmax(320px, 40vw) minmax(0, 1fr);
  grid-template-areas:
    "map intro"
    "map stations";
  align-items: start;
  max-width: 1440px;
  margin: 0 auto;
}

.intro-panel {
  grid-area: intro;
  min-width: 0;
  padding: 28px clamp(22px, 5vw, 72px) 24px;
}

.language-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 34px;
}

.language-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 7px 13px;
  color: var(--muted);
  background: #ffffff;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.language-button:hover {
  color: var(--marianum-blue-dark);
  border-color: rgba(0, 92, 169, 0.35);
}

.language-button.is-active {
  color: #ffffff;
  border-color: var(--marianum-blue);
  background: var(--marianum-blue);
  font-weight: 700;
  transform: scale(1.04);
  box-shadow: 0 8px 18px rgba(0, 92, 169, 0.22);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--marianum-blue);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 780px;
  margin: 0;
  color: var(--marianum-blue-dark);
  font-size: clamp(2.1rem, 4.7vw, 4.7rem);
  line-height: 1.02;
  letter-spacing: 0;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.subtitle {
  margin: 12px 0 24px;
  color: var(--ink);
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  font-weight: 700;
}

.hero-image {
  position: relative;
  overflow: hidden;
  margin: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #d9e8f2, #ffffff 55%, #d8cab1);
  border: 1px solid #e1e1e1;
  box-shadow: none;
}

.hero-image img {
  width: 100%;
  aspect-ratio: 16 / 8;
  object-fit: cover;
}

.hero-image figcaption {
  position: absolute;
  left: 18px;
  bottom: 16px;
  max-width: calc(100% - 36px);
  border-radius: 2px;
  padding: 7px 13px;
  color: #ffffff;
  background: rgba(0, 40, 70, 0.72);
  font-size: 0.9rem;
  font-weight: 700;
}

.hero-image.image-missing {
  min-height: 280px;
}

.hero-image.image-missing::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.18)),
    repeating-linear-gradient(135deg, rgba(0, 92, 169, 0.18) 0 2px, transparent 2px 16px);
}

.intro-text {
  max-width: var(--content-width);
  margin-top: 28px;
  color: #2d3a45;
  font-size: 1.05rem;
}

.intro-text p {
  margin: 0 0 14px;
}

.map-panel {
  grid-area: map;
  position: sticky;
  top: 54px;
  min-width: 0;
  min-height: 100vh;
  padding: 24px;
}

.map-card {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 48px);
  border: 1px solid rgba(216, 226, 236, 0.85);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: none;
}

.map-heading {
  padding: 22px 22px 12px;
}

.map-heading h2,
.section-heading h2 {
  margin: 0;
  color: var(--marianum-blue-dark);
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.18;
}

.map-stage {
  position: relative;
  flex: 1;
  min-height: 500px;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  background:
    linear-gradient(90deg, rgba(0, 92, 169, 0.12) 1px, transparent 1px),
    linear-gradient(rgba(0, 92, 169, 0.12) 1px, transparent 1px),
    #eef5f9;
  background-size: 56px 56px;
}

.map-stage img {
  width: 100%;
  height: 100%;
  min-height: 500px;
  object-fit: cover;
}

.map-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  color: var(--marianum-blue-dark);
  text-align: center;
  font-size: clamp(1.4rem, 3vw, 2.6rem);
  font-weight: 800;
}

.map-stage:not(.image-missing) .map-fallback {
  display: none;
}

.marker-layer {
  position: absolute;
  inset: 0;
}

.map-marker {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50% 50% 50% 0;
  color: var(--marianum-blue-dark);
  background: var(--marker-blue);
  box-shadow: 0 0 0 7px rgba(83, 199, 245, 0.25), 0 12px 24px rgba(0, 60, 95, 0.22);
  cursor: pointer;
  transform: translate(-50%, -100%) rotate(-45deg);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
  animation: markerPulse 1900ms ease-in-out infinite;
}

.map-marker:hover,
.map-marker.is-active {
  background: #ffffff;
  box-shadow: 0 0 0 9px rgba(0, 92, 169, 0.24), 0 0 34px rgba(0, 92, 169, 0.65);
  transform: translate(-50%, -100%) rotate(-45deg) scale(1.13);
  animation-duration: 1050ms;
}

.marker-number {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--marianum-blue-dark);
  font-size: 0.86rem;
  font-weight: 800;
  transform: rotate(45deg);
}

.marker-pin {
  position: absolute;
  inset: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
}

@keyframes markerPulse {
  0%,
  100% {
    box-shadow: 0 0 0 7px rgba(83, 199, 245, 0.25), 0 12px 24px rgba(0, 60, 95, 0.22);
  }
  50% {
    box-shadow: 0 0 0 15px rgba(83, 199, 245, 0.06), 0 12px 24px rgba(0, 60, 95, 0.22);
  }
}

.map-popup {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 10;
  width: min(240px, calc(100% - 32px));
  border: 1px solid rgba(0, 92, 169, 0.18);
  border-radius: var(--radius);
  padding: 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 16px 34px rgba(24, 45, 68, 0.22);
  transform: translate(-50%, calc(-100% - 58px));
}

.map-popup strong {
  display: block;
  margin-bottom: 12px;
  color: var(--marianum-blue-dark);
  font-size: 1rem;
}

.popup-actions {
  display: grid;
  gap: 8px;
}

.popup-actions button {
  border: 1px solid var(--marianum-blue);
  border-radius: var(--radius);
  padding: 8px 10px;
  color: var(--marianum-blue-dark);
  background: #ffffff;
  cursor: pointer;
  text-align: left;
}

.popup-actions button:hover {
  color: #ffffff;
  background: var(--marianum-blue);
}

.stations-panel {
  grid-area: stations;
  min-width: 0;
  padding: 24px clamp(22px, 5vw, 72px) 64px;
}

.section-heading {
  max-width: var(--content-width);
  margin-bottom: 22px;
}

.stations-list {
  display: grid;
  gap: 22px;
  max-width: var(--content-width);
}

.station-card {
  scroll-margin-top: 28px;
  border: 1px solid rgba(216, 226, 236, 0.95);
  border-radius: var(--radius);
  padding: clamp(18px, 3vw, 28px);
  background: var(--surface);
  box-shadow: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.station-card.is-active {
  border-color: rgba(0, 92, 169, 0.45);
  box-shadow: inset 4px 0 0 var(--marianum-blue);
}

.station-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.station-meta span {
  border-radius: 2px;
  padding: 4px 9px;
  background: #eeeeee;
}

.station-card h3 {
  margin: 0 0 18px;
  color: var(--marianum-blue-dark);
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  line-height: 1.18;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.gallery {
  position: relative;
  margin-bottom: 18px;
}

.gallery-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #edf4fa, #ffffff 60%, rgba(185, 146, 71, 0.22));
}

.gallery-frame img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.gallery-fallback {
  display: none;
  min-height: 240px;
  place-items: center;
  padding: 22px;
  color: var(--marianum-blue-dark);
  text-align: center;
  font-size: 1.1rem;
  font-weight: 800;
}

.gallery-frame.image-missing .gallery-fallback {
  display: grid;
}

.gallery-button {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 2px;
  color: #ffffff;
  background: rgba(0, 63, 115, 0.82);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 180ms ease, transform 180ms ease;
}

.gallery-button:hover {
  background: var(--marianum-blue);
  transform: translateY(-50%) scale(1.05);
}

.gallery-button span {
  font-size: 2rem;
  line-height: 1;
}

.gallery-prev {
  left: 12px;
}

.gallery-next {
  right: 12px;
}

.gallery-dots {
  position: absolute;
  left: 50%;
  bottom: 12px;
  display: flex;
  gap: 7px;
  transform: translateX(-50%);
}

.gallery-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.64);
}

.gallery-dots .is-active {
  background: var(--accent-warm);
}

.audio-player {
  width: 100%;
  margin: 4px 0 16px;
  accent-color: var(--marianum-blue);
}

.station-card p {
  margin: 0;
  color: #2e3d48;
  font-size: 1.02rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 30px 22px;
  color: #ffffff;
  background: #222222;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.map-return {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  background: var(--marianum-blue);
  box-shadow: 0 12px 26px rgba(0, 63, 115, 0.28);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.map-return.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (max-width: 1020px) {
  .hamburger-icon-container {
    display: block;
  }

  .navcontainer {
    min-height: 58px;
  }

  #site-nav {
    display: none;
    align-items: stretch;
    padding-top: 58px;
    border-top: 1px solid #eeeeee;
    background: #ffffff;
  }

  #site-nav.is-open {
    display: block;
  }

  #site-nav a {
    min-height: 46px;
    border-top: 1px solid #eeeeee;
    padding: 0 18px;
  }

  .guide-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "intro"
      "map"
      "stations";
  }

  .intro-panel {
    padding: 22px 18px 20px;
  }

  .map-panel {
    position: static;
    min-height: 0;
    padding: 0 18px 24px;
  }

  .map-card {
    min-height: 0;
  }

  .map-stage,
  .map-stage img {
    min-height: 380px;
  }

  .stations-panel {
    padding: 0 18px 48px;
  }
}

@media (max-width: 640px) {
  .language-bar {
    gap: 6px;
    margin-bottom: 24px;
  }

  .language-button {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 0.9rem;
  }

  .hero h1 {
    font-size: 2.05rem;
  }

  .hero-image img {
    aspect-ratio: 4 / 3;
  }

  .hero-image figcaption {
    left: 12px;
    bottom: 12px;
    max-width: calc(100% - 24px);
    font-size: 0.82rem;
  }

  .map-heading {
    padding: 18px 18px 10px;
  }

  .map-stage,
  .map-stage img {
    min-height: 330px;
  }

  .map-marker {
    width: 36px;
    height: 36px;
  }

  .map-popup {
    width: min(220px, calc(100% - 24px));
    transform: translate(-50%, calc(-100% - 48px));
  }

  .gallery-button {
    width: 38px;
    height: 38px;
  }

  .map-return {
    right: 14px;
    bottom: 14px;
    width: 44px;
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
