/* ==========================================================================
   SWS Temp Templates — Blog page
   Mirrors the MyJet design language (tokens from theme.json) without
   touching the theme.
   ========================================================================== */

.sws-blog {
	/* Theme content widths (theme.json: contentSize 1210px / wideSize 1430px). */
	--sws-content-width: var(--wp--style--global--content-size, 1210px);
	--sws-wide-width: var(--wp--style--global--wide-size, 1430px);
	--sws-primary: var(--wp--preset--color--primary, #0f3449);
	--sws-white: var(--wp--preset--color--white, #ffffff);
	--sws-muted: var(--wp--preset--color--secondary, #6c757d);
	--sws-serif: var(--wp--preset--font-family--secondary, "PT Serif", serif);
	--sws-sans: var(--wp--preset--font-family--primary, Helvetica, Arial, sans-serif);
	--sws-card-radius: 18px;
	--sws-blog-hero-image: none;

	font-family: var(--sws-sans);
	background: var(--sws-white);
	color: var(--sws-primary);
	/*
	 * The theme header is position:fixed (out of flow). The theme pushes <main>
	 * down by --site-header-height, but for hero pages it resets that to 0 so the
	 * hero bleeds under the fixed header. We mirror that here (the theme's own
	 * rule is `main:has(.hero){margin-block-start:0}`) so a 100dvh hero fills the
	 * viewport exactly — no white sliver at the bottom.
	 */
	margin-block-start: 0;
}

.sws-blog__entry {
	display: block;
}

.sws-blog-shell {
	width: min(100% - 2rem, var(--sws-content-width));
	margin-inline: auto;
}

/* ── Hero ───────────────────────────────────────────────────────────────── */

.sws-blog-hero {
	background:
		linear-gradient(
			180deg,
			rgba(0, 14, 21, 0.75) 0%,
			rgba(0, 13, 19, 0.75) 25%,
			rgba(0, 11, 17, 0.75) 50%,
			rgba(0, 10, 16, 0.75) 75%,
			rgba(0, 9, 14, 0.75) 100%
		),
		var(--sws-blog-hero-image) lightgray 50% / cover no-repeat;
	background-color: var(--sws-primary);
	color: var(--sws-white);
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	/* Capped hero height for this plugin's templates. */
	min-height: 600px;
	max-height: 600px;
	padding-block: calc(var(--site-header-height, 103px) + clamp(3rem, 6vw, 6rem)) clamp(3rem, 6vw, 6rem);
	padding-inline: 1.5rem;
}

.sws-blog-hero__inner {
	width: min(100%, var(--sws-wide-width));
}

/* Matches theme hero heading: 3.5rem mobile → 5rem desktop, secondary font. */
.sws-blog-hero__title {
	margin: 0;
	font-family: var(--sws-serif);
	font-weight: 400;
	letter-spacing: 0.01em;
	font-size: 3.5rem;
	line-height: 1.1;
}

/* Matches theme hero paragraph: 1.7rem, weight 300, line-height 1.4. */
.sws-blog-hero__subtitle {
	margin: 0.8823529412em auto 0;
	max-width: 52rem;
	font-size: 1.7rem;
	font-weight: 300;
	line-height: 1.4;
	color: rgba(255, 255, 255, 0.82);
}

@media (min-width: 768px) {
	.sws-blog-hero__title {
		font-size: 5rem;
		margin-block-end: 0.4em;
	}
}

/* ── Featured band ──────────────────────────────────────────────────────── */

.sws-blog-featured {
	padding-block: clamp(3.5rem, 6vw, 6rem) clamp(1.5rem, 3vw, 3rem);
}

.sws-blog-featured__card {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: var(--sws-card-radius);
	min-height: clamp(34rem, 40vw, 46rem);
	background:
		linear-gradient(
			180deg,
			rgba(0, 14, 21, 0.15) 0%,
			rgba(0, 11, 17, 0.55) 55%,
			rgba(0, 9, 14, 0.9) 100%
		),
		var(--sws-blog-featured-image, none) center / cover no-repeat;
	background-color: var(--sws-primary);
	color: var(--sws-white);
	text-decoration: none;
	transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.sws-blog-featured__card:hover {
	transform: translateY(-4px);
	box-shadow: 0 28px 60px rgba(12, 29, 40, 0.28);
}

/* All content sits in the lower band of the card; button to the right. */
.sws-blog-featured__content {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 2rem;
	flex-wrap: wrap;
	padding: clamp(2.5rem, 4vw, 4rem);
}

.sws-blog-featured__text {
	flex: 1 1 28rem;
	max-width: 70ch;
}

/* Chip + date · read-time row, grouped just above the title. */
.sws-blog-featured__top {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	flex-wrap: wrap;
	margin-bottom: 1.5rem;
}

.sws-blog-featured__title {
	margin: 0;
	font-family: var(--sws-serif);
	font-weight: 400;
	letter-spacing: 0.01em;
	font-size: 2.8rem;
	line-height: 1.1;
	max-width: 22ch;
}

@media (min-width: 768px) {
	.sws-blog-featured__title {
		font-size: 3.5rem;
	}
}

/* Body copy matches theme hero paragraph: 1.7rem / weight 300 / 1.4. */
.sws-blog-featured__excerpt {
	margin: 1.5rem 0 0;
	max-width: 60ch;
	font-size: 1.7rem;
	font-weight: 300;
	line-height: 1.4;
	color: rgba(255, 255, 255, 0.82);
}

.sws-blog-featured__meta {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	font-size: 1.5rem;
	font-weight: 300;
	color: rgba(255, 255, 255, 0.78);
}

/* Matches theme button-secondary-white: white pill, primary text, 1.8rem. */
.sws-blog-featured__button {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	flex: 0 0 auto;
	align-self: flex-end;
	white-space: nowrap;
	padding: 1em 1.9444444444em 1.0555555556em;
	border-radius: 999px;
	background: #B1EAFF;
	border: 1px solid var(--sws-white);
	font-family: var(--sws-serif);
	font-size: 1.8rem;
	line-height: 1;
	color: var(--sws-primary);
	transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.sws-blog-featured__card:hover .sws-blog-featured__button {
	background: transparent;
	border-color: var(--sws-white);
	color: var(--sws-white);
}

/* Stretch the button link across the whole card so the card stays clickable
   to the post, while the category chip remains an independent link on top. */
.sws-blog-featured__button {
	position: static;
	text-decoration: none;
}

.sws-blog-featured__button::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

/* Chip (shared look across featured + cards) */
.sws-blog-featured__chip,
.sws-blog-card__chip {
	display: inline-flex;
	align-items: center;
	padding: 0.55em 1.1em;
	border-radius: 999px;
	background: rgba(177, 234, 255, 0.92);
	color: var(--sws-primary);
	font-size: 1.2rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.25s ease;
}

/* Chip links sit above the card-wide link so they stay independently clickable. */
.sws-blog-featured__chip,
.sws-blog-card__chip {
	position: relative;
	z-index: 2;
}

.sws-blog-featured__chip:hover,
.sws-blog-card__chip:hover {
	background: var(--sws-white);
	color: var(--sws-primary);
}

/* ── Filter bar ─────────────────────────────────────────────────────────── */

.sws-blog-filter {
	padding-block: clamp(2rem, 3vw, 3rem);
}

.sws-blog-filter__bar {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 0.4rem;
	width: fit-content;
	max-width: 100%;
	margin-inline: auto;
	padding: 0.6rem 1.4rem;
	border-radius: 999px;
	background: var(--sws-primary);
}

.sws-blog-filter__pill {
	position: relative;
	appearance: none;
	border: 0;
	cursor: pointer;
	padding: 0.85em 1.6em;
	border-radius: 12px;
	background: transparent;
	color: rgba(255, 255, 255, 0.72);
	font-family: var(--sws-sans);
	font-size: 1.5rem;
	line-height: 1;
	transition: background 0.25s ease, color 0.25s ease;
}

/* Vertical "|" separator between tabs (not before the first, the active one, or the one after it). */
.sws-blog-filter__pill:not(:first-child)::before {
	content: "";
	position: absolute;
	left: -0.2rem;
	top: 50%;
	transform: translateY(-50%);
	width: 1px;
	height: 1.4em;
	background: rgba(255, 255, 255, 0.24);
}

.sws-blog-filter__pill.is-active::before,
.sws-blog-filter__pill.is-active + .sws-blog-filter__pill::before {
	display: none;
}

.sws-blog-filter__pill:hover {
	color: var(--sws-white);
}

.sws-blog-filter__pill.is-active {
	/* Same horizontal padding as inactive pills so neighbours don't shift when
	   the active state moves; only the vertical size + margin change. */
	padding: 0.4em 1.6em;
	margin-block: 0.35rem;
	background: var(--sws-white);
	color: var(--sws-primary);
}

/* ── Latest Articles grid ───────────────────────────────────────────────── */

.sws-blog-grid-section {
	padding-block: clamp(1.5rem, 3vw, 3rem) clamp(4rem, 7vw, 7rem);
}

.sws-blog-grid-section__title {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	margin: 0 0 clamp(2.5rem, 4vw, 3.5rem);
	font-family: var(--sws-serif);
	font-weight: 400;
	font-size: 2.5rem;
	color: var(--sws-primary);
}

.sws-blog-grid-section__rule {
	display: block;
	width: 3.5rem;
	height: 1px;
	background: var(--sws-primary);
	opacity: 0.5;
}

.sws-blog-grid {
	display: grid;
	gap: clamp(2rem, 3vw, 3rem);
	grid-template-columns: 1fr;
}

@media (min-width: 600px) {
	.sws-blog-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

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

.sws-blog-card {
	position: relative;
	display: flex;
	flex-direction: column;
}

.sws-blog-card[hidden] {
	display: none;
}

.sws-blog-card__media {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: var(--sws-card-radius);
	aspect-ratio: 16 / 10;
	background: #d9e0e4;
}

.sws-blog-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s ease;
}

.sws-blog-card__image--placeholder {
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #c4ced4, #e3e9ec);
}

.sws-blog-card__media:hover .sws-blog-card__image {
	transform: scale(1.04);
}

.sws-blog-card__chip {
	position: absolute;
	top: 1rem;
	left: 1rem;
	font-size: 1.1rem;
	font-weight: 400;
	line-height: 1.5;
	letter-spacing: 0.1rem;
	color: var(--sws-primary);
}

.sws-blog-card__body {
	display: flex;
	flex-direction: column;
	padding-top: 1.5rem;
}

.sws-blog-card__meta {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin: 0 0 0.85rem;
	font-size: 1.3rem;
	font-weight: 300;
	line-height: 1.5;
	color: rgba(15, 52, 73, 0.5);
}

.sws-blog-card__title {
	margin: 0 0 0.9rem;
	font-family: var(--sws-serif);
	font-weight: 400;
	letter-spacing: 0.024rem;
	font-size: 2.4rem;
	line-height: 1.25;
}

.sws-blog-card__title a {
	color: var(--sws-primary);
	text-decoration: none;
}

.sws-blog-card__title a:hover {
	text-decoration: underline;
}

/* Body copy matches theme default font size (1.5rem). */
.sws-blog-card__excerpt {
	margin: 0 0 1.5rem;
	font-size: 1.5rem;
	font-weight: 300;
	line-height: 1.55;
	color: rgba(15, 52, 73, 0.75);
}

.sws-blog-card__link {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin-top: auto;
	font-size: 1.4rem;
	font-weight: 400;
	line-height: 1.5;
	color: var(--sws-primary);
	text-decoration: none;
	transition: gap 0.25s ease;
}

.sws-blog-card__link:hover {
	gap: 0.85rem;
}

.sws-blog-grid__empty {
	margin: 2rem 0 0;
	font-size: 1.5rem;
	color: var(--sws-muted);
}

/* Archive pagination (category template) */
.sws-blog .pagination {
	margin-top: clamp(3rem, 5vw, 4.5rem);
}

.sws-blog .pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem;
}

.sws-blog .pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 4rem;
	padding: 0.9rem 1.3rem;
	border-radius: 999px;
	font-size: 1.4rem;
	line-height: 1;
	color: var(--sws-primary);
	text-decoration: none;
	transition: background 0.25s ease, color 0.25s ease;
}

.sws-blog .pagination .page-numbers:hover {
	background: rgba(15, 52, 73, 0.08);
}

.sws-blog .pagination .page-numbers.current {
	background: var(--sws-primary);
	color: var(--sws-white);
}

@media (max-width: 680px) {
	/* Let the featured card grow to fit its content so nothing (incl. the
	   "Read Article" button) is clipped by the fixed desktop height. */
	.sws-blog-featured__card {
		min-height: 0;
	}

	.sws-blog-featured__content {
		position: static;
		inset: auto;
		flex-direction: column;
		align-items: flex-start;
	}

	.sws-blog-featured__button {
		align-self: flex-start;
	}
	.sws-blog-filter__bar {
		border-radius: 20px;
	}
}
.sws-blog-featured__excerpt {
    opacity: 0.6;
}

button.sws-blog-filter__pill.is-active {
    border-radius: 6px;
}