:root {
  /* LoclareMeds – myk helsestil */
  --border: rgba(17,17,17,0.18);
  --border-strong: rgba(17,17,17,0.28);

  --muted: #5f6b7a;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel2: #f2f6fb;

  --accent: #18a9c8;
  --accent-soft: rgba(24,169,200,0.16);

  --shadow-soft: 0 8px 20px rgba(17,17,17,0.08);
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: radial-gradient(1200px 600px at 50% 0%, #ffffff 0%, var(--bg) 55%);
  color: #111;
}

/* ========= Header ========= */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border-strong);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 18px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.menu-btn {
  border: 1px solid var(--border-strong);
  background: #fff;
  padding: 9px 12px;
  font-weight: 800;
  cursor: pointer;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(17,17,17,0.06);
}

.menu-btn:hover { background: var(--panel2); }
.menu-btn:active { transform: translateY(1px); }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  height: 46px;
  width: auto;
  display: block;
}

@media (max-width: 900px) {
  .brand-logo { height: 40px; }
}

.brand-title {
  font-weight: 900;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ========= Om LoclareMeds-lenke i header ========= */
#aboutLink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;

  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(17,17,17,0.05);

  font-weight: 900;
  font-size: 14px;
  color: #0f6f83;

  white-space: nowrap;
}

#aboutLink:hover { background: var(--panel2); }
#aboutLink:active { transform: translateY(1px); }

/* (medisin.html bruker class="toplink" i stedet for #aboutLink) */
.toplink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;

  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(17,17,17,0.05);

  font-weight: 900;
  font-size: 14px;
  color: #0f6f83;

  white-space: nowrap;
}

.toplink:hover { background: var(--panel2); }
.toplink:active { transform: translateY(1px); }

.lang-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(17,17,17,0.05);
}

.lang-icon {
  font-size: 16px;
  line-height: 1;
}

.select {
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
}

/* ========= NYTT: Meny-panel ========= */
/*
  HTML forventes å ha:
  <div id="menuPanel" class="menu-panel" hidden> ... </div>
  <div id="menuOverlay" class="menu-overlay" hidden></div>

  app.js styrer hidden/aria. Om du ikke har overlay i HTML enda,
  kan du legge det inn (jeg kan oppdatere HTML for deg etterpå).
*/

.menu-panel[hidden] { display: none; }
.menu-overlay[hidden] { display: none; }

/* Overlay bak menyen */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17,17,17,0.28);
  z-index: 60;
}

/* Selve panelen */
.menu-panel {
  position: fixed;
  top: 70px;           /* omtrent høyden på header */
  left: 18px;
  width: 320px;
  max-width: calc(100vw - 36px);

  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(17,17,17,0.18);
  z-index: 70;

  padding: 10px;
}

.menu-panel .menu-title {
  font-weight: 900;
  font-size: 14px;
  color: #0f6f83;
  margin: 6px 10px 10px;
}

.menu-panel a {
  display: flex;
  align-items: center;
  gap: 10px;

  text-decoration: none;
  padding: 10px 12px;
  border-radius: 12px;

  font-weight: 900;
  color: #111;
  border: 1px solid transparent;
}

.menu-panel a:hover {
  background: var(--panel2);
  border-color: var(--border);
}

.menu-panel a:active {
  transform: translateY(1px);
}

.menu-panel .menu-muted {
  color: var(--muted);
  font-size: 13px;
  margin: 8px 10px 6px;
  line-height: 1.35;
}

/* Mobil: meny nesten full bredde og litt lavere top */
@media (max-width: 520px) {
  .menu-panel {
    left: 12px;
    right: 12px;
    width: auto;
    top: 64px;
  }
}

/* ========= Page layout ========= */
.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 22px 18px 40px;
}

.card {
  border: 1px solid var(--border-strong);
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

/* ========= Hero (forside) ========= */
.hero {
  padding: 18px 18px 8px;
}

.hero h1 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: -0.2px;
}

.hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.hero-badge {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(24,169,200,0.10);
  border: 1px solid rgba(24,169,200,0.25);
  color: #0f6f83;
  font-weight: 800;
  font-size: 13px;
}

/* ========= Pill/badge-knapp (brukes for Tilbake) ========= */
.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;

  padding: 6px 10px;
  border-radius: 999px;

  background: rgba(24,169,200,0.10);
  border: 1px solid rgba(24,169,200,0.25);
  color: #0f6f83;

  font-weight: 900;
  font-size: 14px;

  box-shadow: 0 2px 10px rgba(17,17,17,0.05);
  white-space: nowrap;
}

