/* ============================================================
   Littledale - main stylesheet
   Order: component imports > fonts > design tokens > reset >
   base typography > layout > buttons > utilities
   ============================================================ */

/* Component CSS lives in components/ - one file per component, enqueued
   individually AFTER this file with filemtime versions (inc/enqueue.php).
   Do NOT @import them here: imported URLs carry no cache-busting version,
   and loading components after main.css lets component overrides win. */

/* ============================================================
   Fonts - self-hosted (assets/fonts/)
   Libre Baskerville = headings, Onest = body/UI
   ============================================================ */

@font-face {
	font-family: "Libre Baskerville";
	src: url("../fonts/libre-baskerville-v24-latin-regular.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Libre Baskerville";
	src: url("../fonts/libre-baskerville-v24-latin-italic.woff2") format("woff2");
	font-weight: 400;
	font-style: italic;
	font-display: swap;
}

@font-face {
	font-family: "Libre Baskerville";
	src: url("../fonts/libre-baskerville-v24-latin-700.woff2") format("woff2");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Onest";
	src: url("../fonts/onest-v9-latin-regular.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Onest";
	src: url("../fonts/onest-v9-latin-500.woff2") format("woff2");
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Onest";
	src: url("../fonts/onest-v9-latin-600.woff2") format("woff2");
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Onest";
	src: url("../fonts/onest-v9-latin-700.woff2") format("woff2");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

/* ============================================================
   Design tokens
   Palette: designs/DESIGN 1 GUIDELINES - Colours.jpg
   Type:    designs/DESIGN 1 GUIDELINES - Fonts.jpg
   Components use the SEMANTIC tokens, not the raw palette.
   Breakpoints (comments only, vars can't be used in @media):
   tablet 768px / desktop 1024px
   ============================================================ */

:root {
	/* Raw brand palette */
	--color-white: #ffffff;          /* nav links, chevrons (per Figma navbar spec) */
	--color-dark-grey: #41484a;      /* body text */
	--color-grey: #d7d7d1;           /* image underlay */
	--color-light-grey: #eae8e3;     /* background */
	--color-teal-darkest: #001f26;   /* footer background */
	--color-teal-dark: #14333b;      /* heading text */
	--color-teal: #2c4a52;           /* primary background */
	--color-teal-frame: #465e62;     /* lighter offset frame behind photos on the teal band (measured) */
	/* Hero background - measured from the design mockup (band profile along the
	   45deg diagonal): base + three darker-teal band tints + corner band tint */
	--color-teal-hero: #28505a;
	--color-teal-hero-band-1: #274d58;
	--color-teal-hero-band-2: #274e59;
	--color-teal-hero-band-3: #274f59;
	--color-teal-hero-band-4: #264e58;
	--color-caramel: #c1834c;        /* CTA */
	--color-caramel-light: #df9d63;  /* icons + eyebrow headings */
	--color-caramel-dark: #a86d3a;   /* CTA hover - deepened (not lightened) so the label stays legible */
	--color-cream: #f7efe4;          /* background */
	--color-cream-light: #f9f7f2;    /* background + text on dark */
	--color-mid-grey: #6d6d6d;       /* small print (contact privacy note, .fig spec) */
	--color-border-grey: #adada1;    /* form input borders + placeholders (.fig spec) */
	--color-brick: #9d4437;          /* UI error state - not in the brand palette */

	/* Semantic aliases */
	--color-text: var(--color-dark-grey);
	--color-heading: var(--color-teal-dark);
	--color-text-on-dark: var(--color-cream-light);
	--color-bg-body: var(--color-cream-light);
	--color-cta: var(--color-caramel);
	--color-cta-hover: var(--color-caramel-dark);
	--color-accent: var(--color-caramel-light);
	--color-image-underlay: var(--color-grey);
	--color-text-muted: var(--color-mid-grey);
	--color-input-border: var(--color-border-grey);
	--color-placeholder: var(--color-border-grey);
	--color-error: var(--color-brick);
	/* Footer on-dark hairlines - exact .fig values (#ADADA1 at 20%, cream at 40%) */
	--color-footer-line: rgb(173 173 161 / 0.2);
	--color-footer-underline: rgb(249 247 242 / 0.4);

	/* Nearby Help service-type badges. The design used generic blue/green/
	   purple placeholders; these are the brand equivalents, four tints that
	   stay distinguishable from each other and legible on a cream card. */
	--color-badge-drug-bg: rgb(44 74 82 / 0.1);
	--color-badge-drug-text: var(--color-teal-dark);
	--color-badge-peer-bg: rgb(193 131 76 / 0.16);
	--color-badge-peer-text: var(--color-caramel-dark);
	--color-badge-family-bg: rgb(70 94 98 / 0.14);
	--color-badge-family-text: var(--color-teal-frame);
	--color-badge-crisis-bg: rgb(157 68 55 / 0.12);
	--color-badge-crisis-text: var(--color-brick);

	/* Typography (mobile values; desktop overrides below) */
	--font-heading: "Libre Baskerville", Georgia, serif;
	--font-body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
	--text-heading-lg: 1.5rem;    /* 24px > 32px desktop */
	--text-heading-sm: 1.25rem;   /* 20px > 24px desktop */
	--text-body: 1rem;            /* 16px > 18px desktop */
	--text-eyebrow: 0.75rem;      /* 12px every breakpoint */
	--tracking-eyebrow: 1.8px;

	/* Spacing scale */
	--space-xs: 0.5rem;
	--space-sm: 1rem;
	--space-md: 1.5rem;
	--space-lg: 2.5rem;
	--space-xl: 4rem;
	--section-padding: 3.5rem;    /* > 6rem desktop */

	/* Layout - 1240 outer = 1200 inner content at desktop, matching the design */
	--container-max: 1240px;
	--container-pad: 1.25rem;
	--header-height: 4.5rem;      /* > 5rem desktop */

	/* Misc */
	--radius-xs: 2px;
	--radius-sm: 4px;   /* cards, image frames */
	--radius-md: 10px;  /* icon chips */
	--transition: 0.25s ease;
	--shadow-soft: 0 8px 24px rgb(0 31 38 / 0.12);
	/* Contact card + submit button shadows - exact values from the .fig */
	--shadow-card: 0 10px 30px -10px rgb(44 74 82 / 0.15);
	--shadow-button: 0 4px 6px -4px rgb(44 74 82 / 0.2), 0 10px 15px -3px rgb(44 74 82 / 0.2);
}

@media (min-width: 1024px) {
	:root {
		--text-heading-lg: 2rem;
		--text-heading-sm: 1.5rem;
		--text-body: 1.125rem;
		--section-padding: 6rem;
		--header-height: 5rem;
	}
}

/* ============================================================
   Reset
   ============================================================ */

*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	color: var(--color-text);
	background: var(--color-bg-body);
	font-family: var(--font-body);
	font-size: var(--text-body);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

body.nav-open {
	overflow: hidden;
}

/* The header is position:fixed - on the homepage the hero slides beneath it
   (its own padding-top compensates); every other page needs body offset */
body:not(.home) {
	padding-top: var(--header-height);
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* The UA's [hidden] { display: none } is only (0,1,0) and loses to any
   component rule that sets a display, so an element carrying the hidden
   attribute can still render. That bit the service finder's mobile
   List/Map toggle and its map legend, both of which are `hidden` until JS
   activates them and both of which set display:flex - so with JS off they
   appeared, offering a dead Map button and a legend for a map that never
   loads. Enforce it once, theme-wide. */
[hidden] {
	display: none !important;
}

/* ============================================================
   Base typography
   ============================================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 var(--space-sm);
	font-family: var(--font-heading);
	font-weight: 700;
	line-height: 1.3;
	color: var(--color-heading);
}

h1,
h2 {
	font-size: var(--text-heading-lg);
}

h3,
h4 {
	font-size: var(--text-heading-sm);
}

p {
	margin: 0 0 var(--space-sm);
}

a {
	color: var(--color-teal);
	transition: color var(--transition);
}

a:hover {
	color: var(--color-caramel);
}

/* ============================================================
   Layout
   ============================================================ */

.container {
	max-width: var(--container-max);
	margin-inline: auto;
	padding-inline: var(--container-pad);
}

/* TABLET GUARD (mandatory - see CLAUDE.md "Tablet rule"): the designs only
   cover mobile and desktop, so between the breakpoints section media is
   capped and centred instead of stretching the mobile layout. AUTOMATIC:
   targets every BEM "__media" element by convention (plus the explicit
   .section-media class), so new sections cannot forget it. */
@media (min-width: 768px) and (max-width: 1023.98px) {
	.section-media,
	[class*="__media"] {
		width: 100%;
		max-width: 640px;
		margin-inline: auto;
	}
}

/* ============================================================
   Buttons - global system, never one-off per section
   ============================================================ */

/* ONE hover language across every variant: caramel is the ACTION colour, so every
   button warms to caramel on hover (the primary, already caramel, DEEPENS instead).
   COLOUR ONLY - buttons never lift, move or gain a shadow (Miles, 2026-07-15): the
   colour step alone must carry the hover, so keep every variant's shift clearly
   visible. Add new variants here - never style a one-off button inside a section. */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-xs);
	padding: 1.0625rem 3rem;
	font-family: var(--font-body);
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	border: 1px solid transparent;
	border-radius: var(--radius-xs);
	cursor: pointer;
	transition: background-color var(--transition), border-color var(--transition),
		color var(--transition);
}

/* Primary (caramel on any band) - deepens, so the label stays put and legible */
.btn--primary {
	background: var(--color-cta);
	color: var(--color-text-on-dark);
}

.btn--primary:hover,
.btn--primary:focus-visible {
	background: var(--color-cta-hover);
	color: var(--color-text-on-dark);
}

/* Solid light button for dark (teal) backgrounds - warms to caramel */
.btn--light {
	background: var(--color-cream-light);
	color: var(--color-teal-dark);
}

.btn--light:hover,
.btn--light:focus-visible {
	background: var(--color-cta);
	color: var(--color-text-on-dark);
}

/* Outline button for dark (teal) backgrounds - fills caramel */
.btn--outline {
	background: transparent;
	color: var(--color-text-on-dark);
	border-color: var(--color-text-on-dark);
}

.btn--outline:hover,
.btn--outline:focus-visible {
	background: var(--color-cta);
	border-color: var(--color-cta);
	color: var(--color-text-on-dark);
}

/* Solid dark button for light backgrounds - warms to caramel */
.btn--dark {
	background: var(--color-teal-dark);
	color: var(--color-white);
}

.btn--dark:hover,
.btn--dark:focus-visible {
	background: var(--color-cta);
	color: var(--color-text-on-dark);
}

/* Outline button for light backgrounds - fills caramel */
.btn--outline-dark {
	background: transparent;
	color: var(--color-teal-dark);
	border-color: var(--color-teal-dark);
}

.btn--outline-dark:hover,
.btn--outline-dark:focus-visible {
	background: var(--color-cta);
	border-color: var(--color-cta);
	color: var(--color-text-on-dark);
}

/* ============================================================
   Utilities
   ============================================================ */

/* Eyebrow heading: Onest Bold 12px, 1.8px tracking, caramel */
.eyebrow {
	display: block;
	margin: 0 0 var(--space-xs);
	font-family: var(--font-body);
	font-size: var(--text-eyebrow);
	font-weight: 700;
	letter-spacing: var(--tracking-eyebrow);
	text-transform: uppercase;
	color: var(--color-accent);
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	border: 0;
	white-space: nowrap;
}

.skip-to-content {
	position: absolute;
	left: -9999px;
}

.skip-to-content:focus {
	left: 1rem;
	top: 1rem;
	z-index: 999;
	background: var(--color-cream-light);
	color: var(--color-teal-dark);
	padding: 0.5rem 1rem;
}
