/*
 * Nettsmed Smak og se — main.css
 * Designsystem-tokens + grunnleggende layout. Erstatt token-verdier i :root
 * med klient-spesifikke farger og fonter.
 */

:root {
	/* Farger — TODO: erstatt med klient-tokens */
	--c-primary: #000000;
	--c-heading: #111111;
	--c-body:    #444444;
	--c-muted:   #717171;
	--c-border:  #E5E5E3;
	--c-bg:      #FFFFFF;
	--c-bg-soft: #F7F7F5;

	/* Typografi — TODO: erstatt med klient-fonts */
	--ff-display: system-ui, -apple-system, 'Segoe UI', sans-serif;
	--ff-body:    system-ui, -apple-system, 'Segoe UI', sans-serif;

	/* Layout */
	--container: 1200px;
	--gutter:    48px;
	--gutter-sm: 24px;
	--space-xs: 0.5rem;
	--space-sm: 1rem;
	--space-md: 1.5rem;
	--space-lg: 2.5rem;
	--space-xl: 4rem;
	--space-2xl: 6rem;
}

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
	font-family: var(--ff-body);
	color: var(--c-body);
	background: var(--c-bg);
	line-height: 1.7;
	font-size: 17px;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
	font-family: var(--ff-display);
	color: var(--c-heading);
	line-height: 1.2;
	margin: 0 0 var(--space-sm);
	text-wrap: balance;
}
h1 { font-size: clamp(2rem, 4vw + 1rem, 3.5rem); font-weight: 600; }
h2 { font-size: clamp(1.5rem, 2.5vw + 0.5rem, 2.25rem); font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 500; }

a:hover, a:focus-visible {
	color: var(--c-heading);
}

/* ─── A11Y ─── */
.skip-link.screen-reader-text {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--c-heading);
	color: #fff;
	padding: 0.5rem 1rem;
	z-index: 200;
	border-radius: 4px;
}
.skip-link.screen-reader-text:focus {
	left: 1rem;
	top: 1rem;
	clip: auto;
	clip-path: none;
	width: auto;
	height: auto;
}
.visually-hidden {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0,0,0,0);
	white-space: nowrap; border: 0;
}
:focus-visible {
	outline: 2px solid var(--c-primary);
	outline-offset: 2px;
	border-radius: 3px;
}

/* ─── DEV BANNER (blog_public=0) ─── */
body.is-dev::before {
	content: 'DEV — ikke offentlig';
	display: block;
	background: #FEF3C7;
	color: #78350F;
	text-align: center;
	font-size: 0.75rem;
	padding: 0.25rem;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	letter-spacing: 0.5px;
}

/* ─── LAYOUT ─── */
.container {
	max-width: var(--container);
	margin: 0 auto;
	padding: 0 var(--gutter);
}
.section {
	padding: var(--space-2xl) 0;
}

/* ─── HEADER ─── */
.site-header {
	border-bottom: 1px solid var(--c-border);
	background: var(--c-bg);
	transition: box-shadow 0.2s, border-bottom-color 0.2s;
}
.site-header.is-scrolled {
	border-bottom-color: transparent;
	box-shadow: 0 1px 12px rgba(0,0,0,0.06);
}
.header-inner {
	max-width: var(--container);
	margin: 0 auto;
	padding: 0 var(--gutter);
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 72px;
}
.site-brand {
	font-family: var(--ff-display);
	font-weight: 600;
	font-size: 1.125rem;
	color: var(--c-heading);
}
.main-nav__list {
	display: flex;
	gap: var(--space-md);
}
.mobile-toggle {
	display: none;
	background: none;
	border: none;
	cursor: pointer;
	padding: 8px;
	color: var(--c-heading);
}
.mobile-toggle svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 2; fill: none; }
.mobile-menu { display: none; padding: var(--space-sm) var(--gutter); border-top: 1px solid var(--c-border); }
.mobile-menu.is-open { display: block; }
.mobile-menu__list { display: flex; flex-direction: column; gap: var(--space-sm); }

/* ─── FOOTER ─── */
.site-footer {
	border-top: 1px solid var(--c-border);
	background: var(--c-bg-soft);
	padding-block: var(--space-lg);
	margin-top: var(--space-2xl);
}
.site-footer__copy {
	font-size: 0.875rem;
	color: var(--c-muted);
}

/* ─── REVEAL (IntersectionObserver) ─── */
@media (prefers-reduced-motion: no-preference) {
	.reveal {
		opacity: 0;
		transform: translateY(24px);
		transition: opacity 0.7s ease, transform 0.7s ease;
	}
	.reveal.is-visible {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ─── RESPONSIVE ─── */
@media (max-width: 960px) {
	.header-inner { padding: 0 var(--gutter-sm); }
	.container { padding: 0 var(--gutter-sm); }
	.main-nav { display: none; }
	.mobile-toggle { display: block; }
}
