/* ATLAS-HERO-1311 (13 Nov): the client's homepage hero photograph. Markup + switches: inc/hero-1311.php.
   Rule: nothing sits on Kenneth. The picture is placed from K, the x where the subject starts, which is kept clear of
   the text column's ink (E, measured per width band: tools/hero-1311/ink.mjs). Sizes are in container units of
   .h13-media (the section's box), so the picture never changes the layout (CLS 0).
     --e  ink right edge of everything in the text column (H1, subline, button, tiles)        [Kenneth]
     --eh ink right edge of H1, subline, button (tiles may lie over the group's bodies, not faces) [group]
     --f  fraction of the source width at which the subject starts (Kenneth's back 0.315; group: a gap between faces)
     --a  source aspect ratio (Kenneth: 2.275, the frame cropped at y 600 of 768 so Gemini's sparkle is not in the file;
          tools/hero-1311/crop.py) */

body.ac-h13:not(#h13) .ac-650 .h13-hero.h13-hero { background-image: none !important; background-color: #fff !important; position: relative; isolation: isolate; }
body.ac-h13:not(#h13) .ac-650 .h13-hero.h13-hero::before { display: none !important; }
.h13-media { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; container-type: size; }
.h13-media picture { display: contents; }
body:not(#h13) .h13-img.h13-img { position: absolute; display: block; max-width: none !important; min-width: 0; height: auto !important; aspect-ratio: auto; border-radius: 0 !important; box-shadow: none !important; }
.h13-shade { position: absolute; inset: 0; }

/* ---------- desktop and tablet (≥ 768 px): section 3f6406d ---------- */
@media (min-width: 768px) {
	.ac-650 .h13-hero.ac-element-3f6406d { --e: 410px; --eh: 306px; }
	/* Kenneth: K just right of the ink, or further right on wide screens so the picture is never drawn larger than
	   the hero's height needs (then it is 1.777 × the hero's height wide and ends on the right edge). */
	.h13-hero--kenneth.ac-element-3f6406d .h13-img {
		--a: 2.275; --f: .315;
		--k: max(calc(var(--e) + 56px), calc(100cqw - (1 - var(--f)) * 100cqh * var(--a)));
		--w: max(calc(100cqh * var(--a)), calc((100cqw - var(--k)) / (1 - var(--f))));
		width: var(--w) !important; left: calc(var(--k) - var(--f) * var(--w)); top: calc((100cqh - var(--w) / var(--a)) * .4);
	}
	/* the white text side: opaque under the ink, gone at Kenneth's back */
	.h13-hero--kenneth.ac-element-3f6406d .h13-shade {
		--a: 2.275; --f: .315;
		--k: max(calc(var(--e) + 56px), calc(100cqw - (1 - var(--f)) * 100cqh * var(--a)));
		background: linear-gradient(90deg, #fff calc(var(--e) + 8px), rgba(255, 255, 255, .9) calc(var(--e) + 8px + (var(--k) - var(--e) - 8px) * .35), rgba(255, 255, 255, 0) calc(var(--k) - 2px));
	}
	/* group: the picture starts at K with a hard edge; left of it the section's white. Where the whole cohort cannot be
	   shown, --f puts the crop line in a gap between two faces (source x: 9 %, 18 %, 46.3 %, 59 %). */
	.h13-hero--group.ac-element-3f6406d .h13-img {
		--a: 1.3333; --f: 0;
		--k: max(calc(var(--eh) + 18px), calc(100cqw - (1 - var(--f)) * 100cqh * var(--a)));
		--w: max(calc(100cqh * var(--a)), calc((100cqw - var(--k)) / (1 - var(--f))));
		width: var(--w) !important; left: calc(var(--k) - var(--f) * var(--w)); top: calc((100cqh - var(--w) / var(--a)) * .45);
		clip-path: inset(0 0 0 calc(var(--f) * var(--w)));
	}
	.h13-hero--group.ac-element-3f6406d .h13-img { --f: .59; }
}
@media (min-width: 816px) { .ac-650 .h13-hero.ac-element-3f6406d { --e: 448px; --eh: 448px; } }
@media (min-width: 920px) { .ac-650 .h13-hero.ac-element-3f6406d { --e: 511px; --eh: 511px; } }
@media (min-width: 978px) { .h13-hero--group.ac-element-3f6406d .h13-img { --f: .463; } }
@media (min-width: 1024px) { .ac-650 .h13-hero.ac-element-3f6406d { --e: 590px; --eh: 542px; } }
@media (min-width: 1239px) { .h13-hero--group.ac-element-3f6406d .h13-img { --f: .18; } }
@media (min-width: 1280px) { .ac-650 .h13-hero.ac-element-3f6406d { --e: 670px; --eh: 563px; } }
@media (min-width: 1333px) { .h13-hero--group.ac-element-3f6406d .h13-img { --f: .09; } }
@media (min-width: 1406px) { .h13-hero--group.ac-element-3f6406d .h13-img { --f: 0; } }
/* ≥ 1792 px the H1 runs on one line to x ≈ 1028 */
@media (min-width: 1792px) { .ac-650 .h13-hero.ac-element-3f6406d { --e: 1028px; --eh: 1028px; } .h13-hero--group.ac-element-3f6406d .h13-img { --f: .18; } }
@media (min-width: 1871px) { .h13-hero--group.ac-element-3f6406d .h13-img { --f: 0; } }

/* ---------- phones (< 768 px): section 55870eb, a photo band at the top, the text below it ----------
   The band has a hard lower edge: a fade into the navy would lie across Kenneth's body. */
@media (max-width: 767px) {
	body.ac-h13:not(#h13) .ac-650 .h13-hero.ac-element-55870eb { --band: clamp(240px, 76vw, 340px); --padding-top: calc(var(--band) + 24px); padding-top: calc(var(--band) + 24px) !important; --min-height: 0px; min-height: 0 !important; background-color: #031b29 !important; }
	body.ac-h13-group:not(#h13) .ac-650 .h13-hero.ac-element-55870eb { --band: clamp(200px, 62vw, 300px); }
	body.ac-h13:not(#h13) .ac-650 .h13-hero .ac-element-69f75ed { --min-height: 0px; min-height: 0 !important; height: auto !important; justify-content: flex-start !important; }
	body.ac-h13:not(#h13) .ac-650 .h13-hero .ac-element-b22a3c2 { margin-top: 0 !important; }
	.ac-element-55870eb > .h13-media { bottom: auto; height: var(--band); }
	body:not(#h13) .ac-element-55870eb .h13-img.h13-img { inset: 0; width: 100% !important; height: 100% !important; object-fit: cover; }
	/* Kenneth centred in the band (his body 31.5–50.5 % of the frame, face at 41 %, 62 %). The cropped frame (1365 × 600,
	   14 Nov: Gemini's watermark cut off) fills the band's height at 1.28 × the old scale, so no extra zoom. */
	body:not(#h13) .h13-hero--kenneth.ac-element-55870eb .h13-img.h13-img { object-position: 29% 50%; transform: none; }
	/* group: the whole cohort across the band, sky and lawn trimmed */
	body:not(#h13) .h13-hero--group.ac-element-55870eb .h13-img.h13-img { object-position: 50% 55%; }
}
