/**
 * Hemp.com design system (Astra child) — aligns with Hemp Platform premium shell tokens.
 * Use these utilities inside block patterns and FSE templates for consistent rails + sections.
 */

:root {
	--hemp-ink: #063d27;
	--hemp-ink-soft: rgba(6, 61, 39, 0.78);
	--hemp-accent: #0d5c3a;
	--hemp-accent-deep: #0a4a2f;
	--hemp-gold: #c9a227;
	--hemp-gold-soft: #e8d48b;
	--hemp-bg: #f4f7f5;
	--hemp-surface: #ffffff;
	--hemp-edge: rgba(13, 92, 58, 0.14);
	--hemp-shadow: 0 8px 32px rgba(6, 40, 30, 0.07);
	--hemp-radius: 14px;
	--hemp-radius-sm: 10px;
	--hemp-max: 72rem;
	--hemp-space-section: clamp(2rem, 5vw, 3.5rem);
	--hemp-space-band: clamp(1.25rem, 3vw, 2rem);
}

body.hemp-com-astra-child {
	color: var(--hemp-ink-soft);
}

/* --- Layout shells (use as Group additional CSS class) --- */
.hemp-shell-section {
	max-width: var(--hemp-max);
	margin-left: auto;
	margin-right: auto;
	padding-left: clamp(1rem, 3vw, 1.5rem);
	padding-right: clamp(1rem, 3vw, 1.5rem);
	padding-top: var(--hemp-space-section);
	padding-bottom: var(--hemp-space-section);
}

.hemp-shell-section--tight {
	padding-top: var(--hemp-space-band);
	padding-bottom: var(--hemp-space-band);
}

.hemp-shell-surface {
	background: var(--hemp-surface);
	border: 1px solid var(--hemp-edge);
	border-radius: var(--hemp-radius);
	box-shadow: var(--hemp-shadow);
}

/* --- Sponsor / ad rails (structure only; wire creatives via ad plugin or blocks) --- */
.hemp-rail {
	display: grid;
	gap: clamp(1rem, 2vw, 1.5rem);
}

@media (min-width: 900px) {
	.hemp-rail--sponsor-ad {
		grid-template-columns: 1fr 1fr;
		align-items: stretch;
	}
}

.hemp-slot {
	min-height: 120px;
	border-radius: var(--hemp-radius-sm);
	background: linear-gradient(180deg, rgba(244, 247, 245, 0.9) 0%, var(--hemp-surface) 100%);
	border: 1px dashed rgba(13, 92, 58, 0.28);
	padding: 1rem 1.1rem;
	color: var(--hemp-ink-soft);
	font-size: 0.9375rem;
	line-height: 1.45;
}

.hemp-slot__label {
	display: block;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--hemp-accent);
	margin-bottom: 0.35rem;
}

/* Editor canvas: make slots obvious without affecting front end if classes reused */
.block-editor-block-preview .hemp-slot,
.editor-styles-wrapper .hemp-slot {
	background: rgba(13, 92, 58, 0.04);
}

