/**
 * Blog / Journal styles
 *
 * Editorial layout for posts, archives and search — dark/gold brand.
 * Loaded conditionally from functions.php on blog contexts. Uses the global
 * --gw-* custom properties defined in tailwind/custom/base.css (:root).
 */

.gw-blog {
	--gw-article-col: 49rem; /* hero text, body, tags and CTA share this column */
	background: var(--gw-bg);
	color: var(--gw-text);
	font-family: var(--gw-font-body);
	overflow-wrap: anywhere;
}

/* Category / eyebrow pill — self-contained so blog pages don't depend on
 * holo-cards.css (which is only enqueued on trainer pages). Mirrors the
 * canonical .gw-holo-pill in css/holo-cards.css. */
.gw-blog .gw-holo-pill {
	display: inline-block;
	font-family: var(--gw-font-body);
	font-weight: 500;
	font-size: 0.62rem;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	padding: 6px 16px;
	border-radius: 20px;
	background: linear-gradient(135deg, rgba(132, 117, 78, 0.15), rgba(220, 200, 160, 0.15));
	color: var(--gw-gold-light);
	border: 1px solid rgba(168, 151, 106, 0.25);
	text-decoration: none;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	transition: border-color 0.2s ease, color 0.2s ease;
}

.gw-blog a.gw-holo-pill:hover {
	color: #fff;
	border-color: rgba(168, 151, 106, 0.5);
}

/* Shared inner width */
.gw-blog-body,
.gw-blog-header,
.gw-blog-grid,
.gw-blog-related,
.gw-blog-none {
	max-width: 1200px;
	margin-inline: auto;
	padding-inline: clamp(20px, 5vw, 40px);
}

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

.gw-blog-hero {
	position: relative;
	display: flex;
	align-items: flex-end;
	min-height: 62vh;
	overflow: hidden;
	background: var(--gw-surface);
}

.gw-blog-hero-media {
	position: absolute;
	inset: 0;
}

.gw-blog-hero-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.gw-blog-hero-media::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to top,
		var(--gw-bg) 0%,
		rgba(15, 15, 15, 0.75) 38%,
		rgba(15, 15, 15, 0.35) 68%,
		rgba(15, 15, 15, 0.25) 100%
	);
}

/* No featured image — solid panel, still clears the fixed header */
.gw-blog-hero--noimg {
	min-height: auto;
	background:
		radial-gradient(120% 100% at 50% 0%, rgba(132, 117, 78, 0.12), transparent 60%),
		var(--gw-bg);
}

.gw-blog-hero-inner {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: var(--gw-article-col);
	margin-inline: auto;
	padding: clamp(120px, 16vh, 200px) clamp(20px, 5vw, 40px) clamp(36px, 6vh, 64px);
}

/* Journal / Category breadcrumb above the title */
.gw-blog-crumbs {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	font-size: 0.78rem;
	font-weight: 500;
	letter-spacing: 1.5px;
	text-transform: uppercase;
}

.gw-blog-crumbs a {
	color: var(--gw-text-muted);
	text-decoration: none;
	transition: color 0.2s ease;
}

.gw-blog-crumbs a.gw-blog-crumb--current {
	color: var(--gw-gold-light);
}

.gw-blog-crumbs a:hover {
	color: #fff;
}

.gw-blog-crumbs .sep {
	color: var(--gw-text-dim);
}

.gw-blog-title {
	font-family: var(--gw-font-heading);
	font-weight: 700;
	font-size: clamp(2.2rem, 5vw, 3.6rem);
	line-height: 1.05;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: #fff;
	margin: 18px 0 0;
	text-wrap: balance;
}

.gw-blog-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-top: 18px;
	font-size: 0.82rem;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--gw-text-muted);
}

.gw-blog-meta a {
	color: var(--gw-gold-light);
	text-decoration: none;
}

.gw-blog-meta .sep {
	color: var(--gw-text-dim);
}

/* Body / prose — recolor Tailwind Typography for the dark surface */
.gw-blog-body {
	max-width: var(--gw-article-col);
	padding-top: clamp(36px, 6vh, 60px);
	padding-bottom: clamp(40px, 7vh, 72px);
}

.gw-blog-content {
	--tw-prose-body: var(--gw-text);
	--tw-prose-headings: #fff;
	--tw-prose-lead: var(--gw-text);
	--tw-prose-links: var(--gw-gold-light);
	--tw-prose-bold: #fff;
	--tw-prose-counters: var(--gw-text-muted);
	--tw-prose-bullets: var(--gw-gold);
	--tw-prose-hr: var(--gw-border);
	--tw-prose-quotes: #fff;
	--tw-prose-quote-borders: var(--gw-gold);
	--tw-prose-captions: var(--gw-text-muted);
	--tw-prose-code: #fff;
	--tw-prose-pre-code: var(--gw-text);
	--tw-prose-pre-bg: var(--gw-surface);
	--tw-prose-th-borders: var(--gw-border);
	--tw-prose-td-borders: var(--gw-border);
	max-width: none;
	font-size: 1.1rem;
	line-height: 1.75;
}

