/* =========================================================
   THEME SETTINGS
   Bytt primært farger, fonter og hero her ved gjenbruk.
   ========================================================= */

:root {
  --bg: #f3efe7;
  --surface: #faf8f3;
  --surface-2: #eee7dc;

  --text: #272b2d;
  --muted: #6d706f;
  --line: rgba(12, 28, 49, 0.16);

  --primary: #0c1c31;
  --primary-dark: #081523;
  --accent: #b08a4a;
  --accent-soft: #ceb486;
  --link: #642b37;
  --link-hover: #4b2029;
  --white: #ffffff;

  --font-body: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-heading: "Cormorant Garamond", "Iowan Old Style",
                  "Palatino Linotype", "Book Antiqua", Georgia, serif;

  --max: 1180px;
  --reading: 760px;
  --gutter: 40px;

  --hero-height: 250px;
  --hero-image: url("hero.png");
  --hero-position: right center;
  --hero-size: auto 100%;

  --radius: 2px;
  --shadow-menu: 0 24px 80px rgba(8, 21, 35, 0.22);
}

/* Reset */

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

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.72;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--link-hover);
}

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* Felles bredde */

.header-inner,
.hero-inner,
.content-section,
.footer-inner {
  width: min(calc(100% - var(--gutter)), var(--max));
  margin-inline: auto;
}

/* Header */

.site-header {
  position: relative;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  background: var(--primary-dark);
  color: var(--white);
}

.header-inner {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.brand {
  flex: 0 0 auto;
  color: var(--white);
  text-decoration: none;
}

.brand:hover {
  color: var(--white);
}

.brand-name {
  display: block;
  color: var(--white);
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* Desktop navigation */

.desktop-nav ul,
.mobile-menu ul,
.footer-nav ul {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.desktop-nav ul {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0 1.6rem;
}

.desktop-nav a {
  position: relative;
  display: block;
  padding: 1.35rem 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.desktop-nav a:hover,
.desktop-nav .current > a {
  color: var(--white);
}

.desktop-nav .current > a::after {
  position: absolute;
  right: 0;
  bottom: 1rem;
  left: 0;
  height: 1px;
  background: var(--accent);
  content: "";
}

/* Mobile navigation */

.mobile-menu {
  position: relative;
  display: none;
}

.mobile-menu summary {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 11px;
  cursor: pointer;
  list-style: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  place-content: center;
  gap: 5px;
}

.mobile-menu summary::-webkit-details-marker {
  display: none;
}

.mobile-menu summary span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--white);
}

.mobile-menu nav {
  position: absolute;
  top: 56px;
  right: 0;
  width: min(84vw, 330px);
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(8, 21, 35, 0.98);
  box-shadow: var(--shadow-menu);
}

.mobile-menu ul {
  align-items: stretch;
  flex-direction: column;
}

.mobile-menu li,
.mobile-menu a {
  width: 100%;
}

.mobile-menu a {
  display: block;
  padding: 11px 13px;
  border-radius: 8px;
  color: var(--white);
  font-size: 0.86rem;
  text-decoration: none;
}

.mobile-menu a:hover,
.mobile-menu .current > a {
  background: rgba(255, 255, 255, 0.08);
}

/* Hero */

.hero {
  display: grid;
  min-height: var(--hero-height);
  place-items: end start;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background-color: var(--primary);
  background-image: var(--hero-image);
  background-position: var(--hero-position);
  background-size: var(--hero-size);
  background-repeat: no-repeat;
  color: var(--white);
}

.hero-inner {
  padding-bottom: 1.75rem;
}

.hero h1 {
  max-width: 920px;
  margin: 0;
  color: var(--white);
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 3.4vw, 4.6rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

/* Content */

.content-section {
  padding-block: 0 clamp(36px, 5vw, 64px);
}

.home .content-section {
  padding-top: clamp(24px, 3vw, 36px);
}

.breadcrumbs {
  display: flex;
  min-height: 46px;
  padding-top: 0.35rem;
  margin-bottom: clamp(24px, 3vw, 36px);
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--link);
}

.breadcrumbs .current {
  color: var(--primary);
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--reading));
  justify-content: center;
}

