/* ==========================================================================
   Blog: listing, archives, search (template-parts/blog-head.php, post-list.php,
   post-card.php) and single posts (single.php).
   ========================================================================== */

/* Header --------------------------------------------------------------------- */
.blog-head,
.post-head {
	position: relative;
	isolation: isolate;
}

.blog-head {
	padding-block: clamp(40px, 6vw, 88px) clamp(32px, 4vw, 48px);
}

.blog-head__glow {
	position: absolute;
	top: 0;
	left: 50%;
	z-index: -1;
	width: min(1100px, 140vw);
	aspect-ratio: 1;
	transform: translate(-50%, -45%);
	border-radius: 50%;
	background: radial-gradient(closest-side, rgba(243, 218, 221, 0.9), rgba(251, 246, 244, 0));
	pointer-events: none;
}

.blog-head__grid {
	display: grid;
	grid-template-columns: 1.15fr 0.85fr;
	gap: 28px clamp(32px, 5vw, 80px);
	align-items: end;
}

.blog-head .eyebrow {
	margin-bottom: 20px;
}

.blog-head__side {
	display: flex;
	flex-direction: column;
	gap: 22px;
}

.blog-head .search-form {
	max-width: none;
}

.blog-head .search-form .field__control {
	background: var(--color-white);
}

.blog-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: clamp(32px, 4vw, 48px);
}

.blog-filter {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	border-radius: var(--radius-pill);
	background: var(--color-white);
	box-shadow: inset 0 0 0 1px var(--line-on-light);
	font-family: var(--font-ui);
	font-size: 14px;
	font-weight: 600;
	color: var(--color-ink);
	transition: background-color var(--dur-fast), color var(--dur-fast), box-shadow var(--dur-fast);
}

.blog-filter span {
	min-width: 24px;
	padding: 2px 7px;
	border-radius: var(--radius-pill);
	background: var(--accent-soft);
	font-family: var(--font-ui);
	font-size: 12px;
	text-align: center;
	color: var(--color-burgundy-600);
}

.blog-filter:hover {
	box-shadow: inset 0 0 0 1px var(--color-burgundy-600);
	color: var(--color-burgundy-600);
}

.blog-filter.is-active {
	background: var(--color-burgundy-600);
	box-shadow: none;
	color: var(--color-white);
}

.blog-filter.is-active span {
	background: rgba(255, 255, 255, 0.18);
	color: var(--color-white);
}

/* Post cards ------------------------------------------------------------------- */
.blog-list {
	padding-block: 8px clamp(72px, 10vw, 120px);
}

.post-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 28px;
}

/* The whole card is clickable through the title link's overlay. */
.post-card {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-radius: var(--radius-card);
	background: var(--color-white);
	box-shadow: inset 0 0 0 1px var(--line-on-light);
	transition: transform 0.6s var(--ease-out), box-shadow 0.6s var(--ease-out);
}

.post-card:hover {
	transform: translateY(-6px);
	box-shadow: inset 0 0 0 1px var(--color-blush-200), var(--shadow-soft);
}

.post-card__image {
	position: relative;
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: linear-gradient(135deg, var(--color-burgundy-800), var(--color-burgundy-600) 60%, var(--color-blush-200));
}

.post-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 1.2s var(--ease-out);
}

.post-card:hover .post-card__image img {
	transform: scale(1.06);
}

.post-card__placeholder {
	display: grid;
	place-items: center;
	height: 100%;
	color: rgba(255, 255, 255, 0.55);
}

.post-card__placeholder svg {
	width: 72px;
}

.post-card__tag {
	position: absolute;
	top: 16px;
	left: 16px;
	padding: 6px 12px;
	border-radius: var(--radius-pill);
	background: rgba(255, 255, 255, 0.92);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	font-family: var(--font-ui);
	font-size: 12px;
	font-weight: 600;
	line-height: normal;
	color: var(--color-burgundy-600);
}

.post-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	padding: 24px 26px 26px;
}

.post-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	font-family: var(--font-ui);
	font-size: 14px;
	line-height: normal;
	color: var(--color-slate);
}

.post-card__title {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 21px;
	line-height: 1.3;
	color: var(--color-ink);
}

.post-card__title a {
	transition: color var(--dur-fast);
}

.post-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.post-card:hover .post-card__title a {
	color: var(--color-burgundy-600);
}

