/* ==========================================================================
   BLOG — index (home.php / page-blog.php) and archives (category, tag, author, date)
   Everything is prefixed blog- and composed from the shared tokens / tone scopes.
   Sections: 1 hero · 2 featured · 3 category nav · 4 latest grid · 5 from the field · 6 follow · 7 archives · 8 author
   ========================================================================== */

/* WordPress adds the class "tag" to <body> on tag archives, which would pick up the .tag pill component. */
body.tag {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: var(--bg);
	color: var(--fg);
	font-size: var(--fs-body);
	font-weight: 400;
	letter-spacing: normal;
	line-height: var(--lh-body);
	text-transform: none;
	white-space: normal;
}

/* ==========================================================================
   1. HERO — dark, 55–60svh, one strong editorial image
   ========================================================================== */
.blog-hero {
	--hero-min: 58svh;
	align-items: center;
	padding-top: calc(var(--header-h) + clamp(1.25rem, 3vh, 2.25rem));
	padding-bottom: clamp(2.75rem, 5.5vh, 4rem);
}

/* A 55–60svh hero has to carry H1 + lead + search + chips: step the headline down from the generic page-hero size */
.blog-hero .page-hero__title--md {
	font-size: clamp(2.5rem, 1.2rem + 3.6vw, 4.5rem);
}

@supports not (min-height: 1svh) {
	.blog-hero {
		--hero-min: 58vh;
	}
}

.blog-hero__inner {
	/* keep the .wrap gutters and max-width explicit (page-hero__inner declares width:100%) */
	width: min(100% - 2 * var(--gutter), var(--container));
	gap: 2.75rem;
	align-items: center;
}

@media (min-width: 1024px) {
	.blog-hero__inner {
		gap: clamp(3rem, 5vw, 5.5rem);
	}
}

.blog-hero__title {
	margin-bottom: 0.9rem;
}

.blog-hero .page-hero__lead {
	font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.15rem);
}

.blog-hero__search {
	width: min(100%, 34rem);
	margin-top: 1.4rem;
}

.blog-hero__search .search-form input[type='search'] {
	min-height: 56px;
	padding-left: 1.35rem;
	border-color: rgba(246, 235, 221, 0.3);
	background: rgba(11, 9, 7, 0.55);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
}

.blog-hero__search .search-form__submit {
	right: 6px;
	width: 44px;
	height: 44px;
}

.blog-hero__chips {
	margin-top: 1rem;
}


/* Right column: the featured story as a framed editorial image */
.blog-hero__aside {
	position: relative;
	width: 100%;
	max-width: 36rem;
	justify-self: start;
}

/* Stacked layouts: a wider, shorter crop keeps the hero compact */
@media (max-width: 1023px) {
	.blog-hero__aside .media-slot:not(.media-slot--auto):not(.media-slot--fill) {
		aspect-ratio: 16 / 10;
	}
}

@media (min-width: 1024px) {
	.blog-hero__aside {
		justify-self: end;
	}
}

.blog-hero__feature {
	position: relative;
	display: block;
	isolation: isolate;
	border-radius: var(--r-lg);
	color: var(--warm-ivory);
}

.blog-hero__feature:hover {
	color: var(--warm-ivory);
}

.blog-hero__feature .media-slot {
	--media-radius: var(--r-lg);
	box-shadow: 0 34px 80px -34px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(217, 164, 65, 0.3);
}

.blog-hero__frame {
	position: absolute;
	inset: 0;
	z-index: -1;
	border: 1px solid rgba(217, 164, 65, 0.55);
	border-radius: var(--r-lg);
	transform: translate(10px, 10px);
	transition: transform 0.6s var(--ease-out);
}

@media (min-width: 640px) {
	.blog-hero__frame {
		transform: translate(16px, 16px);
	}
}

.blog-hero__feature:hover .blog-hero__frame,
.blog-hero__feature:focus-visible .blog-hero__frame {
	transform: translate(7px, 7px);
}

.blog-hero__feature:hover .media-slot__media {
	transform: scale(1.04);
}

.blog-hero__feature-copy {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 3;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	padding: 2.5rem 1.4rem 1.35rem;
}