.pill-btn:hover { background: rgba(24,169,200,0.14); }
.pill-btn:active { transform: translateY(1px); }

/* ========= Search ========= */
.search-area {
  margin-top: 14px;
  padding: 16px;
  position: relative;
}

.search-area::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  pointer-events: none;
  box-shadow: inset 0 0 0 2px rgba(24,169,200,0.18);
}

.label {
  display: block;
  font-weight: 900;
  margin-bottom: 10px;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.search-input {
  width: 100%;
  padding: 15px 14px;
  border: 1px solid var(--border-strong);
  font-size: 16px;
  outline: none;
  border-radius: 14px;
  background: #fff;
}

.search-input::placeholder { color: rgba(17,17,17,0.45); }

.search-input:focus {
  box-shadow: 0 0 0 5px rgba(24,169,200,0.22);
  border-color: rgba(24,169,200,0.55);
}

.btn {
  border: 1px solid var(--border-strong);
  background: #fff;
  padding: 10px 14px;
  font-weight: 900;
  cursor: pointer;
  border-radius: 14px;
}

.btn:hover { background: var(--panel2); }
.btn:active { transform: translateY(1px); }

.btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: rgba(24,169,200,0.55);
  box-shadow: 0 6px 16px rgba(24,169,200,0.20);
}

.btn.primary:hover { filter: brightness(0.97); }

.search-btn {
  min-height: 50px;
  padding: 0 18px;
}

.search-hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

/* Suggestions */
.suggestions-wrap { margin-top: 10px; }

.suggestions {
  display: grid;
  gap: 8px;
}

.suggestion {
  border: 1px solid var(--border-strong);
  padding: 10px 12px;
  cursor: pointer;
  background: #fff;
  border-radius: 14px;
}

.suggestion:hover {
  background: var(--panel2);
  box-shadow: 0 6px 20px rgba(17,17,17,0.10);
}

/* ========= Footer disclaimer (forside) ========= */
.disclaimer {
  margin-top: 14px;
  padding: 12px 14px;
  font-size: 14px;
  color: #445;
  background: #f9fbfd;
}

.disclaimer .disclaimer-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.disclaimer .warn {
  font-size: 16px;
  line-height: 1;
  margin-top: 2px;
}

/* Ny: bedre lesbarhet for lengre disclaimer */
.disclaimer #disclaimerText {
  line-height: 1.45;
}

/* Ny: gjør "ℹ️ Viktig!" litt tydeligere uten å bli alarm */
.disclaimer #disclaimerText strong {
  display: inline-block;
  margin-bottom: 6px;
}

/* Mobil: litt mindre tekst og mer luft */
@media (max-width: 520px) {
  .disclaimer {
    font-size: 13px;
    padding: 12px;
  }
}

/* ========= Bottom cards ========= */
.bottom-grid {
  display: grid;
  grid-template-columns: 1fr;   /* siden vi bare har én boks nå */
  gap: 16px;
  margin-top: 16px;
}

.bottom-single {
  max-width: 520px;
  margin: 0 auto;
}

.missing-title,
.missing-prio {
  text-align: center;
}

.box {
  padding: 16px;
}

.text-input {
  width: 100%;
  padding: 12px 12px;
  border: 1px solid var(--border-strong);
  font-size: 15px;
  outline: none;
  margin: 10px 0 10px;
  border-radius: 14px;
  background: #fff;
}

.text-input:focus {
  box-shadow: 0 0 0 5px rgba(24,169,200,0.22);
  border-color: rgba(24,169,200,0.55);
}

.small-muted {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
  line-height: 1.35;
}

/* ========= Medisin-side ========= */
.page-narrow {
  max-width: 900px;
}

/* Tilbake-lenke som pill */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;

  padding: 6px 10px;
  border-radius: 999px;

  background: rgba(24,169,200,0.10);
  border: 1px solid rgba(24,169,200,0.25);
  color: #0f6f83;

  font-weight: 900;
  font-size: 14px;

  box-shadow: 0 2px 10px rgba(17,17,17,0.05);
  margin: 12px 0 10px;

  white-space: nowrap;
}

.back-link:hover { background: rgba(24,169,200,0.14); }
.back-link:active { transform: translateY(1px); }

.medicine-header { padding: 16px; }

.medicine-title {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.3px;
}

.medicine-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.key-card {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(24,169,200,0.25);
  background: rgba(24,169,200,0.08);
}

