/* ============================================================================
   Location / stop template — ТЗ §3.2
   ============================================================================

   Loaded after css/style.css and css/menu.css. Every rule introduces a new
   selector; nothing from style.css is redefined, and the three places where a
   site class is reused (.route-card in the "next stops" carousel) are scoped
   under a .loc-next ancestor so routes.html cannot be touched. Checked by
   tools/fidelity_check.py.

   All values come from the design tokens already in style.css: page #3a4257,
   panel #2b3141, primary #ed1a20, card radius 20px / button radius 10px,
   transitions 0.35s ease, container 75rem.
   ========================================================================== */

/* ------------------------------------------------------------------ hero -- */
/* Mirrors .post-hero from blog.css so an article and a stop open the same way. */
.loc-hero {
  position: relative;
  padding: 3rem 0 2.5rem;
  background-color: #2b3141;
}

.loc-hero--image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 3.5rem 0 2.5rem;
}

.loc-hero__overlay {
  display: none;
}

/* ТЗ: "фон 1920×1080 с затемнением overlay 30%". The 30% is the top of the
   gradient; it deepens downwards so the H1 keeps contrast on a bright photo. */
.loc-hero--image .loc-hero__overlay {
  display: block;
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(43, 49, 65, 0.3) 0%,
    rgba(43, 49, 65, 0.55) 55%,
    rgba(58, 66, 87, 0.92) 100%
  );
}

.loc-hero .container {
  position: relative;
  z-index: 1;
}

/* The crumbs sit at the top of the photo, where the overlay is its lightest
   30%: half-white text came out at 1.7–3.3:1 on a bright sky. A strip of the
   panel colour under them, white words on it — 6:1 and more over any photo,
   and the 30% of ТЗ §3.2 stays as it is for the picture itself. */
.loc-hero--image .breadcrumbs__list {
  display: inline-flex;
  padding: 0.375rem 0.75rem;
  border-radius: 10px;
  background-color: rgba(43, 49, 65, 0.75);
}

.loc-hero--image .breadcrumbs__link {
  color: #ffffff;
}

.loc-hero--image .breadcrumbs__current {
  color: #e6e9f5;
}

.loc-hero--image .breadcrumbs__item:not(:last-child)::after {
  color: rgba(255, 255, 255, 0.6);
}

.loc-hero__inner {
  max-width: 52rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.loc-hero__badge {
  align-self: flex-start;
  padding: 0.375rem 0.75rem;
  border-radius: 10px;
  background-color: #ed1a20;
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 600;
}

.loc-hero__title {
  margin: 0;
  font-size: 1.875rem;
  line-height: 1.15;
}

.loc-hero__lead {
  margin: 0;
  color: #e6e9f5;
  font-size: 1.0625rem;
  line-height: 1.6;
}

/* --------------------------------------------------- two columns + panel -- */
.loc-about {
  padding: 3rem 0 1rem;
}

.loc-about__title {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
}

/* ТЗ: "2 колонки на desktop — слева текст, справа инфо-панель". */
.loc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.loc-content {
  min-width: 0;
  color: #f4f4f9;
  line-height: 1.7;
}

.loc-content h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.5rem;
  /* Its own leading, the article's (.post-content h2): inherited from the
     text it is 1.7, and a heading over three lines read as three lines. */
  line-height: 1.3;
}

.loc-content h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.1875rem;
  line-height: 1.35;
}

.loc-content p {
  margin: 0 0 1rem;
}

.loc-content ul,
.loc-content ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.loc-content li {
  margin-bottom: 0.5rem;
}

.loc-content ul {
  list-style: disc;
}

.loc-content ol {
  list-style: decimal;
}

.loc-panel {
  position: static;
  top: 7rem;
}

