/*
 * malye-goroda.css — детали страницы «Теплоход из Ярославля в Углич, Мышкин, Тутаев»
 * (/kruizy/malye-goroda).
 *
 * Здесь только то, чего нет в styles.css (.home-*) и route.css (.rt-*): пометка
 * о демонстрационных данных в hero, полоса фактов 2×2, строка «дальних стоянок»
 * в таблице рейсов, названия маршрутов, секция «Четыре города одного маршрута»
 * с легендой и карточками, текстовые карточки офферов и служебные ссылки.
 * Палитра, шрифты и тени — только токены из styles.css.
 */

/* --- Пометка о примерах в hero ------------------------------------------- */
.mg-hero-note {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  max-width: 480px;
  margin: -1rem 0 2rem;
  padding: .6rem .85rem;
  border-left: 2px solid var(--sun);
  background: rgba(8, 47, 60, .42);
  color: rgba(255, 255, 255, .7);
  font-size: .67rem;
  line-height: 1.45;
}

.mg-hero-note i { color: var(--sun); font-size: .85rem; line-height: 1.25; }

/* --- Полоса фактов: две колонки вместо четырёх узких --------------------- */
.mg-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* --- Строка «дальние стоянки» в таблице рейсов --------------------------- */
.mg-legs td {
  padding: .75rem 1rem;
  border-top: 1px solid var(--line);
  background: linear-gradient(90deg, var(--foam), rgba(233, 242, 237, 0));
  color: var(--river-800);
  font-size: .61rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

tr.mg-legs:hover > td { background: linear-gradient(90deg, var(--foam), rgba(233, 242, 237, 0)); }

/* --- Название маршрута в таблице ---------------------------------------- */
.mg-route-name {
  display: block;
  color: var(--river-950);
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.02em;
}

.mg-route-name::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: .5rem;
  border: 2px solid var(--coral);
  border-radius: 50%;
  vertical-align: middle;
}

/* --- Подзаголовки, абзацы и текстовые ссылки внутри секций -------------- */
.mg-subhead { margin: 2.9rem 0 .9rem; font-size: clamp(1.45rem, 2.6vw, 2.1rem); }
.mg-subhead--tight { margin-top: .6rem; }
.mg-text { max-width: 680px; margin-bottom: .9rem; color: var(--muted); font-size: .88rem; }
.mg-text:last-child { margin-bottom: 0; }
.mg-inline-facts { margin: 1.8rem 0 0; padding-top: 1.1rem; border-top: 1px solid var(--line); }

.mg-link { color: var(--river-800); border-bottom: 1px solid var(--river-500); padding-bottom: .08rem; font-weight: 600; }
.mg-link:hover { color: var(--coral); border-color: var(--coral); }

/* --- Две колонки: текст и боковая панель -------------------------------- */
.mg-two { display: grid; grid-template-columns: 1.45fr .55fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }

/* --- Выноска про пригородную переправу ---------------------------------- */
.mg-ferry {
  position: relative;
  margin-top: 2.6rem;
  padding: 1.8rem 1.7rem 1.6rem;
  border: 1px dashed rgba(23, 52, 59, .3);
  background: var(--foam);
}

.mg-ferry::before {
  content: "переправа";
  position: absolute;
  top: -.6rem;
  left: 1.4rem;
  padding: 0 .5rem;
  background: var(--paper);
  color: var(--river-800);
  font-size: .56rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.mg-ferry h3 { margin-bottom: .7rem; font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
.mg-ferry p { max-width: 780px; margin-bottom: 0; color: var(--muted); font-size: .82rem; }
.mg-compare { margin-top: 2.4rem; }

/* --- Секция «Четыре города одного маршрута» ------------------------------ */
.mg-matrix { position: relative; overflow: clip; background: var(--foam); }

.mg-matrix::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(0deg, transparent 0 47px, rgba(23, 52, 59, .05) 48px),
    repeating-linear-gradient(90deg, transparent 0 47px, rgba(23, 52, 59, .04) 48px);
  pointer-events: none;
}

.mg-matrix > .container { position: relative; z-index: 1; }

.mg-matrix__deco {
  position: absolute;
  right: -1.5rem;
  top: 1.5rem;
  color: rgba(8, 47, 60, .05);
  font-family: var(--display);
  font-size: clamp(11rem, 30vw, 26rem);
  font-weight: 600;
  line-height: .72;
  letter-spacing: -.06em;
  pointer-events: none;
}

.mg-legend { display: flex; flex-wrap: wrap; gap: .5rem .9rem; margin: 0 0 1.6rem; padding: 0; list-style: none; }

.mg-legend li {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .45rem .8rem;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--river-800);
  font-size: .66rem;
  font-weight: 700;
  transition: background .25s, border-color .25s;
}

