/* ============================================================
   Legekontor-portal – delt stilark
   Rolig, klinisk-redaksjonelt uttrykk.
   Endre fargene under (:root) for å justere hele nettsiden.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  --paper:      #f5f2ea;
  --paper-2:    #fffdf8;
  --ink:        #1f2b29;
  --muted:      #6c7a74;
  --primary:    #2c6e63;
  --primary-deep:#1d4d45;
  --primary-soft:#e4efe9;
  --accent:     #bd6238;
  --line:       #e3ddd0;
  --shadow:     0 1px 2px rgba(31,43,41,.05), 0 8px 24px -12px rgba(31,43,41,.18);
  --radius:     14px;
  --sidebar-w:  264px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(120% 90% at 100% 0%, rgba(44,110,99,.06), transparent 60%),
    radial-gradient(100% 80% at 0% 100%, rgba(189,98,56,.05), transparent 55%);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }

.content {
  flex: 1;
  min-width: 0;
  padding: 56px clamp(20px, 5vw, 72px) 80px;
  max-width: 1100px;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--paper-2);
  border-right: 1px solid var(--line);
  padding: 28px 18px 32px;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 22px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(150deg, var(--primary), var(--primary-deep));
  display: grid; place-items: center;
  color: #fff; font-family: 'Fraunces', serif; font-weight: 600; font-size: 19px;
  box-shadow: var(--shadow);
}
.brand-name { font-family: 'Fraunces', serif; font-weight: 600; font-size: 16px; line-height: 1.2; }
.brand-sub  { font-size: 11.5px; color: var(--muted); letter-spacing: .03em; text-transform: uppercase; }

.nav { list-style: none; margin: 0; padding: 0; }
.nav-group > .nav-link { font-weight: 600; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px;
  color: var(--ink); font-size: 14.5px;
  text-decoration: none; transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--primary-soft); text-decoration: none; }
.nav-link.active { background: var(--primary); color: #fff; }
.nav-link.active .nav-ico { opacity: 1; }
.nav-ico { width: 17px; height: 17px; flex-shrink: 0; opacity: .7; }

.nav-children { list-style: none; margin: 2px 0 8px; padding: 0 0 0 14px; }
.nav-children .nav-link { font-size: 13.8px; font-weight: 400; padding: 7px 12px; color: var(--muted); }
.nav-children .nav-link:hover { color: var(--ink); }
.nav-children .nav-link.active { color: #fff; }
.nav-children { border-left: 1px solid var(--line); margin-left: 22px; }

.sidebar-foot {
  margin-top: 26px; padding: 14px 12px 0; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}

/* mobil-knapp (skjult på desktop) */
.nav-toggle {
  display: none;
  position: fixed; top: 14px; left: 14px; z-index: 50;
  width: 44px; height: 44px; border-radius: 11px;
  background: var(--paper-2); border: 1px solid var(--line);
  box-shadow: var(--shadow); cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ''; display: block; width: 20px; height: 2px; background: var(--ink);
  position: relative; transition: .2s;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after  { position: absolute; top: 6px; }

/* ---------- Innholds-typografi ---------- */
.eyebrow {
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--primary); font-weight: 600; margin: 0 0 10px;
}
h1.page-title {
  font-family: 'Fraunces', serif; font-weight: 600;
  font-size: clamp(30px, 4.5vw, 44px); line-height: 1.08;
  margin: 0 0 14px; letter-spacing: -.01em;
}
.lead { font-size: 17px; color: var(--muted); max-width: 60ch; margin: 0 0 40px; }

h2.section { font-family: 'Fraunces', serif; font-weight: 600; font-size: 23px; margin: 44px 0 16px; }

.content p { max-width: 68ch; }

/* ---------- Kort-rutenett (forside + seksjonssider) ---------- */
.card-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.card {
  display: block; background: var(--paper-2);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 22px 20px; box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
  color: var(--ink); text-decoration: none;
}
.card:hover {
  transform: translateY(-3px); text-decoration: none;
  border-color: var(--primary); box-shadow: 0 1px 2px rgba(31,43,41,.05), 0 18px 38px -16px rgba(31,43,41,.28);
}
.card-ico {
  width: 40px; height: 40px; border-radius: 10px; margin-bottom: 16px;
  background: var(--primary-soft); color: var(--primary-deep);
  display: grid; place-items: center;
}
.card-ico svg { width: 22px; height: 22px; }
.card h3 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 19px; margin: 0 0 6px; }
.card p { font-size: 14px; color: var(--muted); margin: 0; max-width: none; }
.card .card-more { margin-top: 14px; font-size: 13px; font-weight: 600; color: var(--primary); }
.card:hover .card-more { color: var(--primary-deep); }

/* ---------- Boks / placeholder ---------- */
.panel {
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 28px; box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.placeholder {
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 30px; color: var(--muted); background: rgba(255,253,248,.6);
}
.placeholder strong { color: var(--ink); }

/* ---------- Tabell (f.eks. telefonliste) ---------- */
table.liste { width: 100%; border-collapse: collapse; font-size: 14.5px; background: var(--paper-2);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.liste th, table.liste td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); }
table.liste th { background: var(--primary-soft); font-weight: 600; color: var(--primary-deep); }
table.liste tr:last-child td { border-bottom: none; }

/* ---------- Knapp ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--primary); color: #fff; border: none;
  padding: 11px 18px; border-radius: 10px; font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: background .15s;
}
.btn:hover { background: var(--primary-deep); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--primary-deep); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--primary-soft); }

/* ---------- Innebygd planlegger (iframe) ---------- */
.embed-frame {
  width: 100%; height: calc(100vh - 220px); min-height: 540px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; box-shadow: var(--shadow);
}

/* ---------- Innlastings-animasjon ---------- */
.reveal { opacity: 0; transform: translateY(10px); animation: rise .5s ease forwards; }
.reveal:nth-child(2) { animation-delay: .05s; }
.reveal:nth-child(3) { animation-delay: .10s; }
.reveal:nth-child(4) { animation-delay: .15s; }
.reveal:nth-child(5) { animation-delay: .20s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- Responsiv ---------- */
@media (max-width: 820px) {
  .nav-toggle { display: flex; }
  .sidebar {
    position: fixed; top: 0; left: 0; z-index: 40;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 0 0 50px rgba(0,0,0,.18);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .content { padding-top: 74px; }
}

/* ---------- Utskrift ---------- */
@media print {
  .sidebar, .nav-toggle { display: none !important; }
  body { background: #fff; }
  .content { max-width: none; padding: 0; }
  .card, .panel, table.liste { box-shadow: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
