/* Roadmap (roadmap.html). Linked only by these pages (i18n-util.mjs renderNgHeadAssets). Owner: the roadmap unit.
   One wall-newspaper issue on one taped sheet: slogan plate + poster headline, the five versions as a chain
   with stamps and arrows, then a band of brief | DLC 1988 | DLC 1991 | stop-the-press. The markup the
   generators read stays as it was: li.rm-item.rm-{done|planned}, <b> version, h2.rm-head, first <p>.
   Done and planned differ by stamp text, by paper (a pasted clipping) against a pencil draft (dashed outline),
   never by colour alone. Laid out by container queries on .rm-sheet. */

/* The two DLC posters are pictures, not site chrome: their inks are the posters' own and stay the same in
   both themes. Source: the DLC 1988 / 1991 poster drawings of the roadmap issue (mock roadmap_gazeta_3,
   commit 89340e2). */
.rm {
	--rm-dlc-red: #B5121B;        /* poster print red (both posters) */
	--rm-dlc-red-2: #9C0F17;      /* 1988: the shaded half of the red */
	--rm-dlc-red-3: #8A0C14;      /* 1988: the stripes over the shaded half */
	--rm-dlc-black: #1B1813;      /* poster black ink (1991 ground, 1988 linework) */
	--rm-dlc-cream: #ECE2C8;      /* poster cream: globe, rays, lettering */
}

/* ─── The sheet: a wrapper with tape and contact shadow, the paper inside ─── */

main.ng-page.rm {
	padding: 0;
	background: none;
	box-shadow: none;
}

main.ng-page.rm::before,
main.ng-page.rm::after {
	content: none;
}

.rm-sheet {
	container-type: inline-size;
	padding: var(--s6) var(--s6) var(--s7);
	font-family: var(--f-read);
}

.rm-defs {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
}

/* Read by screen readers and crawlers, not drawn: the poster headings say
   "DLC 1988" while the eye reads the badge and the year separately. */
