/*
 * Grounded Journal — Foundation
 * Tokens, typography, ground line, links, buttons, section colours.
 * Homepage and single-post styles belong in their own files, not here.
 */

/* ---------- Tokens ---------- */

:root {
	--gj-paper: #EFEEE8;
	--gj-ink: #201E19;
	--gj-ink-2: #39352D;
	--gj-slate: #6B6960;
	--gj-moss: #4E5539;
	--gj-line: rgba(32, 30, 25, 0.13);

	--wellness: #6E7B5C;
	--food: #A9673F;
	--travel: #3F5C6B;
	--journal: #4B3A2E;

	/* Section accent — repointed by .gj-section--* classes */
	--gj-accent: var(--gj-moss);

	--gj-font-display: "warbler-display", Georgia, serif;
	--gj-font-banner: "warbler-banner", Georgia, serif;
	--gj-font-deck: "warbler-deck", Georgia, serif;
	--gj-font-text: "warbler-text", Georgia, serif;
	--gj-font-body: "olimpico", Georgia, serif;

	--space-section: clamp(72px, 9vw, 120px);
	--ease: cubic-bezier(.2, .7, .2, 1);
	--dur-zoom: .65s;
	--dur-reveal: .5s;
}

/* ---------- Base ---------- */

html body {
	background-color: var(--gj-paper);
	color: var(--gj-ink);
	font-family: var(--gj-font-body);
	line-height: 1.8;
}

/* ---------- Headings ---------- */
/* Warbler optical sizes: display for the largest, banner, deck, then text. */

h1, h2, h3, h4, h5, h6 {
	color: var(--gj-ink);
	font-weight: 700;
	letter-spacing: -0.01em;
}

h1 { font-family: var(--gj-font-display); }
h2 { font-family: var(--gj-font-banner); }
h3 { font-family: var(--gj-font-deck); }
h4, h5, h6 { font-family: var(--gj-font-text); }

/* ---------- Ground line motif ---------- */

.gj-ground-line {
	display: block;
	width: 64px;
	height: 1px;
	border: 0;
	margin: 0;
	background-color: var(--gj-ink);
}

.gj-ground-line--center { margin-left: auto; margin-right: auto; }

/* ---------- Content links ---------- */

.entry-content a:not(.wp-block-button__link):not(.gj-button),
.gj-content a {
	color: var(--gj-moss);
	text-decoration: none;
	border-bottom: 1px solid var(--gj-moss);
	transition: color 0.25s ease, border-color 0.25s ease;
}

.entry-content a:not(.wp-block-button__link):not(.gj-button):hover,
.gj-content a:hover {
	color: var(--gj-slate);
	border-bottom-color: var(--gj-line);
}

/* ---------- Buttons ---------- */

.gj-button,
.wp-block-button__link {
	display: inline-block;
	background-color: var(--gj-ink);
	color: var(--gj-paper);
	font-family: var(--gj-font-text);
	font-weight: 700;
	letter-spacing: 0.02em;
	border: 1px solid var(--gj-ink);
	border-radius: 0;
	padding: 0.75em 1.75em;
	text-decoration: none;
	transition: background-color 0.25s ease, color 0.25s ease;
}

.gj-button:hover,
.wp-block-button__link:hover {
	background-color: var(--gj-accent);
	border-color: var(--gj-accent);
	color: var(--gj-paper);
}

.gj-button--ghost {
	background-color: transparent;
	color: var(--gj-ink);
}

.gj-button--ghost:hover {
	background-color: var(--gj-ink);
	color: var(--gj-paper);
}

/* ---------- Section colours ---------- */
/* Apply to a section/wrapper; children pick the accent up via --gj-accent. */

.gj-section--wellness { --gj-accent: var(--wellness); }
.gj-section--food     { --gj-accent: var(--food); }
.gj-section--travel   { --gj-accent: var(--travel); }
.gj-section--journal  { --gj-accent: var(--journal); }

.gj-accent-text { color: var(--gj-accent); }
.gj-accent-bg   { background-color: var(--gj-accent); color: var(--gj-paper); }

/* Hairline rule used between sections */
hr,
.gj-rule {
	border: 0;
	border-top: 1px solid var(--gj-line);
}

/* ---------- Layout container ---------- */

.gj-container {
	max-width: 1200px;
	margin-inline: auto;
	padding-inline: clamp(20px, 4vw, 48px);
}

/* ---------- Keyboard focus ---------- */

