/* Majorstua Portrettfoto: svart, hvitt og bildene */

:root {
	--black: #000;
	--ink: #f3f3f3;
	--muted: #9a9a9a;
	--faint: #2a2a2a;
	--line: #333;
	--error: #ff9d9d;
	--header-height: 4.5rem;
	--serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
	--sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
	--fade-millis: 1800ms;
	color-scheme: dark;
}

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

html {
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--header-height) + 1rem);
	-webkit-text-size-adjust: 100%;
	background: var(--black);
}

body {
	margin: 0;
	/* Gjennomsiktig: bakgrunnen er de to faste lagene under (gradering + film grain) */
	background: transparent;
	color: var(--ink);
	font-family: var(--sans);
	font-size: 1.0625rem;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

/*
 * Bakgrunn: svak gradering i mørk grått med litt lys øverst, og et lag «film grain» (SVG-støy) oppå.
 * Begge ligger fast bak alt innhold (z-index under body sitt innhold), så de flytter seg ikke når man scroller.
 */
body::before,
body::after {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
}
body::before {
	z-index: -2;
	background:
		radial-gradient(ellipse 120% 70% at 50% 0%, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0) 70%),
		linear-gradient(180deg, #1a1a1a 0%, #121212 45%, #0c0c0c 100%);
}
body::after {
	z-index: -1;
	opacity: 0.09;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grain)'/%3E%3C/svg%3E");
	background-size: 180px 180px;
}

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

a { color: inherit; text-decoration-color: var(--muted); text-underline-offset: 0.2em; }
a:hover { text-decoration-color: var(--ink); }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.15; margin: 0; }
h2 { font-size: clamp(1.8rem, 4vw, 2.9rem); letter-spacing: -0.01em; }
h3 { font-size: 1.4rem; }
p { margin: 0 0 1em; }

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

.wrap { width: min(100% - 2rem, 66rem); margin-inline: auto; }

/* ---------- Header ---------- */

.site-header {
	position: fixed;
	inset: 0 0 auto 0;
	z-index: 20;
	height: var(--header-height);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 clamp(1rem, 3vw, 2.5rem);
	background: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
}

.brand { display: flex; flex-direction: column; text-decoration: none; line-height: 1.2; }
.brand-name { font-size: 0.8rem; letter-spacing: 0.28em; text-transform: uppercase; }
.brand-person { font-family: var(--serif); font-size: 1.15rem; }

.site-header nav { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2rem); font-size: 0.8rem; letter-spacing: 0.18em; text-transform: uppercase; }
.site-header nav a { text-decoration: none; padding: 0.4rem 0; }
.site-header nav a:hover { text-decoration: underline; text-underline-offset: 0.5em; }
.site-header .nav-cta { border: 1px solid var(--ink); padding: 0.55rem 1.1rem; }
.site-header .nav-cta:hover { background: var(--ink); color: var(--black); text-decoration: none; }

@media (max-width: 640px) {
	.nav-optional { display: none; }
}

/* ---------- Hero ---------- */

.hero {
	position: relative;
	height: 100vh;
	height: 100svh;
	min-height: 30rem;
	overflow: hidden;
	background: var(--black);
}

.slides { position: absolute; inset: 0; }

.slide {
	position: absolute;
	inset: 0;
	margin: 0;
	opacity: 0;
	transition: opacity var(--fade-millis) ease-in-out;
	pointer-events: none;
}

.slide.is-active { opacity: 1; z-index: 1; }

.slide img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: calc(var(--header-height) + 0.25rem) 1rem 1.5rem;
}

/*
 * Smale skjermer (mobil): bildet dekker hele skjermen, med teksten oppå.
 * Utsnittet styres av fokus-ovalen fra photoblog: main.mjs regner ut nøyaktig object-position.
 * --focus-x/--focus-y (sentrum av ovalen) er en grov reserve til skriptet har kjørt; uten oval brukes 50% 30%.
 */
@media (max-aspect-ratio: 4/5) {
	.slide img {
		object-fit: cover;
		object-position: var(--focus-x, 50%) var(--focus-y, 30%);
		padding: 0;
	}
	/* Mørkere toning nederst, så teksten står godt over et bilde som går helt ned */
	.hero::after { height: 55%; background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.45) 55%, rgba(0, 0, 0, 0)); }
}

.hero::after {
	content: "";
	position: absolute;
	inset: auto 0 0 0;
	height: 12rem;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0));
	z-index: 2;
	pointer-events: none;
}

.hero-text {
	position: absolute;
	z-index: 3;
	left: clamp(1rem, 3vw, 2.5rem);
	bottom: clamp(1.2rem, 4vh, 2.5rem);
	max-width: min(21rem, calc(100% - 2rem));
}