.post-card__title a:focus-visible {
	outline: none;
}

.post-card:focus-within {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
}

.post-card__excerpt {
	flex: 1;
	font-size: 18px;
	line-height: 1.65;
	color: var(--color-slate);
}

.post-card__more {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-top: 6px;
	font-family: var(--font-ui);
	font-size: 14px;
	font-weight: 600;
	color: var(--color-burgundy-600);
}

.post-card__circle {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border: 1.5px solid currentColor;
	border-radius: 50%;
	transition: background-color var(--dur-base), color var(--dur-base), transform 0.5s var(--ease-out);
}

.post-card__circle svg {
	width: 14px;
}

.post-card:hover .post-card__circle {
	background: var(--color-burgundy-600);
	color: var(--color-white);
	transform: rotate(45deg);
}

/* Featured: the newest post leads the listing as a wide card. */
.post-card--featured {
	display: grid;
	grid-template-columns: 1.15fr 1fr;
	margin-bottom: 28px;
}

.post-card--featured .post-card__image {
	aspect-ratio: auto;
	min-height: 440px;
}

.post-card--featured .post-card__image img {
	position: absolute;
	inset: 0;
}

.post-card--featured .post-card__body {
	justify-content: center;
	gap: 16px;
	padding: clamp(28px, 4vw, 56px);
}

.post-card--featured .post-card__title {
	font-size: clamp(26px, 2.6vw, 38px);
	line-height: 1.2;
}

.post-card--featured .post-card__excerpt {
	flex: none;
	font-size: 19px;
	line-height: 1.75;
}

/* Pagination and empty state */
.blog-list .pagination .nav-links {
	justify-content: center;
}

.blog-list .pagination .page-numbers:not(.current):not(:hover) {
	background: var(--color-white);
}

.blog-empty {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 24px;
}

/* Single post ------------------------------------------------------------------- */

/* Reading progress along the top edge, driven by the page scroll (no JS). */
.read-progress {
	display: none;
}

@supports (animation-timeline: scroll()) {
	.read-progress {
		position: fixed;
		inset: 0 0 auto;
		z-index: 200;
		display: block;
		height: 3px;
		background: linear-gradient(90deg, #ff6b7a, var(--color-blush-100));
		transform-origin: 0 50%;
		animation: read-progress linear both;
		animation-timeline: scroll(root);
	}
}

@keyframes read-progress {
	from { transform: scaleX(0); }
	to   { transform: scaleX(1); }
}

.post-head {
	padding-block: clamp(40px, 6vw, 80px) clamp(36px, 5vw, 56px);
}

.post-head__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.post-head .sd-crumbs {
	justify-content: center;
}

.post-head__title {
	max-width: 940px;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: clamp(32px, 4.2vw, 56px);
	line-height: 1.12;
	color: var(--color-ink);
}

.post-head__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 10px 12px;
	margin-top: 26px;
	font-family: var(--font-ui);
	font-size: 15px;
	color: var(--color-slate);
}

.post-head__meta .landing-tag {
	align-self: center;
}

.post-cover__frame {
	position: relative;
	max-width: 1200px;
	margin: 0 auto;
	aspect-ratio: 21 / 9;
	background: linear-gradient(135deg, var(--color-burgundy-800), var(--color-burgundy-600) 60%, var(--color-blush-200));
}

.post-cover__frame img { /* taller than the frame: data-parallax drifts it */
	position: absolute;
	top: -6%;
	left: 0;
	width: 100%;
	height: 112%;
	object-fit: cover;
}

.post-body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: clamp(40px, 6vw, 96px);
	align-items: start;
	padding-block: clamp(48px, 7vw, 96px);
}

.post-body__main {
	max-width: 740px;
}

/* Opening letter of the article */
.post .entry-content > p:first-child::first-letter {
	float: left;
	margin: 0.08em 0.12em 0 0;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 3.6em;
	line-height: 0.82;
	color: var(--color-burgundy-600);
}

.post .entry-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 36px;
}

.post .entry-tags span {
	margin-right: 4px;
	font-weight: 600;
	color: var(--color-ink);
}

.post .entry-tags a {
	padding: 4px 12px;
	border-radius: var(--radius-pill);
	background: var(--color-white);
	box-shadow: inset 0 0 0 1px var(--line-on-light);
}

/* Share */
.post-share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: 48px;
	padding-top: 28px;
	border-top: 1px solid var(--line-on-light);
}

