/* The direct trains pages (direct/, written by scripts/generate-direct-pages.py), on the route
   collection's paper (routes/collection.css): the cities as framed map plates in a grid of three,
   and a city's places as a timetable, by how long the journey takes. */

/* ---- the grid: twelve plates, three across, all on one line (they are a set, not a salon) ---- */
.cities { list-style: none; margin-top: 0; margin-bottom: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: clamp(24px, 3.4vw, 48px); row-gap: clamp(40px, 5vw, 64px); }
.city { opacity: 0; transform: translateY(18px); animation: hang .8s var(--ease) forwards; animation-delay: calc(var(--i) * 55ms + 100ms); }
.city a { display: block; color: inherit; text-decoration: none; }
.plate { display: block; aspect-ratio: 4 / 3; background: #efe9dc; overflow: hidden;
  box-shadow: 0 0 0 1px var(--rule), 0 10px 24px -14px rgba(40, 30, 20, 0.35); transition: transform .45s var(--spring), box-shadow .4s var(--ease); }
.plate img { width: 100%; height: 100%; object-fit: cover; }
.city a:hover .plate, .city a:focus-visible .plate { transform: translateY(-4px);
  box-shadow: 0 0 0 1px var(--rule), 0 22px 36px -18px rgba(40, 30, 20, 0.45); }
.city a:focus-visible { outline: none; }
.city a:focus-visible .plate { outline: 2px solid var(--claret); outline-offset: 5px; }
.city a:hover .name { color: var(--claret); }
.source { margin-top: clamp(40px, 5vw, 64px); margin-bottom: 0; font-size: 14px; color: var(--soft); }
.source + .source { margin-top: 10px; }

/* ---- a city ---- */
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; text-underline-offset: 3px; }
.atlas { margin-top: 0; margin-bottom: 0; }
.atlas img { width: 100%; aspect-ratio: 4 / 3; box-shadow: 0 0 0 1px var(--rule), 0 18px 40px -24px rgba(40, 30, 20, 0.4); }

.sums { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 24px; margin-top: clamp(28px, 4vw, 48px); margin-bottom: 0; }
.sums div { padding-top: 14px; border-top: 1px solid var(--ink); min-width: 0; }
.sums dt { font: 600 11px/1.3 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.sums dd { margin: 6px 0 0; font: 300 clamp(22px, 2.6vw, 34px)/1.15 var(--serif); font-variant-numeric: lining-nums tabular-nums; overflow-wrap: anywhere; }
.sums dd span { display: block; margin-top: 4px; font: 500 13px/1.3 var(--sans); color: var(--soft); }

/* the places, as a timetable: one column of bands, each a table of four */
.bands { margin-top: clamp(48px, 6vw, 80px); }
.key, .places li { display: grid; grid-template-columns: minmax(0, 2.2fr) 5.5em 7.5em minmax(0, 1.6fr); column-gap: 18px; align-items: baseline; }
.key { margin: 0 0 6px; font: 600 11px/1.3 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.key span:nth-child(2), .places .time { text-align: right; }
.band { margin-top: 36px; }
.band h2 { font-size: clamp(24px, 2.6vw, 32px); line-height: 1.2; padding-bottom: 10px; border-bottom: 1px solid var(--ink); }
.band h2 span { font: 500 14px/1 var(--sans); color: var(--faint); margin-left: 6px; vertical-align: 0.25em; }
.places { list-style: none; margin: 0; padding: 0; }
.places li { padding: 11px 0; border-bottom: 1px solid var(--rule); font-size: 15px; }
.place { font: 400 18px/1.3 var(--serif); min-width: 0; }
.place a { color: inherit; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .3s var(--ease), color .2s; }
.place a:hover, .place a:focus-visible { color: var(--claret); background-size: 100% 1px; outline: none; }
.where { font: 500 12px/1 var(--sans); color: var(--faint); margin-left: 6px; letter-spacing: 0.02em; }
.night { display: inline-block; margin-left: 8px; padding: 3px 7px; border-radius: 999px; background: #2b2a3d; color: #f1ead8;
  font: 600 10px/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; vertical-align: 0.2em; }
.time { font-variant-numeric: tabular-nums; font-weight: 500; }
.often { color: var(--soft); font-variant-numeric: tabular-nums; }
.by { color: var(--soft); font-size: 13px; overflow-wrap: anywhere; }
.more { margin-top: 12px; }
.more summary { cursor: pointer; font: 600 13px/1.4 var(--sans); color: var(--claret); }
.more p { margin: 10px 0 0; font-size: 14px; line-height: 1.8; color: var(--ink); max-width: 90ch; }
.more p span { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }

.how { margin-top: clamp(56px, 7vw, 96px); max-width: calc(68ch + 2 * var(--gutter)); margin-left: 0; }
.how h2, .elsewhere h2 { font-size: clamp(26px, 3vw, 38px); line-height: 1.1; }
.how p { margin: 14px 0 0; color: var(--soft); }
.how .small { font-size: 13px; color: var(--faint); }

.elsewhere { margin-top: clamp(48px, 6vw, 80px); }
.elsewhere ol { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 24px; }
.elsewhere li { border-top: 1px solid var(--rule); }
.elsewhere a { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; color: var(--ink); text-decoration: none; font: 400 19px/1.3 var(--serif); }
.elsewhere a span { font: 500 13px/1.9 var(--sans); color: var(--faint); font-variant-numeric: tabular-nums; }
.elsewhere a:hover { color: var(--claret); }

/* ---- smaller screens ---- */
@media (max-width: 900px) {
  .cities { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sums { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 20px; }
  .elsewhere ol { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .cities { column-gap: 14px; row-gap: 30px; }
  .sums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .key { display: none; }
  .places li { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
  .places .time { grid-column: 2; grid-row: 1; }
  .places .often { grid-column: 1; grid-row: 2; font-size: 13px; }
  .places .by { grid-column: 2; grid-row: 2; text-align: right; }
  .elsewhere ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .city { animation: none; opacity: 1; transform: none; }
  .plate { transition: none; }
}