.blog-hero__kicker {
	color: var(--saffron-bright);
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.blog-hero__feature-title {
	display: -webkit-box;
	overflow: hidden;
	font-family: var(--font-display);
	font-size: clamp(1.15rem, 1rem + 0.6vw, 1.55rem);
	line-height: 1.2;
	overflow-wrap: anywhere;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
}

/* ==========================================================================
   2. FEATURED STORY — warm ivory, 7/5 split card
   ========================================================================== */
.blog-featured {
	padding-block: clamp(3rem, 2rem + 4vw, 6rem) clamp(2rem, 1.5rem + 2.5vw, 4rem);
	box-shadow: inset 0 1px 0 rgba(217, 164, 65, 0.6);
}

.blog-featured__card {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	border-radius: var(--r-lg);
	background: var(--surface);
}

.blog-featured__media {
	position: relative;
}

.blog-featured__body {
	justify-content: center;
	gap: 1.1rem;
	padding: clamp(1.5rem, 1rem + 3vw, 3.75rem);
}

.blog-featured__body .eyebrow {
	margin-bottom: 0;
}

.blog-featured__title {
	font-size: clamp(1.75rem, 1.15rem + 2.3vw, 3.1rem);
	line-height: 1.08;
	letter-spacing: -0.02em;
	overflow-wrap: anywhere;
}

.blog-featured__excerpt {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	color: var(--fg-soft);
	font-size: var(--fs-lg);
	line-height: 1.6;
	-webkit-line-clamp: 5;
	-webkit-box-orient: vertical;
}

.blog-featured__cta {
	align-self: flex-start;
	margin-top: 0.4rem;
	pointer-events: none;
}

.blog-featured__card:hover .blog-featured__cta,
.blog-featured__card:focus-within .blog-featured__cta {
	transform: translateY(-2px);
	background: linear-gradient(180deg, var(--saffron-bright) 0%, #ff8a33 100%);
}

.blog-featured__card:hover .blog-featured__cta .icon,
.blog-featured__card:focus-within .blog-featured__cta .icon {
	transform: translateX(5px);
}

@media (min-width: 1024px) {
	.blog-featured__card {
		grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
		min-height: 31rem;
	}
	.blog-featured__media .media-slot {
		position: absolute;
		inset: 0;
		height: 100%;
		aspect-ratio: auto;
	}
}

/* Post-label tags (Official Announcement / Opinion / Field Report) */
.post-label {
	gap: 0.45em;
}

.post-label .icon {
	width: 1.05em;
	height: 1.05em;
}

.tone-ivory .post-label.tag {
	border-color: rgba(168, 66, 12, 0.4);
	background: rgba(168, 66, 12, 0.08);
	color: var(--saffron-ink);
}

.tone-ivory .post-label.tag--gold {
	border-color: rgba(125, 90, 18, 0.45);
	background: rgba(125, 90, 18, 0.1);
	color: var(--gold-ink);
}

.tone-ivory .post-label.tag--solid {
	border-color: var(--saffron);
	background: var(--saffron);
	color: var(--sanctum-black);
}

/* Shared meta row + author avatar */
.post-meta {
	gap: 0.4rem 1.1rem;
}

.post-meta > li + li::before {
	display: none;
}

.post-meta .icon {
	flex: none;
}

.post-meta__author {
	color: var(--fg-soft);
	font-weight: 700;
}

.post-avatar {
	display: inline-grid;
	flex: none;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	overflow: hidden;
	border: 1px solid var(--line-strong);
	border-radius: 50%;
	background: var(--surface-2);
}

.post-avatar img,
.post-avatar__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}

.post-avatar__initial {
	color: var(--accent);
	font-family: var(--font-display);
	font-size: 1.05rem;
	line-height: 1;
}

/* ==========================================================================
   3. CATEGORY NAVIGATION — ivory band, chips + counts
   ========================================================================== */
.blog-cats {
	padding-block: clamp(1.1rem, 0.9rem + 1vw, 1.75rem);
	background-color: var(--bg-alt);
	border-block: 1px solid var(--line);
}

.blog-cats__inner {
	display: grid;
	gap: 0.5rem;
}

.blog-cats__title {
	margin: 0;
}

@media (min-width: 1024px) {
	.blog-cats .chip {
		padding-inline: 1rem;
	}
}

/* Scroll-snap would otherwise pull the first chip flush with the screen edge */
.blog-chips {
	scroll-padding-inline: var(--gutter);
}

.blog-chips .chip {
	transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease,
		transform var(--dur) var(--ease-out);
}

.blog-chips .chip:hover {
	transform: translateY(-2px);
}

/* Keep the count legible on the saffron active chip (the base 0.7 opacity lands at 4.49:1) */
.blog-chips .chip__count {
	opacity: 0.85;
}

.blog-chips .chip.is-busy {
	opacity: 0.6;
}

.tone-ivory .blog-chips .chip:not(.is-active):not([aria-current]):hover {
	background: rgba(244, 122, 31, 0.1);
}

.tone-dark .blog-chips .chip {
	background: rgba(11, 9, 7, 0.4);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}

.tone-dark .blog-chips .chip.is-active,
.tone-dark .blog-chips .chip[aria-current] {
	background: var(--saffron);
}

/* ==========================================================================
   4. LATEST ARTICLES — grid + pagination + load more
   ========================================================================== */
.blog-latest {
	padding-top: clamp(3rem, 2rem + 4vw, 5.5rem);
	padding-bottom: var(--section-y);
}

.blog-latest__head {
	margin-bottom: clamp(1.75rem, 1.2rem + 2vw, 3rem);
}

.blog-latest__count {
	margin: 0;
	color: var(--fg-muted);
	font-size: var(--fs-sm);
	font-weight: 700;
	letter-spacing: 0.04em;
}

.blog-grid > * {
	min-width: 0;
}

.blog-grid {
	transition: opacity 0.25s ease;
}

.blog-grid.is-filtering {
	opacity: 0.35;
	pointer-events: none;
}

.blog-grid__empty {
	grid-column: 1 / -1;
	margin: 0;
	padding: clamp(2rem, 1.5rem + 3vw, 4rem) 1rem;
	color: var(--fg-soft);
	font-size: var(--fs-lg);
	text-align: center;
}

@media (prefers-reduced-motion: reduce) {
	.blog-grid {
		transition: none;
	}
}

/* Consistent heights whatever the title / excerpt length */
.blog-grid .card__title,
.blog-rail .card__title {
	display: -webkit-box;
	overflow: hidden;
	overflow-wrap: anywhere;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
}

.blog-grid .card__excerpt,
.blog-rail .card__excerpt {
	display: -webkit-box;
	overflow: hidden;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
}

.blog-more {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1.5rem;
	margin-top: clamp(2.5rem, 2rem + 3vw, 4.25rem);
}

.blog-more .pagination {
	margin-top: 0;
}

.blog-more__btn {
	min-width: min(100%, 17rem);
}

.blog-more__btn.is-loading {
	opacity: 0.7;
	pointer-events: none;
}

html:not(.hs-js) .blog-more__btn {
	display: none;
}

.blog-empty {
	padding-block: clamp(1.5rem, 1rem + 3vw, 4rem);
}

/* ==========================================================================
   5. FROM THE FIELD — charcoal, horizontal scroll-snap rail
   ========================================================================== */
.blog-field {
	overflow: clip;
}

.blog-field__controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1.5rem;
}

