/* Generated features in the issue design (tqi-*). The i43-* rules in
   custom.css carry the approved look; this sheet adds what full-length
   copy needs: crossheads, captions, strips of any count, clearfix. */

.tqi-feature { scroll-margin-top: 24px; }
.tqi-feature + .tqi-feature { border-top: 1px solid rgba(28, 30, 34, 0.1); margin-top: 24px; }

.tqi-body { max-width: 1040px; }
.tqi-body::after { content: ""; display: table; clear: both; }
.tqi-body > p { max-width: none; }

.tqi-crosshead {
  clear: both;
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 1.15rem;
  line-height: 1.1;
  margin: 32px 0 12px;
  padding-top: 12px;
  border-top: 3px solid #f49731;
  display: inline-block;
}
.tqi-crosshead:first-child { margin-top: 0; }

.i43-text .art-fig figcaption,
.tqi-full figcaption {
  font-size: 0.78rem;
  line-height: 1.4;
  color: rgb(var(--tx-muted));
  margin-top: 8px;
}

.tqi-full { clear: both; margin: 24px 0; }
.tqi-full img { width: 100%; height: auto; }

.tqi-pull { clear: both; margin: 28px 0; }

.tqi-strip { clear: both; margin: 24px 0 0; }
.tqi-strip[style*="--n:2"] { grid-template-columns: repeat(2, 1fr); }
.tqi-strip[style*="--n:3"] { grid-template-columns: repeat(3, 1fr); }
.tqi-strip img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 3 / 2; }

@media (max-width: 640px) {
  .tqi-strip[style*="--n:3"],
  .tqi-strip[style*="--n:2"] { grid-template-columns: 1fr 1fr; }
}

/* ---- Issue design v5 (template-parts/issue-design.php) ---- */
/* Logos: scoped so WooCommerce's `.woocommerce-page img { height:auto }` can't win; full-size files for retina. */
body .i5-hero img.i5-logo { height: 3.5rem; width: auto; max-width: 100%; object-fit: contain; object-position: left center; }
@media (min-width: 640px) { body .i5-hero img.i5-logo { height: 4rem; } }
body img.i5-stable-logo { height: 2rem; width: auto; max-width: none; }

.i5-sec { scroll-margin-top: 24px; }
.i43-strip[style*="--n:3"] { grid-template-columns: repeat(3, 1fr); }
.i43-strip[style*="--n:2"] { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 640px) { .i43-strip[style*="--n:3"] { grid-template-columns: 1fr 1fr 1fr; } }
.i43-smalls img, .i43-strip img, .i43-main img { display: block; }

