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

body {
  font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
  font-size: 11px;
  line-height: 1.5;
  color: yellow;
  background-color: #000;
  overflow: hidden;
  letter-spacing: 0.05em;
}

.carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  width: 100vw;
  height: 100vh;
  -webkit-overflow-scrolling: touch;
  /* Hide scrollbar for cleaner look */
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.carousel::-webkit-scrollbar {
  display: none;
}

.slide {
  flex: 0 0 100vw;
  height: 100vh;
  scroll-snap-align: start;
  padding: 20px 45px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 15px;
}

/* Header layout */
.header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-left: auto;
  margin-right: auto;
}

.header-left {
  display: flex;
  flex-direction: column;
}

.header-right {
  padding-left: 0;
  padding-right: 4em;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Image container */
.image-container {
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding-bottom: 35px;
}

.main-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Footer layout */
.footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 90px;
  margin-left: auto;
  margin-right: auto;
}

.footer-left {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.footer-left-top {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-right {
  padding-left: 0;
  text-align: justify;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* Utility classes */
.uppercase {
  text-transform: uppercase;
}

.block-text {
  max-width: 100%;
  /* Line length control for readability */
}

.slide-placeholder {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.fixed-header {
  position: fixed;
  top: 20px;
  z-index: 10;
  pointer-events: none;
  background-color: transparent;
}

.fixed-footer {
  position: fixed;
  bottom: 20px;
  z-index: 10;
  pointer-events: none;
  background-color: transparent;
}

/* Prevent layout shifts and text jumping during typewriter animations */
#fh-stadt,
#fh-station,
#fh-stadtteil,
#fh-eröffnung,
#ff-seite {
  min-height: 1.5em;
  display: block;
}

#fh-coords {
  min-height: 3em;
  display: block;
}

#ff-left-top div:not([style*="height"]) {
  min-height: 1.5em;
  display: block;
}

#ff-review {
  min-height: 4.5em;
  display: block;
}

.nav-arrow {
  position: fixed;
  bottom: 5px; /* 5px bottom + 15px padding aligns arrow glyph with bottom: 20px (footer height) */
  z-index: 20;
  background: none;
  border: none;
  color: yellow;
  font-family: inherit;
  font-size: 24px;
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  opacity: 0.6;
  transition: opacity 0.2s ease, transform 0.2s ease;
  padding: 15px;
  line-height: 1;
}

.nav-arrow:hover {
  opacity: 1;
}

#nav-arrow-left {
  left: 20px;
}
#nav-arrow-left:active {
  transform: scale(0.9);
}

#nav-arrow-right {
  right: 20px;
}
#nav-arrow-right:active {
  transform: scale(0.9);
}

.ubahn-logo {
  position: absolute;
  top: 0;
  right: 0;
  width: 33px; /* Exactly two lines of text: 2 * 1.5 * 11px */
  height: 33px;
  background-color: yellow;
  color: black;
  font-weight: 900;
  font-family: "Arial Black", "Impact", sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  line-height: 1;
  padding-bottom: 0px;
  transform: translateY(2px);
  cursor: pointer;
  pointer-events: auto;
  z-index: 100;
}

/* Menu Overlay Styles */
.menu-overlay {
  position: absolute;
  top: 0;
  left: calc(100% + 25px); /* Position in the black strip to the right of the image */
  background-color: transparent;
  color: yellow;
  z-index: 90;
  padding-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
  pointer-events: auto;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  white-space: nowrap;
}

.menu-overlay::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.menu-section-title {
  margin: 0;
  margin-bottom: 1.5em;
  display: block;
  line-height: 1.5;
}

.menu-item {
  cursor: pointer;
  margin: 0;
  opacity: 1;
  transition: opacity 0.2s;
  display: block;
  line-height: 1.5;
}

.menu-item:hover {
  opacity: 0.7;
}

.menu-item.active {
  font-weight: bold;
  opacity: 1;
}

.dropdown-container {
  padding-left: 2ch;
  margin: 0;
  display: block;
}

.sort-arrow {
  display: inline-block;
  cursor: pointer;
}

/* Gallery View Styles */
.view-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 100;
  color: yellow;
  cursor: pointer;
  user-select: none;
  line-height: 1.5;
}

.gallery-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 40px;
  padding: 220px 45px 45px 45px; /* Top padding increased to clear horizontal menu */
  height: 100vh;
  overflow-y: auto;
  width: 100vw;
  align-items: start;
}

.gallery-img-container {
  width: 100%;
  cursor: pointer;
  background: transparent;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.gallery-img-container:hover {
  transform: scale(1.02);
  opacity: 0.9;
}

.gallery-img {
  width: 100%;
  height: auto;
  display: block;
}

body.gallery-active .header-left,
body.gallery-active .header-right,
body.gallery-active .fixed-footer,
body.gallery-active .nav-arrow,
body.gallery-active #carousel {
  display: none !important;
}

body.gallery-active .fixed-header {
  width: calc(100% - 40px) !important;
  left: 20px !important;
}

body.gallery-active .menu-overlay {
  left: auto !important;
  right: 45px !important; /* Keep it inside the padding */
  top: 45px !important; /* Move it down to be aligned just under the U */
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 40px !important;
}

body.gallery-active .menu-separator {
  display: none !important;
}