.detail-page {
  background:
    linear-gradient(135deg, rgba(15, 111, 143, 0.08) 0 32%, transparent 32%),
    linear-gradient(180deg, #f8fafc 0, #f3f6f8 46%, #eef3f5 100%);
  color: #0f172a;
}

.detail-page__shell {
  display: grid;
  gap: clamp(20px, 3vw, 34px);
  width: min(100%, 1280px);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 42px) 25px 64px;
}

.detail-overview {
  display: grid;
  gap: 18px;
  align-items: start;
}

.detail-overview__content {
  min-width: 0;
}

.detail-overview__title {
  max-width: 16ch;
  margin: 0;
  color: #0f172a;
  font-size: clamp(2.15rem, 5vw, 4.4rem);
  font-weight: 200;
  line-height: 0.98;
  letter-spacing: 0;
  text-wrap: balance;
}

.detail-overview__content > .route-profile {
  max-width: 720px;
  margin-top: 14px;
}

.detail-overview__description {
  max-width: 72ch;
  margin-top: 18px;
  font-size: 1rem;
}

.detail-section {
  display: grid;
  gap: 14px;
}

.detail-section__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #0f172a;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.detail-section__title::before {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #0ea5e9;
  content: "";
}

.detail-gallery,
.route-card-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.detail-gallery {
  max-width: 760px;
  margin-top: 20px;
}

.route-card-gallery {
  gap: 6px;
}

.detail-gallery__image,
.route-card-gallery__image {
  display: block;
  width: 100%;
  object-fit: cover;
  border-radius: 8px;
  background: #dbe7ef;
  filter: saturate(1.05) contrast(1.02);
}

.detail-gallery__image {
  aspect-ratio: 16 / 10;
}

.route-card-gallery__image {
  aspect-ratio: 5 / 3;
}

.detail-gallery__image:first-child:nth-last-child(1),
.detail-gallery__image:first-child:nth-last-child(3),
.route-card-gallery__image:first-child:nth-last-child(1),
.route-card-gallery__image:first-child:nth-last-child(3) {
  grid-column: 1 / -1;
  aspect-ratio: 2 / 1;
}

.route-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.route-card,
.transport-stop-card,
.rental-card {
  display: grid;
  border: 1px solid #dbe7ef;
  border-radius: 8px;
  background: rgb(255 255 255 / 78%);
  box-shadow: 0 8px 20px rgb(15 23 42 / 5%);
}

.route-card {
  align-content: start;
  gap: 14px;
  padding: 16px;
  background: rgb(255 255 255 / 86%);
  box-shadow: 0 12px 28px rgb(15 23 42 / 7%);
}

