/**
 * Europe Pulse News Hub — module styles.
 *
 * Design tokens are declared as custom properties scoped to .ep-hub so the
 * module inherits the site's system when one exists, and still looks correct
 * standalone. Override any token from the theme without touching this file:
 *
 *     .ep-hub { --ep-accent: #1b4965; --ep-font-sans: "Inter", sans-serif; }
 *
 * No layout-shifting elements, no web fonts, no JavaScript. The module is
 * additive: removing it from a page changes nothing else.
 */

.ep-hub {
	/* Typography */
	--ep-font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--ep-font-serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
	--ep-text-xs: 0.75rem;
	--ep-text-sm: 0.8125rem;
	--ep-text-base: 0.9375rem;
	--ep-text-lg: 1.0625rem;
	--ep-text-xl: 1.375rem;
	--ep-leading: 1.55;

	/* Spacing scale */
	--ep-space-1: 0.25rem;
	--ep-space-2: 0.5rem;
	--ep-space-3: 0.75rem;
	--ep-space-4: 1rem;
	--ep-space-5: 1.5rem;
	--ep-space-6: 2rem;

	/* Colour — calm, low-chroma, high-contrast */
	--ep-ink: #14181d;
	--ep-ink-soft: #4a5461;
	--ep-ink-faint: #6b7684;
	--ep-rule: #e0e4e9;
	--ep-surface: #ffffff;
	--ep-surface-alt: #f6f7f9;
	--ep-accent: #1b4965;
	--ep-alert: #8a2b21;
	--ep-alert-surface: #fdf6f5;

	--ep-radius: 4px;
	--ep-focus: 2px solid var(--ep-accent);

	font-family: var(--ep-font-sans);
	color: var(--ep-ink);
	font-size: var(--ep-text-base);
	line-height: var(--ep-leading);
	margin: 0 0 var(--ep-space-6);
}

@media (prefers-color-scheme: dark) {
	.ep-hub {
		--ep-ink: #eef1f4;
		--ep-ink-soft: #b3bcc6;
		--ep-ink-faint: #8e99a5;
		--ep-rule: #2b3138;
		--ep-surface: #14181d;
		--ep-surface-alt: #1b2026;
		--ep-accent: #8fc0dd;
		--ep-alert: #e79a90;
		--ep-alert-surface: #221a19;
	}
}

/* ---------------------------------------------------------------- header */

.ep-hub__header {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--ep-space-2);
	padding-bottom: var(--ep-space-2);
	margin-bottom: var(--ep-space-4);
	border-bottom: 1px solid var(--ep-rule);
}

.ep-hub__heading {
	margin: 0;
	font-size: var(--ep-text-xl);
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 1.2;
	color: var(--ep-ink);
}

.ep-hub__updated {
	margin: 0;
	font-size: var(--ep-text-xs);
	color: var(--ep-ink-faint);
	font-variant-numeric: tabular-nums;
}

.ep-hub__note {
	margin: var(--ep-space-4) 0 0;
	font-size: var(--ep-text-xs);
	color: var(--ep-ink-faint);
	max-width: 62ch;
}

/* ------------------------------------------------------------ Europe Now */

.ep-hub--now .ep-hub__heading::before {
	content: "";
	display: inline-block;
	width: 0.5em;
	height: 0.5em;
	margin-right: 0.5em;
	border-radius: 50%;
	background: var(--ep-alert);
	vertical-align: middle;
}

.ep-hub__alerts {
	display: grid;
	gap: var(--ep-space-3);
}

.ep-hub__alert {
	padding: var(--ep-space-4);
	background: var(--ep-alert-surface);
	border-left: 3px solid var(--ep-alert);
	border-radius: 0 var(--ep-radius) var(--ep-radius) 0;
}

.ep-hub__alert-title {
	margin: 0 0 var(--ep-space-2);
	font-size: var(--ep-text-lg);
	font-weight: 600;
	line-height: 1.3;
}

.ep-hub__alert-summary,
.ep-hub__story-summary {
	margin: 0 0 var(--ep-space-3);
	color: var(--ep-ink-soft);
	max-width: 68ch;
}

/* ----------------------------------------------------------- Top stories */

.ep-hub__stories {
	display: grid;
	gap: var(--ep-space-5);
}

@media (min-width: 48rem) {
	.ep-hub__stories {
		grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
	}
}

.ep-hub__story {
	padding-top: var(--ep-space-3);
	border-top: 1px solid var(--ep-rule);
}

.ep-hub__story-title {
	margin: 0 0 var(--ep-space-2);
	font-family: var(--ep-font-serif);
	font-size: var(--ep-text-lg);
	font-weight: 600;
	line-height: 1.3;
}

/* ---------------------------------------------------------------- radar */

.ep-hub__radar {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0;
}

.ep-hub__radar-item {
	padding: var(--ep-space-3) 0;
	border-bottom: 1px solid var(--ep-rule);
}

.ep-hub__radar-item:last-child {
	border-bottom: 0;
}

.ep-hub__radar-item--analysis {
	padding-left: var(--ep-space-3);
	border-left: 2px solid var(--ep-rule);
	background: var(--ep-surface-alt);
}

.ep-hub__radar-link {
	display: block;
	color: var(--ep-ink);
	text-decoration: none;
	font-size: var(--ep-text-base);
	font-weight: 500;
	line-height: 1.35;
	text-wrap: pretty;
}

.ep-hub__radar-link:hover,
.ep-hub__radar-link:focus-visible {
	color: var(--ep-accent);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.ep-hub__radar-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--ep-space-2);
	margin: var(--ep-space-1) 0 0;
	font-size: var(--ep-text-xs);
	color: var(--ep-ink-faint);
}

.ep-hub__publisher {
	font-weight: 600;
	color: var(--ep-ink-soft);
}

.ep-hub__radar-meta .ep-hub__time {
	font-variant-numeric: tabular-nums;
}

.ep-hub__tag {
	display: inline-block;
	padding: 0.05em 0.5em;
	font-size: var(--ep-text-xs);
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	border: 1px solid var(--ep-rule);
	border-radius: 2px;
	color: var(--ep-ink-faint);
}

/* -------------------------------------------------------------- sources */

.ep-hub__sources {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: var(--ep-space-2);
	margin: 0;
	padding: 0;
	font-size: var(--ep-text-xs);
}

.ep-hub__sources-label {
	color: var(--ep-ink-faint);
	font-weight: 600;
}

.ep-hub__source a {
	color: var(--ep-accent);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.ep-hub__source a:hover,
.ep-hub__source a:focus-visible {
	text-decoration-thickness: 2px;
}

/* An unobtrusive outbound-link marker, so readers know they are leaving. */
.ep-hub__external::after {
	content: " \2197";
	font-size: 0.9em;
	line-height: 1;
}

/* --------------------------------------------------------- accessibility */

.ep-hub a:focus-visible {
	outline: var(--ep-focus);
	outline-offset: 2px;
	border-radius: 2px;
}

/* Provide .screen-reader-text if the theme does not (some block themes omit it). */
.ep-hub .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: reduce) {
	.ep-hub * {
		transition: none !important;
		animation: none !important;
	}
}
