/* Articles — landing page (template-articles.php) + single posts (single.php).
   Layout mirrors shanahan.nz/updates/ using the theme's global classes
   (.container, .fs-*, .ft-s, .fw-*, .btn-border, .bg-charcoal). */

.articles-intro .container,
.articles-featured .container,
.articles-grid-section .container,
.article-single .container {
	text-align: left;
}

.article-meta {
	font-size: 13px;
	line-height: 1.4;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #6b6b66;
	margin-bottom: 0.75rem;
}

.article-readmore {
	display: inline-block;
	margin-top: 0.75rem;
	border-bottom: 1px solid currentColor;
	padding-bottom: 2px;
}

/* ---- landing: intro ---- */

.articles-intro {
	padding-top: 3rem;
}

.articles-intro-row {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 3rem;
	padding: 2rem 0;
}

.articles-intro-row h1 {
	margin: 0;
}

.articles-intro-row .lead {
	max-width: 36rem;
}

.articles-intro-row .lead p:last-child {
	margin-bottom: 0;
}

/* ---- landing: featured article ---- */

.article-feature {
	display: flex;
	align-items: center;
	gap: 4rem;
	padding: 3rem 0;
	margin: 0;
	text-decoration: none;
	color: inherit;
}

.article-feature-img {
	width: 56%;
	flex-shrink: 0;
}

/* Hover, as on shanahan.nz: the frame clips, the image eases up to 1.04,
   the headline fades to 0.7. No underlines. */
.article-feature-img,
.article-card-img {
	overflow: hidden;
	border-radius: 0.75rem;
}

.article-feature-img img,
.article-card-img img {
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	display: block;
	transition: transform 0.6s ease;
}

.article-feature:hover .article-feature-img img,
.article-card:hover .article-card-img img {
	transform: scale(1.04);
}

.article-feature h2,
.article-card h3 {
	transition: opacity 0.3s ease;
}

.article-feature:hover h2,
.article-card:hover h3 {
	opacity: 0.7;
}

.article-feature:hover,
.article-card:hover,
.article-back:hover {
	text-decoration: none;
}

.article-feature-text {
	flex: 1;
}

.article-feature-text h2 {
	margin: 0 0 1rem;
}

/* ---- landing + more-articles: card grid ---- */

.articles-grid-section {
	padding: 2rem 0 5rem;
}

.articles-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 3rem 2rem;
}

.article-card {
	display: block;
	margin: 0;
	text-decoration: none;
	color: inherit;
}

.article-card-img {
	margin-bottom: 1.25rem;
}

.article-card h3 {
	margin: 0.25rem 0 0.5rem;
}

/* Landing-page grid titles run a step larger, as on shanahan.nz/updates/ */
.articles-grid-section:not(.article-more) .article-card h3 {
	font-size: 1.6rem;
	line-height: 1.18;
	letter-spacing: -0.01em;
	margin: 0.35rem 0 0.6rem;
}

.article-card p {
	margin: 0;
}

/* ---- single article ---- */

.article-measure {
	max-width: 760px;
	margin: 0 auto;
}

/* Clears the fixed menu bar. The theme's own #header-spacer + section rule
   doesn't reach here because the next element is the <article>. */
.article-head {
	padding: 8rem 0 2.5rem;
}

.article-back {
	display: inline-block;
	margin-bottom: 2.5rem;
	text-decoration: none;
	color: #6b6b66;
}

.article-back:hover {
	color: #111;
}

.article-head h1 {
	margin: 0;
}

.article-head .article-date {
	margin: 1.25rem 0 0;
}

.article-hero img {
	width: 100%;
	height: auto;
	aspect-ratio: 5 / 2;
	object-fit: cover;
	display: block;
	border-radius: 0.75rem;
}

.article-body-section {
	padding: 3.5rem 0 4rem;
}

/* size and weight come from .fs-m .fw-600, added to body h2s in includes/articles.php */
.article-body h2 {
	line-height: 1.15;
	margin: 3rem 0 1.25rem;
}

.article-body h3 {
	font-size: 1.25rem;
	font-weight: 600;
	margin: 2.25rem 0 1rem;
}

.article-body table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95rem;
	margin: 1.5rem 0 2rem;
	text-align: left;
}

.article-body th,
.article-body td {
	padding: 0.6rem 0.9rem 0.6rem 0;
	border-top: 1px solid #e3e0dc;
	vertical-align: top;
}

.article-body tr:first-child th,
.article-body tr:first-child td {
	border-top: 0;
}

.article-body th {
	font-weight: 600;
}

.article-body p,
.article-body ul,
.article-body ol {
	margin-bottom: 1.25rem;
	line-height: 1.65;
}

/* Links in article text are underlined (the theme's links are plain by default) */
.article-body a {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	transition: opacity 0.2s ease;
}

.article-body a:hover {
	opacity: 0.7;
}

/* Intro paragraph (editor format "Intro" = fs-m fw-300) */
.article-body p.fs-m {
	line-height: 1.4;
	margin-bottom: 1.75rem;
}

.article-body img {
	max-width: 100%;
	height: auto;
}

/* ---- CTA band ---- */

.article-cta {
	padding: 4.5rem 0;
}

.article-cta .container,
.article-cta h2,
.article-cta p {
	text-align: center;
}

.article-cta h2 {
	margin: 0 0 0.75rem;
}

.article-cta p {
	margin: 0 auto 0.5rem;
	max-width: 32rem;
}

.article-cta-buttons {
	display: flex;
	justify-content: center;
	gap: 1rem;
	flex-wrap: wrap;
}

/* ---- more articles ---- */

.article-more .container {
	padding-top: 4rem;
	border-top: 1px solid #e3e0dc;
}

.article-more-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 2rem;
	margin-bottom: 2.5rem;
}

.article-more-head h2 {
	margin: 0;
}

/* ---- responsive ---- */

@media only screen and (max-width: 1000px) {
	.articles-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.article-feature {
		gap: 2.5rem;
	}

	.articles-grid-section:not(.article-more) .article-card h3 {
		font-size: 1.4rem;
	}
}

@media only screen and (max-width: 700px) {
	.articles-intro-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 1.5rem;
	}

	/* the theme sets a 20px root on phones, so rem spacing runs large here */
	.articles-intro-row {
		padding: 1rem 0 1.25rem;
	}

	.articles-intro hr {
		margin: 0;
	}

	.article-feature {
		flex-direction: column;
		align-items: flex-start;
		gap: 1rem;
		padding: 1.5rem 0 0;
	}

	.article-feature-img {
		width: 100%;
	}

	.articles-grid-section {
		padding: 2rem 0 3rem;
	}

	.articles-grid {
		grid-template-columns: 1fr;
		gap: 2.25rem;
	}

	.article-card-img {
		margin-bottom: 0.9rem;
	}

	.articles-grid-section:not(.article-more) .article-card h3 {
		font-size: 1.25rem;
	}

	.article-hero img {
		aspect-ratio: 3 / 2;
	}

	.article-body table {
		display: block;
		overflow-x: auto;
		font-size: 0.82rem;
	}

	.article-body th,
	.article-body td {
		min-width: 7.5rem;
	}

	.article-more-head {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.5rem;
	}
}

@media screen and (max-width: 768px) {
	.article-head {
		padding-top: 5rem;
	}
}