.loc-panel__card {
  background-color: #2b3141;
  border-radius: 20px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.loc-panel__label {
  margin: 1rem 0 0;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #cfd5e7;
}

.loc-panel__label:first-child {
  margin-top: 0;
}

.loc-panel__value {
  margin: 0.25rem 0 0;
  color: #ffffff;
  line-height: 1.5;
}

.loc-panel__buy {
  margin-top: 1.5rem;
  width: 100%;
  justify-content: center;
}

/* The map that used to fill a section of its own is now one link here. */
.loc-panel__map {
  margin-top: 1.25rem;
  width: 100%;
  justify-content: center;
}

.loc-panel__map img {
  width: 1.125rem;
  height: 1.125rem;
}

/* «Автобус здесь не останавливается» — the first line of the panel on a
   point the bus only passes, so nobody waits for it there. */
.loc-panel__along {
  margin: 0 0 0.75rem;
  padding-left: 0.75rem;
  border-left: 3px solid #ed1a20;
  color: #ffffff;
  line-height: 1.5;
}

.loc-panel__link {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  transition: color 0.35s ease;
}

.loc-panel__link:hover,
.loc-panel__link:focus-visible {
  color: #ed1a20;
}

.loc-panel__dist {
  display: block;
  font-size: 0.875rem;
  color: #cfd5e7;
}

/* --------------------------------------------------------------- gallery -- */
.loc-gallery {
  padding: 2.5rem 0 1rem;
}

/* The stop page's gallery sits in the two columns (views/location.php): the
   grid gap above it does what the section padding did. */
.loc-gallery--inline {
  min-width: 0;
  padding: 0.5rem 0 0;
}

.loc-gallery__title,
.loc-map__title,
.loc-next__title {
  margin: 0 0 1.25rem;
  font-size: 2rem;
}

/* ТЗ: "плиточная сетка (Masonry или Grid)". Grid, because masonry needs either
   JS or a spec that is not shipped everywhere yet. */
.loc-gallery__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.loc-gallery__item {
  padding: 0;
  border: 0;
  background: none;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  transition: transform 0.35s ease;
}

.loc-gallery__item:hover,
.loc-gallery__item:focus-visible {
  transform: translateY(-4px);
}

.loc-gallery__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* -------------------------------------------------------------- lightbox -- */
.loc-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;                 /* above .header (z-index 100 in style.css) */
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(28, 28, 28, 0.92);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.35s ease,
    visibility 0s linear 0.35s;
  /* A sideways swipe pages through the photos (locations.js). Left to the
     browser, the same swipe to the right is its own «Back» gesture, which
     closed the box instead of showing the previous photo. Pinch-zoom stays. */
  touch-action: pinch-zoom;
}

/* TCTDialog makes the box focusable as its fallback, and a click on the photo
   lands there: the ring would frame the whole screen. */
.loc-lightbox:focus {
  outline: none;
}

.loc-lightbox--open {
  opacity: 1;
  visibility: visible;
  transition:
    opacity 0.35s ease,
    visibility 0s linear 0s;
}

.loc-lightbox__image {
  max-width: 92vw;
  max-height: 84vh;
  border-radius: 20px;
  object-fit: contain;
}

.loc-lightbox__button {
  position: absolute;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(43, 49, 65, 0.8);
  color: #ffffff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition:
    border-color 0.35s ease,
    background-color 0.35s ease;
}

.loc-lightbox__button:hover,
.loc-lightbox__button:focus-visible {
  border-color: #ed1a20;
  background: #ed1a20;
}

.loc-lightbox__button--close {
  top: 1.5rem;
  right: 1.5rem;
}

.loc-lightbox__button--prev {
  left: 0.75rem;
}

.loc-lightbox__button--next {
  right: 0.75rem;
}

/* In place of a photo that did not load (assets/locations.js). */
.loc-lightbox__error {
  /* Clear of the two arrows on a phone. */
  max-width: min(20rem, calc(100vw - 9rem));
  margin: 0;
  padding: 1.5rem;
  border-radius: 20px;
  background-color: #2b3141;
  color: #ffffff;
  text-align: center;
  line-height: 1.5;
}

.loc-lightbox__error[hidden],
.loc-lightbox__image[hidden] {
  display: none;
}

.loc-lightbox__counter {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: #cfd5e7;
  font-size: 0.9375rem;
}

/* ------------------------------------------------------------------- map -- */
.loc-map {
  padding: 2.5rem 0;
}

.loc-map__frame {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background-color: #2b3141;
  aspect-ratio: 4 / 3;
  /* A phone on its side: the 16:7 frame was 360 px of a 390 px screen. The
     explicit width keeps the frame full width when the cap applies; with an
     auto width the ratio would narrow it instead. */
  width: 100%;
  max-height: 75vh;
  max-height: 75svh;
}

/* What the frame shows until the Yandex API is asked for and while it is on
   its way (assets/citymap.js): a button, then a line that says it is loading. */
.ymap__veil {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  text-align: center;
}

/* Red on the panel colour is too faint for a word to read; white, as the
   other outline buttons on a dark ground (.blog-hero__actions). */
.ymap__show {
  color: #ffffff;
}

.ymap__show[hidden] {
  display: none;
}

.ymap__status {
  margin: 0;
  color: #cfd5e7;
  font-size: 0.9375rem;
}

.ymap__status:empty {
  display: none;
}

.map-touch-hint {
  margin: 0.75rem 0 0;
  color: #cfd5e7;
  font-size: 0.9375rem;
}

