/* Upful news homepage — BBC/Guardian-influenced editorial layout.
   Self-contained: no theme variables, no external fonts, no CDN requests. */

.uhp-wrap {
	--uhp-ink:      #14171a;
	--uhp-muted:    #5b6167;
	--uhp-rule:     #dcdfe3;
	--uhp-accent:   #0c6b3f;   /* positive-news green, stands in for BBC red */
	--uhp-bg:       #ffffff;
	--uhp-gap:      28px;

	max-width: 1180px;
	margin: 0 auto;
	padding: 0 20px 64px;
	color: var(--uhp-ink);
	background: var(--uhp-bg);
}

/* ---- section nav strip (BBC-style) ---- */
.uhp-sections {
	border-bottom: 3px solid var(--uhp-ink);
	margin-bottom: 28px;
}
.uhp-sections ul {
	list-style: none;
	margin: 0;
	padding: 0 0 10px;
	display: flex;
	flex-wrap: wrap;
	gap: 22px;
}
.uhp-sections a {
	font: 600 14px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	letter-spacing: .01em;
	color: var(--uhp-ink);
	text-decoration: none;
	white-space: nowrap;
}
.uhp-sections a:hover { color: var(--uhp-accent); text-decoration: underline; }

/* ---- shared card parts ---- */
.uhp-card { display: block; }
.uhp-media { display: block; overflow: hidden; background: #eef0f2; }
.uhp-media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	aspect-ratio: 16 / 9;
	transition: transform .35s ease;
}
.uhp-card:hover .uhp-media img { transform: scale(1.03); }

.uhp-kicker {
	display: inline-block;
	margin: 14px 0 6px;
	font: 700 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--uhp-accent);
	text-decoration: none;
}
.uhp-kicker:hover { text-decoration: underline; }

.uhp-headline {
	margin: 0;
	font-family: Georgia, "Times New Roman", "Liberation Serif", serif;  /* Guardian-ish */
	font-weight: 700;
	line-height: 1.16;
	letter-spacing: -0.005em;
}
.uhp-headline a { color: inherit; text-decoration: none; }
.uhp-headline a:hover { text-decoration: underline; text-underline-offset: 3px; }