/* The base stylesheet caps and centers every block inside .entry-content at
 * 640px; here the column itself is the measure, so blocks sit on its edge. */
.gw-blog-content > :not(.alignwide):not(.alignfull) {
	max-width: none;
	margin-inline: 0;
}

.gw-blog-content h2,
.gw-blog-content h3 {
	font-family: var(--gw-font-heading);
	letter-spacing: 0.4px;
	text-transform: uppercase;
}

.gw-blog-content a {
	text-underline-offset: 3px;
	text-decoration-color: var(--gw-border-gold);
	transition: color 0.2s ease;
}

.gw-blog-content a:hover {
	color: #fff;
}

.gw-blog-content blockquote {
	font-family: var(--gw-font-heading);
	font-style: normal;
	letter-spacing: 0.3px;
}

/* Tags */
.gw-blog-tags {
	margin: 40px 0 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.gw-blog-tags a {
	font-size: 0.75rem;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: var(--gw-text-muted);
	border: 1px solid var(--gw-border);
	border-radius: 999px;
	padding: 5px 14px;
	text-decoration: none;
	transition: border-color 0.2s ease, color 0.2s ease;
}

.gw-blog-tags a:hover {
	color: var(--gw-gold-light);
	border-color: var(--gw-border-gold);
}

/* End-of-post CTA band */
.gw-blog-cta {
	margin: clamp(48px, 8vh, 80px) 0 0;
	padding: clamp(32px, 5vw, 48px);
	text-align: center;
	background:
		radial-gradient(120% 140% at 50% 0%, rgba(132, 117, 78, 0.16), transparent 65%),
		var(--gw-surface);
	border: 1px solid var(--gw-border-gold);
	border-radius: var(--gw-radius);
}

.gw-blog-cta h2 {
	font-family: var(--gw-font-heading);
	font-weight: 700;
	font-size: clamp(1.6rem, 4vw, 2.4rem);
	letter-spacing: 1px;
	text-transform: uppercase;
	color: #fff;
	margin: 0;
}

.gw-blog-cta p {
	margin: 12px auto 24px;
	max-width: 42ch;
	color: var(--gw-text-muted);
}

/* "Keep reading" — related articles under the post */
.gw-blog-related {
	padding-top: clamp(40px, 7vh, 72px);
	border-top: 1px solid var(--gw-border);
}

/* Fewer than three related cards stay centered under the heading */
.gw-blog-related .gw-blog-grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
}

.gw-blog-related .gw-blog-card {
	flex: 1 1 300px;
	max-width: 380px;
}

.gw-blog-section-head {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	text-align: center;
	margin-bottom: clamp(24px, 4vw, 40px);
}

.gw-blog-section-head h2 {
	font-family: var(--gw-font-heading);
	font-weight: 700;
	font-size: clamp(1.6rem, 3.5vw, 2.2rem);
	letter-spacing: 1px;
	text-transform: uppercase;
	color: #fff;
	margin: 0;
}

.gw-blog-section-head a {
	font-size: 0.78rem;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--gw-gold-light);
	text-decoration: none;
	transition: color 0.2s ease;
}

.gw-blog-section-head a:hover {
	color: #fff;
}

/* ---------------------------------------------------------------------------
 * Listing (home / archive / search)
 * ------------------------------------------------------------------------- */

.gw-blog-header {
	padding-top: clamp(130px, 20vh, 220px);
	padding-bottom: clamp(28px, 5vh, 48px);
	text-align: center;
}

.gw-blog-header-title {
	font-family: var(--gw-font-heading);
	font-weight: 700;
	font-size: clamp(2.4rem, 6vw, 4rem);
	line-height: 1.05;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: #fff;
	margin: 16px 0 0;
}

.gw-blog-header-sub {
	margin: 14px auto 0;
	max-width: 52ch;
	color: var(--gw-text-muted);
	font-size: 1.05rem;
}

.gw-blog-header-sub span {
	color: var(--gw-gold-light);
}

/* Category chips */
.gw-blog-filters {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-top: clamp(22px, 3vw, 32px);
}

.gw-blog-filters a {
	font-family: var(--gw-font-heading);
	font-weight: 500;
	font-size: 0.95rem;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	color: var(--gw-text-muted);
	border: 1px solid var(--gw-border);
	border-radius: 999px;
	padding: 7px 18px;
	text-decoration: none;
	transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.gw-blog-filters a:hover {
	color: var(--gw-gold-light);
	border-color: var(--gw-border-gold);
}

.gw-blog-filters a.is-current {
	color: #fff;
	background: var(--gw-surface);
	border-color: rgba(168, 151, 106, 0.5);
}

.gw-blog-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: clamp(20px, 3vw, 32px);
	padding-bottom: clamp(48px, 8vh, 88px);
}