/* --- Crosslink / wayfinding bands --- */
.hemp-crosslink-band {
	background: linear-gradient(135deg, var(--hemp-accent-deep) 0%, var(--hemp-accent) 55%, #1a6b47 100%);
	color: #f4f7f5;
	border-radius: var(--hemp-radius);
	padding: var(--hemp-space-band);
	box-shadow: var(--hemp-shadow);
	border: 1px solid rgba(255, 255, 255, 0.12);
}

.hemp-crosslink-band h2,
.hemp-crosslink-band h3,
.hemp-crosslink-band p {
	color: inherit;
}

.hemp-crosslink-band a {
	color: var(--hemp-gold-soft);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.hemp-crosslink-band a:hover,
.hemp-crosslink-band a:focus {
	color: #fff;
}

/* --- Homepage topic row title (optional class on heading block) --- */
.hemp-topic-heading {
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--hemp-ink);
	border-bottom: 3px solid var(--hemp-gold);
	padding-bottom: 0.35rem;
	margin-bottom: 1rem;
}

/* --- Query Loop systems: fixed media, controlled density, no page takeover --- */
.hemp-query-loop {
	--hemp-query-image-h: 180px;
	--hemp-query-thumb-w: 112px;
	--hemp-query-thumb-h: 78px;
}

.hemp-query-loop :where(.wp-block-post-template) {
	gap: clamp(1rem, 2vw, 1.35rem);
	margin: 0;
	padding: 0;
}

.hemp-query-loop :where(.wp-block-post) {
	box-sizing: border-box;
	min-width: 0;
}

.hemp-query-loop :where(.wp-block-post > .wp-block-group:not(.hemp-query-overlay-card__meta)) {
	min-width: 0;
}

.hemp-query-loop :where(.wp-block-post-title) {
	margin: 0;
	color: var(--hemp-ink);
	font-weight: 800;
	letter-spacing: -0.015em;
	line-height: 1.18;
}

.hemp-query-loop :where(.wp-block-post-title a) {
	color: inherit;
	text-decoration: none;
}

.hemp-query-loop :where(.wp-block-post-title a:hover, .wp-block-post-title a:focus) {
	color: var(--hemp-accent);
	text-decoration: underline;
	text-underline-offset: 0.16em;
}

.hemp-query-loop :where(.wp-block-post-excerpt) {
	color: var(--hemp-ink-soft);
	font-size: 0.96rem;
	line-height: 1.5;
	margin-top: 0.45rem;
}

.hemp-query-loop :where(.wp-block-post-date) {
	color: #5a7268;
	font-size: 0.82rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.hemp-query-loop :where(.wp-block-post-featured-image) {
	margin: 0;
}

.hemp-query-loop :where(.wp-block-post-featured-image img) {
	display: block;
	width: 100%;
	object-fit: cover;
	background: #e8efeb;
}

.hemp-query-overlay :where(.wp-block-post) {
	display: grid;
	position: relative;
	overflow: hidden;
	border-radius: var(--hemp-radius);
	background: var(--hemp-ink);
	box-shadow: 0 8px 28px rgba(6, 40, 30, 0.1);
}

.hemp-query-overlay :where(.wp-block-post-featured-image) {
	grid-area: 1 / 1;
	height: 100%;
	min-height: inherit;
	z-index: 1;
}

.hemp-query-overlay :where(.wp-block-post-featured-image a) {
	display: block;
	height: 100%;
}

.hemp-query-overlay :where(.wp-block-post-featured-image img) {
	height: 100%;
	min-height: 100%;
	filter: saturate(0.95);
	transition: transform 180ms ease, filter 180ms ease;
}

.hemp-query-overlay :where(.wp-block-post:hover .wp-block-post-featured-image img) {
	filter: saturate(1.08);
	transform: scale(1.025);
}

.hemp-query-overlay-card__meta {
	align-self: end;
	grid-area: 1 / 1;
	z-index: 2;
	padding: clamp(0.8rem, 2vw, 1.2rem);
	background: linear-gradient(180deg, rgba(6, 61, 39, 0) 0%, rgba(6, 61, 39, 0.86) 72%, rgba(6, 61, 39, 0.96) 100%);
}

.hemp-query-overlay-card__meta .wp-block-post-date,
.hemp-query-overlay-card__meta .wp-block-post-date time,
.hemp-query-overlay-card__meta .wp-block-post-date a {
	color: var(--hemp-gold-soft) !important;
}

.hemp-query-overlay-card__meta .wp-block-post-title,
.hemp-query-overlay-card__meta .wp-block-post-title a {
	color: #fff !important;
	text-shadow: 0 2px 14px rgba(0, 0, 0, 0.38);
}

.hemp-query-overlay-card__meta .wp-block-post-title a:hover,
.hemp-query-overlay-card__meta .wp-block-post-title a:focus {
	color: #fff !important;
	text-decoration-color: var(--hemp-gold-soft) !important;
}

.hemp-query-overlay-split :where(.wp-block-post-template) {
	display: grid;
	grid-template-columns: 1fr;
}

.hemp-query-overlay-split .wp-block-post-template {
	display: grid !important;
}

.hemp-query-overlay-split :where(.wp-block-post) {
	min-height: 210px;
}

.hemp-query-overlay-split :where(.wp-block-post:not(:first-child)) {
	min-height: 150px;
}

@media (min-width: 900px) {
	.hemp-query-overlay-split :where(.wp-block-post-template) {
		grid-template-columns: minmax(0, 1.35fr) minmax(20rem, 0.85fr);
		grid-template-rows: repeat(3, minmax(145px, 1fr));
	}

	.hemp-query-overlay-split :where(.wp-block-post:first-child) {
		grid-row: 1 / span 3;
		min-height: clamp(420px, 46vw, 560px);
	}

	.hemp-query-overlay-split :where(.wp-block-post:not(:first-child)) {
		min-height: 0;
	}
}

.hemp-query-overlay-split :where(.wp-block-post:first-child .wp-block-post-title) {
	font-size: clamp(1.35rem, 3vw, 2.25rem);
}

.hemp-query-overlay-split :where(.wp-block-post:not(:first-child) .wp-block-post-title) {
	font-size: clamp(1rem, 1.7vw, 1.2rem);
}

.hemp-query-overlay-mosaic :where(.wp-block-post-template) {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
	grid-auto-rows: minmax(240px, 1fr);
}

.hemp-query-overlay-mosaic .wp-block-post-template {
	display: grid !important;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)) !important;
	grid-auto-rows: minmax(240px, 1fr);
}

