/* Country story (lane country). Country pages load this after every other stylesheet. Destination accents are in theme.css. */

/* A story replaces the photo gallery (it repeated the hero) and carries the Wikidata link in its credits.
   The story's place row carries #places, the target of the hero's jump link. */
.country-guide:has(> .country-story) #country-place-gallery,
.country-guide:has(> .country-story) > .data-credit { display: none; }

.country-story { margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.story-hook {
  max-width: 19ch;
  margin: 0 0 clamp(2.5rem, 6vw, 4.5rem);
  color: var(--ink);
  font: 400 clamp(2.5rem, 6vw, 5rem)/1.02 var(--display);
  letter-spacing: -.025em;
  text-wrap: balance;
}
.country-story h2 { margin: 0; font: 400 clamp(1.9rem, 3.2vw, 2.6rem)/1.08 var(--display); letter-spacing: -.015em; text-wrap: balance; }

/* The opening under the hook: two short paragraphs at reading size, on the same column as the section text. */
.story-lede { max-width: 40rem; margin: calc(-1 * clamp(1.25rem, 3vw, 2.5rem)) 0 clamp(2.5rem, 6vw, 4.5rem) auto; }
.story-lede p { margin: 0 0 1rem; color: var(--ink); font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.55; }
.story-lede p:last-child { margin-bottom: 0; }
@media (max-width: 760px) { .story-lede { margin-left: 0; } }

/* A moment: the photo runs to both edges of the window, then the heading and text sit on the story grid. */
.story-moment { --bleed: max(var(--gutter), (100vw - 74rem) / 2); margin-block: clamp(3rem, 8vw, 6rem); }
.story-moment-photo { margin: 0 calc(-1 * var(--bleed)); overflow: clip; background: var(--bg-2); }
.story-moment-photo img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; max-height: 86svh; object-fit: cover; }
.story-moment-text {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 40rem);
  gap: .9rem clamp(2rem, 6vw, 5rem);
  padding-top: clamp(1.25rem, 3vw, 2.25rem);
}
@media (max-width: 760px) {
  .story-moment-photo img { aspect-ratio: 4 / 3; }
  .story-moment-text { grid-template-columns: minmax(0, 1fr); }
}
/* The photo settles from a slight zoom as it scrolls into view. Decorative, so browsers without view timelines show it still. */
@supports ((animation-timeline: view()) and (animation-range: entry)) {
  @media (prefers-reduced-motion: no-preference) {
    @keyframes story-moment-settle { from { transform: scale(1.08); } to { transform: scale(1); } }
    .story-moment-photo img { animation: story-moment-settle linear both; animation-timeline: view(); animation-range: entry 0% cover 50%; }
  }
}

/* Where to go: one swipe row, starting on the text column and running to both edges of the window. */
.story-places { --bleed: max(var(--gutter), (100vw - 74rem) / 2); margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.story-places h2 { margin-bottom: 1rem; }
.place-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(78vw, 19rem);
  gap: clamp(.75rem, 1.4vw, 1rem);
  margin: 0 calc(-1 * var(--bleed));
  padding: 4px var(--bleed) 1rem;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--bleed);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.place-row > li { display: flex; scroll-snap-align: start; }
.country-guide .place-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: var(--surface);
  color: var(--ink);
}
.place-card img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--bg-2); }
.place-card-text { display: flex; flex: 1; flex-direction: column; gap: .35rem; padding: 1rem 1.1rem 1.2rem; }
.place-card-name { color: var(--ink); font: 400 1.65rem/1.05 var(--display); }
.place-card-line { color: var(--ink-2); font-size: .95rem; line-height: 1.45; }
.country-guide .place-card-plain { min-height: clamp(13rem, 24vw, 16rem); border-color: transparent; background: var(--bg-2); }
.place-card-plain .place-card-text { padding: 1.2rem 1.25rem 1.3rem; }
.place-card-plain .place-card-line { margin-top: auto; }
.place-card-plain .place-card-name { font-size: 2.1rem; }
/* A row with no photos is a short text list that wraps, not a swipe row of tall blank cards. */
.place-row:not(:has(img)) { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); margin: 0; padding: 4px 0 0; overflow: visible; }
.country-guide .place-row:not(:has(img)) .place-card-plain { min-height: 0; }
.place-row:not(:has(img)) .place-card-plain .place-card-name { font-size: 1.65rem; }
.place-card:hover { border-color: var(--ink-2); }
.place-card-plain:hover { background: var(--accent-soft); }
.place-card:hover .place-card-name { color: var(--accent-hover); }
.country-guide .place-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .place-card { transition: border-color .15s ease-out, background-color .15s ease-out; }
}

/* Short sections: heading on the left, reading column on the right. */
.story-section {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 40rem);
  gap: .9rem clamp(2rem, 6vw, 5rem);
  padding-block: clamp(1.75rem, 3.5vw, 2.75rem);
  border-top: 1px solid var(--line);
}
.story-body p { max-width: 62ch; margin: 0 0 .85rem; }
.story-body p:last-of-type { margin-bottom: 0; }
.country-guide .story-body a { font-weight: 600; }
/* A section's list (dishes, stays, costs): one item per line, divided by hairlines. */
.story-list { max-width: 62ch; margin: 1rem 0 0; padding: 0; list-style: none; }
.story-list:first-child { margin-top: 0; }
.story-list li { padding-block: .7rem; border-top: 1px solid var(--line); line-height: 1.5; }
.story-list li:last-child { border-bottom: 1px solid var(--line); }
@media (max-width: 760px) { .story-section { grid-template-columns: minmax(0, 1fr); } }

/* Daylight by month: bars on a 24-hour scale, the sourced best months in the destination colour. */
.month-strip { max-width: 36rem; margin: 1.5rem 0 0; }
.month-strip figcaption { margin-bottom: .6rem; color: var(--muted); font-size: .85rem; }
.month-strip ol { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(3px, .6vw, 6px); margin: 0; padding: 0; list-style: none; }
.month-strip li { display: grid; grid-template-rows: 6rem auto auto; justify-items: center; gap: .25rem; color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.month-bar { align-self: end; width: 100%; height: calc(var(--day) * 6rem); border-radius: 3px 3px 0 0; background: color-mix(in srgb, var(--ink) 16%, var(--bg)); }
.month-hours { color: var(--ink); }
.is-best .month-bar { background: var(--accent); }
.is-best .month-name { color: var(--ink); font-weight: 600; }

/* Regions and place types replace the gallery's browse links. */
.story-chips, .story-types { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.story-types { gap: 0 1.25rem; margin-top: .75rem; }
.country-guide .story-chips a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 1rem; border: 1px solid var(--line); border-radius: var(--pill); color: var(--ink); }
.country-guide .story-chips a:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-hover); }
.story-types a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

.story-credits { margin-top: 2rem; }
.story-credits summary { width: fit-content; padding-block: .75rem; cursor: pointer; }
.story-credits li { margin-block: .3rem; overflow-wrap: anywhere; }

.country-story .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
