:root {
  color-scheme: dark;
  --bg: #060816;
  --bg-soft: #10152b;
  --surface: rgba(17, 24, 39, 0.94);
  --surface-strong: rgba(12, 17, 32, 0.98);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f7f7fb;
  --text-muted: #9da5bc;
  --accent: #6c4bff;
  --accent-2: #7b61ff;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, rgba(108,75,255,0.35), transparent 28%), linear-gradient(135deg, var(--bg), var(--bg-soft));
  min-height: 100vh;
  min-width: 320px;
  overflow-x: hidden;
}

a { color: inherit; }

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px 1fr;
  position: relative;
}

.sidebar-backdrop {
  display: none;
}

.sidebar {
  background: var(--surface-strong);
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  overflow-y: auto;
  overflow-x: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.brand-badge {
  width: 136px;
  height: 136px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  padding: 8px;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.brand-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 12px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  padding: 9px 11px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.search-box input {
  border: 0;
  outline: none;
  flex: 1;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.search-summary {
  color: var(--text-muted);
  font-size: 12px;
  margin: 0 0 10px;
}

.sidebar-section {
  margin-bottom: 10px;
}

.sidebar-section h3 {
  margin: 0 0 6px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sidebar-link {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
  margin-bottom: 4px;
  cursor: pointer;
  display: grid;
  gap: 2px;
}

.sidebar-link:hover, .sidebar-link.active {
  background: rgba(108, 75, 255, 0.18);
  color: #fff;
}

.sidebar-link strong {
  font-size: 14px;
  line-height: 1.3;
}

.sidebar-link span {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.main {
  padding: 20px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.mobile-menu-toggle {
  display: none;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 0;
}

.mobile-menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

.topbar-copy {
  flex: 1;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
  overflow-wrap: anywhere;
}

.article-card h2 {
  margin-top: 0;
  font-size: 24px;
}

.article-card p, .article-card li {
  line-height: 1.7;
  color: #e6e9f2;
  font-size: 15px;
}

.article-card ul { padding-left: 18px; }

.empty-state {
  color: var(--text-muted);
  margin: 0;
  padding: 10px 0;
  font-size: 13px;
}

@media (max-width: 920px) {
  html { font-size: 15px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 18, 0.72);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
    z-index: 40;
  }
  body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(86vw, 320px);
    z-index: 50;
    border-right: 1px solid var(--border);
    border-bottom: 0;
    padding: 14px;
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .mobile-menu-toggle { display: inline-flex; }
  .main { padding: 14px; }
  .article-card { padding: 16px; }
  .topbar h1 { font-size: 20px; }
}

@media (max-width: 560px) {
  html { font-size: 14px; }
  .brand {
    align-items: flex-start;
    flex-direction: column;
  }
  .search-box { border-radius: 14px; }
  .sidebar-link strong { font-size: 13px; }
  .sidebar-link span { font-size: 11px; }
  .topbar { flex-direction: row; align-items: center; }
  .article-card h2 { font-size: 20px; }
  .article-card p, .article-card li { font-size: 14px; }
}

/* --- Bild- & Bildtext-styling --- */
.article-image-container, .article-figure {
  display: block;
  margin: 28px auto;
  max-width: 650px; /* Begränsar bredden på desktop */
  width: 100%;       /* Gör bilden helt responsiv på mobil */
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
  overflow: hidden;
  clear: both;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.article-figure {
  padding-bottom: 12px;
}

.article-image-container img, .article-figure img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 380px; 
  object-fit: cover; 
  border-radius: 10px;
  cursor: zoom-in;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease;
}

.article-image-container img:hover, .article-figure img:hover {
  transform: scale(1.01);
  box-shadow: 0 4px 20px rgba(108, 75, 255, 0.2); 
}

.article-figure figcaption {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 10px;
  font-style: italic;
  padding: 0 8px;
  line-height: 1.4;
}

@media (max-width: 680px) {
  .article-image-container, .article-figure {
    margin: 20px auto;
    width: 100%;
  }
}