/* Landingside for eksempler – matcher bokens visuelle språk */
:root {
  --bg: #ece8e1;
  --paper: #fffcf7;
  --ink: #1c1917;
  --muted: #57534e;
  --accent: #1a4d6d;
  --accent-dark: #123549;
  --border: #d6d0c4;
  --font-serif: "Source Serif 4", "Georgia", serif;
  --font-sans: "Source Sans 3", system-ui, sans-serif;
  --touch-min: 44px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, rgba(26, 77, 109, 0.08), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(184, 134, 11, 0.06), transparent 50%),
    var(--bg);
}

.ex-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--accent-dark);
  color: #fff;
  text-decoration: none;
}

.ex-skip:focus {
  left: 1rem;
  top: 1rem;
}

.ex-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 40rem;
  margin: 0 auto;
  padding: calc(1rem + var(--safe-top)) calc(1.25rem + var(--safe-right)) 0.5rem calc(1.25rem + var(--safe-left));
}

.ex-back,
.ex-logout {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
}

.ex-back:hover,
.ex-logout:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.ex-main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.5rem calc(1.25rem + var(--safe-right)) 3rem calc(1.25rem + var(--safe-left));
}

.ex-hero {
  margin-bottom: 1.75rem;
}

.ex-eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.ex-hero h1 {
  margin: 0 0 0.65rem;
  font-family: var(--font-serif);
  font-size: clamp(1.85rem, 4vw, 2.35rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--accent-dark);
}

.ex-lead {
  margin: 0;
  max-width: 32rem;
  font-size: 1.02rem;
  line-height: 1.55;
  color: #57534e;
}

.ex-vibe-inline {
  font-size: 0.78em;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.ex-vibe {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.12rem 0.4rem;
  vertical-align: middle;
  font-family: var(--font-sans);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.3;
  color: var(--accent-dark);
  background: rgba(26, 77, 109, 0.1);
  border: 1px solid rgba(26, 77, 109, 0.22);
  border-radius: 4px;
}

.ex-item--soon .ex-vibe {
  opacity: 0.9;
}

.ex-intro {
  margin: 0;
  max-width: 38rem;
}

.ex-intro p {
  margin: 0 0 0.9rem;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--muted);
}

.ex-intro p:first-child {
  font-size: 1.05rem;
  color: var(--ink);
}

.ex-intro p:last-child {
  margin-bottom: 0;
}

.ex-highlight {
  margin: 1.15rem 0 0;
  padding: 0.95rem 1.05rem;
  background: linear-gradient(165deg, rgba(26, 77, 109, 0.08) 0%, rgba(255, 252, 247, 0.95) 100%);
  border: 1px solid rgba(26, 77, 109, 0.22);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
}

.ex-highlight p {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.02rem;
  line-height: 1.5;
  color: var(--accent-dark);
}

.ex-cta {
  margin: 1.75rem 0 0;
}

.ex-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-min);
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  background: linear-gradient(165deg, #2a6f96 0%, var(--accent) 50%, var(--accent-dark) 100%);
  box-shadow: 0 3px 12px rgba(18, 53, 73, 0.2);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}

@media (hover: hover) {
  .ex-cta-btn:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
  }
}

.ex-cta-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ex-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.ex-list__sub {
  margin-left: 1.35rem;
}

.ex-item {
  display: grid;
  grid-template-columns: 3.1rem 1fr auto;
  align-items: center;
  gap: 0.85rem;
  min-height: 3.5rem;
  padding: 0.85rem 1rem;
  text-decoration: none;
  color: inherit;
  background: var(--paper);
  border: 1px solid rgba(214, 208, 196, 0.9);
  border-radius: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

a.ex-item--ready:hover {
  border-color: rgba(26, 77, 109, 0.35);
  box-shadow: 0 6px 18px rgba(18, 53, 73, 0.1);
  transform: translateY(-1px);
}

a.ex-item--ready:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ex-item--soon {
  opacity: 0.62;
  cursor: default;
}

.ex-num {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.ex-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.ex-title {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--accent-dark);
}

.ex-desc {
  display: block;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #57534e;
}

.ex-action {
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--accent);
}

.ex-item--soon .ex-action {
  color: var(--muted);
  font-weight: 600;
}

.ex-footer {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 calc(1.25rem + var(--safe-right)) calc(1.5rem + var(--safe-bottom)) calc(1.25rem + var(--safe-left));
  font-size: 0.78rem;
  color: var(--muted);
}

.ex-footer p {
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(214, 208, 196, 0.85);
}

@media (max-width: 480px) {
  .ex-list__sub {
    margin-left: 0.9rem;
  }

  .ex-item {
    grid-template-columns: 2.6rem 1fr;
    grid-template-rows: auto auto;
  }

  .ex-action {
    grid-column: 2;
  }
}

/* Popup før åpning av eksempel */
.ex-dialog {
  width: min(28rem, calc(100vw - 2rem));
  margin: auto;
  padding: 0;
  border: 1px solid rgba(26, 77, 109, 0.22);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 18px 48px rgba(18, 53, 73, 0.22);
}

.ex-dialog::backdrop {
  background: rgba(18, 53, 73, 0.45);
}

.ex-dialog__panel {
  margin: 0;
  padding: 1.4rem 1.35rem 1.25rem;
}

.ex-dialog__title {
  margin: 0 0 0.75rem;
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--accent-dark);
}

.ex-dialog__lead {
  margin: 0 0 0.85rem;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--accent-dark);
}

.ex-dialog__text {
  margin: 0 0 1.35rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
}

.ex-dialog__text cite {
  font-style: italic;
  color: var(--ink);
}

.ex-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

.ex-dialog__btn {
  min-height: var(--touch-min);
  padding: 0.55rem 1rem;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ex-dialog__btn--secondary {
  border: 1px solid rgba(26, 77, 109, 0.28);
  background: transparent;
  color: var(--accent);
}

.ex-dialog__btn--secondary:hover {
  border-color: var(--accent);
  background: rgba(26, 77, 109, 0.06);
}

.ex-dialog__btn--primary {
  border: 1px solid transparent;
  background: linear-gradient(165deg, #2a6f96 0%, var(--accent) 50%, var(--accent-dark) 100%);
  color: #fff;
}

.ex-dialog__btn--primary:hover {
  background: var(--accent-dark);
}

.ex-dialog__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .ex-dialog__actions {
    flex-direction: column-reverse;
  }

  .ex-dialog__btn {
    width: 100%;
  }
}

/* Fullskjerm-visning fra liste.html (ikke samme som .ex-embed i eksempel-sider) */
body.ex-viewer-open {
  overflow: hidden;
}

.ex-viewer {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  flex-direction: column;
  background: #0f1c24;
}

.ex-viewer__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
  padding: 0.65rem 1rem;
  padding-top: max(0.65rem, env(safe-area-inset-top, 0px));
  background: #123549;
  color: #fff;
}

.ex-viewer__title {
  margin: 0;
  min-width: 0;
  font-family: var(--font-sans, "Source Sans 3", system-ui, sans-serif);
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ex-viewer__close {
  flex-shrink: 0;
  min-height: 40px;
  padding: 0.45rem 1rem;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #123549;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.ex-viewer__close:hover {
  background: #e8eef2;
}

.ex-viewer__close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.ex-viewer__frame {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  border: 0;
  background: #f5f7fa;
}
