/* ============================================================
   studygrind – bloggen.
   Färger, typsnitt och variabler ärvs från styles-v2.css.
   Sidorna länkar ../styles-v2.css + blog.css. Ingen logik här.
   ============================================================ */

.blog-body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.65;
}

/* ---------- Topprad ---------- */

.blog-top {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 20px 0;
}

.blog-brand {
  display: inline-block;
  color: var(--ink);
  text-decoration: none;
}

.blog-logo {
  display: block;
  height: 32px;
  width: auto;
}

.blog-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 14px;
}

.blog-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}

.blog-nav a:hover {
  border-bottom-color: var(--line-strong);
}

.blog-nav a[aria-current="page"] {
  color: var(--accent-deep);
  border-bottom-color: var(--accent);
}

/* ---------- Gemensam spalt ---------- */

.blog-index,
.post {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.blog-kicker,
.post-kicker {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.blog-index h1,
.post h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(30px, 6vw, 42px);
  line-height: 1.15;
  margin: 8px 0 10px;
  text-wrap: balance;
}

.blog-lead,
.post-lead {
  font-family: var(--display);
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0 0 30px;
  text-wrap: pretty;
}

/* ---------- Lista med inlägg ---------- */

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.post-list li {
  border-bottom: 1px solid var(--line);
}

.post-list a {
  display: block;
  padding: 20px 2px;
  color: var(--ink);
  text-decoration: none;
}

.post-list a:hover .post-list-title {
  color: var(--accent-deep);
}

.post-list-title {
  display: block;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.3;
  margin: 0 0 4px;
  text-wrap: balance;
}

.post-list-meta {
  display: block;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.post-list-summary {
  display: block;
  margin: 6px 0 0;
  font-size: 15.5px;
  color: var(--ink-soft);
  max-width: 60ch;
}

.blog-empty {
  margin: 24px 0 0;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  font-size: 15px;
  color: var(--ink-soft);
}

/* ---------- Ett inlägg ---------- */

.post-meta {
  margin: 0 0 26px;
  font-size: 13.5px;
  letter-spacing: 0.02em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.post-meta a {
  color: var(--muted);
}

.post-body {
  font-family: var(--display);
  font-size: 18.5px;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 66ch;
}

.post-body > * + * {
  margin-top: 1em;
}

.post-body h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 25px;
  line-height: 1.25;
  color: var(--ink);
  margin: 40px 0 0;
  text-wrap: balance;
}

.post-body h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.01em;
  color: var(--ink);
  margin: 28px 0 0;
}

.post-body p {
  margin: 0;
}

.post-body a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.post-body strong {
  color: var(--ink);
  font-weight: 600;
}

.post-body ul,
.post-body ol {
  padding-left: 22px;
  margin: 0;
}

.post-body li + li {
  margin-top: 6px;
}

.post-body li::marker {
  color: var(--muted);
}

.post-body blockquote {
  margin: 0;
  padding: 4px 0 4px 18px;
  border-left: 3px solid var(--accent);
  font-style: italic;
  color: var(--ink);
}

.post-body blockquote p {
  margin: 0;
}

.post-body figure {
  margin: 0;
}

.post-body img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.post-body figcaption {
  margin-top: 8px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
}

.post-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.1em 0.35em;
}

.post-body pre {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.55;
}

.post-body pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
}

.post-body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 32px 0;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 15px;
}

.post-body th,
.post-body td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.post-body th {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom-color: var(--line-strong);
}

/* ---------- Avslutning på inlägget ---------- */

.post-footer {
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  align-items: center;
  justify-content: space-between;
}

.post-cta {
  display: inline-block;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 999px;
}

.post-cta:hover {
  background: var(--accent-deep);
}

.post-back {
  margin: 0;
  font-size: 14px;
}

.post-back a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
}

.post-back a:hover {
  color: var(--ink);
}

/* ---------- Sidfot ---------- */

.blog-foot {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px 48px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
}

.blog-foot a {
  color: var(--muted);
}

.blog-foot span {
  color: var(--line-strong);
}

/* ---------- Smal skärm ---------- */

@media (max-width: 520px) {
  .post-body {
    font-size: 17.5px;
  }

  .post-body h2 {
    font-size: 22px;
  }

  .post-list-title {
    font-size: 20px;
  }

  .post-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
