/*
 * EU communication band — compliance styling.
 * Do not add photography, gradients, radii, shadows, animation, campaign accent
 * colour or the campaign arc motif to anything in this file.
 */

/*
 * THE BAND'S GROUND IS PAPER, AND THAT CHANGE IS WHAT PAID FOR REMOVING THE
 * TWO WHITE SUB-PANELS. CHANGED 2026-09-16.
 *
 * It was `var(--eu-stone)`. Two official marks then sat on it, and on stone one
 * of them failed a measurement: the "Enjoy, it's from Europe!" orange #DF5D28
 * measures 2.88:1 against Avolio's stone #E4E5D8 — under the 3:1 a non-text
 * mark is held to — which is precisely why each mark had acquired a white
 * plate of its own.
 *
 * Reviewer comments AP 235083/15-9-2026 require those plates gone. Deleting
 * them and leaving the band on stone would have discharged the reviewer's
 * instruction by REINTRODUCING the contrast defect the plates were added to
 * fix, and the same letter requires the marks to be displayed correctly. So
 * the fix is applied to the GROUND instead of to the marks: with the whole
 * band on paper there is no container around anything — the reviewer's actual
 * objection is a box around a mark, and a uniform band has none — and every
 * mark measures better than it did.
 *
 * MEASURED 2026-09-16 against #FFFFFF, with the stone figures for comparison:
 *   Enjoy orange   #DF5D28   3.66:1  (was 2.88:1 — now passes 3:1)
 *   Reflex Blue    #003399  10.86:1  (was 8.53:1)
 * The disclaimer and the accompanying line are text and gain the same way.
 *
 * `@media print` below already forced this band white, so print and screen now
 * agree instead of differing.
 *
 * DO NOT PUT THE BAND BACK ON STONE WITHOUT RE-MEASURING THE SIGNATURE. It is
 * the binding term, not the emblem.
 */
.eu-funding {
	background-color: var(--eu-paper, #fff);
	color: var(--eu-ink, #333);
	padding-block: var(--wp--preset--spacing--48, 48px);
	padding-inline: var(--eu-gutter, 20px);
}

.eu-funding__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--wp--preset--spacing--32, 32px);
	max-width: var(--eu-container, 1280px);
	margin-inline: auto;
}

