/*
 * EHS EU Funding page — matches ehsghealth.com/eu-funding/.
 * The page header and rich text styles come from pages.css.
 * Each SCF section is its own block; together they read as one text column.
 */

.ehs-eu-part {
	--ehs-eu-dark: #141618;
	--ehs-eu-blue: #003399;
	--ehs-eu-blue-light: #eef2fb;
	padding-top: 36px;
	background: #fff;
}

.ehs-eu-disclaimer {
	padding-top: 27px;
}

/* First section under the banner and the last one above the footer. */
.ehs-eu-part:first-child,
:not(.ehs-eu-part) + .ehs-eu-part {
	padding-top: 50px;
}

.ehs-eu-part:last-child {
	padding-bottom: 86px;
}

/* Vertical rhythm inside a section. */
.ehs-eu-stack > * + * {
	margin-top: 18px !important;
}

.ehs-eu-stack > .ehs-eu-logos + * {
	margin-top: 36px !important;
}

.ehs-eu-stack > .ehs-eu-ref + * {
	margin-top: 26px !important;
}

.ehs-eu-stack > .ehs-eu-contacts {
	margin-top: 10px !important;
}

/* ---------- Headings ---------- */

.ehs-eu-title,
.ehs-eu-heading {
	color: var(--ehs-eu-dark);
	font-family: inherit;
	font-weight: 600;
	letter-spacing: 0;
}

.ehs-eu-title {
	font-size: clamp(29px, 24px + 1.5vw, 35px);
	line-height: 1.12;
}

.ehs-eu-heading {
	font-size: clamp(25px, 22px + 0.9vw, 29px);
	line-height: 1.2;
}

/* ---------- Project overview ---------- */

/* Like the live page, the logos sit one gutter lower than the section top
   and take half the column, but never get smaller than two 273px boxes
   (iPad landscape). */
.ehs-eu-logos {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	align-items: start;
	gap: 36px;
	width: max(calc((100% - 36px) / 2), 582px);
	max-width: 100%;
	margin: 36px 0 0;
	padding: 0;
	list-style: none;
}

.ehs-eu-logos__item {
	margin: 0;
	border: 1px solid #eaeaea;
	background: #fff;
}

.ehs-eu-logos__link {
	display: block;
}

.ehs-eu-logos__img {
	display: block;
	width: 100%;
	height: auto;
}

.ehs-eu-ref {
	width: fit-content;
	max-width: 100%;
	padding: 5px 12px;
	border-radius: 4px;
	background: var(--ehs-eu-blue-light);
	color: var(--ehs-eu-blue);
	font-size: 0.8em;
	font-weight: 600;
	letter-spacing: 0.3px;
}

/* ---------- Expected results ---------- */

.ehs-eu-results .ehs-prose {
	--ehs-bullet: "\2022";
	--ehs-list-indent: 18px;
}

/* ---------- Project information ---------- */

.ehs-eu-table {
	width: 100%;
	max-width: 640px;
	margin-bottom: 0;
	border: 1px solid #eaeaea;
	border-collapse: collapse;
	color: var(--ehs-muted);
	font-size: 18px;
	line-height: 1.2;
}

.ehs-eu-table th,
.ehs-eu-table td {
	padding: 14px 18px;
	border: 0;
	border-bottom: 1px solid #eaeaea;
	text-align: left;
	vertical-align: top;
	transition: background-color 0.2s ease;
}

.ehs-eu-table th {
	width: 45%;
	background: #f6f8fb;
	color: var(--ehs-eu-blue);
	font-weight: 700;
	white-space: nowrap;
}

.ehs-eu-table td {
	font-weight: 600;
}

.ehs-eu-table tr:last-child th,
.ehs-eu-table tr:last-child td {
	border-bottom: 0;
}

/* ---------- Contact ---------- */

.ehs-eu-contacts {
	margin: 0;
	padding: 0 0 0 18px;
	list-style: none;
}

.ehs-eu-contacts__item {
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
	width: fit-content;
	max-width: 100%;
	margin: 0;
	padding: 8px 0;
}

.ehs-eu-contacts__icon {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: var(--ehs-eu-blue-light);
	color: var(--ehs-eu-blue);
	transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.ehs-eu-contacts__icon .ehs-svg {
	display: block;
	width: 20px;
	height: 20px;
}

.ehs-eu-contacts__text {
	min-width: 0;
	font-weight: 500;
	overflow-wrap: anywhere;
}

a.ehs-eu-contacts__text {
	color: var(--ehs-eu-dark);
	text-decoration: none;
}

/* The whole row (icon and text) is the tap target for phone and email. */
a.ehs-eu-contacts__text::after {
	content: "";
	position: absolute;
	inset: 0;
}

a.ehs-eu-contacts__text:focus-visible {
	text-decoration: underline;
}

/* ---------- Relevant programme ---------- */

.ehs-eu-programme__link {
	color: var(--ehs-eu-dark);
	text-decoration: none;
	transition: color 0.2s ease;
}

.ehs-eu-programme__link:hover {
	color: var(--ehs-teal);
	text-decoration: underline;
}

/* ---------- Disclaimer ---------- */

.ehs-eu-disclaimer__text {
	font-size: 0.85em;
	line-height: 1.65;
	opacity: 0.72;
}

/* Hover effects only for mouse users, so they don't stick after a tap. */
@media (hover: hover) {
	.ehs-eu-table tr:hover th,
	.ehs-eu-table tr:hover td {
		background: var(--ehs-eu-blue-light);
	}

	.ehs-eu-contacts__item:hover .ehs-eu-contacts__icon {
		background: var(--ehs-eu-blue);
		color: #fff;
		transform: translateY(-2px);
	}

	.ehs-eu-contacts__item:hover a.ehs-eu-contacts__text {
		text-decoration: underline;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ehs-eu-contacts__icon {
		transition: none;
	}

	.ehs-eu-contacts__item:hover .ehs-eu-contacts__icon {
		transform: none;
	}
}

/* ---------- iPad portrait ---------- */

@media (max-width: 959px) {
	.ehs-eu-part:last-child {
		padding-bottom: 72px;
	}

	/* Two logos per row across the full width, capped so the small
	   ministry PNG isn't blown up; they start right at the section top. */
	.ehs-eu-logos {
		grid-template-columns: repeat(2, minmax(0, 340px));
		width: 100%;
		margin-top: 0;
	}
}

/* ---------- Phones ---------- */

@media (max-width: 569px) {
	/* One logo per row, no wider than a phone screen's content. */
	.ehs-eu-logos {
		grid-template-columns: minmax(0, 300px);
		gap: 18px;
	}

	/* Contact rows line up with the headings. */
	.ehs-eu-contacts {
		padding-left: 0;
	}

	/* Labels wrap so the table fits the screen; the smaller size and wider
	   label column keep short labels such as "EU Co-financing" on one line. */
	.ehs-eu-table {
		font-size: 16px;
	}

	.ehs-eu-table th {
		width: 54%;
		white-space: normal;
	}

	.ehs-eu-table th,
	.ehs-eu-table td {
		padding: 12px;
	}
}
