/* ==========================================================================
   Entry content — article/page body typography and block styles.
   Body 18px on phones to 19px, leading 1.85 (Nepali); --article-scale is set by the A−/A+ control and
   multiplies every size here. --article-h2 / --article-quote come from single.css (.single-layout);
   pages that do not define them fall back to the section-title size.
   ========================================================================== */

.entry-content {
	color: var(--text);
	font-size: calc(var(--fs-body) * var(--article-scale, 1));
	line-height: var(--lh-body);
	overflow-wrap: break-word;
}

.entry-content > * + * { margin-top: 1.1em; }

.entry-content h2,
.entry-content h3,
.entry-content h4 {
	margin-top: 1.8em;
	color: var(--ink);
	line-height: var(--lh-tight);
}

/* Subheads in the story: 22px on phones to 24px, leading 1.4 (Nepali). */
.entry-content h2 {
	margin-top: 2em;
	font-size: calc(var(--article-h2, var(--fs-3)) * var(--article-scale, 1));
	line-height: var(--lh-title);
}
.entry-content h2 + p { margin-top: 0.6em; }
.entry-content h3 { font-size: calc(var(--fs-4) * var(--article-scale, 1)); }
.entry-content h4 { font-size: 1em; }

/* :where() keeps the buttons excluded without :not()'s extra specificity, so component links inside the
   story (.inline-related__link, the team cards) can still set their own colour and underline. */
.entry-content a:where(:not(.btn, .wp-block-button__link)) {
	color: var(--blue);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.25em;
}

/* Hover moves away from the link blue in whichever direction is more contrast: darker on white, lighter
   on the dark page (a fixed navy fell to 2:1 there). Both are 9:1 or better. */
@media (hover: hover) {
	.entry-content a:where(:not(.btn, .wp-block-button__link)):hover { color: color-mix(in srgb, var(--blue) 65%, var(--ink)); }
}

.entry-content ul,
.entry-content ol { padding-left: 1.4em; }
.entry-content li + li { margin-top: 0.35em; }

.entry-content strong { color: var(--ink); }

/* Images, captions, alignment (incl. classic-editor classes) */
.entry-content img { border-radius: var(--radius); }

.entry-content figcaption,
.entry-content .wp-element-caption,
.entry-content .wp-caption-text,
.entry-content .gallery-caption {
	margin-top: var(--s-2);
	color: var(--muted);
	font-size: var(--fs-7);
	line-height: 1.5;
	text-align: left;
}

.wp-caption { max-width: 100%; }
.aligncenter { display: block; margin-inline: auto; }
.alignleft { float: left; margin: 0.3em 1.2em 0.8em 0; max-width: 50%; }
.alignright { float: right; margin: 0.3em 0 0.8em 1.2em; max-width: 50%; }
.entry-content::after { content: ""; display: table; clear: both; }

@media (max-width: 639px) {
	.alignleft,
	.alignright { float: none; max-width: 100%; margin-inline: 0; }
}

/* Quotes: the client's red rule on the left. Pull-quotes and large quotes are Martel (22px on phones to 28px). */
.entry-content blockquote,
.entry-content .wp-block-quote,
.entry-content .wp-block-pullquote {
	margin: 1.6em 0;
	padding: 0.2em 0 0.2em var(--s-5);
	border: 0;
	border-left: 4px solid var(--brand);
	text-align: left;
}

.entry-content .wp-block-pullquote blockquote {
	margin: 0;
	padding: 0;
	border: 0;
}

.entry-content .wp-block-pullquote p,
.entry-content .wp-block-quote.is-style-large p {
	color: var(--heading);
	font-family: var(--font-display);
	font-size: calc(var(--article-quote, var(--fs-2)) * var(--article-scale, 1));
	font-weight: 700;
	line-height: var(--article-quote-lh, 1.5);
	text-wrap: balance;
}

.entry-content blockquote cite,
.entry-content .wp-block-pullquote cite {
	display: block;
	margin-top: var(--s-2);
	color: var(--muted);
	font-family: var(--font-body);
	font-size: var(--fs-7);
	font-style: normal;
	font-weight: 400;
	line-height: var(--lh-ui);
}

/* Galleries */
.entry-content .wp-block-gallery { gap: var(--s-2); }
.entry-content .wp-block-gallery img { border-radius: var(--radius); }

/* Embeds: fluid 16:9 */
.entry-content .wp-block-embed__wrapper iframe {
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
}

/* Tables */
.entry-content table {
	width: 100%;
	border-collapse: collapse;
	font-size: calc(var(--fs-5) * var(--article-scale, 1));
}

.entry-content th,
.entry-content td {
	padding: var(--s-2) var(--s-3);
	border: 1px solid var(--line);
	text-align: left;
}

.entry-content th { background: var(--bg-soft); color: var(--ink); }

/* A table wider than the column scrolls inside its own box: the block's <figure>, or the .table-scroll
   wrapper round a table pasted in as raw HTML. Both are named, focusable regions (inc/article.php), and
   the table keeps its native semantics. */
.entry-content .wp-block-table,
.entry-content .table-scroll { overflow-x: auto; }

/* Editor blocks: brand button, highlight, code. Colours an editor picks (has-*-background-color) still win. */
.entry-content .wp-block-button__link {
	min-height: 44px;
	padding: var(--s-3) var(--s-5);
	border-radius: var(--radius-lg);
	background: var(--fill-selected);
	color: var(--white);
	font-size: var(--fs-6);
	font-weight: 700;
	line-height: 1.3;
	text-decoration: none;
	transition: background-color var(--dur-hover) ease;
}

.entry-content .is-style-outline > .wp-block-button__link {
	border: 2px solid currentColor;
	background: none;
	color: var(--blue);
}

@media (hover: hover) {
	.entry-content .wp-block-button__link:hover { background: var(--navy-2); color: var(--white); }
	.entry-content .is-style-outline > .wp-block-button__link:hover { background: var(--tint); color: var(--blue); }
}

.entry-content mark {
	padding: 0 2px;
	border-radius: 2px;
	background: var(--tint);
	background: color-mix(in srgb, var(--warn) 35%, transparent);
	color: inherit;
}

.entry-content code,
.entry-content pre {
	font-family: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
	font-size: calc(var(--fs-6) * var(--article-scale, 1));
}

.entry-content :not(pre) > code {
	padding: 0.1em 0.35em;
	border-radius: var(--radius);
	background: var(--bg-soft);
}

.entry-content pre {
	padding: var(--s-4);
	border-radius: var(--radius-lg);
	background: var(--bg-soft);
	line-height: 1.6;
	white-space: pre-wrap; /* wraps rather than scrolls: a scrolling box would need its own keyboard stop */
	overflow-wrap: anywhere;
}

.entry-content hr {
	margin-block: 2em;
	border: 0;
	border-top: 1px solid var(--line);
}

/* Paginated posts */
.page-links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s-2);
	align-items: center;
	margin-top: 2em;
	font-size: var(--fs-6);
}

.page-links a,
.page-links > .post-page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 44px;
	height: 44px;
	border: 1px solid var(--line-strong);
	border-radius: var(--radius);
	text-decoration: none;
}

.page-links .current { background: var(--fill-selected); border-color: var(--fill-selected); color: var(--white); }

/* WordPress core classes (Theme Check) */
.sticky,
.bypostauthor { /* no special treatment; kept for compatibility */ }