/*
 * THE SUB-PANEL'S WHITE FILL WAS REMOVED ON 2026-09-16. THE PADDING WAS NOT.
 *
 * Reviewer comments AP 235083/15-9-2026: "Απομάκρυνση άσπρου πλαισίου γύρω από
 * το έμβλημα της ΕΕ και τη δήλωση συγχρηματοδότησης καθώς και από το ειδικό
 * λογότυπο Enjoy" — remove the white frame around the EU emblem and the
 * co-funding statement, and around the Enjoy logo. This declaration was that
 * frame. It used to read `background-color: #fff` with the comment "Pure-white
 * sub-panel: makes the POS-on-off-white question moot at zero cost."
 *
 * WHAT WAS REMOVED IS THE DESIGN CONTAINER, AND NOTHING ELSE. Two things that
 * look like the same white are not, and only one of them was ours:
 *
 *  1. A WHITE BORDER IS INSIDE THE OFFICIAL FILE AND IS UNTOUCHED —
 *     BUT IT IS NOT THE 1/25 BORDER, AND THIS PARAGRAPH SAID IT WAS.
 *
 *     CORRECTED 2026-09-21. The paragraph read: "MEASURED ... the flag's blue
 *     (0,51,153) runs from x~70 to x~1245 and y~75 to y~850, with pure white
 *     in a band from x~45 and y~55 outward — about 30px against a rectangle
 *     height of ~815px, i.e. 1/25." Re-measured per pixel on the same file,
 *     assets/eu/EN_Co-fundedbytheEU_RGB_POS.png, scanning the flag's centre
 *     lines: fully transparent to x=40; OPAQUE #FFFFFFFF from x=42 to x=64;
 *     flag blue #003399 from x=66. Right edge white x=1248-1270, top y=42-63,
 *     bottom y=853-876. The painted flag is 1181x787 at +66+65.
 *
 *     So the ring is ~23px against a 787px flag: 1/34.2, NOT the 1/25
 *     (31.5px) that `The use of the EU emblem in the context of EU programmes
 *     2021-2027` p.5 specifies. The official VERTICAL lockup carries the same
 *     ring at 13px around its 733x489 flag.
 *
 *     THE CONCLUSION IS UNCHANGED AND THE REASONING MOVES ONE CLAUSE. The
 *     ring IS painted into the artwork and deleting a CSS background cannot
 *     reach it — that is measured and it is the operative point here. What
 *     may no longer be said is that the artwork satisfies p.5's border
 *     requirement, because at 1/34 it does not. p.5 is conditional — the
 *     border is required only "if there is no alternative to a coloured
 *     background" — and this band's ground is #fff, so the condition never
 *     triggers. The justification rests on the GROUND, not on a border the
 *     file does not carry. A provenance note that overstates its own artefact
 *     is the first thing an auditor tests.
 *
 *     The same correction applies to docs/reports/
 *     avolio-reviewer-remediation-20260916.md §4, which repeats the figures.
 *  2. THE PADDING IS CLEAR SPACE, NOT DECORATION, so it stays. Removing it
 *     would let the band's other content touch the emblem, which the same
 *     guidance forbids.
 *
 * AND THE CONTRAST QUESTION THE OLD COMMENT WAS ANSWERING IS STILL ANSWERED —
 * one level up, by the band itself, which is now paper rather than stone. See
 * the note on `.eu-funding` above. Reflex Blue measures 10.86:1 on the band's
 * new ground. Nothing needs a plate of its own.
 */
.eu-funding__emblem {
	margin: 0;
	padding: var(--wp--preset--spacing--16, 16px) var(--wp--preset--spacing--24, 24px);
	flex: 0 0 auto;
}

.eu-funding__emblem-img {
	display: block;
	/*
	 * OFFICIAL ARTWORK, UNCHANGED: the official RGB PNG. Never recoloured,
	 * never converted to vector, never redrawn, never CMYK. Its relationship
	 * to its original differs by file — the English lockups are lossless
	 * re-encodes with a provably identical raster, the translated ones are
	 * byte-identical copies — and assets/eu/SOURCES.tsv records which, with
	 * the checksums and the verification method. This comment used to assert
	 * "byte-identical" for whatever file rendered here, which stopped being
	 * true on 2026-09-09 and is corrected rather than repeated.
	 *
	 * SIZED BY THE FLAG, NOT BY THE CANVAS — CHANGED 2026-09-11, AND THE CHANGE
	 * IS THE POINT.
	 *
	 * "The minimum height of the EU emblem shall be 1cm" (Graphic Charter
	 * ENJOY_JUNE2023 p.6; eu-emblem-rules_en.pdf p.9, Minimum size). THE
	 * EMBLEM IS THE PAINTED FLAG: the lockup is the emblem plus the funding
	 * statement, and it is the statement that is translated. Measured on the
	 * official packages, every horizontal canvas is 919px tall and carries the
	 * identical 1181x788 flag, while canvas WIDTH runs 3800px (es) to 4895px
	 * (el). So flag height tracks canvas HEIGHT and is language-invariant;
	 * flag height over canvas WIDTH is not, and varies by 28.8%.
	 *
	 * The declaration below therefore names a FLAG height and divides it by
	 * this file's own measured ratio, supplied inline per render by
	 * render.php. A longer translated wordmark now widens the canvas and
	 * leaves the flag alone. Sized the old way — a flat canvas height — the
	 * Greek lockup published a flag 15.7% shorter than the English one at the
	 * same box, which is the defect this closes.
	 *
	 * THE ENGLISH RESULT IS UNCHANGED TO WITHIN 0.0001px, and deliberately so:
	 * 47.9565 / 0.856366 = 55.99994, 4.71 / 0.856366 = 5.50001,
	 * 65.0838 / 0.856366 = 75.99998 — the previous clamp(56px, 5.5vw, 76px),
	 * restated against the flag. Those previous values were themselves set
	 * above the 1cm floor on purpose, because the emblem must be at least the
	 * same size as the biggest other logo on the page (eu-emblem-rules_en.pdf
	 * p.4: "If other logos are displayed in addition to the EU emblem, the
	 * latter must be at least the same size") and the campaign lockup measures
	 * 55.1px tall at 390px and
	 * 68.9px at 1440px. That reasoning is untouched; only its unit is.
	 *
	 * NO min-height IS SET HERE, AND THAT IS NOT AN OVERSIGHT. With width:auto
	 * and max-width:100%, CSS 2.1 10.4 reduces the used HEIGHT when the width
	 * ceiling binds, which keeps the artwork proportional — a min-height would
	 * make the same rule clamp the height back up and scale official artwork
	 * NON-UNIFORMLY, which is forbidden outright. A site whose band is too
	 * narrow to hold 1cm of flag from the horizontal lockup must serve the
	 * official VERTICAL lockup instead, through the opt-in filter documented
	 * in render.php. It must not be squashed into fitting.
	 */
	--eu-emblem-flag-ratio: 0.856366; /* Fallback only: the English horizontal file. */
	height: calc(clamp(47.9565px, 4.71vw, 65.0838px) / var(--eu-emblem-flag-ratio));
	width: auto;
	max-width: 100%;
}

