/*
 * TR Immigration - article and archive typography
 *
 * Astra renders single posts, archives and author pages with its own defaults,
 * so a reader clicking through from an Elementor page landed on a different
 * typeface and scale. This file puts those templates on the same design tokens
 * as the rest of the site. Every value below is a kit variable.
 */

.single-post,
.archive,
.blog,
.search {
	background: var(--paper);
}

.single-post .site-content,
.archive .site-content,
.blog .site-content,
.search .site-content {
	font-family: var(--font-body);
	color: var(--ink);
}

/* ---- The article shell ----------------------------------------------- */

/*
 * Paper, not white. Astra's boxed container reads as a white card on desktop
 * while collapsing to the page background on a phone, so the same article
 * arrived in two different colours. Paper on both.
 */
.single-post .ast-separate-container .ast-article-single,
.archive .ast-separate-container .ast-article-post,
.blog .ast-separate-container .ast-article-post {
	background: var(--paper);
	border: 0;
	padding: var(--sp-9) var(--sp-8);
}

/* Astra drops a soft shadow on every image inside a single post. */
.ast-article-single figure,
.ast-article-single img:not(figure img),
.single-post .tr-post-hero,
.single-post .tr-ed-media,
.single-post .tr-ed-img {
	box-shadow: none;
}

/*
 * Hold the reading column at a comfortable measure on a large monitor while the
 * hero image is allowed the full width of the shell.
 */
.single-post .entry-header,
.single-post .entry-content,
.single-post .tr-post-eyebrow {
	max-width: var(--measure);
	margin-inline: auto;
}

.single-post .tr-related {
	max-width: none;
}

@media (max-width: 921px) {
	.single-post .ast-separate-container .ast-article-single,
	.archive .ast-separate-container .ast-article-post,
	.blog .ast-separate-container .ast-article-post {
		padding: var(--sp-7) var(--wrap-pad-t);
	}
}

@media (max-width: 544px) {
	.single-post .ast-separate-container .ast-article-single,
	.archive .ast-separate-container .ast-article-post,
	.blog .ast-separate-container .ast-article-post {
		padding: var(--sp-6) var(--wrap-pad-m);
	}
}

/* ---- Eyebrow, headline, byline --------------------------------------- */

.single-post .tr-post-eyebrow {
	margin: 0 auto var(--sp-4);
	font-size: var(--fs-tag);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.13em;
	line-height: var(--lh-fine);
}

.single-post .tr-post-eyebrow a {
	color: var(--gold-deep);
	text-decoration: none;
}

.single-post .tr-post-eyebrow--courts a { color: var(--brick); }
.single-post .tr-post-eyebrow--visas a  { color: var(--green); }

.single-post .tr-post-eyebrow a:hover,
.single-post .tr-post-eyebrow a:focus-visible { text-decoration: underline; }

.single-post .entry-header {
	margin-block-end: var(--sp-6);
	padding-block-end: var(--sp-5);
	border-block-end: var(--hair) solid var(--rule);
}

.single-post .entry-title,
.archive .entry-title,
.blog .entry-title {
	font-family: var(--font-head);
	font-weight: 500;
	color: var(--navy-900);
	line-height: var(--lh-head);
	letter-spacing: -0.015em;
	margin: 0 0 var(--sp-4);
}

.single-post .entry-title { font-size: var(--fs-h1); }
.archive .entry-title,
.blog .entry-title { font-size: var(--fs-h3); }

@media (max-width: 921px) { .single-post .entry-title { font-size: var(--fs-h1-t); } }
@media (max-width: 544px) { .single-post .entry-title { font-size: var(--fs-h1-m); } }

.single-post .entry-meta,
.single-post .entry-meta *,
.archive .entry-meta,
.archive .entry-meta * {
	font-family: var(--font-body);
	font-size: var(--fs-tag);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.09em;
	color: var(--ink-soft);
	line-height: var(--lh-fine);
}

.single-post .entry-meta a,
.archive .entry-meta a {
	color: var(--gold-deep);
	text-decoration: none;
}

.single-post .entry-meta a:hover,
.archive .entry-meta a:hover {
	color: var(--navy-900);
	text-decoration: underline;
}

/* ---- Hero image ------------------------------------------------------ */

.single-post .tr-post-hero {
	margin: 0 0 var(--sp-7);
	border-radius: var(--r-1);
	overflow: hidden;
	background: var(--paper-dim);
}