.content-layout.has-sidebar {
  grid-template-columns: minmax(0, 1fr) minmax(230px, 290px);
  justify-content: stretch;
  gap: clamp(2rem, 4vw, 4.5rem);
}

.page-content {
  display: flow-root;
  max-width: var(--reading);
}

.page-content > :first-child {
  margin-top: 0;
}

.page-content p {
  margin: 0 0 1.15em;
}

.page-content p:first-child {
  color: #3b4042;
  font-family: var(--font-heading);
  font-size: 1.22rem;
  line-height: 1.62;
}

.page-content h1,
.page-content h2,
.page-content h3,
.page-content h4 {
  color: var(--primary);
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.page-content h1 {
  margin: 0 0 0.55em;
  font-size: clamp(2.8rem, 7vw, 6rem);
}

.page-content h2 {
  margin: 1.35em 0 0.55em;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.page-content h3 {
  margin: 1.4em 0 0.55em;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.page-content h4 {
  margin: 1.3em 0 0.55em;
  font-size: 1.1rem;
}

.page-content ul,
.page-content ol {
  padding-left: 1.25em;
}

.page-content li {
  margin-block: 0.45em;
}

.page-content strong {
  color: var(--primary-dark);
}

.page-content blockquote {
  margin: 2rem 0;
  padding: 1rem 0 1rem 1.8rem;
  border-left: 2px solid var(--accent);
  color: var(--primary);
  font-family: var(--font-heading);
  font-size: 1.45rem;
  line-height: 1.5;
}

.page-content hr {
  height: 1px;
  margin: 2.5rem 0;
  border: 0;
  background: var(--line);
}

.page-content table {
  display: block;
  max-width: 100%;
  margin-block: 2rem;
  overflow-x: auto;
  border-collapse: collapse;
}

.page-content th,
.page-content td {
  min-width: 9rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.page-content th {
  color: var(--primary);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* Child navigation */

.sidebar {
  align-self: start;
}

.section-nav {
  position: sticky;
  top: 2rem;
  padding-top: 1rem;
  border-top: 2px solid var(--accent);
}

.section-nav-title {
  margin: 0 0 0.8rem;
  color: var(--primary);
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
}

.section-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.section-nav li {
  margin: 0;
  border-top: 1px solid var(--line);
}

.section-nav li:last-child {
  border-bottom: 1px solid var(--line);
}

.section-nav a {
  display: block;
  padding: 0.82rem 0;
  color: var(--text);
  font-size: 0.88rem;
  text-decoration: none;
}

.section-nav a:hover,
.section-nav .current > a {
  color: var(--link);
}

.section-nav .current > a {
  font-weight: 650;
}

/* Footer */

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  background: var(--primary);
  color: rgba(255, 255, 255, 0.68);
}

.footer-inner {
  display: flex;
  min-height: 66px;
  padding-block: 0.75rem;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.copyright {
  margin: 0;
  white-space: nowrap;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.footer-nav ul {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.7rem 1.6rem;
}

.footer-nav a {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.8rem;
  text-decoration: none;
}

.footer-nav a:hover,
.footer-nav .current > a {
  color: var(--accent-soft);
}

/* Responsive */

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

  .mobile-menu {
    display: block;
  }

  .content-layout.has-sidebar {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .section-nav {
    position: static;
  }
}

@media (max-width: 700px) {
  :root {
    --gutter: 28px;
  }

  .hero {
    background-position: right center;
    background-size: auto 100%;
  }

  .hero-inner {
    padding-bottom: 1.25rem;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 8vw, 3.4rem);
  }
}

@media (max-width: 520px) {
  :root {
    --gutter: 28px;
  }

  body {
    font-size: 16px;
  }

  .brand-name {
    white-space: normal;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.7rem;
  }

  .footer-nav ul {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
