/* terms-layout.html only: ch3 right-column grammar, centered under the site text column. Load after style.css. */
:root { --t-gap: 8px; --t-radius: 8px; --t-col: 1029px; --t-tile: #101114; --t-card: rgba(0,0,0,.04); }

.col {
  --cw: min(var(--t-col), 100vw - 32px);
  width: var(--cw);
  margin: 48px 0 0 calc((100% - var(--cw)) / 2);
  display: grid; gap: var(--t-gap);
}
.tile { position: relative; display: block; overflow: hidden; border-radius: var(--t-radius); background: var(--t-tile); }
.tile > video, .tile > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.tile.w { aspect-ratio: 3 / 2; }
.tile.p { aspect-ratio: 3 / 4; }
.tile.banner { aspect-ratio: 2500 / 875; } /* form-since keeps the banner's own ratio */
.tile.a4 { aspect-ratio: 707 / 1000; } /* report spreads keep their A-format, nothing cropped */
.tile.natural > img { position: static; height: auto; }
a.tile { cursor: zoom-in; transition: opacity .2s ease; }
a.tile:hover { opacity: .92; }
a.tile:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

.card { background: var(--t-card); border-radius: var(--t-radius); padding: 16px; font-size: var(--fs-small); line-height: 1.55; }
.card h2 { margin: 0 0 10px; font: inherit; color: var(--text-3); }
.card p { color: var(--text); }
.text { width: calc((100% - var(--t-gap)) / 2); }

.row, .pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--t-gap); }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--t-gap); }
.stack { display: grid; grid-template-rows: 1fr 1fr; gap: var(--t-gap); }

@media (max-width: 1023px) { .text { width: 100%; } }
@media (max-width: 760px) {
  .row, .pair, .trio { grid-template-columns: 1fr; }
  .stack { grid-template-rows: none; }
  .stack .tile { aspect-ratio: 3 / 2; }
}

/* labels in the project intro; light tiles get a light backing so no dark rim shows at the corners */
.intro .lbl { display: block; color: var(--text-3); }
.tile.light { background: #eaf4fb; }
.tile.light::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); pointer-events: none; } /* white page on white: hairline edge */
.tile.placeholder { background: #e6e6e6; }


/* QA 27.10: lightbox counter must not block the arrows; stacks use grid gap only; nicer wrapping */
.lb-count { pointer-events: none; }
.col .stack > * + * { margin-top: 0; }
.intro p, .card.text p { text-wrap: wrap; }   /* greedy: typography.css (Safari's pretty shortens lines) */

/* Annual report gallery (gallery.js): one 3:2 tile, cover → spread → spread */
.slides { overflow: clip; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.gallery-track { position: absolute; inset: 0; display: flex; transition: transform .55s cubic-bezier(.6, 0, .2, 1); will-change: transform; }
.gallery-slide { position: relative; flex: 0 0 100%; height: 100%; }
.gallery-slide > a { position: absolute; inset: 0; cursor: zoom-in; -webkit-user-drag: none; }
.gallery-slide img { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; pointer-events: none; }
.gallery-slide > a:focus-visible { outline: 2px solid #fff; outline-offset: -6px; border-radius: 4px; }
.slides.is-dragging .gallery-slide > a { cursor: grabbing; }

.gallery-btn {
  position: absolute; top: 50%; z-index: 1;
  display: grid; place-items: center;
  width: 40px; height: 40px; margin-top: -20px;
  padding: 0; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .9); color: var(--text);
  font: 18px/1 var(--font); font-feature-settings: var(--font-features); cursor: pointer;
  opacity: 0; transition: opacity .2s ease, background-color .2s ease;
}
.gallery-prev { left: 16px; }
.gallery-next { right: 16px; }
.gallery-btn:hover { background: #fff; }
.gallery-btn:focus-visible { opacity: 1; outline: 2px solid #fff; outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .slides:hover .gallery-btn { opacity: 1; } }
@media (hover: none), (pointer: coarse) { .gallery-btn:not(:focus-visible) { visibility: hidden; } }

.gallery-dots { position: absolute; left: 0; right: 0; bottom: 6px; z-index: 1; display: flex; justify-content: center; }
.gallery-dots button {
  width: 22px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer;
  display: grid; place-items: center;
}
.gallery-dots button::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: #fff; opacity: .45; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12);
  transition: opacity .2s ease, transform .2s ease;
}
.gallery-dots button[aria-current]::before { opacity: 1; transform: scale(1.15); }
.gallery-dots button:focus-visible { outline: 2px solid #fff; outline-offset: -2px; border-radius: 50%; }
@media (prefers-reduced-motion: reduce) { .gallery-track { transition: none; } }

/* Project header (2026-10-28). Crumbs, header and footer sit on the media column's width,
   and the header uses 4 tracks with the tile gap, so each text edge lands on a tile edge:
   title across all 4; meta labels | values in tracks 1–2; challenge/solution/about in 3–4 (the right half-tile). */
.page-case > .crumbs,
.page-case > .case-head,
.page-case > .site-footer {
  --cw: min(var(--t-col), 100vw - 32px);
  width: var(--cw);
  margin-left: calc((100% - var(--cw)) / 2);
}
.case-head { margin-top: 64px; }
.case-head h1 {
  font-size: clamp(2.75rem, 1.5rem + 3.5vw, 4.5rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-left: -0.05em; /* optical: pull the T's side bearing onto the column edge */
}
.case-body {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--t-gap);
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.case-meta {
  grid-column: 1 / 3;
  margin: 0;
  display: grid;
  row-gap: 12px;
  align-content: start;
}
.case-meta > div { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); column-gap: 16px; }
.case-meta dt { color: var(--text-3); }
.case-meta dd { margin: 0; padding-inline-end: 24px; color: var(--text); }
.case-text { grid-column: 3 / -1; max-width: 36em; }
.case-text section + section { margin-top: 28px; }
.case-text h2 { margin: 0 0 4px; font: inherit; font-weight: 500; color: var(--text); }
.case-text p { text-wrap: wrap; }

@media (max-width: 760px) {
  .case-head { margin-top: 40px; }
  .case-body { grid-template-columns: minmax(0, 1fr); margin-top: 32px; }
  .case-meta, .case-text { grid-column: 1 / -1; }
  .case-meta > div { grid-template-columns: 5em minmax(0, 1fr); column-gap: 12px; }
  .case-meta dd { padding-inline-end: 0; }
  .case-text { margin-top: 40px; }
}