.i5-break .ad-unit { margin: 0 auto; }
.i43-buy .i43-price { box-shadow: none; }
.i43-buy[data-fit] > div > div + div { min-width: 0; }
@media (max-width: 1100px) { .i5-sec .i43-smalls--3 { grid-template-columns: repeat(3, 1fr); } }
/* v5 buy band: flat panel (no diagonal hatch), covers never cropped. */
.i43-buy[data-fit] { background: #16181d; }
.i43-buy[data-fit] .i43-buy__cover img { object-fit: contain; }
/* Too wide to sit flush beside the copy: the cover goes above it, edge to edge (issue.js). */
.i43-buy[data-fit].is-stacked > div { grid-template-columns: minmax(0, 1fr); }
.i43-buy[data-fit].is-stacked .i43-buy__cover { width: 100%; aspect-ratio: var(--cover-r, 1.4146); }

/* ==================================================================
 * Issue design v5.1: v5 plus one parallax band per feature and four quiet
 * touches (reading progress, chapter dots, photo wipe, outlined feature
 * number). issue-cine.js writes transforms only, from cached positions.
 * ================================================================== */
.ic-page { counter-reset: feat; position: relative; }

/* 1. Reading progress, pinned under the magazine bar */
.ic-prog { position: sticky; top: 58px; z-index: 60; height: 3px; margin-bottom: -3px; pointer-events: none; }
.ic-prog i { display: block; height: 100%; background: #f49731; transform-origin: 0 50%; transform: scaleX(0); }

/* 2. Chapter dots: where you are among the features */
.ic-dots { position: fixed; right: 22px; top: 50%; z-index: 55; display: flex; flex-direction: column; gap: 14px; transform: translateY(-50%); opacity: 0; pointer-events: none; transition: opacity .4s ease; }
.ic-dots.is-on { opacity: 1; pointer-events: auto; }
.ic-dots a { position: relative; display: block; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #8a919c; background: rgb(var(--sf-page)); transition: background-color .25s, border-color .25s, transform .25s; }
.ic-dots a:hover, .ic-dots a.is-here { border-color: #f49731; background: #f49731; }
.ic-dots a.is-here { transform: scale(1.35); }
.ic-dots span { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); white-space: nowrap; font-family: Rajdhani, sans-serif; font-weight: 700; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; background: #16181d; color: #fff; padding: 5px 10px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.ic-dots a:hover span, .ic-dots a:focus-visible span { opacity: 1; }
@media (max-width: 1099px) { .ic-dots { display: none; } }

/* 3. The lead photo wipes in once as its section arrives */
.ic-page .i43-collage .i43-main { clip-path: inset(0 100% 0 0); transition: clip-path 1.1s cubic-bezier(.22, 1, .36, 1) .1s; }
.ic-page .i43-collage.on .i43-main { clip-path: inset(0 0 0 0); }

/* 4. A large outlined feature number slides in once beside the copy. A numbered chapter carries its own number in --tfi-n,
   since Safari showed 00 when the chapter both reset and incremented the counter. */
.ic-page .i5-sec { counter-increment: feat; position: relative; }
/* The second part of a chapter split in two carries on that chapter: no number of its own, big or small (Andy, Bugpot OJ0TFU). */
.ic-page .i5-sec.tfi-sec--cont { counter-increment: none; }
.ic-page .tfi-sec--cont .i43-copy::before { content: none; }
.ic-page .i43-copy { position: relative; }
.ic-page .i43-copy::before { content: var(--tfi-n, counter(feat, decimal-leading-zero)); position: absolute; top: -.32em; right: 0; font-family: Rajdhani, sans-serif; font-weight: 700; font-size: 7.5rem; line-height: 1; color: transparent; -webkit-text-stroke: 1.5px rgba(22, 24, 29, .16); pointer-events: none; transform: translateX(40px); opacity: 0; transition: transform 1s cubic-bezier(.22, 1, .36, 1) .2s, opacity 1s ease .2s; }
.ic-page .i43-copy.on::before { transform: none; opacity: 1; }
@media (max-width: 639px) { .ic-page .i43-copy::before { font-size: 5rem; } }

/* The one parallax photo per feature */
.ic-band { position: relative; margin: 64px 0 0; height: 72vh; min-height: 420px; overflow: hidden; background: #16181d; contain: paint; }
.ic-band__layer { position: absolute; left: 0; right: 0; top: -14%; height: 128%; }
.ic-band__layer.is-live { will-change: transform; }
.ic-band__layer img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ic-band__cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 36px 26px; background: linear-gradient(0deg, rgba(22,24,29,.7), rgba(22,24,29,0)); }
.ic-band__cap span { display: inline-block; font-family: Rajdhani, sans-serif; font-weight: 700; font-size: .8rem; letter-spacing: .22em; text-transform: uppercase; color: #fff; border-left: 3px solid #f49731; padding-left: 12px; }
@media (max-width: 1099px) { .ic-band { height: 56vh; min-height: 300px; } .ic-band__layer { top: 0; height: 100%; } }

@media (prefers-reduced-motion: reduce) {
	.ic-band__layer { top: 0; height: 100%; transform: none !important; }
	.ic-page .i43-collage .i43-main, .ic-page .i43-copy::before { clip-path: none; transform: none; opacity: 1; transition: none; }
	.ic-prog { display: none; }
}
.i5-hero.is-off .i43-hero-kb { animation-play-state: paused; }
/* Smooth scroll on the issue page: a backdrop blur on a sticky bar makes the
   browser re-blur everything that scrolls under it, every frame (measured:
   about 1 frame in 9 dropped). The bar is near-opaque anyway, so here it is solid. */
body:has(.ic-page) .mm-bar { backdrop-filter: none; -webkit-backdrop-filter: none; background: #16181d; }
body:has(.ic-page) .dock a { backdrop-filter: none; -webkit-backdrop-filter: none; }

/* Alignment (29 Sep, client: "no gaps, perfectly aligned"). One gutter, --g, for every gap in a
   section: between the columns, main photo and smalls, the smalls, the strip photos and the copy
   blocks. On desktop the copy sets the row height and the photo column follows it: the column is
   size-contained so it never pushes the row, the main photo flexes into whatever is left above the
   smalls row (feature photos may crop; printed covers never do), and the last copy block (the
   button, when there is one) sits on the photos' bottom line. */
.ic-page { --g: 24px; }
.ic-page .i5-sec > .grid { gap: var(--g); }
.ic-page .i5-sec .i43-copy { gap: var(--g); justify-content: flex-start; }
.ic-page .i5-sec .i43-copy > :last-child { margin-top: auto; }
.ic-page .i5-sec .i43-copy > .i43-go { align-self: flex-start; }
.ic-page .i5-sec .i43-copy .ad-inline { margin: 0; }
.ic-page .i5-sec .i43-collage { gap: var(--g); }
.ic-page .i5-sec .i43-smalls,
.ic-page .i5-sec .i43-strip { gap: var(--g); grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); }
.ic-page .i5-sec .i43-strip { margin-top: var(--g); }
.ic-page .i5-sec .i43-main img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.ic-page .i5-sec .i43-collage.is-cover .i43-main img { aspect-ratio: auto; height: auto; object-fit: contain; }
/* A header picture lent by a feature with no photos of its own (the ALLMI Corner's logo page) shows whole, never cropped:
   it keeps the copy's height, set against the left of a white panel its own white side runs into (Andy, Bugpot S75A1U, 26 Oct 2026). */
.ic-page .i5-sec .i43-collage.is-whole .i43-main { background: #fff; }
.ic-page .i5-sec .i43-collage.is-whole .i43-main img { aspect-ratio: auto; height: auto; object-fit: contain; object-position: left center; clip-path: inset(0 2px 0 0); }
@media (min-width: 1100px) {
	.ic-page .i5-sec .i43-collage.is-whole .i43-main { position: relative; }
	.ic-page .i5-sec .i43-collage.is-whole .i43-main img { position: absolute; top: 0; left: 0; height: 100%; width: auto; max-width: 100%; }
}
@media (min-width: 1100px) {
	.ic-page .i5-sec > .grid { container-type: inline-size; }
	.ic-page .i5-sec .i43-collage:not(.is-cover) {
		contain: size;
		/* floor: a 140px main photo plus the smalls row, low enough that the copy always sets the height */
		--cw: calc((100cqw - var(--g)) / 2);
		min-height: calc(140px + var(--g) + (var(--cw) - (var(--sn) - 1) * var(--g)) / var(--sn) * 9 / 16);
	}
	/* no smalls: the floor above divides by --sn, so it is set here; feature-issue.js rewrites the style as "--sn: 0;" */
	.ic-page .i5-sec .i43-collage:is([style*="--sn:0"], [style*="--sn: 0"]) { min-height: 140px; }
	.ic-page .i5-sec .i43-collage:not(.is-cover) .i43-main { flex: 1 1 0; min-height: 0; display: block; }
	.ic-page .i5-sec .i43-collage:not(.is-cover) .i43-main img { height: 100%; aspect-ratio: auto; }
}
/* a section whose only picture is the printed cover: the cover shows whole in the buy band below,
   so the copy spans both columns and runs in two text columns on the same lines */
@media (min-width: 1100px) { .ic-page .i5-sec .i43-copy.is-wide .i43-text { columns: 2; column-gap: var(--g); } .ic-page .i5-sec .i43-copy.is-wide .i43-text p { break-inside: avoid; } }
/* A feature with no photo at all: a compact card of its words, one tint with the accent down its side, never a wide
   block beside an empty column (Andy, Bugpot 23 Oct 2026: the ALLMI Corner on issue 46 "looks awful"). */
.ic-page .i5-sec .i43-copy.is-card { max-width: 860px; padding: 28px 32px; background: rgb(var(--sf-band)); border-left: 4px solid #f49731; border-radius: 3px; }
.ic-page .i5-sec .i43-copy.is-card::before { right: 24px; }
@media (max-width: 639px) { .ic-page .i5-sec .i43-copy.is-card { padding: 20px 18px; } }
/* Advert bands between sections: container width (so its edges sit on the column lines), one
   tint, the ad centred with one gutter above and below. Nothing is ever placed inside a column. */
.ic-page .i5-adband { margin-top: 64px; padding: var(--g); background: rgb(var(--sf-band)); border-radius: 3px; display: flex; justify-content: center; }
.ic-page .i5-adband .ad-unit { margin: 0 auto; width: 100%; }
@media (max-width: 700px) {
	.ic-page .i5-sec .i43-smalls[style*="--n:4"],
	.ic-page .i5-sec .i43-strip[style*="--n:4"] { grid-template-columns: 1fr 1fr; }
}

/* Headings a touch smaller (Dom, Bugpot 3KMRUJ: "the headings are a bit too big"). The approved design had the
   hero heading at 6.2rem, the feature titles at 2.1rem, the buy band at 2.2rem and the contents list at 1.7rem.
   Each comes down about a tenth, and the hero heading now matches the Subscribe and Magazine heroes (5.4 to 5.6rem). */
.ic-page .i5-hero h1 { font-size: 3.4rem; }
@media (min-width: 640px) { .ic-page .i5-hero h1 { font-size: 4.1rem; } }
@media (min-width: 1280px) { .ic-page .i5-hero h1 { font-size: 5.4rem; } }
.ic-page .i5-hero .i43-check b { font-size: 1.5rem; }
.ic-page .i5-sec .i43-title { font-size: 1.85rem; }
@media (max-width: 700px) { .ic-page .i5-sec .i43-title { font-size: 1.5rem; } }
.ic-page .i43-buy h3 { font-size: 1.9rem; }