.mg-legend li:hover { border-color: var(--river-500); }
.mg-legend__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--river-500); box-shadow: 0 0 0 4px rgba(58, 167, 170, .15); }
.mg-legend__far { margin-left: auto; color: var(--muted); }
.mg-legend__far .mg-legend__dot { background: var(--coral); box-shadow: 0 0 0 4px rgba(233, 118, 93, .15); }

.mg-table th[scope="row"] {
  width: 22%;
  padding: 1.1rem 1rem;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: .62rem;
  letter-spacing: .14em;
  text-transform: none;
  vertical-align: middle;
}

.mg-table tr:hover th[scope="row"] { background: var(--white); }
.mg-table tr:hover td { background: var(--white); }
.mg-table td:nth-child(3) { color: var(--river-800); font-weight: 700; }
.mg-city-name { display: block; font-family: var(--display); font-size: 1.15rem; font-weight: 600; color: var(--river-950); letter-spacing: -.02em; }
.mg-th-note { display: block; margin-top: .2rem; color: var(--river-500); font-size: .54rem; font-weight: 700; letter-spacing: .12em; }

.mg-places { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.mg-place { position: relative; }

.mg-place::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: var(--coral);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .35s ease;
}

.mg-place:hover::after { transform: scaleX(1); }
.mg-place--far { background: var(--paper); }
.mg-place--far .mg-place__num { color: var(--river-800); }

/* --- Карточки офферов: единый компактный вид --------------------------- */
.mg-offers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.mg-offer {
  display: flex; flex-direction: column;
  border: 1px solid rgba(10, 30, 51, .12); border-radius: 12px;
  overflow: hidden; background: var(--white, #fff);
  transition: transform .18s ease, box-shadow .18s ease;
}
.mg-offer:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(10, 30, 51, .08); }
.mg-offer img { width: 100%; height: 120px; object-fit: cover; display: block; }
/* flex:1 — тело растягивается на всю карточку, цена уходит к низу */
.mg-offer__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.mg-offer__badge { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; opacity: .65; }
.mg-offer__title {
  font-family: var(--display, Georgia, serif);
  font-size: 1rem; line-height: 1.25; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mg-offer__meta { font-size: .78rem; opacity: .75; display: flex; gap: 10px; flex-wrap: wrap; }
.mg-offer__place { font-size: .78rem; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-offer__price { font-size: .95rem; font-weight: 600; margin-top: auto; }
.mg-offer:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; }

@media (max-width: 575px) {
  .mg-offers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mg-offer img { height: 96px; }
}

@media (max-width: 380px) {
  .mg-offers { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .mg-offer { transition: none; }
  .mg-offer:hover { transform: none; }
}

.mg-offers-foot { display: flex; flex-wrap: wrap; gap: .6rem 1.8rem; margin: 1.7rem 0 0; }

/* --- Якорные переходы: заголовок не прячется под липкой шапкой ----------- */
section[id] { scroll-margin-top: 132px; }

/* --- Посадка у причала --------------------------------------------------- */
.mg-station { margin-top: clamp(2.5rem, 6vw, 4.5rem); }
.mg-station-links { display: flex; flex-wrap: wrap; gap: .8rem 1.8rem; margin: 0; }

@media (max-width: 991px) {
  .mg-two { grid-template-columns: 1fr; gap: 2.2rem; }
  .mg-places { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mg-table th[scope="row"] { width: 30%; }
  .mg-matrix__deco { right: -.5rem; font-size: clamp(9rem, 40vw, 16rem); }
}

@media (max-width: 575px) {
  .mg-facts { grid-template-columns: 1fr; }
  .mg-places { grid-template-columns: 1fr; }
  .mg-legend li { width: 100%; }
  .mg-legend__far { margin-left: 0; }
  .mg-matrix__deco { top: 1rem; font-size: 9rem; }
  .mg-subhead { margin-top: 2.1rem; }
  .mg-ferry { padding: 1.6rem 1.2rem 1.4rem; }
  section[id] { scroll-margin-top: 92px; }
}

@media (prefers-reduced-motion: reduce) {
  .mg-place::after { transition: none; }
}
