/* ============================================================
   KOMPASSET — stil
   Bygger på variabler fra style.css (blå/hvit-palett)
   ============================================================ */

/* Override app-shell constraints from style.css so body scrolls naturally */
html, body { height: auto; min-height: 100%; }
.app { height: auto; overflow: visible; }

.kompass-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

/* ── HERO ── */
.kg-hero {
  text-align: center;
  padding: 1.5rem 1rem 1rem;
  margin-bottom: 1.75rem;
}
.kg-hero-ikon {
  font-size: 2.4rem;
  margin-bottom: .5rem;
  line-height: 1;
}
.kg-hero h1 {
  font-family: Georgia, serif;
  font-size: clamp(1.75rem, 3.5vw, 2.4rem);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.02em;
  margin-bottom: .4rem;
}
.kg-hero > p {
  font-size: clamp(14px, 1.6vw, 16px);
  color: var(--ink2);
  max-width: 560px;
  margin: 0 auto 1.5rem;
  line-height: 1.55;
}

/* ── SØK ── */
.kg-search-wrap {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
}
.kg-search-ic {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--ink3);
  pointer-events: none;
}
#kg-search {
  width: 100%;
  padding: 11px 14px 11px 38px;
  border: 1.5px solid var(--line2);
  border-radius: 24px;
  background: var(--surface);
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  box-shadow: 0 2px 10px rgba(20,40,80,.05);
  transition: border-color .15s, box-shadow .15s;
}
#kg-search:focus {
  outline: none;
  border-color: var(--blue-hi);
  box-shadow: var(--focus);
}
#kg-search::placeholder { color: var(--ink3); }

/* ── FEATURED BANNER ── */
.kg-featured {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, var(--blue-bg) 0%, #d4e2f5 100%);
  border: 1px solid var(--blue-lo);
  border-radius: 16px;
  padding: 1.1rem 1.3rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 12px rgba(31,70,128,.06);
}
.kg-featured-ic {
  width: 54px; height: 54px;
  background: var(--blue);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(31,70,128,.25);
}
.kg-featured-body { flex: 1; min-width: 0; }
.kg-featured-lbl {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--blue-hi);
  margin-bottom: 2px;
}
.kg-featured-title {
  font-family: Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--blue);
  line-height: 1.3;
}
.kg-featured-desc {
  font-size: 13px;
  color: var(--ink2);
  margin-top: 2px;
  line-height: 1.5;
}

/* ── KATEGORI-GRID ── */
.kg-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink3);
  margin: 0 0 .75rem;
  padding-left: .25rem;
}
.kg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.kg-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.25rem 1.1rem 1.1rem;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: all .16s ease;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  position: relative;
}
.kg-card:hover {
  border-color: var(--blue-hi);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(31,70,128,.1);
}
.kg-card:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-color: var(--blue-hi);
}
.kg-ic {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--blue-bg);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: .5rem;
}
.kg-title {
  font-family: Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.01em;
}
.kg-desc {
  font-size: 12px;
  color: var(--ink2);
  line-height: 1.5;
  flex: 1;
}
.kg-count {
  font-size: 11px;
  color: var(--ink3);
  margin-top: .6rem;
  padding-top: .55rem;
  border-top: 1px dashed var(--line);
  font-weight: 500;
}