.eu-funding__statement {
	margin: 0;
	flex: 1 1 22rem;
	max-width: 46ch;
	/* >=17px, sentence case as written. No transform, no tracking, no italics. */
	font-size: clamp(1.0625rem, 1.1vw, 1.1875rem);
	line-height: 1.5;
	font-weight: 400;
	text-transform: none;
	letter-spacing: normal;
	font-style: normal;
}

/*
 * The two national dietary-guideline references. Structural elements of the
 * record, not small print: legible size, real links, never collapsed, never in
 * a dark section, and present on every route because the obligation attaches to
 * the material rather than to the page.
 *
 * Two columns at >=768px so both sentences read as one pair rather than as a
 * stacked afterthought. Each reserves two lines so a longer authority name
 * cannot reflow the band.
 */
.eu-funding__references {
	max-width: var(--eu-container, 1280px);
	margin: var(--wp--preset--spacing--32, 32px) auto 0;
	border-top: 1px solid var(--eu-hair-strong, rgba(51, 49, 51, 0.14));
	padding-top: var(--wp--preset--spacing--24, 24px);
	display: grid;
	gap: var(--wp--preset--spacing--16, 16px) var(--wp--preset--spacing--48, 48px);
}

@media (min-width: 768px) {
	.eu-funding__references {
		grid-template-columns: 1fr 1fr;
	}
}

/* Reset the inherited .eu-reference rule: the band supplies its own hairline. */
.eu-funding__reference {
	margin: 0;
	border-top: 0;
	padding-block-start: 0;
	max-width: 60ch;
	font-size: var(--wp--preset--font-size--small, 0.9375rem);
	line-height: 1.55;
	/* Two lines reserved so a longer authority name cannot cause a reflow. */
	min-height: calc(2 * 1.55em);
}

