/* The demo page, on top of site.css. Not part of the bundle. */
main > section {
  box-sizing: border-box;
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 16px 0;
}

main > #settings {
  padding-top: 16px;
}

.chooser {
  display: grid;
  gap: 8px;
  margin-block: 16px;
}

.chooser fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0;
  padding: 4px 8px 8px;
  border: 1px solid #999;
}

/* The settings flow side by side, each group as wide as its choices. */
#settings .chooser {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
}

.system {
  color: #555;
}

/* The page opens on the slider: as tall as most of the window, each photo filling it, the text on a light shade. The
   title follows the width of its slide, so three in view stay readable. */
.try {
  height: min(78vh, 760px);
  background: #222;
}

.try .slide {
  position: relative;
  container-type: inline-size;
}

.slide-text {
  position: absolute;
  inset: auto 0 0;
  padding: 64px max(16px, calc((100% - 960px) / 2)) 56px;
  background: linear-gradient(transparent, rgb(0 0 0 / .5));
  color: #fff;
}

.slide-text p {
  margin: 0;
  max-width: 40em;
}

.slide-title {
  font-size: clamp(22px, 5cqi, 52px);
  font-weight: 700;
  line-height: 1.1;
}

/* The fraction for the first paint, as the stylesheet reads only whole numbers from the attribute. Spacing inside the
   slide (D-021). */
.centred {
  --per-view: 1.6;
  height: 360px;
}

.centred .slide {
  box-sizing: border-box;
  padding: 0 6px;
}

@media (width < 700px) {
  .centred {
    --per-view: 1;
  }
}

/* The page by the slide (D-033): the slider #centred keeps slider-centred-slide-N on <body>. */
#slider-title {
  text-decoration: underline 4px var(--tone, transparent);
  text-underline-offset: 8px;
  transition: text-decoration-color 0.5s;
}

.slider-centred-slide-1 #slider-title { --tone: #2e8b57; }
.slider-centred-slide-2 #slider-title { --tone: #6b8f9e; }
.slider-centred-slide-3 #slider-title { --tone: #5b4b9a; }
.slider-centred-slide-4 #slider-title { --tone: #c8873a; }
.slider-centred-slide-5 #slider-title { --tone: #3a7fc1; }

/* Two ways to the detail of a small image, side by side. The frame of EchoZoom clips what grows. A touch that is
   not a pinch scrolls the page, until the image is zoomed, when every gesture is the zoom's. */
.zoom-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.zoom-pair figure {
  margin: 0;
}

.zoom-pair figcaption {
  margin-top: 8px;
  color: #444;
  font-size: 15px;
}

.zoom-frame {
  overflow: clip;
  border-radius: 6px;
}

.zoom-frame img {
  touch-action: pan-y;
}

.zoom-frame img.ebx-zoomed {
  touch-action: none;
}

.zoom-pair a img {
  width: 100%;
  border-radius: 6px;
}

/* A band of numbers on a darkened photo. The label comes first for a screen reader and stands under the number. Digits
   of one width keep a counting number from shaking. */
.numbers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px 24px;
  margin: 24px 0 0;
  padding: 48px 24px;
  border-radius: 12px;
  background: linear-gradient(rgb(8 20 32 / .78), rgb(8 20 32 / .86)), url("photos/lake.webp") center / cover;
  color: #fff;
  text-align: center;
}

.numbers div {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 6px;
}

.numbers dt {
  color: #d5dee8;
  font-size: 15px;
}

.numbers dd {
  margin: 0;
  font-size: clamp(32px, 4vw, 40px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  white-space: nowrap;
}

@media (width < 860px) {
  .numbers {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (width < 480px) {
  .numbers {
    grid-template-columns: 1fr;
  }
}

figure.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
  margin: 0;
}

figure.gallery img {
  width: 100%;
  object-fit: cover;
}

.footer {
  max-width: 960px;
  margin: 64px auto 0;
  padding: 24px 16px 48px;
  border-top: 1px solid #ddd;
  color: #444;
  font-size: 14px;
}