a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
	outline: 2px solid var(--gj-moss);
	outline-offset: 3px;
}

/* Site title stays in Warbler regardless of Customizer state */
.site-header .site-branding .site-title {
	font-family: var(--gj-font-deck);
	font-weight: 700;
}

/* ---------- Interaction system ----------
 * Primitives shared across sections/pages. Motion is gated behind .js-anim on
 * <html>, added by interactions.js only when JS runs AND the visitor has not
 * asked for reduced motion — so without either, everything is simply visible.
 */

.reveal { will-change: auto; }

.js-anim .reveal {
	opacity: 0;
	transform: translateY(14px);
	transition: opacity var(--dur-reveal) var(--ease), transform var(--dur-reveal) var(--ease);
}

.js-anim .reveal.is-in {
	opacity: 1;
	transform: none;
}

/* Ground line: same motif as .gj-ground-line, plus the draw-in behaviour */
.ground-line {
	display: block;
	width: 64px;
	height: 1px;
	border: 0;
	margin: 0;
	background-color: var(--gj-ink);
	transform-origin: left center;
}

.ground-line--paper { background-color: var(--gj-paper); }
.ground-line--faint { background-color: var(--gj-line); }

.js-anim .ground-line {
	transform: scaleX(0);
	transition: transform .8s var(--ease);
}

.js-anim .ground-line.is-in {
	transform: scaleX(1);
}

/* Hover-zoom media frame */
.zoom-frame {
	display: block;
	position: relative;
	overflow: hidden;
}

.zoom-frame img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.js-anim .zoom-frame:not(.zoom-frame--ambient) img {
	transition: transform var(--dur-zoom) var(--ease);
}

.js-anim .gj-card:hover .zoom-frame:not(.zoom-frame--ambient) img,
.js-anim .gj-card:focus-within .zoom-frame:not(.zoom-frame--ambient) img {
	transform: scale(1.05);
}

/* Reveal-CTA. Type law: uppercase is always Olimpico, never Warbler. */
.card-cta {
	display: inline-block;
	font-family: var(--gj-font-body);
	font-size: 14px;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--gj-accent);
}

.card-cta--paper { color: var(--gj-paper); }

.js-anim .card-cta {
	opacity: 0;
	transform: translateY(6px);
	transition: opacity var(--dur-reveal) var(--ease), transform var(--dur-reveal) var(--ease);
}

.js-anim .gj-card:hover .card-cta,
.js-anim .gj-card:focus-within .card-cta,
.js-anim .gj-world:hover .card-cta,
.js-anim .gj-world:focus-visible .card-cta {
	opacity: 1;
	transform: none;
}

/* Quiet CTA: small-caps serif with a moss underline sweeping in from the left */
.btn-quiet {
	position: relative;
	display: inline-block;
	font-family: var(--gj-font-text);
	font-variant-caps: all-small-caps;
	font-weight: 400;
	font-size: 19px;
	letter-spacing: .16em;
	color: var(--gj-ink);
	text-decoration: none;
	padding-bottom: 7px;
	border-bottom: 0;
}

.btn-quiet::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	height: 1px;
	background-color: var(--gj-moss);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform .35s var(--ease);
}

.btn-quiet:hover::after,
.btn-quiet:focus-visible::after {
	transform: scaleX(1);
}

@media (prefers-reduced-motion: reduce) {
	.btn-quiet::after { transition: none; }
}

/* ---------- Footer ---------- */

.gj-footer {
	background-color: var(--gj-paper);
	padding-block: clamp(48px, 6vw, 80px) clamp(32px, 4vw, 48px);
}

.gj-footer .ground-line {
	margin-bottom: clamp(32px, 4vw, 48px);
}

.gj-footer__row {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 20px 40px;
	margin-bottom: clamp(28px, 3.5vw, 40px);
}

.gj-footer__wordmark {
	font-family: var(--gj-font-deck);
	font-size: 24px;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--gj-ink);
	margin: 0;
}

.gj-footer__nav {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 28px;
}

.gj-footer__nav a {
	/* Type law: uppercase = Olimpico */
	font-family: var(--gj-font-body);
	font-size: 14px;
	font-weight: 400;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--gj-ink-2);
	text-decoration: none;
	transition: color .25s ease;
}

.gj-footer__nav a:hover {
	color: var(--gj-moss);
}

.gj-footer__line {
	font-size: 15px;
	color: var(--gj-slate);
	margin: 0;
}
