/* Osteopati Skjelbred – shared styles for all pages */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

:root {
  --bg: #f7f3ec;
  --surface: #fffdf9;
  --surface-2: #efe9df;
  --text: #1d2733;
  --muted: #5a6573;
  --border: rgba(29, 39, 51, 0.10);

  /* Accent picks up the blue from the logo; warm tones echo its red/yellow */
  --accent: #2f5f8f;
  --accent-hover: #264e77;
  --accent-soft: rgba(47, 95, 143, 0.09);
  --warm: #c98a3c;
  --rose: #b4404f;

  --shadow-sm: 0 1px 2px rgba(29, 39, 51, 0.05);
  --shadow-md: 0 18px 40px -18px rgba(29, 39, 51, 0.28);

  --radius: 20px;
  --container: 1080px;
  --menu-h: 76px;
  --header-bg: rgba(247, 243, 236, 0.85);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, ui-serif, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
}

[data-theme="dark"] {
  --bg: #12161b;
  --surface: #1a2027;
  --surface-2: #222a33;
  --text: #ebeef2;
  --muted: #a6b0bc;
  --border: rgba(235, 238, 242, 0.10);
  --accent: #8fb9e6;
  --accent-hover: #a9caee;
  --accent-soft: rgba(143, 185, 230, 0.12);
  --warm: #e0ad6a;
  --rose: #e48a95;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 18px 40px -18px rgba(0, 0, 0, 0.6);
  --header-bg: rgba(18, 22, 27, 0.85);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12161b;
    --surface: #1a2027;
    --surface-2: #222a33;
    --text: #ebeef2;
    --muted: #a6b0bc;
    --border: rgba(235, 238, 242, 0.10);
    --accent: #8fb9e6;
    --accent-hover: #a9caee;
    --accent-soft: rgba(143, 185, 230, 0.12);
    --warm: #e0ad6a;
    --rose: #e48a95;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 18px 40px -18px rgba(0, 0, 0, 0.6);
    --header-bg: rgba(18, 22, 27, 0.85);
  }
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
}

main { flex: 1; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 3px;
  border-radius: 8px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}
.container.narrow { max-width: 780px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; top: -100px; left: 16px; z-index: 100;
  padding: 10px 18px; background: var(--accent); color: var(--bg);
  border-radius: 0 0 12px 12px; font-weight: 700; text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; }

/* === Header === */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: var(--header-bg);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  min-height: var(--menu-h);
}

.brand {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none; margin-right: auto;
}
/* The logo has a white background, so it sits on a white tile in both themes */
.logo-tile {
  display: grid; place-items: center;
  background: #fff;
  border-radius: 12px;
  padding: 4px 6px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.logo-tile img { height: 40px; width: auto; }
.brand-text { display: grid; line-height: 1.15; }
.brand-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
}
.brand-tagline { font-size: 0.82rem; color: var(--muted); font-weight: 500; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--muted);
  transition: color 0.15s ease, background-color 0.15s ease;
}
.nav a:hover { color: var(--text); background: var(--accent-soft); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

.theme-btn, .menu-btn {
  display: inline-grid; place-items: center;
  width: 42px; height: 42px; flex: none;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.theme-btn:hover, .menu-btn:hover { background: var(--surface-2); }
.theme-btn svg, .menu-btn svg { width: 20px; height: 20px; }
.theme-btn .moon { display: none; }
[data-theme="dark"] .theme-btn .sun { display: none; }
[data-theme="dark"] .theme-btn .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: none; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: block; }
}
.menu-btn { display: none; }

[hidden] { display: none !important; }

/* Hide the page until it has been translated, so Norwegian doesn't flash first */
.i18n-wait body { visibility: hidden; }

/* === Language menu === */
.lang-switch { position: relative; flex: none; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 12px 0 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit; font-size: 0.88rem; font-weight: 700; letter-spacing: 0.04em;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.lang-btn:hover { background: var(--surface-2); }
.lang-btn .chev { width: 14px; height: 14px; color: var(--muted); transition: transform 0.15s ease; }
.lang-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }

.lang-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40;
  min-width: 170px;
  list-style: none;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
}
.lang-menu a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600; font-size: 0.95rem;
}
.lang-menu a:hover { background: var(--accent-soft); }
.lang-menu a[aria-current="true"] { color: var(--accent); background: var(--accent-soft); }
.lang-menu a[aria-current="true"]::after {
  content: ""; margin-left: auto; width: 6px; height: 11px;
  border: solid currentColor; border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-2px, -2px);
}

