/* =========================================================================
   Omniyat Theme — main.css
   Reset, design tokens, typography, layout, header, footer, nav.
   ========================================================================= */

/* ---------- 1. Self-hosted fonts ----------
   Single-family commit on Bricolage Grotesque (Mathieu Triay, SIL OFL, free).
   Variable in the upstream, but we ship 3 fixed weights to keep parity with
   the previous Roboto setup and avoid the ~80KB variable-axis overhead for
   weights we don't use. Source: gwfh.mranftl.com, latin + latin-ext subsets
   merged via unicode-range. Reflex-reject-list-safe (not Inter/Roboto/Outfit).
   Weight roles: 400 body, 500 buttons/nav/medium emphasis, 700 headings.
   Replaces: Roboto (×3 weights) + Roboto Slab (×3 weights, never bound). */
@font-face {
	font-family: "Bricolage Grotesque";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("../fonts/bricolage-grotesque-400.woff2") format("woff2");
}
@font-face {
	font-family: "Bricolage Grotesque";
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url("../fonts/bricolage-grotesque-500.woff2") format("woff2");
}
@font-face {
	font-family: "Bricolage Grotesque";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("../fonts/bricolage-grotesque-700.woff2") format("woff2");
}

/* ---------- 2. Design tokens (CSS custom properties) ---------- */
:root {
	/* Colors — mirrors theme.json palette */
	--color-primary:    #83A522;
	--color-secondary:  #54595F;
	--color-text:       #7A7A7A;
	--color-accent:     #61CE70;
	--color-dark:       #272727;
	--color-mint:       #AEDB76;
	--color-white:      #FFFFFF;
	--color-bg:         #FFFFFF;
	--color-bg-soft:    #F7F9F2;
	--color-border:     #E5E7EB;

	/* Typography — single-family commit on Bricolage Grotesque.
	   --font-display aliases --font-sans so the blocks plugin (which addresses
	   headings via var(--font-display)) keeps working without a rebuild. When
	   a true display face is added later, swap --font-display only. */
	--font-sans:    "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-display: var(--font-sans);

	--fs-sm:   0.875rem;   /* 14px */
	--fs-base: 1rem;       /* 16px */
	--fs-lg:   1.0625rem;  /* 17px */
	--fs-xl:   1.25rem;    /* 20px — h5 */
	--fs-2xl:  clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);     /* h4 24px */
	--fs-3xl:  clamp(1.625rem, 1.4rem + 1.1vw, 2rem);      /* h3 32px */
	--fs-4xl:  clamp(2rem, 1.6rem + 2vw, 2.8125rem);       /* h2 45px */
	--fs-5xl:  clamp(2.25rem, 1.6rem + 3.3vw, 3.4375rem);  /* h1 55px */

	--lh-tight: 1.2;
	--lh-snug:  1.3;
	--lh-body:  1.5;

	/* Spacing scale (--space-1 = 0.25rem = 4px, geometric-ish) */
	--space-1:  0.25rem;   /* 4px  */
	--space-2:  0.5rem;    /* 8px  */
	--space-3:  0.75rem;   /* 12px */
	--space-4:  1rem;      /* 16px */
	--space-5:  1.5rem;    /* 24px */
	--space-6:  2rem;      /* 32px */
	--space-7:  3rem;      /* 48px */
	--space-8:  4.5rem;    /* 72px */
	--space-9:  6rem;      /* 96px */
	--space-10: 8rem;      /* 128px */

	/* Layout */
	--container-max:  1200px;
	--container-pad:  1.25rem;
	--container-pad-lg: 2rem;
	--header-h:       80px;

	/* Misc */
	--radius-sm: 2px;
	--radius-md: 6px;
	--radius-lg: 12px;
	--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
	--shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
	--shadow-nav: 0 2px 8px rgba(39, 39, 39, 0.06);
	--transition: 200ms ease;
}

