/* ==========================================================================
   Projects page: photo gallery and lightbox
   Loaded only on /projects/. Uses the same colours, fonts and radii as the
   rest of the site (cream #faf4ea, card #171716, text #d0d5db, Inter/Poppins).
   ========================================================================== */

.gallery { display: flex; flex-direction: column; gap: 20px; }
@media (min-width: 640px) { .gallery { gap: 28px; } }

/* Filter buttons: wrap onto extra lines on narrow screens (never overflow) */
.gallery__filters { display: flex; flex-wrap: wrap; gap: 10px; }
/* Filters need JavaScript; hide them only when it is off (the 'js' class is set in <head>, so nothing shifts) */
html:not(.js) .gallery__filters { display: none; }
.gallery__filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid #505050;
  border-radius: 8px;
  background-color: transparent;
  color: #d0d5db;
  font-family: Inter, sans-serif;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.gallery__count { font-size: 12px; font-weight: 500; opacity: .7; }
@media (hover: hover) {
  .gallery__filter:hover { border-color: #faf4ea; color: #faf4ea; }
}
.gallery__filter[aria-pressed="true"],
.gallery__filter[aria-pressed="true"]:hover { border-color: #faf4ea; background-color: #faf4ea; color: #000; }
.gallery__filter:focus-visible { outline: 2px solid #faf4ea; outline-offset: 3px; }

/* Grid: 1 column on phones, 2 from 640px, 3 from 1024px */
.gallery__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  transition: opacity .18s ease;
}
.gallery__grid.is-filtering { opacity: 0; }
@media (min-width: 640px) { .gallery__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 1024px) { .gallery__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }
/* Main Projects page: denser grid (1 column under 480px, 2 to 1023px, 3 to 1279px, 4 from 1280px).
   Suburb project pages keep the larger-photo layout above. */
.gallery__grid--dense { grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 480px) { .gallery__grid--dense { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 768px) { .gallery__grid--dense { gap: 18px; } }
@media (min-width: 1024px) { .gallery__grid--dense { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 1280px) { .gallery__grid--dense { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; } }

/* "More Auzsheet Roofing Work": photos shown under All only */
.gallery__more { display: flex; flex-direction: column; gap: 16px; padding-top: 8px; }
.gallery__more[hidden] { display: none; }
.gallery__more-title {
  color: #faf4ea;
  font-family: Poppins, sans-serif;
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
}
@media (min-width: 768px) { .gallery__more-title { font-size: 24px; line-height: 32px; } }

.gallery__item { position: relative; }
.gallery__item[hidden] { display: none; }
.gallery__tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 15px;
  background-color: #1e2939;
  cursor: zoom-in;
}
.gallery__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .7s cubic-bezier(.4, 0, .2, 1);
}
.gallery__tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .35), rgba(0, 0, 0, 0) 45%);
  opacity: 0;
  transition: opacity .3s;
}
.gallery__chip {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1;
  padding: 6px 10px;
  border-radius: 8px;
  background-color: #faf4ea;
  color: #000;
  font-family: Inter, sans-serif;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  text-decoration: none;
}
a.gallery__chip { z-index: 2; padding: 8px 10px; transition: background-color .2s, color .2s; }
@media (hover: hover) { a.gallery__chip:hover { background-color: #000; color: #faf4ea; } }
a.gallery__chip:focus-visible { outline: 2px solid #faf4ea; outline-offset: 2px; }
.gallery__zoom {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: flex;
  padding: 10px;
  border-radius: 4px;
  background-color: #000;
  color: #f4f4f4;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .3s, transform .3s;
}
.gallery__zoom svg { width: 16px; height: 16px; }
@media (hover: hover) {
  .gallery__tile:hover .gallery__img { transform: scale(1.05); }
  .gallery__tile:hover::after,
  .gallery__tile:hover .gallery__zoom { opacity: 1; transform: none; }
}
.gallery__tile:focus-visible { outline: 2px solid #faf4ea; outline-offset: 3px; }
.gallery__tile:focus-visible .gallery__zoom { opacity: 1; transform: none; }
/* touch screens: always show the enlarge hint */
@media (hover: none) { .gallery__zoom { opacity: 1; transform: none; } }

.gallery__noscript {
  color: #d0d5db;
  font-family: Inter, sans-serif;
  font-weight: 500;
}

/* ---- Lightbox ----------------------------------------------------------- */
html.lightbox-open, html.lightbox-open body { overflow: hidden; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 12px 92px;
  opacity: 0;
  transition: opacity .2s ease;
}
.lightbox.is-open { opacity: 1; }
.lightbox__backdrop { position: absolute; inset: 0; background-color: rgba(0, 0, 0, .92); }
.lightbox__figure {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  max-height: 100%;
  pointer-events: none;
}
.lightbox__img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 64px - 92px - 40px);
  border-radius: 10px;
  object-fit: contain;
  transition: opacity .2s ease;
  pointer-events: auto;
}
@supports (height: 100dvh) {
  .lightbox__img { max-height: calc(100dvh - 64px - 92px - 40px); }
}
.lightbox__img.is-loading { opacity: .35; }
.lightbox__caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  color: #d0d5db;
  font-family: Inter, sans-serif;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  text-align: center;
}
.lightbox__caption strong { color: #faf4ea; font-weight: 600; }
.lightbox__counter { color: #97a1af; }

.lightbox__btn {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 9999px;
  background-color: rgba(0, 0, 0, .7);
  color: #fff;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
.lightbox__btn svg { width: 22px; height: 22px; }
@media (hover: hover) {
  .lightbox__btn:hover { background-color: #fff; color: #000; }
}
.lightbox__btn:focus-visible { outline: 2px solid #faf4ea; outline-offset: 2px; }
.lightbox__close { top: 10px; right: 12px; background-color: #faf4ea; color: #000; border-color: #faf4ea; }
/* phones: previous/next sit below the photo, easy to reach with a thumb */
.lightbox__prev { bottom: 24px; left: calc(50% - 60px); }
.lightbox__next { bottom: 24px; right: calc(50% - 60px); }
@media (min-width: 768px) {
  .lightbox { padding: 72px 88px 56px; }
  .lightbox__img { max-height: calc(100vh - 72px - 56px - 40px); }
  @supports (height: 100dvh) {
    .lightbox__img { max-height: calc(100dvh - 72px - 56px - 40px); }
  }
  .lightbox__close { top: 16px; right: 20px; }
  .lightbox__prev { bottom: auto; top: 50%; left: 20px; transform: translateY(-50%); }
  .lightbox__next { bottom: auto; top: 50%; right: 20px; transform: translateY(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .gallery__grid, .gallery__img, .lightbox, .lightbox__img { transition: none; }
}

/* ---- Phase 2: suburb context line under the filters --------------------- */
.gallery__context {
  margin: 0;
  color: #d0d5db;
  font-family: Inter, sans-serif;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
}
.gallery__context strong { color: #faf4ea; font-weight: 600; }
.gallery__context-link,
.lightbox__link { color: #faf4ea; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.gallery__context-link { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; white-space: nowrap; }
.gallery__context[hidden] { display: none; }
.lightbox__link { pointer-events: auto; }
.gallery__context-link:focus-visible,
.lightbox__link:focus-visible { outline: 2px solid #faf4ea; outline-offset: 2px; }

/* ---- Phase 2: breadcrumbs (project and area pages) ---------------------- */
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 8px; color: #97a1af; font-family: Inter, sans-serif; font-size: 13px; line-height: 20px; font-weight: 500; }
.breadcrumbs li + li::before { content: "/"; color: #505050; }
.breadcrumbs a { color: #d0d5db; text-decoration: none; }
.breadcrumbs a:hover { color: #faf4ea; text-decoration: underline; }
.breadcrumbs a:focus-visible { outline: 2px solid #faf4ea; outline-offset: 2px; }
.breadcrumbs [aria-current] { color: #faf4ea; }

/* ---- Phase 2: project and area pages ------------------------------------ */
.project-section { display: flex; flex-direction: column; gap: 20px; }
.project-section__title {
  color: #faf4ea;
  font-family: Poppins, sans-serif;
  font-size: 22px;
  line-height: 30px;
  font-weight: 600;
}
@media (min-width: 768px) { .project-section__title { font-size: 26px; line-height: 34px; } }
.project-facts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 0; }
@media (min-width: 640px) { .project-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.project-facts__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px;
  background-color: #1e2939;
}
.project-facts dt { color: #97a1af; font-family: Inter, sans-serif; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.project-facts dd { margin: 0; color: #faf4ea; font-family: Inter, sans-serif; font-size: 15px; line-height: 22px; font-weight: 500; }
.project-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.project-links a, .project-links span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid #505050;
  border-radius: 8px;
  color: #d0d5db;
  font-family: Inter, sans-serif;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .2s, color .2s, border-color .2s;
}
@media (hover: hover) { .project-links a:hover { border-color: #faf4ea; background-color: #faf4ea; color: #000; } }
.project-links a:focus-visible { outline: 2px solid #faf4ea; outline-offset: 3px; }
.project-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 640px) { .project-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 1024px) { .project-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.project-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 15px;
  background-color: #1e2939;
  color: #d0d5db;
  text-decoration: none;
}
.project-card__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.project-card__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.4, 0, .2, 1); }
.project-card__body { display: flex; flex-direction: column; gap: 6px; padding: 16px; }
.project-card__title { color: #faf4ea; font-family: Poppins, sans-serif; font-size: 18px; line-height: 26px; font-weight: 600; }
.project-card__text { font-family: Inter, sans-serif; font-size: 14px; line-height: 20px; font-weight: 500; }
.project-card__more { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; color: #faf4ea; font-family: Inter, sans-serif; font-size: 14px; font-weight: 600; }
@media (hover: hover) { .project-card:hover .project-card__media img { transform: scale(1.05); } .project-card:hover .project-card__more { text-decoration: underline; } }
.project-card:focus-visible { outline: 2px solid #faf4ea; outline-offset: 3px; }
.project-prose { display: flex; flex-direction: column; gap: 14px; max-width: 900px; }
.project-prose a { color: #faf4ea; text-decoration: underline; text-underline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .project-card__media img { transition: none; } }

/* ==========================================================================
   Suburb pages with several jobs: project selector, per-job sections,
   and the progress "story" layout (e.g. Tingira Heights).
   Same colours, fonts and radii as the rest of the site.
   ========================================================================== */
.project-kicker {
  margin: 0 0 4px;
  color: #97a1af;
  font-family: Inter, sans-serif;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.project-job { scroll-margin-top: 140px; padding-top: 28px; border-top: 1px solid rgba(255, 255, 255, .1); }
.project-links--job { margin-top: 4px; }

/* Project selector cards */
.job-selector__list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 640px) { .job-selector__list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } }
.job-card {
  display: flex;
  align-items: stretch;
  min-height: 112px;
  overflow: hidden;
  border: 1px solid #505050;
  border-radius: 15px;
  background-color: #000;
  color: #d0d5db;
  text-decoration: none;
  transition: border-color .2s, background-color .2s;
}
.job-card__media { position: relative; flex: 0 0 38%; max-width: 220px; overflow: hidden; }
.job-card__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.job-card__body { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 14px 16px; min-width: 0; }
.job-card__num { color: #97a1af; font-family: Inter, sans-serif; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.job-card__title { color: #faf4ea; font-family: Poppins, sans-serif; font-size: 17px; line-height: 24px; font-weight: 600; }
.job-card__meta { font-family: Inter, sans-serif; font-size: 13px; line-height: 18px; font-weight: 500; }
.job-card__more { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; color: #faf4ea; font-family: Inter, sans-serif; font-size: 13px; font-weight: 600; }
@media (hover: hover) { .job-card:hover { border-color: #faf4ea; } .job-card:hover .job-card__more { text-decoration: underline; } }
.job-card:active { border-color: #faf4ea; }
.job-card:focus-visible { outline: 2px solid #faf4ea; outline-offset: 3px; }

/* ---- Progress story ---------------------------------------------------- */
.story { gap: 24px; }
.story__head { display: flex; flex-direction: column; gap: 2px; }
.story__sub { margin: 6px 0 0; color: #d0d5db; font-family: Inter, sans-serif; font-size: 14px; line-height: 22px; font-weight: 500; }
.story__main { display: flex; flex-direction: column; gap: 28px; }
.story__tile { position: relative; display: block; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 15px; background-color: #1e2939; cursor: zoom-in; }
.story__tile img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.4, 0, .2, 1); }
.story__lead .story__tile { aspect-ratio: 16 / 10; }
.story__tile--thumb { aspect-ratio: 4 / 3; border-radius: 10px; }
.story__tile--thumb img { position: absolute; inset: 0; height: 100%; object-fit: cover; }
@media (hover: hover) {
  .story__tile:hover img { transform: scale(1.03); }
  .story__tile:hover .gallery__zoom { opacity: 1; transform: none; }
}
.story__tile:focus-visible { outline: 2px solid #faf4ea; outline-offset: 3px; }
.story__tile:focus-visible .gallery__zoom { opacity: 1; transform: none; }

/* Lead photo + facts panel: 60 / 40 from 1024px */
.story__intro { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 1024px) { .story__intro { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 28px; align-items: center; } }
.story__facts { display: flex; flex-direction: column; gap: 14px; }
.story__dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; margin: 0; }
@media (min-width: 1024px) { .story__dl { grid-template-columns: minmax(0, 1fr); } }
.story__fact { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, .1); }
@media (min-width: 1024px) { .story__fact { flex-direction: row; justify-content: space-between; gap: 16px; padding: 14px 0; } }
.story__fact dt { color: #97a1af; font-family: Inter, sans-serif; font-size: 12px; line-height: 18px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.story__fact dd { margin: 0; color: #faf4ea; font-family: Inter, sans-serif; font-size: 15px; line-height: 22px; font-weight: 600; }
.story__note { margin: 0; color: #97a1af; font-family: Inter, sans-serif; font-size: 13px; line-height: 20px; font-weight: 500; }

/* Step rail: horizontal from 768px, hidden on phones (the stages carry their own line) */
.story__rail { display: none; }
@media (min-width: 768px) {
  .story__rail { display: block; }
  .story__rail ol { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
  .story__rail ol::before { content: ""; position: absolute; top: 17px; left: 18px; right: 18px; height: 1px; background-color: rgba(255, 255, 255, .18); }
  .story__rail a { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 36px; padding-right: 12px; background-color: #171716; color: #d0d5db; font-family: Inter, sans-serif; font-size: 14px; font-weight: 600; text-decoration: none; }
  .story__rail a:hover .story__rail-label { color: #faf4ea; text-decoration: underline; }
  .story__rail a:focus-visible { outline: 2px solid #faf4ea; outline-offset: 3px; }
}
.story__dot, .story__num {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #faf4ea;
  border-radius: 9999px;
  background-color: #171716;
  color: #faf4ea;
  font-family: Poppins, sans-serif;
  font-size: 13px;
  font-weight: 600;
}

/* Stages: vertical sequence with a line on phones, alternating rows from 1024px */
.story__stages { position: relative; display: flex; flex-direction: column; gap: 36px; margin: 0; padding: 0 0 0 52px; list-style: none; }
.story__stages::before { content: ""; position: absolute; top: 18px; bottom: 18px; left: 17px; width: 1px; background-color: rgba(255, 255, 255, .18); }
.story__stage { position: relative; display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 140px; }
.story__stage .story__num { position: absolute; top: 0; left: -52px; }
.story__stage-text { display: flex; flex-direction: column; gap: 6px; min-height: 36px; justify-content: center; }
.story__stage-title { margin: 0; color: #faf4ea; font-family: Poppins, sans-serif; font-size: 19px; line-height: 26px; font-weight: 600; }
.story__caption { margin: 0; color: #d0d5db; font-family: Inter, sans-serif; font-size: 14px; line-height: 22px; font-weight: 500; }
.story__stage-media { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.story__thumbs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.story__thumbs--3 > li:last-child { grid-column: span 2; }
.story__thumbs--3 > li:last-child .story__tile--thumb { aspect-ratio: 8 / 3; }
@media (min-width: 640px) {
  .story__thumbs--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .story__thumbs--3 > li:last-child { grid-column: auto; }
  .story__thumbs--3 > li:last-child .story__tile--thumb { aspect-ratio: 4 / 3; }
}
@media (min-width: 1024px) {
  .story__stages { padding-left: 0; gap: 48px; }
  .story__stages::before { display: none; }
  .story__stage { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 32px; align-items: center; }
  .story__stage .story__num { position: static; }
  .story__stage-text { order: 2; justify-content: center; }
  .story__stage-media { order: 1; }
  .story__stage--flip { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); }
  .story__stage--flip .story__stage-text { order: 1; }
  .story__stage--flip .story__stage-media { order: 2; }
  .story__stage-title { font-size: 22px; line-height: 30px; }
}

/* Full progression gallery behind the button */
.story__more { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.story__toggle {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid #faf4ea;
  border-radius: 8px;
  background-color: #faf4ea;
  color: #000;
  font-family: Inter, sans-serif;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
@media (hover: hover) { .story__toggle:hover { background-color: transparent; color: #faf4ea; } }
.story__toggle:focus-visible { outline: 2px solid #faf4ea; outline-offset: 3px; }
html:not(.js) .story__toggle { display: none; }
.js .story__all.is-collapsed { display: none; }
.story__all { display: flex; flex-direction: column; gap: 14px; width: 100%; }
.story__all-title { margin: 0; color: #faf4ea; font-family: Poppins, sans-serif; font-size: 17px; line-height: 24px; font-weight: 600; }
.gallery__grid--progress { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 768px) { .gallery__grid--progress { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 1024px) { .gallery__grid--progress { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
.gallery__grid--progress .gallery__item { list-style: none; }
@media (prefers-reduced-motion: reduce) { .story__tile img { transition: none; } }
@media (max-width: 639px) { .story__more { align-items: stretch; } .story__toggle { justify-content: center; text-align: center; } }
/* Phones: slimmer stage line so supporting photos stay large */
@media (max-width: 479px) {
  .story__stages { padding-left: 42px; }
  .story__stages::before { left: 15px; top: 16px; bottom: 16px; }
  .story__stage .story__num { left: -42px; width: 31px; height: 31px; font-size: 12px; }
  .story__stage-text { min-height: 31px; }
}

/* Final refinement: 2-column facts on phones with an odd number of facts: last one spans the row */
.story__dl > .story__fact:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* Final refinement: compact desktop stages. Each stage is one editorial row:
   main photo ~65%, and number/title/caption with the supporting photos ~35%. */
@media (min-width: 1024px) {
  .story__stages { gap: 28px; }
  .story__stage {
    grid-template-columns: minmax(0, 65fr) minmax(0, 35fr);
    grid-template-rows: 1fr auto auto 1fr;
    gap: 0 28px;
    align-items: start;
    padding-bottom: 28px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
  }
  .story__stage:last-child { padding-bottom: 0; border-bottom: 0; }
  .story__stage-media { display: contents; }
  .story__primary { grid-column: 1; grid-row: 1 / -1; }
  .story__primary .story__tile { aspect-ratio: 16 / 10; }
  .story__stage-text { grid-column: 2; grid-row: 2; order: 0; justify-content: flex-start; }
  /* text + thumbnails form one block, centred beside the main photo */
  .story__thumbs { grid-column: 2; grid-row: 3; align-self: start; margin-top: 16px; }
  .story__thumbs--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .story__thumbs--3 > li:last-child { grid-column: span 2; }
  .story__thumbs--3 > li:last-child .story__tile--thumb { aspect-ratio: 8 / 3; }
  .story__stage--flip { grid-template-columns: minmax(0, 35fr) minmax(0, 65fr); }
  .story__stage--flip .story__primary { grid-column: 2; }
  .story__stage--flip .story__stage-text, .story__stage--flip .story__thumbs { grid-column: 1; }
}