.flag {
  display: inline-block; flex: none;
  width: 22px; height: 16px;
  border-radius: 3px;
  background: center / cover no-repeat;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.14);
}
.flag-nn { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 16'%3E%3Crect width='22' height='16' fill='%23ba0c2f'/%3E%3Cpath d='M6 0h4v16H6zM0 6h22v4H0z' fill='%23fff'/%3E%3Cpath d='M7 0h2v16H7zM0 7h22v2H0z' fill='%2300205b'/%3E%3C/svg%3E"); }
.flag-en { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3CclipPath id='t'%3E%3Cpath d='M30 15h30v15zv15H0zH0V0zV0h30z'/%3E%3C/clipPath%3E%3Cpath d='M0 0v30h60V0z' fill='%23012169'/%3E%3Cpath d='M0 0l60 30m0-30L0 30' stroke='%23fff' stroke-width='6'/%3E%3Cpath d='M0 0l60 30m0-30L0 30' clip-path='url(%23t)' stroke='%23c8102e' stroke-width='4'/%3E%3Cpath d='M30 0v30M0 15h60' stroke='%23fff' stroke-width='10'/%3E%3Cpath d='M30 0v30M0 15h60' stroke='%23c8102e' stroke-width='6'/%3E%3C/svg%3E"); }
.flag-de { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 5 3'%3E%3Cpath fill='%23000' d='M0 0h5v1H0z'/%3E%3Cpath fill='%23dd0000' d='M0 1h5v1H0z'/%3E%3Cpath fill='%23ffce00' d='M0 2h5v1H0z'/%3E%3C/svg%3E"); }

@media (max-width: 800px) {
  .menu-btn { display: inline-grid; }
  .lang-code, .lang-btn .chev { display: none; }
  .lang-btn { width: 42px; padding: 0; justify-content: center; }
  .nav {
    display: none;
    position: absolute; left: 12px; right: 12px; top: calc(100% + 6px);
    flex-direction: column; align-items: stretch;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; border-radius: 10px; color: var(--text); }
  .brand-tagline { display: none; }
  .brand-name { font-size: 1.05rem; }
  .logo-tile img { height: 34px; }
  :root { --menu-h: 66px; }
}

@media (max-width: 420px) {
  .container { padding: 0 14px; }
  .header-inner { gap: 6px; }
  .brand { gap: 8px; }
  .brand-name { font-size: 0.98rem; }
  .logo-tile { padding: 3px 4px; }
  .logo-tile img { height: 30px; }
  .lang-btn, .theme-btn, .menu-btn { width: 38px; height: 38px; }
}

/* === Typography helpers === */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.82rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--accent);
}
.eyebrow::before {
  content: ""; width: 28px; height: 2px; background: currentColor; border-radius: 2px;
}

/* === Hero (front page) === */
.hero {
  position: relative;
  padding: clamp(48px, 9vw, 104px) 0 clamp(40px, 7vw, 80px);
  overflow: hidden;
}
.hero::before, .page-hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(560px 380px at 88% 15%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    radial-gradient(480px 340px at 8% 95%, color-mix(in srgb, var(--warm) 14%, transparent), transparent 70%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
}
.hero h1, .page-hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.hero h1 {
  font-size: clamp(2.3rem, 5.4vw, 3.8rem);
  margin: 18px 0 20px;
}
.hero h1 em, .page-hero h1 em { font-style: italic; color: var(--accent); }
.lead {
  font-size: clamp(1.08rem, 2vw, 1.22rem);
  color: var(--muted);
  max-width: 540px;
}
.lead-name { display: block; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.hero-art {
  background: #fff;
  border-radius: 28px;
  padding: clamp(18px, 3vw, 28px);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}
.hero-art img { width: 100%; }

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { max-width: 360px; order: -1; }
}

/* === Sub-page hero === */
.page-hero {
  position: relative;
  padding: clamp(40px, 7vw, 72px) 0 clamp(20px, 4vw, 32px);
  overflow: hidden;
}
.page-hero .container { position: relative; }
.page-hero h1 {
  font-size: clamp(2rem, 4.6vw, 3rem);
  margin: 14px 0 12px;
}

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 650; font-size: 1rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--accent); color: var(--bg); box-shadow: var(--shadow-md); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-ghost { border-color: var(--border); background: var(--surface); color: var(--text); }
.btn-ghost:hover { border-color: color-mix(in srgb, var(--accent) 40%, transparent); transform: translateY(-1px); }
.btn-sm { padding: 10px 18px; font-size: 0.95rem; }

@media (max-width: 520px) {
  .actions .btn { flex: 1 1 100%; }
}

/* === Sections & cards === */
section[id] { scroll-margin-top: calc(var(--menu-h) + 16px); }
.section { padding: clamp(36px, 6vw, 72px) 0; }
.section-head { margin-bottom: 26px; }
.section-head h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
  line-height: 1.2;
  margin-top: 10px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: clamp(22px, 4vw, 34px);
}