.key-card strong { color: #0f6f83; }

.section {
  margin-top: 14px;
  padding: 16px;
}

.section h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.bullets {
  margin: 0;
  padding-left: 18px;
  line-height: 1.55;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

/* ========= NYTT: BIVIRKNINGER (accordion) ========= */
/* Matcher LoclareMeds-stilen: border, radius, panel2-hover, myk */
.accordion {
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(17,17,17,0.05);
  padding: 10px 12px;
}

/* Selve “knappen” i summary */
.accordion-title {
  cursor: pointer;
  font-weight: 900;
  color: #0f6f83;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Fjern default marker (Chrome/Safari) */
.accordion-title::-webkit-details-marker {
  display: none;
}

/* Hover-effekt som de andre knappene */
.accordion:hover {
  background: var(--panel2);
}

/* Litt luft når den er åpen */
.accordion[open] .accordion-title {
  margin-bottom: 10px;
}

/* Innholdet */
.accordion-body {
  padding-top: 2px;
}

/* Overskrifter inne i accordion */
.accordion-h3 {
  margin: 12px 0 6px;
  font-size: 15px;
  font-weight: 900;
  color: #111;
}

/* Intro-tekst (mild) */
.muted {
  color: var(--muted);
  line-height: 1.45;
  margin: 0 0 10px;
}

/* Tekst-basert bivirkningsinnhold (dagens JSON-format) */
#seText {
  white-space: pre-line;   /* bevar linjeskift */
  line-height: 1.55;
  color: #111;
  margin: 0;
}

/* Litt luft når seText vises */
.accordion-body #seText {
  margin-top: 8px;
}


/* ========= Del-knapp (medisin-side) ========= */
#shareBtn {
  width: auto;              /* ikke full bredde */
  min-width: 190px;         /* litt “trygg” bredde */
  max-width: 420px;
  min-height: 50px;         /* beholdt høyden */
  padding: 12px 18px;
  border-radius: 14px;      /* match .btn */
  margin: 0 auto;           /* midtstill */
  display: inline-flex;     /* ikon + tekst på linje */
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

/* Hint under del-knapp */
.share-hint {
  margin-top: 8px;
  font-size: 13px;
  text-align: center;
  color: var(--muted);
  line-height: 1.35;
}

.share-hint.ok {
  color: #0f6f83;
  font-weight: 700;
}

.share-hint.err {
  color: #7a2f2f;
  font-weight: 700;
}

/* ========= Footer-lenker ========= */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 18px 0;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;

  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(17,17,17,0.05);

  font-weight: 900;
  font-size: 14px;
  color: #0f6f83;
}

.footer-link:hover { background: var(--panel2); }
.footer-link:active { transform: translateY(1px); }

/* RTL */
html[dir="rtl"] body { text-align: right; }
html[dir="rtl"] .topbar-inner { flex-direction: row-reverse; }
html[dir="rtl"] .topbar-left { flex-direction: row-reverse; }
html[dir="rtl"] .lang-wrap { flex-direction: row-reverse; }
html[dir="rtl"] .search-row { direction: rtl; }

/* Ny: RTL – plasser disclaimer-innhold mer naturlig */
html[dir="rtl"] .disclaimer .disclaimer-row {
  flex-direction: row-reverse;
}

/* Responsive */
@media (max-width: 900px) {
  .bottom-grid { grid-template-columns: 1fr; }

  .brand-title { display: none; } /* mer plass på mobil */
  .hero h1 { font-size: 24px; }

  .search-row {
    grid-template-columns: 1fr;
  }

  .search-btn {
    width: 100%;
    min-height: 48px;
  }
}

@media (max-width: 420px) {
  #aboutLink { display: none; }

  .pill-btn,
  .back-link {
    font-size: 13px;
    padding: 6px 9px;
  }

  /* Del-knapp litt mindre på små skjermer */
  #shareBtn {
    min-width: 160px;
    padding: 12px 16px;
  }
}
/* ========= NYTT: Oppdateringer / Nyheter (forside) ========= */
.news {
  margin-top: 14px;           /* samme rytme som disclaimer */
  padding: 12px 14px;         /* matcher disclaimer */
  background: #ffffff;        /* samme som cards */
}

.news .news-body {
  margin-top: 8px;            /* erstatter inline margin-top */
}
.news-list { margin-top: 8px; }

.news-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.news-item:last-child { border-bottom: none; }

.news-text {
  font-weight: 700;
  color: #0f6f83;
  line-height: 1.35;
}

.news-date {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