.gw-blog-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--gw-surface);
	border: 1px solid var(--gw-border);
	border-radius: var(--gw-radius);
	overflow: hidden;
	transition: transform 0.25s ease, border-color 0.25s ease;
}

.gw-blog-card:hover {
	transform: translateY(-4px);
	border-color: var(--gw-border-gold);
}

.gw-blog-card-media {
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--gw-surface-light);
}

.gw-blog-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.gw-blog-card:hover .gw-blog-card-media img {
	transform: scale(1.04);
}

/* Placeholder when a post has no featured image */
.gw-blog-card-media--empty {
	display: flex;
	align-items: center;
	justify-content: center;
	background:
		radial-gradient(120% 120% at 50% 0%, rgba(132, 117, 78, 0.14), transparent 65%),
		var(--gw-surface-light);
}

.gw-blog-card-media--empty span {
	font-family: var(--gw-font-heading);
	font-size: 1.4rem;
	letter-spacing: 3px;
	text-transform: uppercase;
	color: var(--gw-gold);
	opacity: 0.6;
}

.gw-blog-card-body {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 22px 24px 26px;
}

.gw-blog-card-title {
	font-family: var(--gw-font-heading);
	font-weight: 600;
	font-size: 1.4rem;
	line-height: 1.15;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	margin: 0;
}

.gw-blog-card-title a {
	color: #fff;
	text-decoration: none;
}

/* Stretched link — whole card is clickable, pill link stays separate */
.gw-blog-card-title a::after {
	content: '';
	position: absolute;
	inset: 0;
}

.gw-blog-card:hover .gw-blog-card-title a {
	color: var(--gw-gold-light);
}

.gw-blog-card-excerpt {
	color: var(--gw-text-muted);
	font-size: 0.95rem;
	line-height: 1.6;
	margin: 0;
}

.gw-blog-card-meta {
	margin-top: 4px;
	font-size: 0.75rem;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--gw-text-dim);
}

/* The category pill sits above the stretched link */
.gw-blog-card .gw-holo-pill {
	position: relative;
	z-index: 1;
	align-self: flex-start;
}

/* Lead article — spans the grid, image beside text on wide screens */
.gw-blog-card--featured {
	grid-column: 1 / -1;
}

.gw-blog-card--featured .gw-blog-card-body {
	padding: 26px 28px 30px;
}

.gw-blog-card--featured .gw-blog-card-title {
	font-size: clamp(1.7rem, 3.2vw, 2.6rem);
	line-height: 1.08;
}

.gw-blog-card--featured .gw-blog-card-excerpt {
	font-size: 1.02rem;
	max-width: 52ch;
}

.gw-blog-card-more {
	margin-top: 10px;
	font-size: 0.78rem;
	font-weight: 500;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--gw-gold-light);
}

@media (min-width: 900px) {
	.gw-blog-card--featured {
		display: grid;
		grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
	}

	.gw-blog-card--featured .gw-blog-card-media {
		position: relative;
		aspect-ratio: auto;
		min-height: 440px;
	}

	.gw-blog-card--featured .gw-blog-card-media img {
		position: absolute;
		inset: 0;
	}

	.gw-blog-card--featured .gw-blog-card-body {
		justify-content: center;
		padding: clamp(32px, 4vw, 56px);
	}
}

/* ---------------------------------------------------------------------------
 * Pagination + empty state
 * ------------------------------------------------------------------------- */

.gw-blog .pagination,
.gw-blog .nav-links {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
	padding-bottom: clamp(48px, 8vh, 88px);
}

.gw-blog .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	height: 44px;
	padding: 0 12px;
	border: 1px solid var(--gw-border);
	border-radius: var(--gw-radius-sm);
	color: var(--gw-text);
	text-decoration: none;
	font-family: var(--gw-font-heading);
	letter-spacing: 0.5px;
	transition: border-color 0.2s ease, color 0.2s ease;
}

.gw-blog .page-numbers:hover,
.gw-blog .page-numbers.current {
	border-color: var(--gw-border-gold);
	color: var(--gw-gold-light);
}

.gw-blog .page-numbers.current {
	background: var(--gw-surface);
}

.gw-blog-none {
	padding-top: clamp(130px, 20vh, 220px);
	padding-bottom: clamp(80px, 14vh, 160px);
	text-align: center;
}

.gw-blog-none h1 {
	font-family: var(--gw-font-heading);
	font-weight: 700;
	font-size: clamp(2rem, 5vw, 3rem);
	letter-spacing: 1px;
	text-transform: uppercase;
	color: #fff;
}

.gw-blog-none p {
	margin: 12px auto 24px;
	max-width: 46ch;
	color: var(--gw-text-muted);
}

.gw-blog-none .search-form {
	display: inline-flex;
	gap: 8px;
}

.gw-blog-none input[type='search'] {
	background: var(--gw-surface);
	border: 1px solid var(--gw-border);
	border-radius: var(--gw-radius-sm);
	color: var(--gw-text);
	padding: 10px 16px;
	min-width: 220px;
}
