/* ==================================================================
   Projects, editorial: the archive as a magazine grid, the single as a spread.
   Built on the Modulo grid (hairlines, Geist, four columns) and tuned for 16:9 screens.
   ================================================================== */

/* ------------------------------------------------------------------
   Archive: a repeating six-item rhythm
   1 full-bleed feature | 2 wide + 3 tall | 4 tall + 5 wide | 6 full-bleed (then repeat)
   ------------------------------------------------------------------ */

.rt2-ed-grid .wp-block-post-template {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.rt2-ed-grid .wp-block-post-template > li {
  margin: 0;
  min-width: 0;
}

.rt2-ed-grid .wp-block-post-template > li:nth-child(6n + 1),
.rt2-ed-grid .wp-block-post-template > li:nth-child(6n) { grid-column: span 4; }
.rt2-ed-grid .wp-block-post-template > li:nth-child(6n + 2),
.rt2-ed-grid .wp-block-post-template > li:nth-child(6n + 5) { grid-column: span 3; }
.rt2-ed-grid .wp-block-post-template > li:nth-child(6n + 3),
.rt2-ed-grid .wp-block-post-template > li:nth-child(6n + 4) { grid-column: span 1; }

.rt2-ed-card {
  position: relative;
  height: 100%;
  border-bottom: 1px solid var(--rt2-line);
  border-right: 1px solid var(--rt2-line);
}

.rt2-ed-grid .wp-block-post-template > li:nth-child(6n + 1) .rt2-ed-card,
.rt2-ed-grid .wp-block-post-template > li:nth-child(6n) .rt2-ed-card,
.rt2-ed-grid .wp-block-post-template > li:nth-child(6n + 3) .rt2-ed-card,
.rt2-ed-grid .wp-block-post-template > li:nth-child(6n + 5) .rt2-ed-card {
  border-right: 0;
}

.rt2-ed-card__media {
  margin: 0;
  overflow: hidden;
}

.rt2-ed-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 16 / 10;
  transition: transform 900ms var(--rt2-ease);
}

.rt2-ed-card:hover .rt2-ed-card__media img {
  transform: scale(1.025);
}

/* Full-bleed features: 16:9 image, text laid over the lower left on a soft gradient */
.rt2-ed-grid .wp-block-post-template > li:nth-child(6n + 1) .rt2-ed-card,
.rt2-ed-grid .wp-block-post-template > li:nth-child(6n) .rt2-ed-card {
  color: #fff;
}

.rt2-ed-grid .wp-block-post-template > li:nth-child(6n + 1) .rt2-ed-card__media img,
.rt2-ed-grid .wp-block-post-template > li:nth-child(6n) .rt2-ed-card__media img {
  aspect-ratio: 16 / 9;
  max-height: 88vh;
}

.rt2-ed-grid .wp-block-post-template > li:nth-child(6n + 1) .rt2-ed-card__text,
.rt2-ed-grid .wp-block-post-template > li:nth-child(6n) .rt2-ed-card__text {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 120px var(--rt2-inset) 32px;
  background: linear-gradient(to top, rgba(7, 20, 25, 0.78), rgba(7, 20, 25, 0));
  --rt2-fg: #fff;
  --rt2-fg-60: rgba(255, 255, 255, 0.72);
}