/* Skarp skygge, så teksten er lesbar også over lyse bilder */
.hero-text h1,
.hero-lead,
.hero-counter {
	text-shadow: 0 1px 1px rgba(0, 0, 0, 0.95), 0 2px 4px rgba(0, 0, 0, 0.85), 0 0 14px rgba(0, 0, 0, 0.6);
}
.hero-text .button { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.55); }

.hero-text h1 { font-size: clamp(1.9rem, 3.2vw, 2.7rem); margin-bottom: 0.4rem; }
.hero-lead { color: #fff; margin-bottom: 1.1rem; font-size: 0.97rem; line-height: 1.5; }

.hero-controls {
	position: absolute;
	z-index: 3;
	right: clamp(1rem, 3vw, 2.5rem);
	bottom: clamp(1.2rem, 4vh, 2.5rem);
	display: flex;
	align-items: center;
	gap: 0.75rem;
	font-size: 0.85rem;
	letter-spacing: 0.15em;
	color: var(--muted);
}

.icon-button {
	appearance: none;
	background: transparent;
	color: var(--ink);
	border: 1px solid var(--line);
	width: 2.6rem;
	height: 2.6rem;
	border-radius: 50%;
	font-size: 1.1rem;
	cursor: pointer;
	transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.icon-button:hover { background: var(--ink); color: var(--black); border-color: var(--ink); }

@media (max-width: 640px) {
	.hero-text { max-width: calc(100% - 2rem); }
	.hero-controls { right: auto; left: clamp(1rem, 3vw, 2.5rem); bottom: auto; top: calc(var(--header-height) + 0.25rem); }
	.hero-controls .icon-button { width: 2.2rem; height: 2.2rem; }
}

/* Mobil, forsiden: sentrert tekst i bildet. «Bestill» i headeren skjules, siden «Bestill portrettsesjon» vises på første skjerm. */
@media (max-width: 640px) {
	.hero-text { left: 1rem; right: 1rem; max-width: none; text-align: center; }
	.hero-lead { max-width: 22rem; margin-inline: auto; }
	body:not(.plain-page) .site-header .nav-cta { display: none; }

	/* Navnet øverst sentrert (headeren har ingen synlige menypunkter igjen på forsiden) */
	body:not(.plain-page) .site-header { justify-content: center; }
	body:not(.plain-page) .site-header nav { display: none; }
	body:not(.plain-page) .brand { align-items: center; text-align: center; }

	/* Telleren sentrert under navnet, pilene på hver sin side av bildet */
	.hero-controls { inset: 0; display: block; pointer-events: none; }
	.hero-counter { position: absolute; left: 0; right: 0; top: calc(var(--header-height) - 0.5rem); text-align: center; color: rgba(255, 255, 255, 0.85); font-size: 0.75rem; }
	.hero-controls .icon-button {
		position: absolute;
		top: 50%;
		transform: translateY(-50%);
		width: 2.6rem;
		height: 2.6rem;
		pointer-events: auto;
		background: rgba(0, 0, 0, 0.25);
		border-color: rgba(255, 255, 255, 0.35);
	}
	.hero-controls [data-js-id="prev"] { left: 0.6rem; }
	.hero-controls [data-js-id="next"] { right: 0.6rem; }
}

/* Klikk på bildet blar (høyre halvdel fram, venstre tilbake) */
.hero { -webkit-tap-highlight-color: transparent; }
.slides { cursor: pointer; }

/* Når man blar selv, går overtoningen raskt. Den automatiske beholder den rolige --fade-millis. */
.slides.is-quick .slide { transition-duration: 350ms; }

/* ---------- Knapper ---------- */

.button {
	display: inline-block;
	appearance: none;
	border: 1px solid var(--ink);
	background: var(--ink);
	color: var(--black);
	font: inherit;
	font-size: 0.8rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	text-decoration: none;
	padding: 0.95rem 1.8rem;
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
}
.button:hover { background: transparent; color: var(--ink); }
.button:disabled, .button[aria-disabled="true"] { opacity: 0.55; cursor: progress; }
.button[role="button"] { user-select: none; -webkit-user-select: none; }

/* ---------- Seksjoner ---------- */

.section { padding-block: clamp(4rem, 10vw, 8rem); border-top: 1px solid var(--faint); }
.section:first-of-type { border-top: 0; }

.eyebrow { font-size: 0.78rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.5rem; }

.two-column { display: grid; gap: clamp(1.5rem, 5vw, 4rem); }
@media (min-width: 52rem) { .two-column { grid-template-columns: 1fr 1fr; align-items: start; } }

.prose p { color: #d8d8d8; max-width: 40rem; }
.prose h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: 1.5rem; }
.two-column h2 { margin-bottom: 1.25rem; }
.prose h2 { font-size: 1.5rem; margin: 2rem 0 0.5rem; }

.cards { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: clamp(2rem, 5vw, 3rem); }
@media (min-width: 52rem) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card { background: #111; padding: clamp(1.5rem, 3vw, 2.25rem); display: flex; flex-direction: column; }
.card-meta { color: var(--muted); font-size: 0.8rem; letter-spacing: 0.18em; text-transform: uppercase; margin: 0.4rem 0 1.2rem; }
.card-summary { font-family: var(--serif); font-size: 1.2rem; line-height: 1.35; }
.card p { color: #cfcfcf; }
.card-price { margin: auto 0 0; padding-top: 1rem; color: var(--ink) !important; border-top: 1px solid var(--faint); font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; }

.steps { list-style: none; counter-reset: step; padding: 0; margin: clamp(2rem, 5vw, 3rem) 0 0; display: grid; gap: 2rem; }
@media (min-width: 52rem) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps li { counter-increment: step; border-top: 1px solid var(--line); padding-top: 1rem; }
.steps li::before { content: "0" counter(step); display: block; font-family: var(--serif); font-size: 2rem; color: var(--muted); margin-bottom: 0.5rem; }
.steps h3 { font-size: 1.2rem; margin-bottom: 0.4rem; }
.steps p { color: #cfcfcf; font-size: 0.97rem; }

/* ---------- Skjema ---------- */

.booking-form { display: grid; gap: 1.4rem; }
.field label, .check { display: block; font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.field .optional { text-transform: none; letter-spacing: 0; }

.booking-form input[type="text"],
.booking-form input[type="email"],
.booking-form input[type="tel"],
.booking-form select,
.booking-form textarea {
	width: 100%;
	/* Bittelitt lysere flate enn bakgrunnen, så feltene synes */
	background-color: rgba(255, 255, 255, 0.05);
	color: var(--ink);
	font: inherit;
	border: 0;
	border-bottom: 1px solid #4a4a4a;
	border-radius: 0;
	padding: 0.7rem 0.8rem;
	margin-top: 0.2rem;
	appearance: none;
	transition: background-color 0.2s, border-color 0.2s;
}
.booking-form select { padding-right: 2.2rem; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; }
.booking-form select option { background: #1a1a1a; color: var(--ink); }
.booking-form textarea { resize: vertical; border: 1px solid #4a4a4a; padding: 0.8rem; }
.booking-form input:focus, .booking-form select:focus, .booking-form textarea:focus { outline: none; border-color: var(--ink); background-color: rgba(255, 255, 255, 0.08); }

.field .check { display: flex; gap: 0.75rem; align-items: flex-start; text-transform: none; letter-spacing: 0; font-size: 0.95rem; line-height: 1.5; cursor: pointer; }
.field .check input { margin-top: 0.3rem; accent-color: #fff; width: 1.1rem; height: 1.1rem; flex: none; }

.field-error { color: var(--error); font-size: 0.9rem; margin: 0.35rem 0 0; min-height: 0; }
.field-error:empty { display: none; }
.form-status { margin: 0; font-size: 1rem; }
.form-status.is-success { color: var(--ink); border-left: 2px solid var(--ink); padding-left: 1rem; }
.form-status.is-error { color: var(--error); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- FAQ ---------- */

.faq { margin-top: clamp(2rem, 5vw, 3rem); border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 1.2rem 2.5rem 1.2rem 0; font-family: var(--serif); font-size: 1.25rem; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0.25rem; top: 1rem; font-size: 1.6rem; color: var(--muted); }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: #cfcfcf; max-width: 46rem; padding-bottom: 1.2rem; margin: 0; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--faint); padding: 3rem 0 2rem; color: var(--muted); font-size: 0.95rem; }
.footer-grid { display: grid; gap: 1.5rem; }
@media (min-width: 52rem) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-brand { font-family: var(--serif); font-size: 1.25rem; color: var(--ink); margin-bottom: 0.2rem; }
.site-footer p { margin-bottom: 0.35rem; }
.footer-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--faint); font-size: 0.85rem; }

/* ---------- Enkle sider (personvern, feil) ---------- */

.plain-page main { padding-top: calc(var(--header-height) + 3rem); padding-bottom: 5rem; min-height: 70vh; }
.plain-page .site-header { background: rgba(20, 20, 20, 0.92); }

/* ---------- Redusert bevegelse ---------- */

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.slide, .slides.is-quick .slide { transition-duration: 0.01ms; }
}
