:root {
  --bg: #2b1418;
  --accent: #d9b26f;
  --text: #fbf3e6;
  --paper: #fbf5ec;
  --card: #ffffff;
  --ink: #3a2226;
  --muted: #7b6467;
  --line: #eadfce;
  --ok: #2f7d4f;
  --warn: #a8641c;
  --error: #b3261e;
  --radius: 16px;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Nunito Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.45;
}

[hidden] { display: none !important; }

.hero {
  background:
    radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--accent) 22%, var(--bg)) 0%, var(--bg) 75%);
  color: var(--text);
  text-align: center;
  padding: 34px 16px 30px;
  border-bottom: 3px solid var(--accent);
}

.hero h1 {
  margin: 4px 0 2px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(40px, 11vw, 64px);
  line-height: 1.05;
  color: var(--accent);
}

.hero p {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 21px;
  opacity: 0.92;
}

.ornament {
  color: var(--accent);
  letter-spacing: 0.5em;
  font-size: 14px;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 6px 24px rgba(58, 34, 38, 0.06);
  margin-bottom: 16px;
}

.card h2 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.15;
}

label.field { display: block; margin: 14px 0 6px; font-weight: 600; }
.hint { color: var(--muted); font-size: 15px; margin: 4px 0 0; }

input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  width: 100%;
  font: inherit;
  font-size: 17px; /* 16px+ hindrer zoom på iPhone */
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}

textarea { min-height: 84px; resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  font: inherit;
  font-weight: 700;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.primary { background: var(--bg); color: var(--text); border-color: var(--bg); }
.btn.gold { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.danger { background: transparent; color: var(--error); border-color: color-mix(in srgb, var(--error) 40%, transparent); }
.btn.block { width: 100%; }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: 15px; }

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--bg);
  text-decoration: underline;
  cursor: pointer;
}

.alert {
  border-radius: 12px;
  padding: 12px 14px;
  margin: 12px 0;
  font-size: 16px;
}

.alert.error { background: #fbe9e7; color: var(--error); }
.alert.ok { background: #e7f4ec; color: var(--ok); }
.alert.info { background: #f6efe2; color: var(--ink); }

.center { text-align: center; }
.muted { color: var(--muted); }

/* Skjult, men fortsatt klikkbar via label – display:none kan stoppe filvelgeren på eldre iPhone */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  opacity: 0;
}


/* Språkvelger øverst til høyre i toppfeltet */
.hero { position: relative; }
.lang-slot { position: absolute; top: 10px; right: 12px; }
.lang-picker {
  width: auto;
  font: inherit;
  font-size: 14px;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  color: var(--text);
}
.lang-picker option { color: #3a2226; background: #fff; }


/* Samtykke (Lag album og opplasting) */
.consent { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 4px; font-size: 15px; line-height: 1.4; cursor: pointer; }
.consent input { flex: none; width: 22px; height: 22px; margin-top: 1px; accent-color: var(--bg); cursor: pointer; }
.consent a { color: var(--bg); font-weight: 700; white-space: nowrap; }

.download-all { margin: 0 0 16px; background: var(--card); }

.site-footer { text-align: center; padding: 8px 16px 28px; font-size: 14px; }
.site-footer a { color: var(--muted); }

/* Temavalg (Lag album og innstillingene i admin) */
.theme-picker { border: 0; padding: 0; margin: 14px 0 0; }
.theme-picker legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.theme-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.theme-option {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  padding: 10px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; font-size: 14px; font-weight: 600;
}
.theme-option input { position: absolute; opacity: 0; pointer-events: none; }
.theme-option:has(input:checked) { border-color: var(--bg); background: #f6efe2; }
.theme-option:has(input:focus-visible) { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 50%, transparent); }
.theme-swatch { display: flex; }
.theme-swatch i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; margin-right: -6px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }

/* Vurdering før ZIP-nedlastingen (review-dialog.js) */
.rating-dialog {
  width: min(480px, calc(100vw - 32px));
  border: 0;
  border-radius: var(--radius);
  padding: 22px;
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.rating-dialog::backdrop { background: rgba(27, 16, 53, 0.55); }
.rating-dialog h2 { margin: 0 0 6px; font-family: var(--serif); font-size: 26px; }
.rating-stars { display: flex; gap: 6px; margin: 14px 0 4px; }
.rating-star {
  font-size: 38px; line-height: 1; padding: 2px 4px; border: 0; background: none; cursor: pointer;
  color: #d9cfe4; transition: transform 0.1s ease, color 0.1s ease;
}
.rating-star.on { color: #f5b301; }
.rating-star:hover { transform: scale(1.12); }
.rating-star:focus-visible { outline: 2px solid var(--bg); outline-offset: 2px; border-radius: 6px; }
.rating-dialog textarea { min-height: 72px; }
.rating-dialog .dialog-buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
/* Tydelig fokus for tastatur og skjermleser (gjelder alle sidene som bruker site.css) */
a:focus-visible, button:focus-visible, .btn:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 55%, transparent);
}