.post-share__label {
	font-family: var(--font-ui);
	font-size: 14px;
	font-weight: 600;
	color: var(--color-ink);
}

.post-share__list {
	display: flex;
	gap: 10px;
}

.post-share__btn {
	position: relative;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--color-white);
	box-shadow: inset 0 0 0 1px var(--line-on-light);
	color: var(--color-burgundy-600);
	transition: background-color var(--dur-fast), color var(--dur-fast), transform 0.4s var(--ease-out);
}

.post-share__btn svg {
	width: 18px;
}

.post-share__btn:hover {
	background: var(--color-burgundy-600);
	color: var(--color-white);
	transform: translateY(-3px);
}

.post-share__copied {
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	padding: 5px 10px;
	border-radius: 8px;
	background: var(--color-ink);
	font-family: var(--font-ui);
	font-size: 12px;
	font-weight: 500;
	white-space: nowrap;
	color: var(--color-white);
	transform: translateX(-50%);
	pointer-events: none;
}

.post-share__copied:empty {
	display: none;
}

/* Previous / next */
.post-nav {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
	margin-top: 32px;
}

.post-nav__link {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 20px 22px;
	border-radius: 20px;
	background: var(--color-white);
	box-shadow: inset 0 0 0 1px var(--line-on-light);
	transition: box-shadow var(--dur-fast), transform 0.5s var(--ease-out);
}

.post-nav__link:hover {
	box-shadow: inset 0 0 0 1px var(--color-burgundy-600);
	transform: translateY(-3px);
}

.post-nav__link--next {
	grid-column: 2;
	text-align: right;
}

.post-nav__label {
	font-family: var(--font-ui);
	font-size: 13px;
	font-weight: 600;
	color: var(--color-burgundy-600);
}

.post-nav__title {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 18px;
	line-height: 1.35;
	color: var(--color-ink);
}

/* Sidebar: emergency line and booking */
.post-body__aside {
	position: sticky;
	top: var(--sticky-top);
}

.post-help {
	--accent: var(--color-white);
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	overflow: hidden;
	padding: 32px 28px 104px;
	border-radius: var(--radius-card);
	background: linear-gradient(160deg, var(--color-burgundy-600), var(--color-burgundy-700));
	color: var(--color-white);
}

.post-help__label {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-family: var(--font-ui);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--color-blush-200);
}

.post-help__number {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 32px;
	line-height: 1.15;
}

.post-help__text {
	margin-bottom: 8px;
	font-size: 18px;
	line-height: 1.6;
	color: var(--color-blush-100);
}

.post-help .ecg {
	position: absolute;
	right: 0;
	bottom: 18px;
	left: 0;
	width: 100%;
	height: 60px;
	color: rgba(243, 218, 221, 0.3);
}

/* Keep reading */
.post-related {
	padding-block: clamp(64px, 9vw, 110px);
	border-radius: var(--radius-panel) var(--radius-panel) 0 0;
	background: var(--color-paper);
}

.post-related__all {
	justify-self: end;
	margin-top: 0;
}

/* Responsive ---------------------------------------------------------------------- */
@media (max-width: 1080px) {
	.post-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.post-body {
		grid-template-columns: minmax(0, 1fr) 280px;
	}
}

@media (max-width: 900px) {
	.blog-head__grid,
	.post-card--featured,
	.post-body {
		grid-template-columns: minmax(0, 1fr);
	}

	.post-card--featured .post-card__image {
		min-height: 0;
		aspect-ratio: 16 / 10;
	}

	.post-body__main {
		max-width: none;
	}

	.post-body__aside {
		position: static;
	}

	.post-related__all {
		justify-self: start;
	}
}

@media (max-width: 640px) {
	.post-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 20px;
	}

	.post-card__body {
		padding: 20px 20px 22px;
	}

	/* Long titles read better left-aligned on a phone. */
	.post-head__inner {
		align-items: flex-start;
		text-align: left;
	}

	.post-head .sd-crumbs,
	.post-head__meta {
		justify-content: flex-start;
	}

	.post-cover__frame {
		aspect-ratio: 4 / 3;
	}

	.post-nav {
		grid-template-columns: minmax(0, 1fr);
	}

	.post-nav__link--next {
		grid-column: auto;
		text-align: left;
	}

	.post-help {
		padding: 26px 22px 96px;
	}
}
