/* Layout for medlemsundersøkelsen 2024. Samme palett og skrift som resten av nettstedet. */

:root {
  --green-dark: #074144;
  --green: #064044;
  --green-mid: #0a7876;
  --green-soft: #107875;
  --cream: #f5decc;
  --cream-bright: #faf5f0;
  --coral: #ec664d;
  --line: #e4eeed;
  --text: #064044;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: "Red Hat Text", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--coral); }
a:hover { color: #d9534f; }

.site-header {
  background: var(--green-dark);
  color: var(--cream);
}

.site-header__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1rem 0.75rem;
}

.site-header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.site-logo {
  color: var(--cream-bright);
  font-weight: 700;
  font-size: 1.125rem;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.site-header__actions {
  display: flex;
  gap: 0.5rem;
}

.site-nav {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
}

.site-nav a {
  color: var(--cream);
  text-decoration: none;
  font-size: 0.875rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--green-soft);
  color: var(--cream-bright);
}

.btn {
  display: inline-flex;
  align-items: center;
  border-radius: 0.5rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
}

.btn--coral { background: var(--coral); }
.btn--coral:hover { background: #d9534f; color: #fff; }
.btn--green { background: #1a8281; }
.btn--green:hover { background: #3d9493; color: #fff; }
.btn--outline {
  background: #fff;
  color: #1a8281;
  border: 2px solid #1a8281;
}
.btn--outline:hover { background: #1a8281; color: #fff; }

.report-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

.report {
  max-width: 42rem;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.report-toc details {
  border: 1px solid #b8d4d4;
  border-radius: 0.75rem;
  background: #fff;
}

.report-toc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  list-style: none;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--green-dark);
}

.report-toc summary::-webkit-details-marker { display: none; }

.report-toc summary::after {
  content: "";
  flex: none;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.report-toc details[open] summary::after {
  transform: rotate(225deg) translateY(-2px);
}

.report-toc__panel {
  border-top: 1px solid #dbe9f5;
  max-height: min(70vh, calc(100vh - 8rem));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #1a8281 transparent;
  padding: 0.5rem;
}

.report-toc__list,
.report-toc__sub {
  list-style: none;
  margin: 0;
  padding: 0;
}

.report-toc__list a {
  display: block;
  border-radius: 0.5rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.35;
  color: rgba(6, 64, 68, 0.85);
  text-decoration: none;
}

.report-toc__chapter > a,
.report-toc__chapter-row > a { font-weight: 600; }

.report-toc__chapter-row {
  display: flex;
  align-items: flex-start;
  gap: 0.15rem;
}

.report-toc__chapter-row > a {
  flex: 1 1 auto;
  min-width: 0;
}

.report-toc__toggle {
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  margin-top: 0.15rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--green-dark);
  cursor: pointer;
}

.report-toc__toggle::after {
  content: "";
  display: block;
  width: 0.4rem;
  height: 0.4rem;
  margin: 0.35rem auto 0;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.report-toc__chapter.is-open > .report-toc__chapter-row .report-toc__toggle::after {
  transform: rotate(225deg);
  margin-top: 0.5rem;
}

.report-toc__toggle:hover,
.report-toc__chapter.is-current > .report-toc__chapter-row > a {
  background: #dbe9f5;
  color: var(--green-dark);
}

.report-toc__sub { display: none; }

.report-toc__chapter.is-open > .report-toc__sub { display: block; }

.report-toc__list a:hover {
  background: #dbe9f5;
  color: var(--green-dark);
}

.report-toc__list a[aria-current="true"] {
  background: #107875;
  color: var(--cream-bright);
  font-weight: 600;
}

.report-toc__sub {
  margin: 0.15rem 0 0.35rem 0.75rem;
  padding-left: 0.2rem;
  border-left: 2px solid #b8d4d4;
}

.report-toc__sub a {
  font-size: 0.8125rem;
  font-weight: 400;
  padding-left: 0.65rem;
}

.report-toc__foot {
  margin-top: 0.75rem;
  padding: 0.75rem 0.75rem 0.35rem;
  border-top: 1px solid #b8d4d4;
  display: grid;
  gap: 0.45rem;
}

.report-toc__foot a {
  color: rgba(6, 64, 68, 0.85);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.report-toc__foot a:hover {
  color: var(--green-dark);
  text-decoration: underline;
}

.report-body [docparttype="Table of Contents"] { display: none; }

.back {
  display: inline-flex;
  margin-bottom: 1.25rem;
  color: var(--green-soft);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.back:hover { color: var(--green-dark); }

.meta {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.report > h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  line-height: 1.2;
  font-weight: 700;
  color: var(--green-dark);
}

.lede {
  margin: 0 0 1.25rem;
  font-size: 1.125rem;
  line-height: 1.6;
  color: rgba(6, 64, 68, 0.9);
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 0 2rem;
}

.report-body h1,
.report-body h2,
.report-body h3,
.report-body h4 {
  color: var(--green-dark);
  font-weight: 700;
  line-height: 1.3;
  margin: 2rem 0 0.75rem;
}

.report-body h1,
.report-body h2,
.report-body h3,
.report-body h4,
.report-body a[name] { scroll-margin-top: 1.25rem; }

.report-body h1 { font-size: 1.35rem; }
.report-body h2 { font-size: 1.15rem; }
.report-body h3 { font-size: 1.05rem; }
.report-body h4 { font-size: 1rem; margin-bottom: 0.35rem; }

.report-body p {
  margin: 0 0 1rem;
}

.report-body br {
  display: block;
  margin-top: 0.85rem;
  content: "";
}

.report-body ul,
.report-body ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.report-body li { margin: 0.25rem 0; }

.report-body a { text-underline-offset: 2px; }

.report-body a[name] {
  color: inherit;
  text-decoration: none;
}

.report-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.5rem auto;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: #fff;
}

.report-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0 2rem;
  font-size: 0.92rem;
  line-height: 1.45;
}

.report-body th,
.report-body td {
  border: 1px solid var(--line);
  padding: 0.55rem 0.7rem;
  text-align: left;
  vertical-align: top;
}

.report-body th {
  background: var(--cream-bright);
  font-weight: 700;
}

.report-body tr:nth-child(even) td { background: #f7fbfb; }

.scroll-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--green-dark);
  color: var(--cream-bright);
}

.scroll-to-top svg { width: 1.25rem; height: 1.25rem; transform: rotate(180deg); }

.site-footer {
  background: var(--green-dark);
  color: var(--cream);
  margin-top: 2rem;
}

.site-footer__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.25rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  font-size: 0.8rem;
}

.site-footer a {
  color: var(--cream);
  text-decoration: none;
}

.site-footer a:hover { color: #fff; }

@media (min-width: 40rem) {
  .site-header__inner { padding-left: 1.5rem; padding-right: 1.5rem; }

  .report-shell {
    display: grid;
    grid-template-columns: minmax(12.5rem, 17rem) minmax(0, 1fr);
    column-gap: 2rem;
    align-items: start;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .report-toc {
    position: sticky;
    top: 1rem;
    align-self: start;
    height: calc(100vh - 2rem);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #1a8281 transparent;
  }

  .report-toc details {
    display: block;
    max-height: none;
    border: 0;
    background: transparent;
  }

  .report-toc details:not([open]) > .report-toc__panel,
  .report-toc details:not([open])::details-content {
    content-visibility: visible;
    display: block;
    height: auto;
  }

  .report-toc summary {
    pointer-events: none;
    padding: 0 0.75rem 0.5rem;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1a8281;
  }

  .report-toc summary::after { display: none; }

  .report-toc__panel {
    border-top: 0;
    padding: 0;
    max-height: none;
    overflow: visible;
  }
}
