/**
 * CHF Theme — Base Styles
 * CSS Reset, custom properties, @font-face, typography defaults
 */

/* ==========================================================================
   FONT FACE DECLARATIONS
   ========================================================================== */

@font-face {
	font-family: 'Montserrat';
	font-style: normal;
	font-weight: 600 700;
	font-display: swap;
	src: url('../fonts/montserrat.woff2') format('woff2');
}

@font-face {
	font-family: 'Open Sans';
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url('../fonts/opensans.woff2') format('woff2');
}

/* ==========================================================================
   CSS CUSTOM PROPERTIES
   ========================================================================== */

:root {
	/* Colour palette */
	--g: #1B5E20;
	--gm: #2E7D32;
	--gl: #4CAF50;
	--glite: #A5D6A7;
	--gold: #D4A840;
	--gold2: #E65100;
	--gold3: #FFF8E1;
	--cream: #FAFAF5;
	--white: #FFFFFF;
	--dark: #0F1A10;
	--text: #1C1C1C;
	--muted: #5A6B5C;
	--border: #D9E8D9;

	/* Typography */
	--serif: 'Montserrat', system-ui, sans-serif;
	--sans: 'Open Sans', system-ui, sans-serif;
	--fs-base: 16px;
}

/* ==========================================================================
   CSS RESET
   ========================================================================== */

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

html {
	font-size: var(--fs-base, 16px);
	scroll-behavior: smooth;
}

body {
	font-family: var(--sans);
	font-size: 1rem;
	line-height: 1.65;
	color: var(--text);
	background: var(--cream);
	overflow-x: hidden;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
canvas,
svg {
	display: block;
	max-width: 100%;
}

img {
	height: auto;
}

input,
button,
textarea,
select {
	font: inherit;
}

a {
	text-decoration: none;
	color: inherit;
}

ul,
ol {
	list-style: none;
}

table {
	border-collapse: collapse;
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--serif);
	font-weight: 700;
	line-height: 1.2;
	color: var(--g);
}

h1 {
	font-size: clamp(2rem, 4vw, 3.6rem);
	font-weight: 700;
}

h2 {
	font-size: clamp(1.7rem, 2.8vw, 2.4rem);
}

h3 {
	font-size: clamp(1.1rem, 1.6vw, 1.4rem);
	font-weight: 600;
}

h4 {
	font-size: 1.1rem;
	font-weight: 600;
}

h5 {
	font-size: 1rem;
	font-weight: 600;
}

h6 {
	font-size: 0.9rem;
	font-weight: 600;
}

p {
	font-size: 1rem;
}

small,
.meta {
	font-size: 0.875rem;
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

/* Focus visible */
*:focus-visible {
	outline: 2px solid var(--gold);
	outline-offset: 2px;
}

/* Skip link */
.skip-link {
	position: absolute;
	top: -100%;
	left: 1rem;
	z-index: 10000;
	padding: 0.75rem 1.5rem;
	background: var(--g);
	color: var(--white);
	font-weight: 600;
	border-radius: 0 0 4px 4px;
	transition: top 0.2s;
}

.skip-link:focus {
	top: 0;
}

/* Screen reader only */
.screen-reader-text,
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

.screen-reader-text:focus {
	position: static;
	width: auto;
	height: auto;
	padding: 0.5rem 1rem;
	margin: 0;
	overflow: visible;
	clip: auto;
	white-space: normal;
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