.single-post .tr-post-hero-img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.single-post .tr-post-hero-cap {
	margin: var(--sp-3) 0 0;
	font-size: var(--fs-sm);
	line-height: var(--lh-fine);
	color: var(--ink-soft);
}

/* ---- Body copy ------------------------------------------------------- */

.single-post .entry-content {
	font-family: var(--font-body);
	font-size: var(--fs-body);
	line-height: var(--lh-body);
	color: var(--ink);
}

/*
 * Body typography, scoped to direct children of the content wrapper.
 *
 * Astra fires astra_entry_content_after from inside .entry-content, so the
 * author byline and the related-articles block sit inside it too. Without the
 * child combinator these rules reach into those blocks and restyle their
 * headings and paragraphs.
 */
.single-post .entry-content > p { margin: 0 0 var(--sp-5); }

/* The opening paragraph carries the piece. */
.single-post .entry-content > p:first-of-type {
	font-size: var(--fs-lede);
	line-height: var(--lh-fine);
	color: var(--navy-800);
	margin-block-end: var(--sp-6);
}

/*
 * Subheads stay at body size, as asked. They separate by weight, colour and
 * letter-spacing rather than by scale, and by the space above them.
 */
.single-post .entry-content > h2,
.single-post .entry-content > h3,
.single-post .entry-content > h4 {
	font-family: var(--font-head);
	font-size: var(--fs-body);
	font-weight: 700;
	line-height: var(--lh-fine);
	text-transform: uppercase;
	letter-spacing: 0.085em;
	color: var(--gold-deep);
	margin: var(--sp-8) 0 var(--sp-4);
}

.single-post .entry-content > h2:first-child { margin-block-start: 0; }

/* ---- Lists ----------------------------------------------------------- */

.single-post .entry-content > ul,
.single-post .entry-content > ol {
	margin: 0 0 var(--sp-5);
	padding-inline-start: 0;
	list-style: none;
}

.single-post .entry-content > ul > li,
.single-post .entry-content > ol > li {
	position: relative;
	padding-inline-start: var(--sp-5);
	margin-block-end: var(--sp-3);
}

.single-post .entry-content > ul > li::before {
	content: "";
	position: absolute;
	inset-inline-start: 0;
	top: 0.62em;
	width: var(--sp-3);
	height: var(--edge);
	background: var(--gold);
}

.single-post .entry-content > ol { counter-reset: tr-ol; }
.single-post .entry-content > ol > li { counter-increment: tr-ol; }

.single-post .entry-content > ol > li::before {
	content: counter(tr-ol);
	position: absolute;
	inset-inline-start: 0;
	font-weight: 700;
	font-size: var(--fs-sm);
	color: var(--gold-deep);
}

/* ---- Callout --------------------------------------------------------- */

.single-post .entry-content blockquote,
.single-post .entry-content .tr-callout {
	margin: var(--sp-7) 0;
	padding: var(--sp-5) var(--sp-6);
	background: var(--paper);
	border-inline-start: var(--edge) solid var(--gold);
	border-radius: var(--r-1);
	font-size: var(--fs-lede);
	line-height: var(--lh-fine);
	color: var(--navy-800);
}

.single-post .entry-content blockquote p:last-child,
.single-post .entry-content .tr-callout p:last-child { margin-block-end: 0; }

/* ---- Inline detail --------------------------------------------------- */

.single-post .entry-content strong {
	font-weight: 700;
	color: var(--navy-900);
}

.single-post .entry-content > p a,
.single-post .entry-content > ul a,
.single-post .entry-content > ol a,
.single-post .entry-content > blockquote a {
	color: var(--navy-800);
	text-decoration: underline;
	text-decoration-color: var(--gold);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.single-post .entry-content > p a:hover,
.single-post .entry-content > ul a:hover,
.single-post .entry-content > ol a:hover,
.single-post .entry-content > blockquote a:hover {
	color: var(--gold-deep);
	text-decoration-color: var(--gold-deep);
}

.single-post .entry-content em { font-style: italic; }

/* ---- Archive and author listings ------------------------------------- */

.archive .entry-content,
.blog .entry-content,
.search .entry-content {
	font-family: var(--font-body);
	font-size: var(--fs-body);
	line-height: var(--lh-body);
	color: var(--ink);
}

.archive .ast-archive-description .ast-archive-title,
.archive .page-title {
	font-family: var(--font-head);
	font-size: var(--fs-h2);
	font-weight: 500;
	color: var(--navy-900);
	line-height: var(--lh-head);
}

.ast-button,
.single-post .entry-content .ast-button { font-family: var(--font-body); }