.blog-rail-nav {
	display: flex;
	gap: 0.5rem;
}

.blog-rail-nav__btn {
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 1px solid var(--line-strong);
	border-radius: 50%;
	background: transparent;
	color: var(--fg);
	transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease, border-color var(--dur-fast) ease,
		opacity var(--dur-fast) ease;
}

.blog-rail-nav__btn:hover:not(:disabled),
.blog-rail-nav__btn:focus-visible {
	border-color: var(--saffron);
	background: var(--saffron);
	color: var(--sanctum-black);
}

.blog-rail-nav__btn:disabled {
	opacity: 0.35;
	cursor: default;
}

.blog-rail {
	gap: var(--gap);
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
}

.blog-rail:focus-visible {
	outline-offset: -2px;
}

/* Without JavaScript there are no arrow buttons, so show a visible scrollbar */
html:not(.hs-js) .blog-rail {
	scrollbar-width: thin;
	scrollbar-color: var(--saffron) transparent;
}

html:not(.hs-js) .blog-rail::-webkit-scrollbar {
	display: block;
	height: 8px;
}

html:not(.hs-js) .blog-rail::-webkit-scrollbar-thumb {
	border-radius: 8px;
	background: var(--saffron);
}

.blog-rail > .blog-fcard {
	flex: 0 0 min(88%, 22.5rem);
	scroll-snap-align: start;
}

@media (min-width: 768px) {
	.blog-rail > .blog-fcard {
		flex-basis: min(90%, 38rem);
	}
	.blog-fcard.card--horizontal .card__media {
		flex-basis: 40%;
		max-width: 40%;
	}
}

.blog-fcard .card__body {
	gap: 0.6rem;
}

.blog-fcard .card__title {
	font-size: clamp(1.2rem, 1.05rem + 0.5vw, 1.5rem);
}