.rm-vh {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Poster headlines: the condensed face in capitals (the skill's one place for them besides stamps). */
.rm-head {
	margin: 0;
	font-family: var(--f-disp);
	font-weight: 700;
	line-height: 1.05;
	text-transform: uppercase; /* gate-allow: caps poster headlines of the newspaper issue (SKILL Type: capitals for poster headlines and stamps) */
	hyphens: auto;
	overflow-wrap: break-word;
}

/* Hand-ruled: a double rule under the masthead, a single heavy one above the band. */
.rm-rule {
	height: 0;
	margin: var(--s5) 0;
	border-top: 7px double var(--ink);
}

.rm-line + .rm-rule {
	border-top: 3px solid var(--dim);
}

/* ─── Masthead ─── */

.rm-mast {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	gap: var(--s6);
	align-items: center;
}

/* The slogan: a printed plate glued on, framed twice. */
.rm-slogan {
	justify-self: start;
	margin: var(--s2);
	padding: var(--s3) var(--s4);
	background: var(--ink);
	color: var(--panel);
	box-shadow: 0 0 0 3px var(--panel), 0 0 0 6px var(--ink), 5px 7px 1px 6px var(--shadow);
	transform: rotate(-1.5deg);
}

.rm-slogan p {
	margin: 0;
	font: 600 var(--t3)/1.15 var(--f-disp);
	white-space: nowrap;
}

.rm-slogan .l1 {
	display: flex;
	align-items: center;
	gap: .5em;
}

.rm-slogan .l1 svg {
	flex: none;
	width: auto;
	height: 1.2em;
}

.rm-slogan .l3 {
	font-weight: 700;
	text-decoration: underline 3px;
	text-underline-offset: 5px;
}

.rm-masthead-title {
	text-align: center;
}

.rm-issue {
	margin: 0;
	color: var(--dim);
	font: italic 400 var(--t2)/1.3 var(--f-read);
}

.rm-mast h1.rm-head {
	margin: var(--s2) 0;
	color: var(--accent); /* gate-allow: accent-spread the one headline per view in print red (visual-voice accent role) */
	font-size: var(--t-c4);
	line-height: .95;
	text-wrap: balance;
}

.rm-game {
	margin: 0;
	font: 500 var(--t3)/1.2 var(--f-disp);
}

/* ─── The five versions: a zigzag chain joined by arrows ─── */
/* Unequal columns: the released version (the lead item) is the widest. */

.rm-line {
	display: grid;
	grid-template-columns: minmax(0, 5.8fr) minmax(0, 5fr) minmax(0, 4.6fr) minmax(0, 5.6fr) minmax(0, 4.4fr);
	column-gap: var(--s6);
	align-items: start;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rm-item {
	position: relative;
	margin: 0;
	padding: 0;
}

.rm-item.rm-low {
	padding-top: var(--s8);
}

.rm-item.rm-high {
	padding-bottom: var(--s8);
}

/* Planned: a pencil draft. Done: a clipping pasted on, second paper, lifted. */
.rm-card {
	padding: var(--s3);
	border: 2px dashed var(--dim);
}

.rm-done .rm-card {
	border: 0;
	background-color: var(--panel-2);
	background-image: var(--grain);
	box-shadow: 4px 6px 1px var(--shadow);
	transform: rotate(-1deg);
}

.rm-ver {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--s1) var(--s2);
}

/* The version number: the console face on its grid, on an inverse plate. */
.rm-ver b {
	padding: var(--s1) var(--s2);
	background: var(--ink);
	color: var(--panel);
	font: 400 var(--t1)/1.25 var(--f-con);
	font-variant-numeric: tabular-nums;
}

.rm-ver span {
	color: var(--dim);
	font: italic 400 var(--t1)/1.2 var(--f-read);
}

/* the released version (the lead) gets the bigger heading; a long planned title (DE «Mehrspielermodus»)
   must fit its column unbroken */
.rm-item h2.rm-head {
	margin: var(--s3) 0 var(--s2);
	font-size: var(--t2);
	line-height: 1.1;
}

.rm-done h2.rm-head {
	font-size: var(--t3);
}

.rm-thin {
	width: var(--s6);
	height: 3px;
	margin-bottom: var(--s2);
	background: var(--ink);
}

.rm-item p {
	margin: 0;
	font: 400 var(--t1)/1.5 var(--f-read);
}

/* Arrow from each version to the next, centred in the column gap. */
.rm-item:not(:last-child)::after {
	content: "";
	position: absolute;
	top: calc(var(--s8) + var(--s3));
	right: calc(var(--s6) / -2 - var(--s3));
	width: var(--s5);
	height: var(--s5);
	background: var(--ink);
	clip-path: polygon(0 38%, 55% 38%, 55% 0, 100% 50%, 55% 100%, 55% 62%, 0 62%);
}

/* ─── Stamps (ng-stamp gives the face, the caps and the accent; planned is pencilled, dashed) ─── */

.rm-stamp {
	font-weight: 600;
	white-space: nowrap;
	filter: url(#rm-grunge);
	mix-blend-mode: multiply;
}

html[data-theme="dark"] .rm-stamp {
	mix-blend-mode: normal;
}

.rm-stamp.st-planned {
	border: 3px dashed var(--dim);
	color: var(--dim);
}

.rm-item > .rm-stamp {
	position: absolute;
	left: 50%;
}

.rm-low > .rm-stamp {
	top: var(--s4);
}

.rm-high > .rm-stamp {
	bottom: var(--s4);
}

.rm-item:nth-child(1) > .rm-stamp {
	transform: translateX(-50%) rotate(-6deg);
}

.rm-item:nth-child(2) > .rm-stamp {
	transform: translateX(-50%) rotate(5deg);
}

.rm-item:nth-child(3) > .rm-stamp {
	transform: translateX(-50%) rotate(-4deg);
}

.rm-item:nth-child(4) > .rm-stamp {
	transform: translateX(-50%) rotate(6deg);
}

.rm-item:nth-child(5) > .rm-stamp {
	transform: translateX(-50%) rotate(-5deg);
}

/* ─── Bottom band: brief | two DLC posters | stop-the-press, hand-ruled columns ─── */

.rm-band {
	display: grid;
	grid-template-columns: minmax(0, 312fr) 2px minmax(0, 330fr) 2px minmax(0, 380fr) 2px minmax(0, 710fr);
	column-gap: var(--s5);
	align-items: stretch;
}

.rm-band > div {
	position: relative;
	min-width: 0;
}

.rm-vrule {
	background: var(--dim);
}

.rm-brief h2.rm-head {
	font-size: var(--t5);
}

.rm-brief .rm-kick {
	margin: var(--s3) 0 var(--s4);
}

.rm-brief ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.rm-brief li {
	margin-bottom: var(--s3);
	font: 400 var(--t1)/1.45 var(--f-read);
}

.rm-brief li b {
	font-family: var(--f-disp);
	font-weight: 700;
}

/* The posters: pasted prints, each at its own small tilt, hard shadow. */
.rm-poster {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-height: calc(var(--s8) * 4);
	padding: var(--s4);
	overflow: hidden;
	color: var(--rm-dlc-cream);
	isolation: isolate;
	box-shadow: 5px 7px 1px var(--shadow);
}

.rm-p88 {
	transform: rotate(-1.2deg);
}

.rm-p91 {
	transform: rotate(.8deg);
}

.rm-poster > svg {
	position: absolute;
	inset: 0;
	z-index: -1;
	width: 100%;
	height: 100%;
}

.rm-poster .pr-f { fill: var(--rm-dlc-red); }
.rm-poster .pr2-f { fill: var(--rm-dlc-red-2); }
.rm-poster .pr3-f { fill: var(--rm-dlc-red-3); }
.rm-poster .pk-f { fill: var(--rm-dlc-black); }
.rm-poster .pc-f { fill: var(--rm-dlc-cream); }
.rm-poster .pk-s { stroke: var(--rm-dlc-black); }
.rm-poster .pc-s { stroke: var(--rm-dlc-cream); }

.rm-poster .rm-dlc {
	align-self: flex-start;
	padding: var(--s1) var(--s2);
	font: 700 var(--t1)/1.2 var(--f-disp);
}

.rm-p88 .rm-dlc {
	background: var(--rm-dlc-black);
}

.rm-p91 .rm-dlc {
	background: var(--rm-dlc-red);
}

.rm-poster h2.rm-head {
	margin-top: auto;
	font-size: var(--t-c4);
	line-height: .9;
}

.rm-p88 h2.rm-head {
	text-shadow: 3px 3px 0 var(--rm-dlc-black);
}

.rm-p91 h2.rm-head {
	text-shadow: 3px 3px 0 var(--rm-dlc-red);
}

.rm-poster p {
	margin: var(--s2) 0 0;
	font: 600 var(--t1)/1.25 var(--f-disp);
}

/* Stop the press: an inverse bar, a headline, the teaser pasted as a print. */
.rm-proj .rm-kickbar {
	display: inline-block;
	padding: var(--s1) var(--s2);
	background: var(--ink);
	color: var(--panel);
	font: 600 var(--t1)/1.3 var(--f-disp);
}

.rm-proj h2.rm-head {
	max-width: 70%;
	margin: var(--s3) 0;
	font-size: var(--t4);
}

.rm-photo {
	margin: 0;
}

.rm-photo img {
	display: block;
	width: 100%;
	height: auto;
	padding: var(--s1);
	background: var(--panel-2);
	box-shadow: 4px 5px 1px var(--shadow);
	transform: rotate(.6deg);
}

.rm-photo figcaption {
	margin-top: var(--s3);
	color: var(--dim);
	font: italic 400 var(--t1)/1.35 var(--f-read);
}

.rm-proj p {
	margin: var(--s3) 0 0;
	font: 400 var(--t1)/1.45 var(--f-read);
}

/* stamped across the bottom of the item, under the last line */
.rm-proj {
	padding-bottom: var(--s7);
}

.rm-proj .rm-stamp {
	position: absolute;
	right: var(--s3);
	bottom: var(--s2);
	transform: rotate(-8deg);
}

.rm-price {
	margin: var(--s4) 0 0;
	color: var(--dim);
	font: 400 var(--t1)/1.3 var(--f-read);
	text-align: right;
}

/* ─── Narrow sheet: one column; the chain runs top to bottom as a zigzag ─── */
@container (max-width: 820px) {
	.rm-sheet {
		padding: var(--s5) var(--s4) var(--s6);
	}

	.rm-mast {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--s5);
	}

	.rm-slogan {
		justify-self: center;
	}

	.rm-slogan p {
		font-size: var(--t2);
		white-space: normal;
	}

	/* the loud element stays loud on the phone (--t6 drops to 2rem there): 4rem, capped by the sheet width */
	.rm-mast h1.rm-head {
		font-size: min(var(--t-c4), 16cqi); /* gate-allow: type-scale the poster headline is sized to the narrow sheet so its longest word fits unbroken */
	}
}

/* Below the full sheet width the five columns get too narrow for a version plate and a long title:
   the chain runs top to bottom, cards alternating left and right; the band goes two-up. */
@container (max-width: 1120px) {
	.rm-line {
		grid-template-columns: minmax(0, 1fr);
		row-gap: var(--s7);
	}

	.rm-item {
		width: min(calc(100% - var(--s5)), 36rem);
	}

	.rm-item:nth-child(even) {
		justify-self: end;
	}

	.rm-item.rm-low,
	.rm-item.rm-high {
		padding: 0;
	}

	.rm-item h2.rm-head {
		font-size: var(--t3);
	}

	.rm-item > .rm-stamp {
		position: static;
		margin: 0 0 var(--s3) var(--s1);
		transform: rotate(-3deg);
	}

	.rm-item:nth-child(n) > .rm-stamp {
		transform: rotate(-3deg);
	}

	.rm-item:nth-child(even) > .rm-stamp {
		transform: rotate(3deg);
	}

	.rm-item:not(:last-child)::after {
		top: calc(100% + var(--s3));
		right: auto;
		left: calc(50% - var(--s2));
		width: var(--s4);
		height: var(--s5);
		clip-path: polygon(30% 0, 70% 0, 70% 50%, 100% 50%, 50% 100%, 0 50%, 30% 50%);
	}

	.rm-band {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: var(--s5);
	}

	.rm-vrule {
		display: none;
	}

	.rm-brief,
	.rm-proj {
		grid-column: 1 / -1;
	}

	.rm-poster {
		min-height: calc(var(--s8) * 3);
	}

	.rm-proj {
		padding-bottom: 0;
	}

	.rm-proj h2.rm-head {
		max-width: none;
	}

	.rm-proj .rm-stamp {
		position: static;
		margin: var(--s4) 0 var(--s1) var(--s2);
	}
}

/* Below phone width the posters stand one above the other. */
@container (max-width: 440px) {
	.rm-band {
		grid-template-columns: minmax(0, 1fr);
	}
}