.icon-wrap {
  width: 52px; height: 52px; border-radius: 16px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  margin-bottom: 18px;
}
.icon-wrap svg { width: 26px; height: 26px; }

.services { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.service h3 { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; margin-bottom: 8px; }
.service p { color: var(--muted); }

.about {
  display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center;
  margin-top: 20px;
}
.portrait {
  width: 104px; height: 104px; border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border), var(--shadow-md);
  background: var(--surface-2);
}
.about h3 { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; }
.about .role { color: var(--accent); font-weight: 650; margin-bottom: 14px; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.icon-link {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.icon-link:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.icon-link svg { width: 20px; height: 20px; }

/* Contact + map */
.contact-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 20px; align-items: stretch; }
.contact-list { list-style: none; display: grid; gap: 4px; margin-bottom: 24px; }
.contact-list a {
  display: flex; align-items: center; gap: 14px;
  padding: 12px; margin: 0 -12px;
  border-radius: 14px;
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.contact-list a:hover { background: var(--accent-soft); }
.contact-list .ic {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.contact-list .ic svg { width: 20px; height: 20px; }
.contact-list small {
  display: block; font-size: 0.78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
}
.contact-list strong { font-weight: 600; overflow-wrap: anywhere; }
.contact-card .actions { margin-top: 0; }

.map-card { padding: 0; overflow: hidden; min-height: 360px; }
.map-frame { display: block; width: 100%; height: 100%; min-height: 360px; border: 0; }
[data-theme="dark"] .map-frame { filter: invert(0.9) hue-rotate(180deg) saturate(0.6); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .map-frame { filter: invert(0.9) hue-rotate(180deg) saturate(0.6); }
}

@media (max-width: 820px) {
  .services, .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .about { grid-template-columns: 1fr; }
  .portrait { width: 84px; height: 84px; }
}

/* === Om meg === */
.profile {
  display: grid; grid-template-columns: auto 1fr;
  gap: clamp(20px, 4vw, 40px); align-items: center;
}
.portrait-lg { width: 176px; height: 176px; border-width: 4px; }
@media (max-width: 600px) {
  .profile { grid-template-columns: 1fr; }
  .portrait-lg { width: 128px; height: 128px; }
}
.credentials { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.9rem; font-weight: 600;
}
.chip::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}

.prose { color: var(--muted); }
.prose > * + * { margin-top: 1em; }
.prose h2 {
  font-family: var(--serif); font-weight: 600; color: var(--text);
  font-size: 1.5rem; line-height: 1.25;
}
.prose h3 { color: var(--text); font-size: 1.1rem; margin-top: 1.6em; }
.prose .sub { color: var(--accent); font-weight: 600; margin-top: 4px; }
.prose ul { padding-left: 1.2em; display: grid; gap: 6px; }
.prose li::marker { color: var(--accent); }
.prose strong { color: var(--text); }

/* Without JS all three languages are shown one after another */
.lang-panel + .lang-panel { margin-top: 20px; }

.cta-card {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px;
  margin-top: 24px;
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 18%, transparent);
  box-shadow: none;
}
.cta-card h2 { font-family: var(--serif); font-weight: 600; font-size: 1.35rem; }
.cta-card p { color: var(--muted); }

.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 28px;
  color: var(--muted); font-weight: 600; text-decoration: none;
}
.back-link:hover { color: var(--text); }

/* === Footer === */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: clamp(24px, 5vw, 48px);
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.footer-links { display: flex; gap: 18px; }
footer a { text-underline-offset: 3px; }
footer a:hover { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto !important; }
}