/* Varier ikon-farge diskret per kategori (ordning i data.js) */
.kg-card[data-kat="kom-i-gang"] .kg-ic { background: var(--blue-bg);  color: var(--blue); }
.kg-card[data-kat="prompt-tips"] .kg-ic { background: #e4ecf8;          color: #2a5a9a; }
.kg-card[data-kat="pedagogikk"]  .kg-ic { background: var(--green-bg); color: var(--green); }
.kg-card[data-kat="teknisk"]     .kg-ic { background: #e4eef4;         color: #1a5070; }
.kg-card[data-kat="personvern"]  .kg-ic { background: var(--red-bg);   color: var(--red); }
.kg-card[data-kat="ordliste"]    .kg-ic { background: #e8ecf6;         color: #3a4870; }
.kg-card[data-kat="video"]       .kg-ic { background: #e0ecf8;         color: #1f4680; }
.kg-card[data-kat="faq"]         .kg-ic { background: var(--amber-bg); color: var(--amber); }

/* ── KATEGORI-SIDE ── */
.kg-breadcrumb {
  font-size: 12px;
  color: var(--ink3);
  margin-bottom: 1rem;
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  align-items: center;
}
.kg-breadcrumb a {
  color: var(--blue);
  text-decoration: none;
  cursor: pointer;
  font-weight: 500;
}
.kg-breadcrumb a:hover { text-decoration: underline; }
.kg-breadcrumb span { color: var(--ink3); }

.kg-kat-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}
.kg-kat-ic {
  width: 64px; height: 64px;
  background: var(--blue-bg);
  color: var(--blue);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  flex-shrink: 0;
}
.kg-kat-head h1 {
  font-family: Georgia, serif;
  font-size: 1.6rem;
  color: var(--ink);
  letter-spacing: -.02em;
  margin-bottom: .2rem;
}
.kg-kat-head p {
  font-size: 14px;
  color: var(--ink2);
  line-height: 1.5;
}

.kg-tips-list {
  display: flex;
  flex-direction: column;
  gap: .625rem;
}
.kg-tips-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  width: 100%;
  transition: all .14s;
}
.kg-tips-row:hover {
  border-color: var(--blue-hi);
  background: var(--blue-bg);
  transform: translateX(2px);
}
.kg-tips-row:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-color: var(--blue-hi);
}
.kg-tips-ic {
  width: 38px; height: 38px;
  background: var(--s2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.kg-tips-row:hover .kg-tips-ic { background: var(--surface); }
.kg-tips-body { flex: 1; min-width: 0; }
.kg-tips-tittel {
  font-family: Georgia, serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 2px;
}
.kg-tips-ingress {
  font-size: 13px;
  color: var(--ink2);
  line-height: 1.5;
}
.kg-tips-meta {
  font-size: 11px;
  color: var(--ink3);
  margin-top: .4rem;
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.kg-tips-chev {
  color: var(--ink3);
  font-size: 20px;
  font-weight: 300;
  flex-shrink: 0;
}
.kg-tips-row:hover .kg-tips-chev { color: var(--blue); }

.kg-empty {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--ink3);
  font-size: 14px;
}

.kg-search-title {
  font-family: Georgia, serif;
  font-size: 1.3rem;
  color: var(--ink);
  letter-spacing: -.02em;
  margin-bottom: 1rem;
}

/* ── ARTIKKEL (tips-visning) ── */
.kg-article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(20,40,80,.05);
}
.art-head {
  padding: 2rem 2rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--blue-bg) 0%, var(--surface) 100%);
}
.art-kat {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--blue);
  margin-bottom: .5rem;
}
.art-head h1 {
  font-family: Georgia, serif;
  font-size: clamp(1.6rem, 3vw, 2rem);
  color: var(--ink);
  letter-spacing: -.02em;
  line-height: 1.2;
  margin-bottom: .6rem;
}
.art-lede {
  font-size: 17px;
  color: var(--ink2);
  line-height: 1.6;
  margin-bottom: 1rem;
  max-width: 640px;
}
.art-meta {
  font-size: 12px;
  color: var(--ink3);
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.art-body { padding: 1.5rem 2rem 2rem; max-width: 720px; }
.art-body > * + * { margin-top: 1rem; }

.art-p {
  font-size: 15px;
  color: var(--ink);
  line-height: 1.7;
}
.art-h2 {
  font-family: Georgia, serif;
  font-size: 1.2rem;
  color: var(--ink);
  letter-spacing: -.01em;
  margin-top: 1.75rem !important;
  margin-bottom: .25rem;
}
.art-h2 + * { margin-top: .5rem !important; }
.art-ul {
  padding-left: 1.4rem;
}
.art-ul li {
  font-size: 15px;
  color: var(--ink);
  line-height: 1.65;
  margin-bottom: .4rem;
}
.art-callout {
  background: var(--amber-bg);
  border-left: 4px solid var(--amber-hi);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  display: flex;
  gap: .75rem;
  align-items: flex-start;
}
.art-callout strong {
  color: var(--amber);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding-top: 2px;
  flex-shrink: 0;
}
.art-callout span {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.6;
  flex: 1;
}
.art-code {
  background: #0f1a2e;
  color: #d8e4f5;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.art-link {
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1.5px solid var(--blue-lo);
}
.art-link:hover { border-bottom-color: var(--blue); }
.art-video {
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}
.art-video iframe {
  width: 100%; height: 100%;
  border: 0;
}

.art-fig {
  margin: 1.25rem 0;
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.art-fig img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
  background: var(--s2);
}
.art-fig-svg {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--s2);
}
.art-fig-svg svg {
  max-width: 100%;
  max-height: 420px;
  height: auto;
}
.art-fig figcaption {
  padding: .65rem .9rem;
  font-size: 12px;
  color: var(--ink3);
  background: var(--surface);
  border-top: 1px solid var(--line);
  font-style: italic;
}

.art-foot {
  padding: 1.25rem 2rem 1.75rem;
  border-top: 1px solid var(--line);
  background: var(--s2);
}

/* ── ADMIN-KNAPP (flyter) ── */
.kg-admin-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 40;
  background: var(--surface);
  border: 1px solid var(--line2);
  color: var(--ink2);
  padding: 9px 14px;
  border-radius: 22px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(20,40,80,.12);
  display: flex;
  align-items: center;
  gap: .4rem;
  font-family: inherit;
  transition: all .15s;
}
.kg-admin-fab:hover {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  transform: translateY(-1px);
}

/* ── ADMIN-MODAL ── */
.kg-admin-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 25, 45, .55);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.kg-admin-modal.open { display: flex; }
.kg-admin-dialog {
  background: var(--surface);
  border-radius: 16px;
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.kg-admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--blue-bg);
}
.kg-admin-head h2 {
  font-family: Georgia, serif;
  font-size: 1.15rem;
  color: var(--blue);
  letter-spacing: -.01em;
}
.kg-admin-close {
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--ink3);
  cursor: pointer;
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-family: inherit;
}
.kg-admin-close:hover { background: var(--surface); color: var(--ink); }

