/**
 * Base — CSS custom properties (design system), reset, and typography.
 * Improved for premium food magazine aesthetic.
 * Version 2.0
 */

/* =====================================================================
 * Design Tokens
 * =================================================================== */
:root {
	/* Colors — warm, editorial, food-forward */
	--hk-color-bg:              #faf8f5;
	--hk-color-surface:         #ffffff;
	--hk-color-surface-alt:     #f4f0e8;
	--hk-color-surface-warm:    #fdf6ec;
	--hk-color-text:            #1e1610;
	--hk-color-text-muted:      #6b5e52;
	--hk-color-text-light:      #a08878;
	--hk-color-border:          #e8dfd2;
	--hk-color-border-light:    #f0ebe3;
	--hk-color-accent:          #c8512a;
	--hk-color-accent-dark:     #a3411f;
	--hk-color-accent-light:    #fef0ea;
	--hk-color-accent-contrast: #ffffff;
	--hk-color-focus:           #c8512a;
	--hk-color-gold:            #c89b3c;
	--hk-color-green:           #3a7d44;

	/* Typography — system font stack (zero external requests) */
	--hk-font-body:    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--hk-font-display: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;

	/* Fluid type scale */
	--hk-text-xs:   clamp(0.7rem,   0.68rem + 0.1vw,  0.78rem);
	--hk-text-sm:   clamp(0.85rem,  0.82rem + 0.15vw, 0.9375rem);
	--hk-text-base: clamp(1rem,     0.97rem + 0.2vw,  1.0625rem);
	--hk-text-lg:   clamp(1.1rem,   1.05rem + 0.3vw,  1.25rem);
	--hk-text-xl:   clamp(1.3rem,   1.2rem  + 0.5vw,  1.6rem);
	--hk-text-2xl:  clamp(1.6rem,   1.45rem + 0.85vw, 2.1rem);
	--hk-text-3xl:  clamp(2rem,     1.75rem + 1.3vw,  2.8rem);
	--hk-text-4xl:  clamp(2.4rem,   2rem    + 2.1vw,  3.6rem);

	--hk-line-tight:  1.15;
	--hk-line-snug:   1.35;
	--hk-line-normal: 1.65;

	/* Spacing scale */
	--hk-space-1:  0.25rem;
	--hk-space-2:  0.5rem;
	--hk-space-3:  0.75rem;
	--hk-space-4:  1rem;
	--hk-space-5:  1.5rem;
	--hk-space-6:  2rem;
	--hk-space-7:  3rem;
	--hk-space-8:  4.5rem;
	--hk-space-9:  6rem;

	/* Radius */
	--hk-radius-sm:   5px;
	--hk-radius-md:   10px;
	--hk-radius-lg:   16px;
	--hk-radius-xl:   24px;
	--hk-radius-pill: 999px;

	/* Shadows */
	--hk-shadow-xs: 0 1px 3px rgba(30,20,10,0.07);
	--hk-shadow-sm: 0 2px 8px rgba(30,20,10,0.09), 0 1px 2px rgba(30,20,10,0.06);
	--hk-shadow-md: 0 8px 24px -4px rgba(30,20,10,0.16), 0 2px 6px rgba(30,20,10,0.08);
	--hk-shadow-lg: 0 16px 48px -8px rgba(30,20,10,0.22), 0 4px 12px rgba(30,20,10,0.1);

	/* Layout */
	--hk-container-max: 1300px;
	--hk-container-pad: clamp(1rem, 4vw, 2.5rem);
	--hk-header-height: 68px;
	--hk-border-width:  1px;

	/* Transitions */
	--hk-ease:      cubic-bezier(0.4,0,0.2,1);
	--hk-ease-out:  cubic-bezier(0,0,0.2,1);
	--hk-duration:  200ms;
}

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: auto;
}

body {
	margin: 0;
	background-color: var(--hk-color-bg);
	color: var(--hk-color-text);
	font-family: var(--hk-font-body);
	font-size: var(--hk-text-base);
	line-height: var(--hk-line-normal);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img, picture, svg, video, canvas { display: block; max-width: 100%; height: auto; }
img { background-color: var(--hk-color-surface-alt); }

h1, h2, h3, h4, h5, h6 {
	font-family: var(--hk-font-display);
	line-height: var(--hk-line-tight);
	font-weight: 700;
	margin: 0 0 var(--hk-space-3);
	color: var(--hk-color-text);
	letter-spacing: -0.02em;
}

h1 { font-size: var(--hk-text-4xl); }
h2 { font-size: var(--hk-text-3xl); }
h3 { font-size: var(--hk-text-2xl); }
h4 { font-size: var(--hk-text-xl);  }
h5 { font-size: var(--hk-text-lg);  }
h6 { font-size: var(--hk-text-base); }

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

ul, ol { margin: 0 0 var(--hk-space-4); padding-inline-start: var(--hk-space-5); }

a {
	color: inherit;
	text-decoration-color: var(--hk-color-accent);
	text-underline-offset: 0.18em;
	transition: color var(--hk-duration) var(--hk-ease);
}

a:not([class]) { color: var(--hk-color-accent-dark); }
a:hover { text-decoration-thickness: 2px; }

button, input, select, textarea { font-family: inherit; font-size: 100%; }
button { cursor: pointer; }

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

blockquote {
	margin: var(--hk-space-5) 0;
	padding: var(--hk-space-4) var(--hk-space-5);
	border-left: 4px solid var(--hk-color-accent);
	background: var(--hk-color-surface-warm);
	border-radius: 0 var(--hk-radius-md) var(--hk-radius-md) 0;
	font-style: italic;
	color: var(--hk-color-text-muted);
}

/* =====================================================================
 * Accessibility
 * =================================================================== */
.screen-reader-text {
	border: 0;
	clip: rect(1px,1px,1px,1px);
	clip-path: inset(50%);
	height: 1px; margin: -1px;
	overflow: hidden; padding: 0;
	position: absolute !important;
	width: 1px; word-wrap: normal !important;
}

.skip-link {
	position: absolute;
	top: -100px;
	left: var(--hk-space-3);
	z-index: 10000;
	background: var(--hk-color-text);
	color: var(--hk-color-accent-contrast);
	padding: var(--hk-space-3) var(--hk-space-4);
	border-radius: var(--hk-radius-sm);
	font-weight: 600;
	transition: top 0.15s ease-out;
	text-decoration: none;
}

.skip-link:focus { top: var(--hk-space-3); }

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

a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
	outline: 2px solid var(--hk-color-focus);
	outline-offset: 3px;
	border-radius: var(--hk-radius-sm);
}

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