/* ---------- 3. Reset minimal ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: var(--font-sans);
	font-size: var(--fs-base);
	line-height: var(--lh-body);
	color: var(--color-secondary);
	background: var(--color-bg);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}
img, svg, video, picture { max-width: 100%; height: auto; display: block; }
button { font: inherit; cursor: pointer; }
ul, ol { padding-inline-start: 1.2em; }
hr { border: 0; border-top: 1px solid var(--color-border); }

/* ---------- 4. Typography ---------- */
h1, h2, h3, h4, h5, h6 {
	margin: 0 0 var(--space-4);
	font-weight: 600;
	line-height: var(--lh-tight);
	color: var(--color-dark);
}
h1 { font-size: var(--fs-5xl); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-4xl); line-height: var(--lh-tight); }
h3 { font-size: var(--fs-3xl); line-height: var(--lh-snug); }
h4 { font-size: var(--fs-2xl); line-height: var(--lh-snug); }
h5 { font-size: var(--fs-xl);  line-height: var(--lh-snug); }
h6 { font-size: var(--fs-lg);  line-height: var(--lh-snug); }

p { margin: 0 0 var(--space-4); }
.lead { font-size: var(--fs-lg); }

a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover, a:focus-visible { color: var(--color-accent); text-decoration: underline; }

:focus-visible {
	outline: 2px solid var(--color-primary);
	outline-offset: 2px;
	border-radius: var(--radius-sm);
}

/* ---------- 5. Layout container ---------- */
.container {
	width: 100%;
	max-width: var(--container-max);
	margin-inline: auto;
	padding-inline: var(--container-pad);
}
@media (min-width: 1024px) {
	.container { padding-inline: var(--container-pad-lg); }
}

/* ---------- 6. Buttons ---------- */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-2);
	padding: 0.75rem 1.5rem;
	font-family: var(--font-sans);
	font-weight: 500;
	font-size: var(--fs-base);
	line-height: 1.2;
	border: 1px solid transparent;
	border-radius: var(--radius-sm);
	cursor: pointer;
	text-decoration: none;
	transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}
.btn:hover, .btn:focus-visible { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
	background: var(--color-primary);
	color: var(--color-white);
}
.btn-primary:hover, .btn-primary:focus-visible {
	background: #6F8C1C;
	color: var(--color-white);
}
.btn-ghost {
	background: transparent;
	color: var(--color-primary);
	border-color: var(--color-primary);
}
.btn-ghost:hover, .btn-ghost:focus-visible {
	background: var(--color-primary);
	color: var(--color-white);
}

/* ---------- 7. Accessibility helpers ---------- */
.sr-only,
.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 10000;
	padding: 0.75rem 1rem;
	background: var(--color-dark);
	color: var(--color-white);
}
.skip-link:focus { left: 0; }

/* =========================================================================
   8. SITE HEADER (sticky + logo + nav + CTA + burger)
   ========================================================================= */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--color-white);
	border-bottom: 1px solid transparent;
	/* box-shadow now applied dynamically by header.css when .is-scrolled
	   (toggled by header.js when window.scrollY > 50). Phase 5.5. */
}
.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-4);
	min-height: var(--header-h);
}

/* Logo (text version) */
.site-logo {
	font-family: var(--font-sans);
	font-weight: 700;
	font-size: 1.5rem;
	letter-spacing: 0.08em;
	color: var(--color-dark);
	text-decoration: none;
	line-height: 1;
	display: inline-flex;
	align-items: baseline;
	gap: 0.15em;
}
.site-logo:hover, .site-logo:focus-visible { color: var(--color-dark); text-decoration: none; }
.site-logo__mark { color: var(--color-primary); }

/* Primary nav */
.site-nav__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: var(--space-5);
}
.site-nav__list a {
	display: inline-block;
	padding: 0.5rem 0;
	color: var(--color-dark);
	font-weight: 500;
	font-size: var(--fs-base);
	text-decoration: none;
}
.site-nav__list a:hover,
.site-nav__list .current-menu-item > a,
.site-nav__list .current_page_item > a {
	color: var(--color-primary);
	text-decoration: none;
}

/* CTA in header */
.site-header__cta { flex-shrink: 0; }