.kg-admin-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}

/* PIN */
.kg-pin-view {
  max-width: 320px;
  margin: 2rem auto;
  text-align: center;
}
.kg-pin-view p {
  font-size: 14px;
  color: var(--ink2);
  margin-bottom: 1rem;
  line-height: 1.5;
}
.kg-pin-view input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--line2);
  border-radius: 10px;
  font-size: 16px;
  text-align: center;
  letter-spacing: .4em;
  font-family: inherit;
  margin-bottom: .75rem;
}
.kg-pin-view input:focus {
  outline: none;
  border-color: var(--blue-hi);
  box-shadow: var(--focus);
}
.kg-pin-err {
  color: var(--red);
  font-size: 12px;
  margin-bottom: .5rem;
  min-height: 16px;
}
.kg-pin-hint {
  font-size: 11px;
  color: var(--ink3);
  margin-top: .75rem;
}

/* ── ADMIN: liste ── */
.ka-toolbar {
  display: flex;
  gap: .5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--line);
}
.ka-list {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.ka-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem .875rem;
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.ka-row-ic {
  width: 32px; height: 32px;
  background: var(--surface);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.ka-row-body { flex: 1; min-width: 0; }
.ka-row-tittel {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}
.ka-row-meta {
  font-size: 11px;
  color: var(--ink3);
}
.ka-row-actions {
  display: flex;
  gap: .3rem;
  flex-shrink: 0;
}

/* ── ADMIN: redigering ── */
.ka-edit { display: flex; flex-direction: column; gap: 1rem; }
.ka-field { display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.ka-field label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink3);
}
.ka-field input, .ka-field textarea, .ka-field select {
  width: 100%;
  padding: 8px 11px;
  border: 1.5px solid var(--line2);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  resize: vertical;
}
.ka-field input:focus, .ka-field textarea:focus, .ka-field select:focus {
  outline: none;
  border-color: var(--blue-hi);
  box-shadow: var(--focus);
}
.ka-field-row { display: flex; gap: .75rem; flex-wrap: wrap; }
.ka-field-row .ka-field { min-width: 120px; }

/* Blokker */
#ka-blokker {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-top: .25rem;
}
.ka-blokk {
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.ka-blokk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem .75rem;
  background: var(--s3);
  border-bottom: 1px solid var(--line);
}
.ka-blokk-type {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--ink2);
}
.ka-blokk-actions { display: flex; gap: .25rem; }
.ka-blokk-body { padding: .6rem .75rem; }
.ka-blokk-body textarea, .ka-blokk-body input {
  width: 100%;
  padding: 7px 10px;
  border: 1.5px solid var(--line);
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  background: var(--surface);
}
.ka-blokk-body textarea:focus, .ka-blokk-body input:focus {
  outline: none;
  border-color: var(--blue-hi);
  box-shadow: var(--focus);
}

.ka-add-blokk {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px dashed var(--line);
}
.ka-add-blokk > span {
  font-size: 11px;
  color: var(--ink3);
  font-weight: 600;
  margin-right: .25rem;
}

/* Bilde-opplasting */
.ka-upload {
  display: flex;
  gap: .5rem;
  align-items: center;
  margin-bottom: .5rem;
  flex-wrap: wrap;
}
.ka-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: 6px 12px;
  background: var(--blue);
  color: #fff;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.ka-upload-btn:hover { background: var(--blue-hi); }
.ka-upload-hint {
  font-size: 11px;
  color: var(--ink3);
}
.ka-img-prev {
  margin-top: .5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .4rem;
  text-align: center;
}
.ka-img-prev img {
  max-width: 100%;
  max-height: 180px;
  height: auto;
  border-radius: 4px;
}
.ka-img-prev svg {
  max-width: 100%;
  max-height: 180px;
  height: auto;
}

.ka-save-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  position: sticky;
  bottom: 0;
  background: var(--surface);
  padding-bottom: .25rem;
}
.ka-save-msg {
  font-size: 12px;
  color: var(--ink3);
  font-weight: 600;
}
.ka-save-msg.ok { color: var(--green); }

/* ── Mobil ── */
@media (max-width: 600px) {
  .kompass-wrap { padding: 1rem .75rem 3rem; }
  .kg-grid { grid-template-columns: 1fr 1fr; gap: .75rem; }
  .kg-card { padding: 1rem .9rem; }
  .kg-ic { width: 38px; height: 38px; font-size: 18px; }
  .kg-title { font-size: 14px; }
  .kg-featured { flex-direction: column; align-items: flex-start; text-align: left; }
  .kg-featured .btn { align-self: stretch; text-align: center; }
  .kg-kat-head { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .art-head, .art-body, .art-foot { padding-left: 1.25rem; padding-right: 1.25rem; }
}