.map-touch-hint[hidden],
.map-legend[hidden] {
  display: none;
}

.loc-map__frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ------------------------------------------------------- next stops rail -- */
.loc-next {
  padding: 1rem 0 3rem;
}

.loc-next__track {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
  /* The thin bar of «Другие туры», not the system's white one on a dark page. */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

.loc-next__card {
  flex: 0 0 min(30rem, 85vw);
  scroll-snap-align: start;
}

/* Scoped overrides of the site's own card. The selector strings differ from
   the ones in style.css, so nothing is redefined, and the .loc-next ancestor
   means routes.html keeps its 320px media untouched. */
.loc-next .route-card__media {
  flex: 0 0 9rem;
  border-radius: 18px;
  overflow: hidden;
}

.loc-next .route-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.loc-next__card-title a {
  color: #ffffff;
  text-decoration: none;
  transition: color 0.35s ease;
}

/* The photo of a next-stop card is a link of its own and had no hover, while the
   title beside it turns red. The zoom of the city cards (.city-card__image). */
.loc-next__media img {
  transition: transform 0.35s ease;
}

.loc-next__media:hover img,
.loc-next__media:focus-visible img {
  transform: scale(1.04);
}

.loc-next__card-title a:hover,
.loc-next__card-title a:focus-visible {
  color: #ed1a20;
  text-decoration: underline;
}

/* -------------------------------------------------------------- city hub -- */
.city-hero {
  padding: 3rem 0 1.5rem;
  background-color: #2b3141;
}

.city-hero__title {
  margin: 0.5rem 0 0.75rem;
  font-size: 1.875rem;
}

.city-hero__lead {
  margin: 0;
  max-width: 46rem;
  color: #e6e9f5;
  line-height: 1.6;
}

/* The full-screen picture of the customer's samarkandcitytour.uz home page
   (.hero--full: 100vh, cover) — here less the fixed header, since this page
   does not slide its content under it. The overlay is the location hero's:
   30% at the top as ТЗ §3.2 asks, deeper at the bottom where the text sits. */
.city-hero--image {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: calc(100vh - 5.5rem);
  min-height: calc(100svh - 5.5rem);
  padding: 4rem 0 3rem;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.city-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(43, 49, 65, 0.3) 0%,
    rgba(43, 49, 65, 0.55) 55%,
    rgba(58, 66, 87, 0.92) 100%
  );
}

.city-hero--image .container {
  position: relative;
  z-index: 1;
  width: 100%;
}

.city-list {
  padding: 2.5rem 0 1rem;
}

.city-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr));
  gap: 1.5rem;
}

.city-card {
  display: flex;
  flex-direction: column;
  background-color: #2b3141;
  border-radius: 20px;
  overflow: hidden;
}

.city-card__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.city-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.city-card:hover .city-card__image {
  transform: scale(1.04);
}

/* A place whose photo the customer has not sent yet. A bare gradient read as a
   picture that failed to load, so it carries the site's own location pin. */
.city-card__image--placeholder {
  background:
    url("/img/icon-location.svg") center / 3rem 3rem no-repeat,
    linear-gradient(135deg, #3a4257 0%, #2b3141 100%);
}

/* Same red circle as .route-card__order, but positioned inside the card
   instead of hanging off a timeline. */
.city-card__order {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background-color: #ed1a20;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  /* Inside a link: without its own colour the number took the link colour. */
  color: #ffffff;
  box-shadow: 0 0.5rem 1.25rem rgba(237, 26, 32, 0.45);
}

/* flex: see .tour-card__body in tours.css, the link at the end sits on margin-top: auto. */
.city-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.5rem;
  padding: 1.25rem;
}

.city-card__title {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.3;
}

.city-card__title a {
  color: #ffffff;
  text-decoration: none;
  transition: color 0.35s ease;
}

.city-card__title a:hover,
.city-card__title a:focus-visible {
  color: #ed1a20;
  text-decoration: underline;
}

.city-card__address {
  margin: 0;
  font-size: 0.875rem;
  color: #cfd5e7;
}

/* ТЗ: сниппет в 2 строки, same treatment as the blog card. */
.city-card__excerpt {
  margin: 0;
  color: #e6e9f5;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.city-card__more {
  margin-top: auto;
  padding-top: 0.5rem;
  color: #ed1a20;
  font-weight: 600;
  font-size: 0.9375rem;
}

a.city-card__more {
  align-self: flex-start;
  text-decoration: none;
  transition: color 0.35s ease;
}

a.city-card__more:hover {
  color: #ffffff;
}