.hemp-query-overlay-mosaic :where(.wp-block-post) {
	min-height: 240px;
}

@media (min-width: 900px) {
	.hemp-query-overlay-mosaic :where(.wp-block-post:first-child) {
		grid-column: span 2;
	}

	.hemp-query-overlay-mosaic .wp-block-post-template > .wp-block-post:first-child {
		grid-column: span 2 !important;
	}
}

.hemp-query-overlay-grid :where(.wp-block-post-template) {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
	grid-auto-rows: minmax(220px, 1fr);
}

.hemp-query-overlay-grid .wp-block-post-template {
	display: grid !important;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)) !important;
	grid-auto-rows: minmax(220px, 1fr);
}

.hemp-query-overlay-grid :where(.wp-block-post) {
	min-height: 220px;
}

.hemp-query-two-topic-board {
	display: grid;
	gap: clamp(1rem, 2vw, 1.35rem);
}

@media (min-width: 900px) {
	.hemp-query-two-topic-board {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.hemp-query-two-topic-board .hemp-shell-surface {
	padding: clamp(1rem, 2vw, 1.35rem);
}

.hemp-query-card-grid :where(.wp-block-post-template) {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
	grid-auto-rows: 1fr;
	align-items: stretch;
}

.hemp-query-card-grid .wp-block-post-template {
	display: grid !important;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)) !important;
	grid-auto-rows: 1fr;
	align-items: stretch;
}

.hemp-query-card-grid :where(.wp-block-post) {
	background: var(--hemp-surface);
	border: 1px solid var(--hemp-edge);
	border-radius: var(--hemp-radius);
	box-shadow: 0 4px 18px rgba(6, 40, 30, 0.05);
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 0;
	overflow: hidden;
}

.hemp-query-card-grid :where(.wp-block-post > *:not(.wp-block-post-featured-image)) {
	margin-left: 1rem;
	margin-right: 1rem;
}

.hemp-query-card-grid :where(.wp-block-post > :last-child) {
	margin-bottom: 1rem;
}

.hemp-query-card-grid :where(.wp-block-post-title) {
	margin-top: 0.55rem;
}

.hemp-query-card-grid :where(.wp-block-post-excerpt) {
	flex: 1 1 auto;
}

.hemp-query-card-grid :where(.wp-block-post-featured-image img) {
	aspect-ratio: 16 / 10;
	height: var(--hemp-query-image-h);
}