/* Burger button — visible on mobile only */
.nav-toggle {
	display: none;
	background: transparent;
	border: 0;
	padding: 0.5rem;
	color: var(--color-dark);
}
.nav-toggle__icon,
.nav-toggle__icon::before,
.nav-toggle__icon::after {
	display: block;
	width: 26px;
	height: 2px;
	background: currentColor;
	transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle__icon { position: relative; }
.nav-toggle__icon::before,
.nav-toggle__icon::after {
	content: "";
	position: absolute;
	left: 0;
}
.nav-toggle__icon::before { top: -8px; }
.nav-toggle__icon::after  { top: 8px; }
[data-nav-open] .nav-toggle__icon { background: transparent; }
[data-nav-open] .nav-toggle__icon::before { top: 0; transform: rotate(45deg); }
[data-nav-open] .nav-toggle__icon::after  { top: 0; transform: rotate(-45deg); }

/* Nav backdrop (mobile) */
.nav-backdrop {
	display: none;
	position: fixed;
	inset: var(--header-h) 0 0 0;
	background: rgba(39, 39, 39, 0.4);
	z-index: 80;
	opacity: 0;
	transition: opacity var(--transition);
}

/* ---------- Mobile breakpoint: nav off-canvas ---------- */
@media (max-width: 767px) {
	.nav-toggle { display: inline-flex; align-items: center; justify-content: center; }

	.site-header__cta { display: none; } /* CTA moves into the off-canvas */

	.site-nav {
		position: fixed;
		top: var(--header-h);
		right: 0;
		bottom: 0;
		width: min(85vw, 320px);
		background: var(--color-white);
		box-shadow: -4px 0 16px rgba(0, 0, 0, 0.08);
		padding: var(--space-5);
		transform: translateX(100%);
		transition: transform var(--transition);
		z-index: 90;
		overflow-y: auto;
	}
	.site-nav__list {
		flex-direction: column;
		align-items: stretch;
		gap: var(--space-1);
	}
	.site-nav__list a {
		display: block;
		padding: var(--space-3) var(--space-2);
		border-radius: var(--radius-sm);
	}
	.site-nav__list a:hover {
		background: var(--color-bg-soft);
	}
	.site-nav__cta-mobile {
		display: block;
		margin-top: var(--space-5);
		text-align: center;
		width: 100%;
	}

	[data-nav-open] body { overflow: hidden; }
	[data-nav-open] .site-nav { transform: translateX(0); }
	[data-nav-open] .nav-backdrop { display: block; opacity: 1; }
}

/* On desktop, hide the inline mobile CTA */
@media (min-width: 768px) {
	.site-nav__cta-mobile { display: none; }
}

/* =========================================================================
   9. SITE MAIN
   ========================================================================= */
.site-main { min-height: 50vh; }

/* =========================================================================
   10. SITE FOOTER (4 cols + sub-footer)
   ========================================================================= */
.site-footer {
	margin-top: var(--space-9);
	background: var(--color-dark);
	color: #BFC3C9;
}
.site-footer a { color: #E5E7EB; }
.site-footer a:hover, .site-footer a:focus-visible {
	color: var(--color-accent);
	text-decoration: underline;
}

.site-footer__cols {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-6);
	padding-block: var(--space-7);
}
@media (min-width: 768px) {
	.site-footer__cols {
		grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
		gap: var(--space-5);
	}
}
.site-footer__col h3,
.site-footer__col .footer-col__title {
	font-family: var(--font-sans);
	font-size: var(--fs-lg);
	font-weight: 700;
	color: var(--color-white);
	margin: 0 0 var(--space-4);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}
.site-footer__col ul {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
}
.site-footer__col p { margin: 0 0 var(--space-3); }
.site-footer__brand .site-logo { color: var(--color-white); }

/* Sub-footer */
.site-subfooter {
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	padding-block: var(--space-4);
	font-size: var(--fs-sm);
}
.site-subfooter__inner {
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
	align-items: center;
	text-align: center;
}
.site-subfooter__legal {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2) var(--space-4);
	justify-content: center;
}
/* Inert legal links — labels visible, no dead href.
   When the actual pages land (Phase 6), replace each <span> with <a> in footer.php. */
.site-subfooter__legal-pending {
	color: #8C9097;
	cursor: default;
}
@media (min-width: 768px) {
	.site-subfooter__inner {
		flex-direction: row;
		justify-content: space-between;
		text-align: left;
	}
}
