/* ==========================================================================
   Northfield Theatre — Design System
   main.css: tokens, reset, base typography, layout, utilities, animations
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. FONT FACES — Self-hosted Google Fonts
   -------------------------------------------------------------------------- */

/* Inter — full variable range (wght 100–900, opsz 14–32, normal + italic).
   Drives both body and headings; hierarchy is created by weight, not typeface. */
@font-face {
	font-family: 'Inter';
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url('../fonts/inter-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
		U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
		U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: 'Inter';
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url('../fonts/inter-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
		U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
		U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
		U+A720-A7FF;
}

@font-face {
	font-family: 'Inter';
	font-style: italic;
	font-weight: 100 900;
	font-display: swap;
	src: url('../fonts/inter-italic-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
		U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
		U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: 'Inter';
	font-style: italic;
	font-weight: 100 900;
	font-display: swap;
	src: url('../fonts/inter-italic-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
		U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
		U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
		U+A720-A7FF;
}

/* --------------------------------------------------------------------------
   2. DESIGN TOKENS — CSS Custom Properties
   -------------------------------------------------------------------------- */

:root {
	/* Brand colours */
	--color-primary: #1B4D3E;
	--color-primary-dark: #153D31;
	--color-primary-light: #24654F;
	--color-accent: #E8A33D;
	--color-accent-dark: #CF8E2E;
	--color-accent-light: #F0BD6A;

	/* Neutrals */
	--color-dark: #1A1A1A;
	--color-text: #333333;
	--color-text-muted: #666666;
	--color-text-light: #999999;
	--color-bg: #FFFFFF;
	--color-bg-soft: #FAF7F2;
	--color-bg-dark: #1A1A1A;
	--color-border: #E5E5E5;
	--color-border-dark: #CCCCCC;

	/* Semantic colours */
	--color-success: #2D7A4F;
	--color-warning: #B45309;
	--color-danger: #B91C1C;

	/* Focus ring */
	--color-focus: #E8A33D;
	--focus-ring: 0 0 0 3px var(--color-focus);

	/* Typography */
	/* Single-typeface system: Inter drives everything. Hierarchy is created
	   by weight + tracking, not by switching to a serif. */
	--font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	--font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

	--text-xs: 0.75rem;    /* 12px */
	--text-sm: 0.875rem;   /* 14px */
	--text-base: 1.0625rem; /* 17px */
	--text-lg: 1.125rem;   /* 18px */
	--text-xl: 1.25rem;    /* 20px */
	--text-2xl: 1.5rem;    /* 24px */
	--text-3xl: 1.875rem;  /* 30px */
	--text-4xl: 2.25rem;   /* 36px */
	--text-5xl: 3rem;      /* 48px */
	--text-6xl: 3.5rem;    /* 56px */

	--leading-tight: 1.2;
	--leading-snug: 1.35;
	--leading-normal: 1.6;
	--leading-relaxed: 1.75;

	--weight-regular: 400;
	--weight-medium: 500;
	--weight-semibold: 600;
	--weight-bold: 700;
	--weight-extrabold: 800;
	--weight-black: 900;

	/* Spacing scale */
	--space-xs: 0.25rem;   /* 4px */
	--space-sm: 0.5rem;    /* 8px */
	--space-md: 1rem;      /* 16px */
	--space-lg: 1.5rem;    /* 24px */
	--space-xl: 2rem;      /* 32px */
	--space-2xl: 3rem;     /* 48px */
	--space-3xl: 4rem;     /* 64px */
	--space-4xl: 6rem;     /* 96px */

	/* Layout */
	--container-max: 1280px;
	--container-narrow: 960px;
	--container-wide: 1440px;
	--container-padding: 1.5rem;

	/* Borders */
	--radius-sm: 4px;
	--radius-md: 8px;
	--radius-lg: 12px;
	--radius-full: 9999px;

	/* Shadows */
	--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
	--shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
	--shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
	--shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.12);

	/* Transitions */
	--transition-fast: 150ms ease;
	--transition-base: 200ms ease;
	--transition-slow: 300ms ease;

	/* Z-index scale */
	--z-dropdown: 100;
	--z-sticky: 200;
	--z-overlay: 300;
	--z-modal: 400;
	--z-toast: 500;

	/* Header height (used for scroll offsets) */
	--header-height: 120px;
	--header-height-mobile: 64px;
}

/* --------------------------------------------------------------------------
   3. CSS RESET — Modern normalisation
   -------------------------------------------------------------------------- */

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

* {
	margin: 0;
}

html {
	-webkit-text-size-adjust: 100%;
	-moz-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: var(--header-height);
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

body {
	min-height: 100vh;
	line-height: var(--leading-normal);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

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

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

p,
h1,
h2,
h3,
h4,
h5,
h6 {
	overflow-wrap: break-word;
}

ul[role='list'],
ol[role='list'] {
	list-style: none;
	padding-left: 0;
}

a {
	color: inherit;
	text-decoration-skip-ink: auto;
}

table {
	border-collapse: collapse;
}

/* --------------------------------------------------------------------------
   4. BASE TYPOGRAPHY
   -------------------------------------------------------------------------- */

body {
	font-family: var(--font-body);
	font-size: var(--text-base);
	font-weight: var(--weight-regular);
	color: var(--color-text);
	background-color: var(--color-bg);
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--font-heading);
	line-height: var(--leading-tight);
	color: var(--color-dark);
	font-weight: var(--weight-bold);
}

h1 {
	font-size: var(--text-4xl);
	font-weight: var(--weight-extrabold);
}

h2 {
	font-size: var(--text-3xl);
	font-weight: var(--weight-bold);
}

h3 {
	font-size: var(--text-2xl);
	font-weight: var(--weight-bold);
}

h4 {
	font-size: var(--text-xl);
	font-weight: var(--weight-semibold);
}

h5 {
	font-size: var(--text-lg);
	font-weight: var(--weight-semibold);
}

h6 {
	font-size: var(--text-base);
	font-weight: var(--weight-semibold);
}

@media (min-width: 768px) {
	h1 {
		font-size: var(--text-5xl);
	}

	h2 {
		font-size: var(--text-4xl);
	}

	h3 {
		font-size: var(--text-3xl);
	}
}

@media (min-width: 1024px) {
	h1 {
		font-size: var(--text-6xl);
	}
}

p {
	margin-bottom: var(--space-md);
}

p:last-child {
	margin-bottom: 0;
}

a {
	color: var(--color-primary);
	transition: color var(--transition-base);
}

a:hover {
	color: var(--color-primary-dark);
}

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

strong,
b {
	font-weight: var(--weight-semibold);
}

small {
	font-size: var(--text-sm);
}

blockquote {
	border-left: 4px solid var(--color-accent);
	padding-left: var(--space-lg);
	margin: var(--space-xl) 0;
	font-style: italic;
	color: var(--color-text-muted);
}

hr {
	border: none;
	border-top: 1px solid var(--color-border);
	margin: var(--space-2xl) 0;
}

/* Lists (inside content areas) */
.entry-content ul,
.entry-content ol {
	padding-left: var(--space-xl);
	margin-bottom: var(--space-md);
}

.entry-content li {
	margin-bottom: var(--space-xs);
}

.entry-content li:last-child {
	margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   5. LAYOUT — Container and grid utilities
   -------------------------------------------------------------------------- */

.container {
	width: 100%;
	max-width: var(--container-max);
	margin-left: auto;
	margin-right: auto;
	padding-left: var(--container-padding);
	padding-right: var(--container-padding);
}

.container--narrow {
	max-width: var(--container-narrow);
}

.container--wide {
	max-width: var(--container-wide);
}

.site-main {
	min-height: 50vh;
}

.page-header {
	padding: var(--space-2xl) 0;
}

.page-header__title {
	margin-bottom: var(--space-sm);
}

.page-header__subtitle {
	font-family: var(--font-body);
	font-size: var(--text-lg);
	font-weight: var(--weight-regular);
	color: var(--color-text-muted);
}

/* Section spacing */
.section {
	padding: var(--space-3xl) 0;
}

@media (min-width: 768px) {
	.section {
		padding: var(--space-4xl) 0;
	}
}

.section--cream {
	background-color: var(--color-bg-soft);
}

.section--dark {
	background-color: var(--color-bg-dark);
	color: var(--color-bg);
}

/* --------------------------------------------------------------------------
   6. BUTTONS
   -------------------------------------------------------------------------- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-sm);
	padding: 0.75em 1.5em;
	font-family: var(--font-body);
	font-size: var(--text-base);
	font-weight: var(--weight-semibold);
	line-height: 1;
	text-decoration: none;
	border: 2px solid transparent;
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: background-color var(--transition-base),
		color var(--transition-base),
		border-color var(--transition-base),
		box-shadow var(--transition-base),
		transform var(--transition-base);
	white-space: nowrap;
}

.btn:focus-visible {
	outline: 3px solid var(--color-focus);
	outline-offset: 2px;
}

.btn--primary {
	background-color: var(--color-accent);
	color: var(--color-dark);
	border-color: var(--color-accent);
}

.btn--primary:hover {
	background-color: var(--color-accent-dark);
	border-color: var(--color-accent-dark);
	color: var(--color-dark);
}

.btn--secondary {
	background-color: var(--color-primary);
	color: var(--color-bg);
	border-color: var(--color-primary);
}

.btn--secondary:hover {
	background-color: var(--color-primary-dark);
	border-color: var(--color-primary-dark);
	color: var(--color-bg);
}

.btn--outline {
	background-color: transparent;
	color: var(--color-primary);
	border-color: var(--color-primary);
}

.btn--outline:hover {
	background-color: var(--color-primary);
	color: var(--color-bg);
}

.btn--outline-light {
	background-color: transparent;
	color: var(--color-bg);
	border-color: var(--color-bg);
}

.btn--outline-light:hover {
	background-color: var(--color-bg);
	color: var(--color-dark);
}

.btn--sm {
	font-size: var(--text-sm);
	padding: 0.5em 1em;
}

.btn--lg {
	font-size: var(--text-lg);
	padding: 1em 2em;
}

.btn--full {
	width: 100%;
}

/* --------------------------------------------------------------------------
   7. FORM ELEMENTS
   -------------------------------------------------------------------------- */

.form-group {
	margin-bottom: var(--space-lg);
}

.form-label {
	display: block;
	margin-bottom: var(--space-xs);
	font-weight: var(--weight-medium);
	font-size: var(--text-sm);
}

.form-input,
.form-select,
.form-textarea {
	display: block;
	width: 100%;
	padding: 0.625em 0.875em;
	font-size: var(--text-base);
	line-height: var(--leading-normal);
	color: var(--color-text);
	background-color: var(--color-bg);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
	outline: none;
	border-color: var(--color-primary);
	box-shadow: 0 0 0 3px rgba(27, 77, 62, 0.15);
}

.form-input::placeholder {
	color: var(--color-text-light);
}

/* --------------------------------------------------------------------------
   8. UTILITY CLASSES
   -------------------------------------------------------------------------- */

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

.sr-only-focusable:focus,
.sr-only-focusable:active {
	position: static;
	width: auto;
	height: auto;
	padding: inherit;
	margin: inherit;
	overflow: visible;
	clip: auto;
	white-space: inherit;
}

/* Skip link */
.skip-link {
	position: absolute;
	top: -100%;
	left: var(--space-md);
	z-index: var(--z-toast);
	padding: var(--space-sm) var(--space-md);
	background-color: var(--color-accent);
	color: var(--color-dark);
	font-weight: var(--weight-semibold);
	text-decoration: none;
	border-radius: 0 0 var(--radius-sm) var(--radius-sm);
	transition: top var(--transition-fast);
}

.skip-link:focus {
	top: 0;
	outline: 3px solid var(--color-primary);
	outline-offset: 2px;
}

/* Text alignment */
.text-center {
	text-align: center;
}

.text-left {
	text-align: left;
}

.text-right {
	text-align: right;
}

/* Visually hidden but maintains layout */
.invisible {
	visibility: hidden;
}

/* --------------------------------------------------------------------------
   9. BADGES
   -------------------------------------------------------------------------- */

.badge {
	display: inline-flex;
	align-items: center;
	padding: 0.2em 0.6em;
	font-size: var(--text-xs);
	font-weight: var(--weight-semibold);
	line-height: 1;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	border-radius: var(--radius-sm);
}

.badge--available {
	background-color: rgba(45, 122, 79, 0.1);
	color: var(--color-success);
}

.badge--low {
	background-color: rgba(180, 83, 9, 0.1);
	color: var(--color-warning);
}

.badge--soldout {
	background-color: rgba(185, 28, 28, 0.1);
	color: var(--color-danger);
}

.badge--category {
	background-color: var(--color-primary);
	color: var(--color-bg);
}

/* --------------------------------------------------------------------------
   10. ANIMATIONS — All wrapped in prefers-reduced-motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
	/* Fade in on scroll — applied via JS Intersection Observer */
	.fade-in-up {
		opacity: 0;
		transform: translateY(20px);
		transition: opacity 0.6s ease, transform 0.6s ease;
	}

	.fade-in-up.is-visible {
		opacity: 1;
		transform: translateY(0);
	}

	/* Hover lift for cards */
	.hover-lift {
		transition: transform var(--transition-base), box-shadow var(--transition-base);
	}

	.hover-lift:hover {
		transform: translateY(-3px);
		box-shadow: var(--shadow-lg);
	}

	/* Image zoom on hover */
	.img-zoom {
		overflow: hidden;
	}

	.img-zoom img {
		transition: transform var(--transition-slow);
	}

	.img-zoom:hover img {
		transform: scale(1.03);
	}

	/* Basket icon pulse animation */
	@keyframes basket-pulse {
		0% { transform: scale(1); }
		50% { transform: scale(1.2); }
		100% { transform: scale(1); }
	}

	.basket-pulse {
		animation: basket-pulse 0.4s ease;
	}
}

/* For users who prefer reduced motion: no animations, instant transitions */
@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;
	}

	.fade-in-up {
		opacity: 1;
		transform: none;
	}
}

/* --------------------------------------------------------------------------
   11. WORDPRESS SPECIFIC — Alignment, captions, galleries
   -------------------------------------------------------------------------- */

.alignwide {
	max-width: var(--container-wide);
	margin-left: auto;
	margin-right: auto;
}

.alignfull {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
}

.wp-caption {
	max-width: 100%;
}

.wp-caption-text {
	font-size: var(--text-sm);
	color: var(--color-text-muted);
	margin-top: var(--space-xs);
}

.gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: var(--space-sm);
	margin-bottom: var(--space-xl);
}

/* --------------------------------------------------------------------------
   12. PRINT STYLES
   -------------------------------------------------------------------------- */

@media print {
	body {
		font-size: 12pt;
		color: #000;
		background: #fff;
	}

	.site-header,
	.site-footer,
	.skip-link,
	.alert-banner {
		display: none;
	}

	a[href]::after {
		content: ' (' attr(href) ')';
		font-size: 0.8em;
		color: #666;
	}

	.container {
		max-width: 100%;
		padding: 0;
	}
}
