/*
 * Grounded Journal — Homepage
 * Section layout only. Tokens + interaction primitives live in foundation.css.
 */

/* ---------- Sticky header refine ---------- */

body.home #masthead {
	position: sticky;
	top: 0;
	z-index: 100;
}

body.home #masthead .site-header-row-container-inner {
	transition: background-color .3s var(--ease), border-color .3s var(--ease);
	border-bottom: 1px solid transparent;
}

body.home.gj-scrolled #masthead .site-header-row-container-inner {
	background-color: rgba(239, 238, 232, .94);
	border-bottom-color: var(--gj-line);
}

/* ---------- Hero ---------- */

.gj-hero {
	position: relative;
	min-height: 86vh;
	min-height: 86svh;
	display: flex;
	align-items: flex-end;
}

.gj-hero__media {
	position: absolute;
	inset: 0;
}

.gj-hero__media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	transform: scale(1);
}

/* Ambient zoom: one slow settle, then still */
.js-anim .gj-hero.is-live .gj-hero__media img {
	transform: scale(1.06);
	transition: transform 12s linear;
}

/* Bottom-left scrim for legibility */
.gj-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(22deg, rgba(32, 30, 25, .62) 0%, rgba(32, 30, 25, .28) 34%, rgba(32, 30, 25, 0) 62%);
	pointer-events: none;
}

.gj-hero__content {
	position: relative;
	z-index: 1;
	width: 100%;
	padding-bottom: clamp(48px, 7vh, 88px);
}

.gj-hero__title {
	/* !important: the legacy Additional CSS forces warbler-display on all h1-h6 */
	font-family: var(--gj-font-banner) !important;
	font-size: clamp(44px, 6vw, 88px);
	line-height: .98;
	letter-spacing: -0.02em;
	color: var(--gj-paper);
	margin: 0 0 20px;
	max-width: 14em;
}

.gj-hero__title .flourish {
	font-weight: 400;
	font-style: italic;
}

.gj-hero__standfirst {
	font-family: var(--gj-font-text);
	font-style: italic;
	font-size: 19px;
	color: var(--gj-paper);
	margin: 0 0 28px;
	max-width: 34em;
}

/* Hero CTA is a standard .btn; charcoal reads cleanly on the scrim */

/* ---------- Lead story ---------- */

.gj-lead-section {
	padding-block: var(--space-section);
}

/* .gj-lead, .gj-kicker, .gj-meta + card components live in foundation.css */

/* ---------- More soon / Latest grid ---------- */

.gj-more-soon {
	padding-block: 0 var(--space-section);
}

.gj-more-soon__line {
	font-family: var(--gj-font-text);
	font-style: italic;
	font-size: 17px;
	color: var(--gj-slate);
	margin: 22px 0 0;
}

.gj-grid-section {
	padding-block: 0 var(--space-section);
}

/* ---------- The four worlds ---------- */

.gj-worlds {
	padding-block: 0 var(--space-section);
}

.gj-worlds__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: clamp(16px, 2vw, 24px);
}

/* Wash behind, solid panel in front — image-ready later */
.gj-world {
	display: block;
	position: relative;
	min-height: clamp(320px, 44vh, 440px);
	background-color: var(--gj-accent);
	background-image: linear-gradient(rgba(239, 238, 232, .86), rgba(239, 238, 232, .86));
	padding: 10px;
	text-decoration: none;
}

.gj-world__panel {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	align-items: flex-start;
	gap: 12px;
	height: 100%;
	min-height: inherit;
	box-sizing: border-box;
	background-color: var(--gj-accent);
	padding: clamp(20px, 2.5vw, 32px);
	overflow: hidden;
}

/* Colour deepens via an ink veil (opacity only — GPU friendly) */
.gj-world__panel::after {
	content: "";
	position: absolute;
	inset: 0;
	background-color: var(--gj-ink);
	opacity: 0;
	transition: opacity .3s var(--ease);
	pointer-events: none;
}

.gj-world:hover .gj-world__panel::after,
.gj-world:focus-visible .gj-world__panel::after {
	opacity: .12;
}

.gj-world .ground-line--paper {
	opacity: .7;
}

.gj-world__label {
	font-family: var(--gj-font-deck);
	font-size: clamp(24px, 2.2vw, 30px);
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--gj-paper);
	position: relative;
	z-index: 1;
	transition: transform .3s var(--ease);
}

.gj-world:hover .gj-world__label,
.gj-world:focus-visible .gj-world__label {
	transform: translateY(-4px);
}

.gj-world .card-cta {
	position: relative;
	z-index: 1;
}

/* Newsletter band + MailerLite styling live in foundation.css */

/* ---------- Responsive ---------- */

@media (max-width: 1023px) {
	.gj-worlds__grid { grid-template-columns: repeat(2, 1fr); }
	.gj-world { min-height: clamp(260px, 34vh, 360px); }
}

@media (max-width: 781px) {
	.gj-hero { min-height: 78vh; min-height: 78svh; }
}

@media (max-width: 540px) {
	.gj-worlds__grid { grid-template-columns: 1fr; }
	.gj-world { min-height: 220px; }
}