.blog-fcard__cat {
	color: var(--fg-muted);
	letter-spacing: 0.06em;
}

@media (prefers-reduced-motion: reduce) {
	.blog-rail {
		scroll-behavior: auto;
	}
}

/* ==========================================================================
   6. NEWSLETTER / FOLLOW — compact saffron band
   ========================================================================== */
.blog-follow {
	padding-block: clamp(2.75rem, 2rem + 3vw, 4.75rem);
}

.blog-follow__inner {
	position: relative;
	z-index: 1;
	display: grid;
	gap: 1.75rem;
	align-items: center;
}

@media (min-width: 900px) {
	.blog-follow__inner {
		grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
		gap: 3rem;
	}
}

.blog-follow .eyebrow {
	margin-bottom: 0.8rem;
}

.blog-follow__title {
	margin: 0 0 0.6rem;
	font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3.25rem);
	line-height: 1.05;
	letter-spacing: -0.02em;
}

.blog-follow__text {
	max-width: 34rem;
	margin: 0;
	color: var(--fg-soft);
	font-size: var(--fs-lg);
}

.blog-follow__links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem 1.5rem;
}

@media (min-width: 900px) {
	.blog-follow__links {
		justify-content: flex-end;
	}
}

.blog-follow .social-links {
	margin: 0;
}

.blog-follow .social-links a {
	border-color: rgba(11, 9, 7, 0.5);
	color: var(--sanctum-black);
}

.blog-follow .social-links a:hover,
.blog-follow .social-links a:focus-visible {
	border-color: var(--sanctum-black);
	background: var(--sanctum-black);
	color: var(--warm-ivory);
}

.blog-follow__form {
	max-width: 32rem;
}

.blog-follow input[type='email'] {
	border-color: rgba(11, 9, 7, 0.45);
	background: var(--warm-ivory);
	color: var(--sanctum-black);
}

.blog-follow input[type='email']::placeholder {
	color: var(--stone-ink);
}

@media (max-width: 559px) {
	.blog-follow__form .btn {
		flex: 1 1 100%;
	}
}

.blog-follow .btn--dark {
	--btn-bg: var(--sanctum-black);
	--btn-fg: var(--warm-ivory);
}

@media (min-width: 900px) {
	.blog-follow__form {
		margin-left: auto;
	}
}

/* ==========================================================================
   7. ARCHIVES — category, tag, date (hero from the page-hero component)
   ========================================================================== */
.blog-archive-hero .page-hero__inner {
	/* keep the .wrap gutters and max-width explicit (page-hero__inner declares width:100%) */
	width: min(100% - 2 * var(--gutter), var(--container));
}

.blog-archive-hero .page-hero__title {
	overflow-wrap: anywhere;
}

.blog-archive {
	padding-top: clamp(3rem, 2rem + 4vw, 5.5rem);
}

/* ==========================================================================
   8. AUTHOR — avatar card inside the hero
   ========================================================================== */
.blog-author {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1.5rem clamp(1.5rem, 3vw, 2.75rem);
}

.blog-author__avatar.post-avatar {
	width: clamp(5.5rem, 4rem + 5vw, 8.5rem);
	height: clamp(5.5rem, 4rem + 5vw, 8.5rem);
	border: 2px solid var(--antique-gold);
	box-shadow: 0 0 0 6px rgba(217, 164, 65, 0.12), 0 0 46px rgba(244, 122, 31, 0.28);
}

.blog-author__text {
	flex: 1 1 18rem;
	min-width: 0;
}

.blog-author__name {
	margin-bottom: 0.9rem;
	overflow-wrap: anywhere;
}

.blog-author__text .page-hero__lead {
	margin-bottom: 0;
}

.blog-author__count {
	margin: 1rem 0 0;
	color: var(--accent-2);
	font-size: var(--fs-sm);
	font-weight: 700;
	letter-spacing: 0.06em;
}

@media (prefers-reduced-motion: reduce) {
	.blog-hero__frame,
	.blog-hero__feature .media-slot__media,
	.blog-chips .chip {
		transition: none;
	}
}

/* Breadcrumb links in the archive / author heroes: 44px hit area without changing the layout */
.blog-archive-hero .breadcrumbs a,
.blog-author-hero .breadcrumbs a {
	display: inline-block;
	padding-block: 0.8rem;
	margin-block: -0.8rem;
}

/* The CTA band's ornament is drawn in full-strength ink; on phones it would sit on top of the headline */
@media (max-width: 767px) {
	.blog-cta .cta-band__art {
		display: none;
	}
}