.eu-funding__legal {
	max-width: var(--eu-container, 1280px);
	margin: var(--wp--preset--spacing--32, 32px) auto 0;
	border-top: 1px solid color-mix(in srgb, var(--eu-ink, #333) 12%, transparent);
	padding-top: var(--wp--preset--spacing--24, 24px);
}

.eu-funding__disclaimer {
	margin: 0;
	max-width: 92ch;
	font-size: 0.9375rem; /* 15px, above the 14px floor */
	line-height: 1.55;
	/* Reserve 2-4 lines at every breakpoint so the layout never jumps. */
	min-height: calc(2 * 1.55em);
}

@media (min-width: 768px) {
	.eu-funding {
		padding-block: var(--wp--preset--spacing--64, 64px);
	}
}

/* Mandatory elements must survive print. */
@media print {
	.eu-funding {
		background: #fff !important;
		color: #000 !important;
		break-inside: avoid;
	}

	/*
	 * Canvas height on paper, not flag height, because print has no width
	 * ceiling to defeat. Every file this theme ships clears the 1cm flag
	 * minimum at this canvas height: the smallest ratio shipped is 0.516913,
	 * the EN/DE/FR/EL vertical files' 489px flag on their 946px canvas, giving
	 * 10.3mm of flag. (The Spanish vertical file is the OUTLIER IN THE OTHER
	 * DIRECTION at 0.530369 — a 922px canvas — so it is not the binding case.)
	 */
	.eu-funding__emblem-img {
		height: 20mm;
	}
}

/*
 * The signature on non-homepage routes. Fixed legible height: the 1/6 rule is
 * stated for the homepage header, and no supplied source states a size for
 * other pages, so it is neither shrunk nor inflated here.
 *
 * 139.7px of canvas renders 120px of artwork (510/438), matching the geometry
 * in inc/blocks/enjoy-signature/style.css. The official file is unchanged.
 *
 * ON A PURE-WHITE SUB-PANEL, and that is a MEASURED correction rather than a
 * styling preference.
 *
 * The signature's orange measures 3.32:1 against the page ground, which is why
 * the homepage seats it on --page. Against the band's stone ground it measures
 * only 2.82:1 — under the 3:1 a non-text mark is held to. On white it measures
 * 3.66:1.
 *
 * A brand or institutional logotype is arguably exempt from that threshold
 * altogether, but this is not the place to lean on an exemption: the emblem
 * already sits on a white sub-panel inside this band for exactly the same
 * reason — it makes a ground question moot at zero cost — and the correct move
 * is to treat the second official mark the same way. The ARTWORK IS UNCHANGED;
 * only its ground is. Nothing is recoloured, cropped or re-proportioned.
 *
 * The padding also supplies the clear space the Charter's proportional grid
 * requires around the artwork, measured from the artwork's own edges.
 */
/*
 * ITS WHITE FILL WAS REMOVED ON 2026-09-16, FOR THE REVIEWER'S INSTRUCTION;
 * THE PADDING IS CHARTER CLEAR SPACE AND STAYS.
 *
 * The long note above is kept because its MEASUREMENT is still the reason this
 * band is the colour it is — but read it as history, not as instruction: its
 * conclusion ("seat the second official mark on a white sub-panel too") has
 * been superseded. Reviewer comments AP 235083/15-9-2026 require no white
 * frame around the Enjoy logo, and the 2.82:1-on-stone problem the note
 * identifies is now solved by the BAND being paper rather than by a plate
 * under this one mark. Re-measured 2026-09-16 on the band's new ground: 3.66:1,
 * which is the same number the note credits to white, because it is white.
 */
.eu-funding__signature {
	flex: 0 0 auto;
	margin-inline-start: auto;
	line-height: 0;
	padding: var(--wp--preset--spacing--16, 16px) var(--wp--preset--spacing--24, 24px);
}

.eu-funding__signature .eu-signature__img {
	block-size: 139.7px;
	inline-size: auto;
	aspect-ratio: 348 / 510;
}

/* Editor-only: the block has nothing to edit, and says so. */
.eu-funding-placeholder {
	border: 1px dashed #949494;
	padding: 16px;
	background: #f6f7f7;
	color: #1e1e1e;
}

.eu-funding-placeholder__title {
	margin: 0 0 8px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-size: 12px;
}

.eu-funding-placeholder__text {
	margin: 0;
	font-size: 13px;
	max-width: 70ch;
}
