/* Standalone, minimal CSS for blogg/ */
:root {
  --blog-bg: #ffffff;
  --blog-surface: #ffffff;
  --blog-text: #111213;
  --blog-muted: #6b7280;
  --blog-border: #e5e7eb;
  --blog-primary: #0f766e;
  --blog-link: #0ea5e9;
}

body.blog-body[data-theme="dark"] {
  --blog-bg: #0b0c0e;
  --blog-surface: #0f1115;
  --blog-text: #e5e7eb;
  --blog-muted: #9ca3af;
  --blog-border: #1f2937;
  --blog-primary: #10b981;
  --blog-link: #38bdf8;
}

.blog {
  background: var(--blog-bg);
  color: var(--blog-text);
}

/* Ensure global navbar stays on top and is clickable on blog page */
.navbar-desktop, .navbar-touch { z-index: 10000; }

.blog__header {
  padding: 16px 0 8px;
  border-bottom: 1px solid var(--blog-border);
}
.blog__header h1 { margin: 4px 0 6px; font-size: clamp(28px, 3.2vw, 40px); line-height: 1.2; letter-spacing: 0.015em; font-weight: 600; }
.blog__header p { margin: 0; color: var(--blog-muted); font-size: clamp(14px, 1.4vw, 18px); line-height: 1.6; max-width: 980px; }

.blog__container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

.blog__actions { display: flex; gap: 8px; margin-top: 12px; }
.theme-switch { display: inline-flex; border: 1px solid var(--blog-border); border-radius: 999px; overflow: hidden; }
.theme-toggle { appearance: none; background: transparent; border: 0; padding: 6px 12px; font-weight: 600; cursor: pointer; color: var(--blog-text); line-height: 1; }
.theme-toggle:hover { background: rgba(2, 132, 199, 0.08); }
.theme-toggle.is-active { background: var(--blog-text); color: var(--blog-bg); }

.blog__layout {
  max-width: 1120px;
  margin: 8px auto 32px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

/* Ensure left content and right TOC start at same vertical height
   and sit slightly below the header divider */
.blog__layout { padding-top: 16px; }
.blog__content { margin-top: 0; padding-top: 0; padding-bottom: 0; }
.blog__sidebar { margin-top: 0; }

@media (min-width: 1024px) {
  .blog__layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
  }
}

.blog__content { min-width: 0; }
.blog__empty { color: var(--blog-muted); }

.post {
  border-bottom: 1px solid var(--blog-border);
  padding-bottom: 20px;
  margin-bottom: 24px;
  margin-top: 0;
}

.post--featured { margin-top: 0; }

.post__link { color: inherit; text-decoration: none; display: block; }
.post__image { position: relative; border-radius: 8px; overflow: hidden; background: var(--blog-surface); }
.post__image img { width: 100%; height: 360px; display: block; object-fit: cover; object-position: center center; }
.post__category {
  position: absolute; left: 12px; bottom: 12px;
  background: var(--blog-primary); color: #fff; font-size: 12px;
  padding: 6px 10px; border-radius: 999px;
}
.post__content { padding: 12px 4px 0; }
.post__date { display: block; color: var(--blog-muted); font-size: 12px; margin-bottom: 6px; }
.post__title { font-size: 22px; line-height: 1.3; margin: 0 0 8px; }
.post__excerpt { color: var(--blog-muted); margin: 0 0 10px; }
.post__readmore { color: var(--blog-link); font-weight: 600; }

.blog__pagination { display: flex; justify-content: center; padding: 8px 0 0; color: var(--blog-muted); }

.blog__sidebar { position: sticky; top: 208px; height: max-content; z-index: 1; }
.toc { border: 1px solid var(--blog-border); border-radius: 8px; padding: 12px; background: var(--blog-surface); }
.toc h3 { margin: 0 0 8px; font-size: 16px; }
.toc__list { list-style: none; padding: 0; margin: 0; }
.toc__link { display: flex; justify-content: space-between; gap: 8px; padding: 10px 8px; border-radius: 6px; color: var(--blog-text); text-decoration: none; }
.toc__link:hover { background: rgba(2, 132, 199, 0.08); }
.toc__link.is-active { background: rgba(2, 132, 199, 0.12); font-weight: 600; }
.toc__count { color: var(--blog-muted); }

/* Equal heights: make the sidebar fill the featured image height on first row */
@media (min-width: 1024px) {
  .post--featured .post__image img { height: 380px; }
  .blog__sidebar { margin-top: 0; }
  .blog__sidebar .toc { height: 380px; overflow: auto; }
}

/* Mobile improvements */
@media (max-width: 1023px) {
  .blog { padding-top: 112px; position: relative; z-index: 0; }
  .blog__sidebar { position: static; top: auto; }
  .toc { margin-top: -8px; }
  .post__image img { height: 280px; }
}

/* Reduce motion and improve perf */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}