.uhp-standfirst {
	margin: 10px 0 0;
	color: var(--uhp-muted);
	font: 400 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
.uhp-meta {
	margin: 10px 0 0;
	color: var(--uhp-muted);
	font: 400 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* ---- lead story ---- */
.uhp-top { padding-bottom: 30px; border-bottom: 1px solid var(--uhp-rule); }
.uhp-lead .uhp-headline { font-size: clamp(30px, 4.4vw, 50px); }
.uhp-lead .uhp-standfirst { font-size: clamp(17px, 1.5vw, 20px); }

@media (min-width: 900px) {
	.uhp-lead { display: grid; grid-template-columns: 1.35fr 1fr; gap: 34px; align-items: start; }
	.uhp-lead .uhp-kicker { margin-top: 0; }
}

/* ---- grids ---- */
.uhp-grid { display: grid; gap: var(--uhp-gap); padding: 30px 0; }
.uhp-grid-major { grid-template-columns: 1fr; }
.uhp-grid-minor { grid-template-columns: 1fr; padding-top: 18px; }

@media (min-width: 640px) {
	.uhp-grid-major { grid-template-columns: repeat(2, 1fr); }
	.uhp-grid-minor { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
	.uhp-grid-major { grid-template-columns: repeat(3, 1fr); }
	.uhp-grid-minor { grid-template-columns: repeat(4, 1fr); }
}

.uhp-major .uhp-headline { font-size: clamp(19px, 2vw, 23px); }
.uhp-minor .uhp-headline { font-size: 17px; }
.uhp-minor .uhp-media img { aspect-ratio: 3 / 2; }

/* column rules, Guardian-style, on wide screens only. Drawn as pseudo-elements
   in the gap so every card keeps the same width (padding-based rules made the
   first card in a row wider, so its image was taller than its neighbours').
   The grid clips the rule that would sit left of each row's first column. */
@media (min-width: 900px) {
	.uhp-grid-major, .uhp-grid-minor { overflow: hidden; }
	.uhp-grid-major > .uhp-card,
	.uhp-grid-minor > .uhp-card { position: relative; }
	.uhp-grid-major > .uhp-card::before,
	.uhp-grid-minor > .uhp-card::before {
		content: "";
		position: absolute;
		top: 0;
		bottom: 0;
		left: calc(var(--uhp-gap) / -2);
		border-left: 1px solid var(--uhp-rule);
	}
}

/* ---- "More good news" divider ---- */
.uhp-rule {
	margin: 12px 0 0;
	padding-top: 22px;
	border-top: 3px solid var(--uhp-ink);
	font: 700 20px/1.2 Georgia, "Times New Roman", serif;
}

.uhp-empty { padding: 60px 0; color: var(--uhp-muted); }

/* the theme's own page title / breadcrumb strip is redundant on this layout */
.home .page-title, .home .hero-section { display: none !important; }

@media (prefers-color-scheme: dark) {
	.uhp-wrap {
		--uhp-ink: #f2f4f6; --uhp-muted: #a8b0b8;
		--uhp-rule: #333a41; --uhp-accent: #4cc38a; --uhp-bg: transparent;
	}
	.uhp-media { background: #22272c; }
}

/* ======================================================================
   Fixed-height headlines in multi-column grids, so every card's image,
   standfirst and date line up across a row whatever the headline length.
   Three lines covers every headline so far (max ~76 chars); anything
   longer is cut with an ellipsis rather than pushing the row out of line.
   ====================================================================== */
@media (min-width: 640px) {
	.uhp-grid .uhp-headline {
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 3;
		line-clamp: 3;
		overflow: hidden;
		height: calc(1.16em * 3);
	}
	.uhp-grid .uhp-standfirst {
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 3;
		line-clamp: 3;
		overflow: hidden;
		height: calc(1.5em * 3);
	}
}

/* ======================================================================
   Section / search listings
   ====================================================================== */
.uha-head {
	padding: 26px 0 22px;
	margin-bottom: 26px;
	border-bottom: 1px solid var(--uhp-rule);
}
.uha-kicker {
	margin: 0 0 8px;
	font: 700 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--uhp-muted);
}
.uha-title {
	margin: 0;
	padding-top: 12px;
	border-top: 5px solid var(--pillar);
	display: inline-block;
	font-family: Georgia, "Times New Roman", "Liberation Serif", serif;
	font-weight: 700;
	font-size: clamp(34px, 5vw, 56px);
	line-height: 1.05;
	letter-spacing: -0.01em;
	color: var(--uhp-ink);
}
.uha-desc { margin-top: 12px; max-width: 680px; color: var(--uhp-muted); font: 400 17px/1.5 Georgia, serif; }
.uha-desc p { margin: 0; }

.uha .uhp-kicker { color: var(--uhp-accent); }

.uha-pages { padding: 26px 0 0; border-top: 1px solid var(--uhp-rule); }
.uha-pages ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.uha-pages a, .uha-pages span {
	display: inline-block;
	min-width: 40px;
	padding: 10px 14px;
	border: 1px solid var(--uhp-rule);
	border-radius: 999px;
	text-align: center;
	font: 600 14px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	color: var(--uhp-ink);
	text-decoration: none;
}
.uha-pages a:hover { border-color: var(--uhp-ink); }
.uha-pages .current { background: var(--uhp-ink); border-color: var(--uhp-ink); color: var(--uhp-bg); }

/* ======================================================================
   Article pages
   ====================================================================== */
.uar-article { max-width: 860px; margin: 0 auto; padding-top: 30px; }

.uar-head { padding-bottom: 20px; }
.uar-kicker {
	display: inline-block;
	padding-top: 8px;
	border-top: 4px solid var(--pillar);
	margin-bottom: 14px;
	font: 700 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--uhp-accent);
	text-decoration: none;
}
.uar-kicker:hover { text-decoration: underline; }
.uar-title {
	margin: 0;
	font-family: Georgia, "Times New Roman", "Liberation Serif", serif;
	font-weight: 700;
	font-size: clamp(32px, 4.6vw, 52px);
	line-height: 1.1;
	letter-spacing: -0.01em;
	color: var(--uhp-ink);
}
.uar-standfirst {
	margin: 16px 0 0;
	font: 400 clamp(19px, 2vw, 22px)/1.4 Georgia, "Times New Roman", serif;
	color: var(--uhp-muted);
}
.uar-dateline {
	margin: 18px 0 0;
	padding-top: 12px;
	border-top: 1px solid var(--uhp-rule);
	font: 400 14px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	color: var(--uhp-muted);
}

.uar-figure { margin: 0 0 28px; }
.uar-figure img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: #eef0f2; }
.uar-figure figcaption {
	margin-top: 8px;
	font: 400 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	color: var(--uhp-muted);
}

.uar-body {
	max-width: 680px;
	font: 400 19px/1.6 Georgia, "Times New Roman", "Liberation Serif", serif;
	color: var(--uhp-ink);
}
.uar-body > * { margin: 0 0 1.1em; }
.uar-body > p:first-child::first-letter {
	float: left;
	font-size: 3.4em;
	line-height: .85;
	padding: .06em .08em 0 0;
	font-weight: 700;
	color: var(--pillar);
}
.uar-body h2, .uar-body h3 { font-family: Georgia, serif; font-weight: 700; line-height: 1.2; margin-top: 1.6em; }
.uar-body a { color: var(--uhp-accent); text-underline-offset: 3px; }
.uar-body blockquote {
	margin: 1.4em 0;
	padding-left: 18px;
	border-left: 4px solid var(--pillar);
	font-style: italic;
	color: var(--uhp-ink);
}
.uar-body img { max-width: 100%; height: auto; }
.uar-body .upful-source {
	margin-top: 1.8em;
	padding-top: 14px;
	border-top: 1px solid var(--uhp-rule);
	font: 400 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	color: var(--uhp-muted);
}

.uar-more { margin-top: 48px; }

@media (prefers-color-scheme: dark) {
	.uar-figure img { background: #22272c; }
}

/* ---- share bar (end of article) ---- */
.uar-share {
	max-width: 680px;
	margin: 36px 0 0;
	padding: 18px 0;
	border-top: 3px solid var(--uhp-ink);
	border-bottom: 1px solid var(--uhp-rule);
}
.uar-share-label {
	margin: 0 0 12px;
	font: 700 18px/1.2 Georgia, "Times New Roman", serif;
	color: var(--uhp-ink);
}
.uar-share ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.uar-share-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 44px;
	height: 44px;
	padding: 0 12px;
	border: 1px solid var(--uhp-rule);
	border-radius: 999px;
	background: transparent;
	color: var(--uhp-ink);
	font: 600 15px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.uar-share-btn:hover, .uar-share-btn:focus-visible { color: #fff; border-color: transparent; background: var(--uhp-ink); }
.uar-share-btn.is-whatsapp:hover { background: #1f9e54; }
.uar-share-btn.is-facebook:hover { background: #1877f2; }
.uar-share-btn.is-x:hover        { background: #000; }
.uar-share-btn.is-bluesky:hover  { background: #0a7aff; }
.uar-share-btn.is-linkedin:hover { background: #0a66c2; }
.uar-share-native .uar-share-btn { background: var(--uhp-accent); border-color: var(--uhp-accent); color: #fff; padding: 0 16px; }
.uar-share-status { margin: 10px 0 0; min-height: 1em; font: 600 14px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; color: var(--uhp-accent); }

/* ---- story-format label ("Explained", "In numbers" …) ---- */
.uhp-label { color: var(--pillar, var(--uhp-accent)); }
.uhp-label::after { content: " / "; color: var(--uhp-muted); font-weight: 400; }

/* ---- byline ---- */
.uar-dateline span[aria-hidden] { margin: 0 6px; }
.uar-byline a { color: var(--uhp-ink); font-weight: 600; text-decoration: none; }
.uar-byline a:hover { text-decoration: underline; }

/* ---- Most read ---- */
.uhp-mostread { margin: 34px 0 10px; }
.uhp-mostread ol {
	counter-reset: mr;
	list-style: none;
	margin: 18px 0 0;
	padding: 0;
	display: grid;
	gap: 0 var(--uhp-gap);
	grid-template-columns: 1fr;
}
.uhp-mostread li {
	counter-increment: mr;
	display: grid;
	grid-template-columns: 52px 1fr;
	align-items: start;
	padding: 14px 0;
	border-top: 1px solid var(--uhp-rule);
}
.uhp-mostread li::before {
	content: counter(mr);
	font: 700 44px/0.9 Georgia, "Times New Roman", serif;
	color: var(--uhp-accent);
}
.uhp-mostread a {
	font: 700 17px/1.25 Georgia, "Times New Roman", serif;
	color: var(--uhp-ink);
	text-decoration: none;
}
.uhp-mostread a:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 900px) {
	.uhp-mostread ol { grid-template-columns: repeat(5, 1fr); }
	.uhp-mostread li { grid-template-columns: 1fr; gap: 8px; }
}

/* ---- section bands on the homepage ---- */
.uhp-band { margin-top: 34px; }
.uhp-band-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	padding-top: 12px;
	border-top: 5px solid var(--pillar);
}
.uhp-band-head h2 { margin: 0; font: 700 26px/1.1 Georgia, "Times New Roman", serif; }
.uhp-band-head h2 a { color: var(--uhp-ink); text-decoration: none; }
.uhp-band-more {
	font: 600 14px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	color: var(--uhp-ink);
	text-decoration: none;
	white-space: nowrap;
}
.uhp-band-more:hover, .uhp-band-head h2 a:hover { text-decoration: underline; }
.uhp-band .uhp-grid { padding-top: 18px; }

/* ---- static pages and 404 ---- */
.upg .uar-body h2 { font-size: 26px; }
.upg .uar-body ul, .upg .uar-body ol { padding-left: 1.2em; }
.upg .uar-body li { margin-bottom: .4em; }
.upg .uar-body > p:first-child::first-letter { float: none; font-size: inherit; padding: 0; color: inherit; font-weight: inherit; line-height: inherit; }
.u404-search { display: flex; gap: 8px; max-width: 520px; margin: 10px 0 20px; }
.u404-search input { flex: 1; height: 46px; padding: 0 14px; border: 1px solid var(--uhp-rule); border-radius: 4px; font: 400 16px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; background: var(--uhp-bg); color: var(--uhp-ink); }
.u404-search button { height: 46px; padding: 0 20px; border: 0; border-radius: 4px; background: #12402F; color: #F6F1E4; font: 700 15px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; cursor: pointer; }

/* ---- dark mode, site-wide ---- */
@media (prefers-color-scheme: dark) {
	html, body, #main-container, .site-main { background: #0f1412 !important; }
	.uhp-wrap { --uhp-bg: #0f1412; }
	.uar-body a, .uhp-kicker, .uar-kicker, .uha .uhp-kicker { color: #7fd1a6; }
	.uar-share-btn { color: var(--uhp-ink); }
	.uar-share-btn:hover, .uar-share-btn:focus-visible { color: #fff; }
	.uar-share-native .uar-share-btn { background: #2e7d57; border-color: #2e7d57; }
	.uha-pages .current { color: #0f1412; }
	.u404-search input { background: #1a211e; }
}

/* Headings take our ink colour, not the theme's heading colour (which stays
   dark navy in dark mode and made homepage headlines unreadable). */
.uhp-wrap h1, .uhp-wrap h2, .uhp-wrap h3, .uhp-wrap h4 { color: var(--uhp-ink); }