.rt2-ed-grid .wp-block-post-template > li:nth-child(6n + 1) .rt2-ed-card__title,
.rt2-ed-grid .wp-block-post-template > li:nth-child(6n) .rt2-ed-card__title {
  font-size: var(--rt2-size-display);
  font-size: clamp(2.5rem, 1rem + 5.5vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  max-width: 14ch;
}

/* Tall items: a portrait crop that matches the wide neighbour */
.rt2-ed-grid .wp-block-post-template > li:nth-child(6n + 3) .rt2-ed-card__media img,
.rt2-ed-grid .wp-block-post-template > li:nth-child(6n + 4) .rt2-ed-card__media img {
  aspect-ratio: 10 / 18.6;
}

.rt2-ed-card__text {
  padding: 20px var(--rt2-inset) 28px;
}

.rt2-ed-card__meta > * {
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

.rt2-ed-card__meta a,
.rt2-ed-card__title a {
  color: inherit;
  text-decoration: none;
}

.rt2-ed-card__title {
  margin: 10px 0 0;
  font-size: var(--rt2-size-section);
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.rt2-ed-grid .wp-block-post-template > li:nth-child(6n + 3) .rt2-ed-card__title,
.rt2-ed-grid .wp-block-post-template > li:nth-child(6n + 4) .rt2-ed-card__title {
  font-size: var(--rt2-size-card);
}

.rt2-ed-card__excerpt {
  margin-top: 10px;
  max-width: 52ch;
}

.rt2-ed-grid .wp-block-post-template > li:nth-child(6n + 3) .rt2-ed-card__excerpt,
.rt2-ed-grid .wp-block-post-template > li:nth-child(6n + 4) .rt2-ed-card__excerpt {
  display: none;
}

/* ------------------------------------------------------------------
   Single: opening spread
   ------------------------------------------------------------------ */

.rt2-ed-open__body {
  border-top: 1px solid var(--rt2-line);
}

.rt2-ed-open__title {
  padding: 64px var(--rt2-inset) 56px;
}

.rt2-ed-open__title .rt2-h1 {
  max-width: 12ch;
}

.rt2-ed-open__aside {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 64px var(--rt2-inset) 32px;
}

.rt2-ed-figure {
  margin: 0;
}

.rt2-ed-figure img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.rt2-ed-figure--hero img {
  aspect-ratio: 16 / 9;
  max-height: 92vh;
}

/* Project sheet: the dl as a quiet strip under the hero */
.rt2-ed-sheet .rt-details {
  border-top: 0;
}

.rt2-ed-sheet .rt-details__value {
  min-height: 120px;
  padding-top: 40px;
}

/* The story: kicker left, copy in the middle two columns, air on the right */
.rt2-ed-story__row .rt2-cell {
  padding-top: 72px;
  padding-bottom: 88px;
}

.rt2-ed-prose p:first-child {
  font-size: var(--rt2-size-section);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--rt2-fg);
  max-width: 24ch;
  margin-bottom: 0.9em;
}

.rt2-ed-prose p,
.rt2-ed-prose li {
  max-width: 56ch;
}

/* Electrical details on the dark band: the first as a statement, the rest as a numbered strip */
.rt2-ed-details .rt-highlights {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.rt2-ed-details .rt-highlights__item {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  counter-increment: rt2-detail;
  position: relative;
  padding-top: 56px;
}

.rt2-ed-details .rt-highlights__item::before {
  content: counter(rt2-detail, decimal-leading-zero);
  position: absolute;
  top: 16px;
  left: var(--rt2-inset);
  font-family: var(--rt2-cond);
  font-size: var(--rt2-size-label);
  letter-spacing: 0.04em;
  color: var(--rt2-accent);
}

.rt2-ed-details .rt-highlights__item:first-child {
  grid-column: span 2;
  grid-row: span 2;
  min-height: 420px;
}

.rt2-ed-details .rt-highlights__item:first-child .rt-highlights__title {
  font-size: var(--rt2-size-section);
  line-height: 1.04;
  letter-spacing: -0.035em;
  max-width: 16ch;
}

.rt2-ed-details .rt-highlights__item:nth-child(4n + 1):not(:first-child) {
  border-right: 1px solid var(--rt2-line);
}

/* Photographs: a six-image spread rhythm
   1 full | 2 + 3 halves | 4 offset wide with the caption beside | 5 + 6 halves */
.rt2-ed-gallery .rt-gallery {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.rt2-ed-gallery .rt-gallery li {
  min-width: 0;
}

.rt2-ed-gallery .rt-gallery li:nth-child(6n + 1) { grid-column: span 4; }
.rt2-ed-gallery .rt-gallery li:nth-child(6n + 2),
.rt2-ed-gallery .rt-gallery li:nth-child(6n + 3),
.rt2-ed-gallery .rt-gallery li:nth-child(6n + 5),
.rt2-ed-gallery .rt-gallery li:nth-child(6n) { grid-column: span 2; }
.rt2-ed-gallery .rt-gallery li:nth-child(6n + 4) { grid-column: 2 / span 3; }

.rt2-ed-gallery .rt-gallery__item {
  padding: 0;
  border-right: 0;
}

.rt2-ed-gallery .rt-gallery li:nth-child(6n + 2) .rt-gallery__item,
.rt2-ed-gallery .rt-gallery li:nth-child(6n + 5) .rt-gallery__item {
  border-right: 1px solid var(--rt2-line);
}

.rt2-ed-gallery .rt-gallery__item img {
  aspect-ratio: 16 / 10;
}

.rt2-ed-gallery .rt-gallery li:nth-child(6n + 1) .rt-gallery__item img {
  aspect-ratio: 16 / 9;
  max-height: 92vh;
}

.rt2-ed-gallery .rt-gallery li:nth-child(6n + 4) .rt-gallery__item img {
  aspect-ratio: 3 / 2;
}

.rt2-ed-gallery .rt-gallery__caption {
  padding: 14px var(--rt2-inset) 18px;
  margin: 0;
}

.rt2-ed-gallery .rt-gallery li:nth-child(6n + 4) .rt-gallery__item {
  display: grid;
  grid-template-columns: 1fr 3fr;
}

.rt2-ed-gallery .rt-gallery li:nth-child(6n + 4) .rt-gallery__item img {
  order: 2;
}

.rt2-ed-gallery .rt-gallery li:nth-child(6n + 4) .rt-gallery__caption {
  order: 1;
  align-self: end;
  border-right: 1px solid var(--rt2-line);
  padding-bottom: 24px;
}

/* Next project: image as a full band with the text over it */
.rt2-ed .rt2-next__row {
  position: relative;
  min-height: 60vh;
}

.rt2-ed .rt2-next__media {
  grid-column: 1 / -1;
  grid-row: 1;
}

.rt2-ed .rt2-next__media img {
  aspect-ratio: 16 / 7;
  min-height: 60vh;
}

.rt2-ed .rt2-next__text {
  grid-column: 1 / 3;
  grid-row: 1;
  z-index: 1;
  justify-content: flex-end;
  background: linear-gradient(to right, rgba(7, 20, 25, 0.72), rgba(7, 20, 25, 0));
  border-right: 0;
}

.rt2-ed .rt2-next__title {
  font-size: clamp(2.5rem, 1rem + 5vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

@media (max-width: 899px) {
  .rt2-ed-grid .wp-block-post-template {
    grid-template-columns: 1fr;
  }

  .rt2-ed-grid .wp-block-post-template > li:nth-child(n) {
    grid-column: auto;
  }

  .rt2-ed-grid .wp-block-post-template > li:nth-child(n) .rt2-ed-card__media img {
    aspect-ratio: 16 / 10;
    max-height: none;
  }

  .rt2-ed-grid .wp-block-post-template > li:nth-child(n) .rt2-ed-card {
    border-right: 0;
    color: var(--rt2-fg);
  }

  .rt2-ed-grid .wp-block-post-template > li:nth-child(n) .rt2-ed-card__text {
    position: static;
    padding: 20px var(--rt2-inset) 28px;
    background: none;
    --rt2-fg: var(--rt2-ink);
    --rt2-fg-60: var(--wp--preset--color--border-dark);
  }

  .rt2-ed-grid .wp-block-post-template > li:nth-child(n) .rt2-ed-card__title {
    font-size: var(--rt2-size-card);
  }

  .rt2-ed-open__title,
  .rt2-ed-open__aside {
    grid-column: 1 / -1;
    padding: 40px var(--rt2-inset) 24px;
  }

  .rt2-ed-story__row .rt2-cell {
    grid-column: 1 / -1;
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .rt2-ed-details .rt-highlights,
  .rt2-ed-gallery .rt-gallery {
    grid-template-columns: 1fr;
  }

  .rt2-ed-details .rt-highlights__item:first-child,
  .rt2-ed-gallery .rt-gallery li:nth-child(n) {
    grid-column: auto;
    grid-row: auto;
    min-height: 0;
  }

  .rt2-ed-gallery .rt-gallery li:nth-child(6n + 4) .rt-gallery__item {
    display: block;
  }

  .rt2-ed-gallery .rt-gallery li:nth-child(6n + 4) .rt-gallery__caption {
    border-right: 0;
  }

  .rt2-ed .rt2-next__text {
    grid-column: 1 / -1;
    background: linear-gradient(to top, rgba(7, 20, 25, 0.8), rgba(7, 20, 25, 0.1));
  }
}

/* Phone rhythm for the projects (see the scale at the end of home-2.css) */
@media (max-width: 899px) {
  .rt2-ed-open__title {
    padding: 32px var(--rt2-inset) 0;
  }

  .rt2-ed-open__aside {
    padding: 16px var(--rt2-inset) 32px;
  }

  .rt2-ed-story__row .rt2-cell {
    padding-top: 32px;
    padding-bottom: 0;
  }

  .rt2-ed-story__row .rt2-cell + .rt2-cell {
    padding-top: var(--rt2-text);
    padding-bottom: var(--rt2-band);
  }

  .rt2-ed-details .rt-highlights__item {
    min-height: 0;
    padding-top: var(--rt2-band);
    padding-bottom: var(--rt2-action);
  }

  .rt2-ed-grid .wp-block-post-template > li:nth-child(n) .rt2-ed-card__text,
  .rt2-ed-card__text {
    padding: 16px var(--rt2-inset) var(--rt2-action);
  }

  .rt2-ed-gallery .rt-gallery__caption {
    padding: var(--rt2-text) var(--rt2-inset) 16px;
  }
}

/* ------------------------------------------------------------------
   Project index (Projects archive, section 02): photo rows.
   Year | photo | title + partners line | "See project" button.
   Columns follow the four-column head above (1 | 2 to 3 | 4).
   Blocks: Date, Featured Image, Title, rt/project-partners, Read More.
   ------------------------------------------------------------------ */

.rt2-index .wp-block-post-template {
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rt2-index .wp-block-post-template > li {
  margin: 0;
}

.rt2-index .rt2-index__row {
  display: grid;
  grid-template-columns: 25% auto minmax(0, 1fr) 25%;
  grid-template-areas: "year photo text more";
  align-items: center;
  padding-block: 12px;
  border-bottom: 1px solid var(--rt2-line);
  transition: background 200ms var(--rt2-ease);
}

.rt2-index .rt2-index__row:hover,
.rt2-index .rt2-index__row:focus-within {
  background: var(--rt2-base);
}

.rt2-index .rt2-index__row > * {
  min-width: 0;
  margin: 0;
}

.rt2-index .rt2-index__year {
  grid-area: year;
  padding-inline: var(--rt2-inset);
}

.rt2-index .rt2-index__photo {
  grid-area: photo;
  width: clamp(88px, 24vw, 132px);
  aspect-ratio: 132 / 84;
  margin-left: var(--rt2-inset);
  overflow: hidden;
}

.rt2-index .rt2-index__photo a {
  display: block;
  height: 100%;
}

.rt2-index .rt2-index__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rt2-index .rt2-index__text {
  grid-area: text;
  padding-inline: var(--rt2-inset);
}

.rt2-index .rt2-index__text > * {
  margin: 0;
}

.rt2-index .rt2-index__title a {
  display: inline-block;
}

.rt2-index .rt2-index__text > .rt2-index__partners {
  margin-top: 6px;
}

/* The button: pale grey blue, text left, arrow right. Hover turns it ink and tips the arrow down-right. */
.rt2-index .rt2-index__more {
  grid-area: more;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: auto;
  min-height: 52px;
  margin-inline: var(--rt2-inset);
  padding: 14px 18px;
  font-family: var(--rt2-sans);
  font-size: 0.9375rem;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  border-radius: 0;
  background: var(--wp--preset--color--primary-accent);
  color: var(--rt2-ink);
  transition: background 200ms var(--rt2-ease), color 200ms var(--rt2-ease);
}

.rt2-index .rt2-index__more::after {
  content: "";
  display: inline-block;
  flex: none;
  width: 1em;
  height: 1em;
  background: currentColor;
  -webkit-mask: var(--rt2-icon-ground) center / contain no-repeat;
  mask: var(--rt2-icon-ground) center / contain no-repeat;
  rotate: -90deg;
  display: inline-block;
  font-size: 1rem;
  transition: transform 200ms var(--rt2-ease);
}

.rt2-index .rt2-index__more:hover,
.rt2-index .rt2-index__more:focus-visible {
  background: var(--rt2-ink);
  color: #fff;
}

.rt2-index .rt2-index__more:hover::after,
.rt2-index .rt2-index__more:focus-visible::after {
  transform: rotate(45deg);
}

.rt2-index .rt2-index__row a:focus-visible {
  outline: 2px solid var(--rt2-accent);
  outline-offset: 2px;
}

/* Phone and tablet: photo on the left, year, title and partners beside it, the button full width below. */
@media (max-width: 899px) {
  .rt2-index .rt2-index__row {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "photo year"
      "photo text"
      "more  more";
    align-items: start;
    padding-block: 16px;
  }

  .rt2-index .rt2-index__year {
    padding-bottom: 6px;
  }

  /* Three classes: pages-2.css zeroes block margins on every flow group child. */
  .rt2-index .rt2-index__row > .rt2-index__more {
    margin-top: 16px;
  }
}

/* Text links, part two: the action links and the card labels take the same link color and underline (Jake, 2026-11-12).
   The variables are set in pages-2.css. This sits in the last stylesheet so it wins over the older resets. */
.rt2 .rt2-link a,
.rt2 .rt2-card__meta a,
.rt2 .rt2-card__tags a,
.rt2 .rt2-ed-card__meta a,
.rt2 .rt2-head a,
.rt2 p.rt2-footer__top a,
.rt2 .rt2-footer__legal a {
  color: var(--rt2-link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.rt2 .rt2-link a:hover,
.rt2 .rt2-card__meta a:hover,
.rt2 .rt2-card__tags a:hover,
.rt2 .rt2-ed-card__meta a:hover,
.rt2 .rt2-head a:hover,
.rt2 p.rt2-footer__top a:hover,
.rt2 .rt2-footer__legal a:hover {
  color: var(--rt2-link-hover);
}
