/* Farger */
:root {
  --profile: #550029;
  --bg: #FDF2F2;
  --card: #ffffff;
  --text: #2d2d2d;
  --muted: #5a5b5e;
  --border: #e5e7eb;
}

* { box-sizing: border-box; }

/* --- Profilfonter fra www.nb.no --- */
@font-face {
  font-family: ClearfaceStd;
  font-style: normal;
  font-weight: 400;
  font-display: swap; /* fallback */
  src: url('https://www.nb.no/content/themes/theme-block-base/assets/fonts/ClearfaceStd-Regular.woff2')
       format('woff2');
}

@font-face {
  font-family: Gerhard;
  font-style: normal;
  font-weight: 500; /* Medium */
  font-display: swap;
  src: url('https://www.nb.no/content/themes/theme-block-base/assets/fonts/STKGerhard-Medium.woff2')
       format('woff2');
}

@font-face {
  font-family: "Bureau Sans";
  font-style: normal;
  font-weight: 300 700;
  font-display: fallback;
  src: url('https://www.nb.no/content/themes/theme-block-base/assets/fonts/STKBureauSansVariableComplete.woff2')
       format('woff2');
}


/* Sideinnhold */
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  text-align: center;
}

.logo {
  position: absolute;
  top: 20px;
  left: 20px;
  max-width: 200px;
  height: auto;
}

.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 20px 20px;
}

/* LENKER */
/* ubesøkt */
a:link {
  color: var(--profile);
}

/* besøkt */
a:visited {
  color: #40263e;
}

/* musepeker */
a:hover {
  color: rgb(223, 27, 125);
}

header {
  text-align: center;
  margin: 20px 0 20px;
}

h1 {
  font-family: ClearfaceStd, serif; /* fallback */
  font-size: 3.0rem;
  font-weight: 400;                 /* ClearfaceStd-Regular */
  margin: 0 0 10px;
  color: var(--profile);
}

h2 {
  font-family: ClearfaceStd, serif; /* fallback */
  font-size: 2.0rem;
  font-weight: 500;                 /* ClearfaceStd-Bold */
  margin: 15px 0 15px;
  color: var(--profile);
}

h3 {
  font-family: "Bureau Sans", sans-serif; /* fallback */
  font-size: 1.4rem;
  font-weight: 500;                 /* STK Bureau Sans Regular */
  margin: 0 0 50px 50px;
  color: var(--profile);
}

p {
  font-family: "Bureau Sans", sans-serif; /* fallback */
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 0.5rem;
}


.sr-only {
  position: absolute !important;
  left: -9999px !important;
}

/* Søkefelt */
.search-form {
  display: flex;
  align-items: center;
  width: min(600px, 90vw);
  background: #fff;
  border-radius: 9999px;
  border: 1px solid #ccc;
  overflow: hidden;
  margin: 1rem auto;
}

.search-form input[type="search"] {
  flex: 1;
  border: none;
  padding: 0.75rem 1.5rem;
  font-family: monospace;
  font-size: 0.9rem;
  outline: none;
}

.search-form button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border: none;
  background: #40263E;
  cursor: pointer;
}

.search-form button svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: #fff;
}

.search-form button:hover {
  background: var(--profile);
}


/* Hjelpetekst for forklaring av vanskelige ord */

.explain {
  position: relative;
  border-bottom: 1px dotted var(--muted);
  cursor: help;
  text-decoration: none;
}

/* Boble for forklarende tekst */
.explain::after {
  content: attr(data-explain);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px); /* visning over elementet */
  transform: translateX(-50%);
  background: #f6f6f6;
  color: #111111;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 1rem;
  line-height: 1.2;
  white-space: nowrap;
  max-width: min(80ch, 120vw);
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
  transition: opacity .15s ease-in-out;
}

/* Liten peker */
.explain::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #550029;
  opacity: 0;
  transition: opacity .15s ease-in-out;
}

/* Vis ved musepeker og tastaturfokus */
.explain:hover::after,
.explain:hover::before,
.explain:focus-visible::after,
.explain:focus-visible::before {
  opacity: 1;
}

/* Plasser verktøytips under med data-attributt */
.explain[data-placement="bottom"]::after {
  top: calc(100% + 8px);
  bottom: auto;
}

.explain[data-placement="bottom"]::before {
  top: 100%;
  bottom: auto;
  border: 6px solid transparent;
  border-bottom-color: #333;
}

/* Respekter preferanser for redusert beveglighet */
@media (prefers-reduced-motion: reduce) {
  .explain::after,
  .explain::before {
    transition: none;
  }
}


/* Kort */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--card-radius, 18px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
  transition: box-shadow .15s ease, border-color .15s ease, transform .1s ease;
  font-family: var(--font-meta);
}

.card:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  border-color: #d1d5db;
  transform: translateY(-1px);
}

.card h3 {
  font-size: 1.25rem;
  margin: 0;
  color: var(--profile);
}

.card:focus-visible {
  outline: 3px solid var(--profile);
  outline-offset: 3px;
}

.card_media {
  aspect-ratio: var(--media-ratio, 16/9);
  width: 100%;
  background: #eee;
}

.card_media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card_body {
  padding: 18px;
}