.route-card--selected {
  border-color: #f59e0b;
  background:
    linear-gradient(135deg, #fffbeb, rgb(255 255 255 / 94%) 48%, #ecfeff),
    #ffffff;
  box-shadow:
    0 0 0 3px rgb(245 158 11 / 13%),
    0 18px 36px rgb(15 23 42 / 12%);
}

.route-card__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.route-card__selected-label {
  margin: 0 0 5px;
  color: #c2410c;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.route-card__title,
.transport-stop-card__title,
.rental-card__title {
  margin: 0;
  color: #0f172a;
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.18;
}

.route-card__title-row {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.route-card__grades {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 6px;
  max-width: 14rem;
}

.route-status,
.route-grade {
  display: inline-flex;
  align-items: center;
  border: 1px solid;
  border-radius: 999px;
  white-space: nowrap;
}

.route-status {
  gap: 5px;
  min-height: 22px;
  padding: 3px 8px 3px 6px;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1;
}

.route-status--open {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.route-status--closed {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.route-status__dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 999px;
}

.route-status--open .route-status__dot {
  background: #16a34a;
}

.route-status--closed .route-status__dot {
  background: #dc2626;
}

.route-grade {
  min-height: 28px;
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 600;
}

.route-grade__legend {
  flex-basis: 100%;
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: right;
}

.route-links {
  display: grid;
  gap: 8px;
}

.route-links__title {
  margin: 0;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.route-links__list {
  display: grid;
  gap: 5px;
}

.route-links__link,
.rental-card__link,
.weather-source__link {
  color: #0369a1;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.route-links__link {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.35;
}

.rental-card__link {
  justify-self: start;
  color: #2563eb;
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
}

.route-links__link:hover,
.route-links__link:focus-visible {
  color: #075985;
}

.rental-card__link:hover {
  text-decoration: underline;
}

.route-profile {
  display: grid;
  gap: 9px;
}

.route-profile__timing,
.route-profile__terrain,
.route-profile__altitudes {
  margin: 0;
}

.route-profile__fact {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.route-profile__fact-label {
  color: #64748b;
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.route-profile__fact-value {
  margin: 3px 0 0;
  color: #0f172a;
  font-size: 0.9rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.route-profile__timing {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid #dbe7ef;
  border-radius: 8px;
  padding: 10px;
  background:
    linear-gradient(135deg, #f8fafc, #eff6ff 52%, #ecfeff),
    #ffffff;
}

.route-profile__timing .route-profile__fact {
  border: 1px solid rgb(219 231 239 / 82%);
  border-radius: 8px;
  padding: 8px 9px;
  background: rgb(255 255 255 / 82%);
}

.route-profile__timing .route-profile__fact:first-child {
  grid-column: 1 / -1;
  border-color: #bfdbfe;
  background: #ffffff;
  box-shadow: 0 8px 18px rgb(37 99 235 / 8%);
}

.route-profile__timing .route-profile__fact:first-child .route-profile__fact-value {
  color: #1d4ed8;
  font-size: 1.08rem;
  font-weight: 600;
}

.route-profile__timing .route-profile__fact:not(:first-child) .route-profile__fact-value,
.route-profile__terrain .route-profile__fact-value {
  font-size: 0.88rem;
  font-weight: 500;
}

.route-profile__terrain {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.route-profile__terrain .route-profile__fact {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 9px 10px;
  background: #f8fafc;
}

.route-profile__altitudes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.route-profile__altitudes .route-profile__fact {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 5px 8px;
  background: #ffffff;
}

.route-profile__altitudes .route-profile__fact-label {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.route-profile__altitudes .route-profile__fact-value {
  margin: 0;
  color: #334155;
  font-size: 0.88rem;
  font-weight: 500;
}

.route-card__description,
.transport-stop-card__description,
.rental-card__description {
  margin-top: 0;
}

.transport-stop-grid,
.rental-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.transport-stop-card,
.rental-card {
  gap: 8px;
  padding: 14px;
}

.rental-card__address {
  display: grid;
  gap: 2px;
  margin: 0;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.45;
}

.rental-card__address-label {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.weather-table {
  width: 100%;
  overflow: hidden;
  border: 1px solid #dbe7ef;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.weather-table__row {
  display: grid;
  width: 100%;
  grid-template-columns: .5fr repeat(3, minmax(0, 1fr));
}

.weather-table__row--header {
  background: #e0f2fe;
}

.weather-table__cell--heading {
  padding: 8px 10px;
  color: #0369a1;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.weather-table__cell--heading:not(:first-of-type) {
  justify-self: center;
}

.weather-table__row--day:not(:first-of-type) {
  border-top: 1px solid #e2e8f0;
}

.weather-table__cell--day-label {
  align-self: center;
  padding: 0 10px;
  color: #0f766e;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.weather-table__slot {
  display: grid;
  align-content: center;
  justify-items: center;
  min-width: 0;
  border-left: 1px solid #e2e8f0;
  padding: 6px 5px;
  text-align: center;
}

.weather-table__slot--empty {
  display: grid;
  place-items: center;
  color: #94a3b8;
  font-weight: 600;
}

.weather-table__condition {
  display: grid;
  justify-items: center;
  gap: 2px;
  text-align: center;
}

.weather-table__icon {
  display: block;
  height: 40px;
}

.weather-table__temp {
  color: #0f172a;
  font-size: 14px;
  font-weight: 600;
}

.weather-table__wind-rain {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px 6px;
  margin-top: 6px;
  color: #64748b;
  font-size: 11px;
  font-weight: 500;
}

.weather-table__wind-rain-icon {
  flex: 0 0 auto;
  display: block;
  width: 11px;
  height: 11px;
  color: #0ea5e9;
}

.weather-source {
  display: grid;
  gap: 5px;
  margin: 15px 0 0;
  color: #64748b;
  font-size: 11px;
}

.weather-source__link {
  color: inherit;
}

@media (min-width: 980px) {
  .detail-overview {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 430px);
  }
}

@media (max-width: 980px) {
  .detail-overview__title {
    max-width: 22ch;
  }
}

@media (max-width: 760px) {
  .detail-page__shell {
    padding-inline: 16px;
  }

  .route-card-grid {
    grid-template-columns: 1fr;
  }

  .route-card__header {
    grid-template-columns: 1fr;
  }

  .route-card__grades {
    justify-content: start;
    max-width: none;
  }

  .route-grade__legend {
    text-align: left;
  }

  .weather-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .weather-table__row {
    min-width: 620px;
  }
}

@media (max-width: 560px) {
  .route-card-grid,
  .route-profile__timing,
  .route-profile__terrain,
  .detail-gallery,
  .route-card-gallery {
    grid-template-columns: 1fr;
  }

  .route-profile__altitudes .route-profile__fact {
    width: 100%;
    justify-content: space-between;
  }

  .weather-table__slot {
    grid-template-rows: auto auto;
    gap: 5px;
    padding: 7px 4px;
  }

  .weather-table__wind-rain {
    display: grid;
    grid-template-columns: auto auto auto auto;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 0;
  }

  .detail-gallery__image:first-child:nth-last-child(3),
  .route-card-gallery__image:first-child:nth-last-child(3) {
    aspect-ratio: 16 / 10;
  }
}
