body {
  background: #050505;
  color: #f7f7f2;
}

body > header {
  border-bottom-color: #1e1e1e;
  background: #050505;
}

body > header .brand,
body > header .nav-links a {
  color: #f7f7f2;
}

body > header .nav-links a.active,
body > header .nav-links a:hover {
  border-bottom-color: #ffd400;
}

body > header .nav-ubahn {
  display: inline-flex;
  align-items: center;
  gap: .34rem;
}

body > header .nav-ubahn-icon {
  display: inline-grid;
  place-items: center;
  width: 1.15em;
  height: 1.15em;
  border-radius: 50%;
  background: #005aa7;
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: .82em;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 1.5px #fff;
}

.ubahn-page {
  padding: 0 0 44px;
  background: #050505;
}

.ubahn-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 12px 14px;
  border-bottom: 1px solid #1e1e1e;
  background: #050505;
}

.ubahn-mark {
  display: inline-flex;
  align-items: center;
  gap: .48rem;
  color: #f7f7f2;
  font-family: Arial, Helvetica, sans-serif;
  font-size: .86rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.ubahn-mark-icon {
  display: inline-grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: #005aa7;
  color: #fff;
  font-size: 1.15rem;
  line-height: 1;
  box-shadow: 0 0 0 3px #fff;
}

.ubahn-sort {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid #303030;
  color: #d8d8d2;
  font-size: .82rem;
}

.sort-button {
  appearance: none;
  border: 0;
  border-right: 1px solid #303030;
  border-radius: 0;
  padding: .48rem .82rem;
  background: #111;
  color: #f7f7f2;
  font: inherit;
  font-weight: 700;
  letter-spacing: .01em;
  cursor: pointer;
}

.sort-button:last-child {
  border-right: 0;
}

.sort-button:hover {
  background: #1b1b1b;
}

.sort-button.is-active {
  background: #ffd400;
  color: #111;
}

.ubahn-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 0;
  width: 100%;
  margin: 0;
  background: #050505;
}

.ubahn-tile {
  display: block;
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border: 0;
  padding: 0;
  background: #111;
  color: #fff;
  cursor: pointer;
}

.ubahn-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .28s ease, filter .28s ease;
}

.ubahn-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(0, 0, 0, .82), rgba(0, 0, 0, .08) 64%);
  opacity: 0;
  transition: opacity .2s ease;
}

.ubahn-tile:focus-visible {
  z-index: 1;
  outline: 3px solid #ffd400;
  outline-offset: -3px;
}

.ubahn-tile:hover img,
.ubahn-tile:focus-visible img {
  filter: saturate(1.09) contrast(1.04);
  transform: scale(1.025);
}

.ubahn-tile:hover::before,
.ubahn-tile:focus-visible::before,
.ubahn-tile:hover .ubahn-info,
.ubahn-tile:focus-visible .ubahn-info {
  opacity: 1;
}

.ubahn-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: stretch;
  gap: 0;
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}

.line-badge {
  display: inline-grid;
  place-items: center;
  min-width: 2.8rem;
  min-height: 2rem;
  padding: .12rem .42rem;
  border: 2px solid #fff;
  border-radius: 0;
  color: var(--line-ink, #fff);
  background: var(--line-color, #005aa7);
  font-family: Arial, Helvetica, sans-serif;
  font-size: .84rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}

.station-name {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #111;
  background: rgba(255, 212, 0, .95);
  font-family: Arial, Helvetica, sans-serif;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .01em;
  line-height: 1.1;
  padding: .32rem .45rem;
  text-align: left;
  text-shadow: none;
  white-space: normal;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(44px, 1fr) minmax(0, auto) minmax(44px, 1fr);
  align-items: center;
  justify-items: center;
  background: rgba(5, 5, 5, .97);
  color: #fff;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-frame {
  grid-column: 2;
  max-width: min(92vw, 1800px);
  max-height: 90vh;
  margin: 0;
  text-align: center;
}

.lightbox-frame img {
  display: block;
  max-width: 100%;
  max-height: 82vh;
  margin: 0 auto;
  object-fit: contain;
}

.lightbox-frame figcaption {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: stretch;
  justify-content: center;
  min-height: 2rem;
  margin-top: 10px;
  font-size: .9rem;
}

.lightbox-frame figcaption .line-badge {
  min-height: 2.15rem;
  border-radius: 0;
  box-shadow: none;
}

.lightbox-frame figcaption .station-name {
  display: inline-grid;
  align-items: center;
  max-width: min(68vw, 720px);
  font-size: .9rem;
  white-space: normal;
}

.lightbox-button {
  appearance: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-family: Georgia, serif;
  line-height: 1;
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 44px;
  height: 44px;
  font-size: 2rem;
}

.lightbox-prev,
.lightbox-next {
  width: 54px;
  height: 90px;
  font-size: 3.8rem;
  opacity: .78;
}

.lightbox-prev:hover,
.lightbox-next:hover,
.lightbox-close:hover {
  opacity: 1;
}

.lightbox-prev {
  grid-column: 1;
}

.lightbox-next {
  grid-column: 3;
}

.lightbox-open {
  position: absolute;
  right: 22px;
  bottom: 18px;
  color: rgba(255, 255, 255, .72);
  font-size: .82rem;
}

.lightbox-open:hover {
  color: #fff;
}

body.lightbox-opened {
  overflow: hidden;
}

@media (max-width: 760px) {
  .ubahn-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .ubahn-sort {
    width: 100%;
    justify-content: stretch;
  }

  .sort-button {
    flex: 1 1 0;
    padding-inline: .5rem;
  }

  .ubahn-wall {
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  }

  .lightbox {
    grid-template-columns: 1fr 1fr;
    align-items: end;
  }

  .lightbox-frame {
    grid-column: 1 / -1;
    align-self: center;
    max-width: 100vw;
  }

  .lightbox-frame img {
    max-height: 78vh;
  }

  .lightbox-prev,
  .lightbox-next {
    grid-row: 2;
    width: 100%;
    height: 62px;
    font-size: 2.6rem;
  }

  .lightbox-prev {
    grid-column: 1;
  }

  .lightbox-next {
    grid-column: 2;
  }

  .lightbox-open {
    left: 18px;
    right: auto;
  }
}