/* 44px under a thumb. The negative margin takes it back from the card's own
   padding, so the card stays the height it was. */
@media (max-width: 48rem) {
  a.city-card__more {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding-top: 0;
    margin-bottom: -0.5rem;
  }
}

/* A sight off the route or the route overview: a label instead of the
   stop number, same place and size as .city-card__order. */
.city-card__tag {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.375rem 0.75rem;
  border-radius: 10px;
  background-color: #2b3141;
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 600;
}

.city-card--route .city-card__tag {
  background-color: #ed1a20;
}

/* ------------------------------------------------------------- city map -- */
.city-map {
  padding-bottom: 0;
}

/* On /samarkand/ the map is followed by the patterned «Билеты» band, which
   starts at its own edge: without this the frame stood on the band. 4rem is
   the band's own padding, the gap every block of that page keeps. */
.city-home .city-map {
  padding-bottom: 4rem;
}

/* The key to the three marks — same colours as the Yandex presets
   citymap.js uses: red stop, grey «по пути», blue near the route. */
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  color: #cfd5e7;
  font-size: 0.9375rem;
}

.map-legend__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.map-legend__item::before {
  content: "";
  flex: none;
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 50%;
  box-sizing: border-box;
}

.map-legend__item--stop::before {
  background-color: #ed1a20;
}

.map-legend__item--along::before {
  border: 3px solid #b3b3b3;
  background-color: #ffffff;
}

.map-legend__item--place::before {
  border: 3px solid #1e98ff;
  background-color: #ffffff;
}

.city-card--along .city-card__tag {
  background-color: #4a4e5c;
}

.city-map__note {
  margin: -0.5rem 0 1.25rem;
  color: #cfd5e7;
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* The API draws into the frame itself; its own root must fill it. */
.ymap > ymaps,
.ymap > [class*="ymaps"] {
  width: 100% !important;
  height: 100% !important;
}

.city-empty {
  margin: 0;
  color: #e6e9f5;
}

/* ---------------------------------------------------------- 1024 and down -- */



/* ----------------------------------------------------------- 768 and down -- */


/* Осталось max-width: у этих свойств нет базового значения,
   и «вернуть как было» на широком экране было бы догадкой. */
@media (max-width: 48rem) {
  .loc-gallery__title {
    font-size: 1.5rem;
  }

  .loc-map__title {
    font-size: 1.5rem;
  }

  .loc-next__title {
    font-size: 1.5rem;
  }
}


/* ----------------------------------------------------------- 560 and down -- */


/* Осталось max-width: у этих свойств нет базового значения,
   и «вернуть как было» на широком экране было бы догадкой. */
@media (max-width: 35rem) {
  /* 86% of the rail and a 1rem gap, as «Читайте также» (.post-related): the
     next card shows by 26–36 px. At 88vw it started past the edge (320 px) or
     showed by 3 px (390 px), and four stops read as one. */
  .loc-next__track {
    gap: 1rem;
  }

  .loc-next__card {
    flex-basis: 86%;
  }

  .loc-next .route-card {
    flex-direction: column;
  }

  .loc-next .route-card__media {
    flex-basis: auto;
    aspect-ratio: 16 / 9;
  }
}


@media (prefers-reduced-motion: reduce) {
  .loc-gallery__item,
  .city-card__image,
  .loc-lightbox {
    transition: none;
  }
}

/* 35.0625rem — точное дополнение к 35rem, которым пользуется
   этот же файл до перестановки: нет ширины, где сработали бы
   оба правила или ни одного. */
@media (min-width: 35.0625rem) {
  .loc-gallery__grid {
    grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr));
    gap: 1rem;
  }
}

/* 48.0625rem — точное дополнение к 48rem, которым пользуется
   этот же файл до перестановки: нет ширины, где сработали бы
   оба правила или ни одного. */
@media (min-width: 48.0625rem) {
  .loc-hero--image {
    padding: 5rem 0 3.5rem;
  }

  .loc-hero__title {
    font-size: 2.5rem;
  }

  .city-hero__title {
    font-size: 2.5rem;
  }

  .loc-about__title {
    font-size: 2rem;
  }

  .loc-map__frame {
    aspect-ratio: 16 / 7;
  }

  .loc-lightbox__button--prev {
    left: 1.5rem;
  }

  .loc-lightbox__button--next {
    right: 1.5rem;
  }
}

/* 63.8125rem — точное дополнение к 63.75rem, которым пользуется
   этот же файл до перестановки: нет ширины, где сработали бы
   оба правила или ни одного. */