.hemp-query-card-grid :where(.wp-block-post-featured-image),
.hemp-query-card-grid :where(.wp-block-post-featured-image a) {
	display: block;
	flex: 0 0 var(--hemp-query-image-h);
	height: var(--hemp-query-image-h);
	overflow: hidden;
}

.hemp-query-publisher-river {
	display: grid;
	gap: clamp(1rem, 2vw, 1.5rem);
}

@media (min-width: 980px) {
	.hemp-query-publisher-river {
		grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.75fr);
		align-items: start;
	}
}

.hemp-query-publisher-river__main,
.hemp-query-publisher-river__side {
	padding: clamp(1rem, 2vw, 1.35rem);
}

.hemp-query-publisher-river__side {
	background: linear-gradient(180deg, rgba(244, 247, 245, 0.94) 0%, #fff 100%);
}

.hemp-query-publisher-river__side .hemp-query-media-list {
	--hemp-query-thumb-w: 88px;
	--hemp-query-thumb-h: 64px;
}

.hemp-query-topic-stack :where(.wp-block-post-template) {
	display: grid;
	grid-template-columns: 1fr;
}

@media (min-width: 780px) {
	.hemp-query-topic-stack :where(.wp-block-post-template) {
		grid-template-columns: 1.05fr 0.95fr;
	}
}

.hemp-query-media-list :where(.wp-block-post-template) {
	display: grid;
	grid-template-columns: 1fr;
}

.hemp-query-media-list :where(.wp-block-post) {
	display: grid;
	grid-template-columns: var(--hemp-query-thumb-w) minmax(0, 1fr);
	gap: 0.85rem;
	align-items: center;
	border-bottom: 1px solid var(--hemp-edge);
	padding-bottom: 1rem;
}

.hemp-query-media-list :where(.wp-block-post-featured-image img) {
	aspect-ratio: 4 / 3;
	width: var(--hemp-query-thumb-w);
	height: var(--hemp-query-thumb-h);
	border-radius: var(--hemp-radius-sm);
}

.hemp-query-media-list :where(.wp-block-post-title) {
	font-size: clamp(1rem, 1.8vw, 1.16rem);
}

.hemp-query-media-list :where(.wp-block-post-excerpt) {
	display: none;
}

.hemp-query-authority-stack :where(.wp-block-post-template) {
	display: grid;
	grid-template-columns: 1fr;
}

@media (min-width: 900px) {
	.hemp-query-authority-stack :where(.wp-block-post-template) {
		grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.8fr);
	}

	.hemp-query-authority-stack :where(.wp-block-post:first-child) {
		grid-row: span 4;
	}
}

.hemp-query-authority-stack :where(.wp-block-post:first-child) {
	background: var(--hemp-surface);
	border: 1px solid var(--hemp-edge);
	border-radius: var(--hemp-radius);
	box-shadow: var(--hemp-shadow);
	overflow: hidden;
}

.hemp-query-authority-stack :where(.wp-block-post:first-child .wp-block-post-featured-image img) {
	aspect-ratio: 16 / 9;
	height: clamp(220px, 32vw, 380px);
}

.hemp-query-authority-stack :where(.wp-block-post:first-child > *:not(.wp-block-post-featured-image)) {
	margin-left: 1.15rem;
	margin-right: 1.15rem;
}

.hemp-query-authority-stack :where(.wp-block-post:first-child > :last-child) {
	margin-bottom: 1.15rem;
}

.hemp-query-authority-stack :where(.wp-block-post:not(:first-child)) {
	display: grid;
	grid-template-columns: var(--hemp-query-thumb-w) minmax(0, 1fr);
	gap: 0.85rem;
	align-items: start;
	border-bottom: 1px solid var(--hemp-edge);
	padding-bottom: 0.95rem;
}

.hemp-query-authority-stack :where(.wp-block-post:not(:first-child) .wp-block-post-featured-image img) {
	aspect-ratio: 4 / 3;
	width: var(--hemp-query-thumb-w);
	height: var(--hemp-query-thumb-h);
	border-radius: var(--hemp-radius-sm);
}