@media (min-width: 63.8125rem) {
  .loc-layout {
    grid-template-columns: minmax(0, 1fr) 20rem;
    /* The text, then the gallery under it; the panel spans both. The second
       row takes what the panel has over the text, so the photos fill the
       left column where a short text left up to 560 px empty. */
    grid-template-rows: auto 1fr;
    gap: 2.5rem;
  }

  .loc-content {
    grid-column: 1;
    grid-row: 1;
  }

  .loc-panel {
    position: sticky;
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .loc-gallery--inline {
    grid-column: 1;
    grid-row: 2;
    padding-top: 0;
  }

  /* Up to four next stops (TCT_NEXT_STOPS) in one row, all in view: the rail
     showed two and a half and had nothing a mouse could turn it with. Same
     move as «Другие туры» on a tour page. */
  .loc-next__track {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible;
    scroll-snap-type: none;
    padding-bottom: 0;
  }

  .loc-next .route-card {
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem;
  }

  .loc-next .route-card__media {
    flex-basis: auto;
    aspect-ratio: 16 / 9;
  }
}

/* ---------------------------------------------- a city's own home page -- */
/* /samarkand/ as the home page of samarkandcitytour.uz (CityPage). The blocks
   below the hero are the home page's own classes from style.css; only what
   that page does not have is styled here. */
.city-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.city-hero__cta {
  justify-content: center;
  transition: background-color 0.35s ease, color 0.35s ease;
}

.city-hero__cta.button--primary:hover,
.city-hero__cta.button--primary:focus-visible {
  background-color: #c9151a;
}

.city-hero--home .city-hero__title {
  font-size: 2.125rem;
}

/* The stop cards of the schedule are links to the stop pages; the home page's
   cards are not, so their colour and underline are reset here. */
.city-home .schedule-card__link {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: inherit;
  color: inherit;
  text-decoration: none;
}

.city-home .schedule-card__link:hover .schedule-card__title,
.city-home .schedule-card__link:focus-visible .schedule-card__title {
  color: #ed1a20;
}

.city-home .schedule-card__title {
  transition: color 0.35s ease;
}

.city-home .schedule-card__figure .city-card__image--placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 20px;
}

.city-home .ticket-card__button {
  justify-content: center;
}

/* Every stop the same width, however many there are. The home page pairs its
   cards in rows, which with an odd count leaves the last one twice as wide;
   the rows step aside here and the cards share one grid. */
.city-home .schedule__cards {
  display: grid;
  /* Two to a row on a phone, all five in one on a wide screen. */
  grid-template-columns: repeat(auto-fit, minmax(min(8.5rem, 100%), 1fr));
  gap: 1rem;
}

.city-home .schedule__card-row {
  display: contents;
}

.city-home .schedule-card__link,
.city-home .schedule-card__figure {
  width: 100%;
}

.city-home .schedule-card__figure img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Contacts without the office map beside them: the four cards share the row.
   A grid, not the home page's wrapping flex: there each card asks for 18rem,
   and four of those are wider than the container, so the row broke 3 + 1 with
   the last card stretched over the whole width. Two by two from 561 px and
   below 1200 px, where four would squeeze a phone number. */
.city-contacts .contacts-card-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
}

.city-contacts .contacts-card {
  width: auto;
}

/* The heading of the contacts stood on the edge of the patterned FAQ band
   above, which ends where its padding does. */
.city-contacts {
  padding-top: 4rem;
}

@media (min-width: 35.0625rem) {
  .city-contacts .contacts-card-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Four in a row only where a card is 280 px wide: the e-mail address is one
   unbreakable word of ~205 px beside a 32 px icon. 75rem is the container. */
@media (min-width: 75rem) {
  .city-contacts .contacts-card-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* A narrower card breaks the address rather than pushing the icon out. */
.city-contacts .contacts-card__body {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* «Покупка на сайте Samarkand City Tour ↗» under the buttons that leave for
   samarkandcitytour.uz (views/partials/city-home.php). */
.city-ext-note {
  margin: 0.75rem 0 0;
  color: #e6e9f5;
  font-size: 0.875rem;
  line-height: 1.5;
}

.city-ext-note--tickets {
  margin: 0;
  text-align: center;
}

@media not all and (max-width: 48rem) {
  .city-hero--home .city-hero__title {
    font-size: 3rem;
  }
}

/* Same for the outline button over the city's photograph. */
.city-hero--image .city-hero__cta.button--ghost {
  color: #ffffff;
  background-color: rgba(43, 49, 65, 0.6);
}

.city-hero--image .city-hero__cta.button--ghost:hover,
.city-hero--image .city-hero__cta.button--ghost:focus-visible {
  background-color: rgba(237, 26, 32, 0.35);
}