.hemp-query-authority-stack :where(.wp-block-post:not(:first-child) .wp-block-post-excerpt) {
	display: none;
}

.hemp-query-listing-grid :where(.wp-block-post) {
	position: relative;
}

.hemp-query-listing-grid :where(.wp-block-post-excerpt) {
	display: none;
}

.hemp-listing-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin: 0.75rem 1rem 0.35rem;
}

.hemp-listing-badge {
	display: inline-flex;
	align-items: center;
	border-radius: 999px;
	border: 1px solid rgba(13, 92, 58, 0.18);
	background: rgba(244, 247, 245, 0.92);
	color: var(--hemp-ink);
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.04em;
	line-height: 1;
	padding: 0.36rem 0.5rem;
	text-transform: uppercase;
	white-space: nowrap;
}

.hemp-listing-badge--featured {
	background: linear-gradient(135deg, var(--hemp-gold) 0%, var(--hemp-gold-soft) 100%);
	border-color: rgba(201, 162, 39, 0.55);
	color: #2a2106;
}

.hemp-listing-badge--upgraded {
	background: rgba(13, 92, 58, 0.1);
	border-color: rgba(13, 92, 58, 0.28);
	color: var(--hemp-accent-deep);
}

.hemp-listing-badge--verified {
	background: rgba(10, 74, 47, 0.92);
	border-color: rgba(10, 74, 47, 0.92);
	color: #fff;
}

@media (max-width: 520px) {
	.hemp-query-media-list :where(.wp-block-post),
	.hemp-query-authority-stack :where(.wp-block-post:not(:first-child)) {
		grid-template-columns: 92px minmax(0, 1fr);
	}

	.hemp-query-media-list :where(.wp-block-post-featured-image img),
	.hemp-query-authority-stack :where(.wp-block-post:not(:first-child) .wp-block-post-featured-image img) {
		width: 92px;
		height: 68px;
	}
}

/* --- Header / footer template parts --- */
.hemp-site-header {
	background: rgba(255, 255, 255, 0.94);
	border-bottom: 1px solid var(--hemp-edge);
	box-shadow: 0 4px 18px rgba(6, 40, 30, 0.04);
	position: relative;
	z-index: 10;
}

.hemp-site-header__bar {
	max-width: var(--hemp-max);
	margin-left: auto;
	margin-right: auto;
	padding: 0.85rem clamp(1rem, 3vw, 1.5rem);
}

.hemp-site-header .wp-block-site-title a,
.hemp-site-header .wp-block-navigation-item__content {
	color: var(--hemp-ink);
	font-weight: 700;
	text-decoration: none;
}

.hemp-site-header .wp-block-navigation-item__content:hover,
.hemp-site-header .wp-block-navigation-item__content:focus {
	color: var(--hemp-accent);
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

.hemp-site-header .hemp-header-cta .wp-block-button__link {
	background: var(--hemp-accent);
	border-color: var(--hemp-accent);
	color: #fff;
	font-weight: 800;
}

.hemp-site-header .hemp-header-cta .wp-block-button__link:hover,
.hemp-site-header .hemp-header-cta .wp-block-button__link:focus {
	background: var(--hemp-accent-deep);
	border-color: var(--hemp-accent-deep);
}

.hemp-site-footer {
	background: var(--hemp-ink);
	color: rgba(255, 255, 255, 0.82);
	margin-top: var(--hemp-space-section);
}

.hemp-site-footer__inner {
	max-width: var(--hemp-max);
	margin-left: auto;
	margin-right: auto;
	padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 3vw, 1.5rem);
}

.hemp-site-footer h2,
.hemp-site-footer h3,
.hemp-site-footer .wp-block-site-title a {
	color: #fff;
}

.hemp-site-footer a {
	color: var(--hemp-gold-soft);
	text-decoration: none;
}

.hemp-site-footer a:hover,
.hemp-site-footer a:focus {
	color: #fff;
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

.hemp-site-footer__bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.16);
	margin-top: 1.5rem;
	padding-top: 1rem;
	font-size: 0.9rem;
}
