/* blog.css — standalone blog pages (/blog, /blog/:slug)
   Own navbar (solid, not transparent), own background, consistent palette. */

/* ── THEME VARS ──────────────────────────────────────────── */
:root,
[data-theme="dark"] {
  --bg:           #1e1e1c;
  --text:         #f0f0d8;
  --text-muted:   rgba(240, 240, 216, 0.55);
  --nav-bg:       #141412;
  --nav-border:   rgba(198, 97, 63, 0.2);
  --nav-text:     #f0f0d8;
  --nav-hover:    #f79b1d;
  --nav-accent:   #c6613f;
  --card-bg:      rgba(28, 28, 26, 0.9);
  --card-border:  rgba(198, 97, 63, 0.2);
  --sidebar-bg:   rgba(20, 20, 18, 0.6);
  --sidebar-border: rgba(198, 97, 63, 0.15);
  --btn-bg:       #c6613f;
  --btn-text:     #fafad9;
  --btn-hover:    #a84e30;
  --link-color:   #c6a96a;
  --cat-bg:       rgba(198, 97, 63, 0.12);
  --cat-active-bg: #c6613f;
  --page-max:     1180px;
}

[data-theme="light"] {
  --bg:           #f5f0ea;
  --text:         #16110a;
  --text-muted:   rgba(22, 17, 10, 0.55);
  --nav-bg:       #ede7de;
  --nav-border:   rgba(198, 97, 63, 0.15);
  --nav-text:     #16110a;
  --nav-hover:    #e08800;
  --nav-accent:   #c6613f;
  --card-bg:      rgba(245, 240, 234, 0.95);
  --card-border:  rgba(198, 97, 63, 0.18);
  --sidebar-bg:   rgba(237, 231, 222, 0.7);
  --sidebar-border: rgba(198, 97, 63, 0.12);
  --btn-bg:       #c6613f;
  --btn-text:     #fafad9;
  --btn-hover:    #a84e30;
  --link-color:   #8b5e20;
  --cat-bg:       rgba(198, 97, 63, 0.1);
  --cat-active-bg: #c6613f;
}

/* ── RESET ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
}

a { color: inherit; }

/* ── NAVBAR ──────────────────────────────────────────────── */
.blog-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  backdrop-filter: blur(12px);
}

.blog-nav__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  height: 54px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 28px;
}

.blog-nav__brand {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--nav-text);
  text-decoration: none;
  flex-shrink: 0;
}

.blog-nav__links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.blog-nav__links a {
  padding: 5px 13px;
  font-size: 0.83rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-muted);
  border-radius: 4px;
  transition: color 0.18s, background 0.18s;
}

.blog-nav__links a:hover,
.blog-nav__links a.active {
  color: var(--nav-hover);
}

.blog-nav__auth {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.blog-nav__login {
  padding: 5px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--nav-accent);
  text-decoration: none;
  border: 1px solid rgba(198, 97, 63, 0.35);
  border-radius: 5px;
  transition: border-color 0.18s, color 0.18s;
}

.blog-nav__login:hover { border-color: var(--nav-accent); color: var(--nav-hover); }

.blog-nav__user {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.blog-nav__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5ee848;
  box-shadow: 0 0 5px rgba(94,232,72,0.6);
  flex-shrink: 0;
}

.blog-nav__signout {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0;
  transition: color 0.18s;
}

.blog-nav__signout:hover { color: #f08070; }

.blog-nav__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  padding: 4px;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: auto;
}

.blog-nav__burger span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--nav-text);
  border-radius: 2px;
}

/* ── PAGE LAYOUT ─────────────────────────────────────────── */
.blog-layout {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 44px 24px 80px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  align-items: start;
}

/* ── FEED HEADER ─────────────────────────────────────────── */
.blog-feed__header {
  margin-bottom: 2rem;
}

.blog-feed__title {
  font-size: clamp(1.5rem, 2.8vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  color: var(--text);
}

/* ── CATEGORY PILLS ──────────────────────────────────────── */
.blog-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.blog-cats__pill {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  background: var(--cat-bg);
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.blog-cats__pill:hover { color: var(--nav-hover); border-color: var(--nav-accent); }
.blog-cats__pill.active { background: var(--cat-active-bg); color: #fafad9; border-color: var(--cat-active-bg); }

/* ── POST LIST ───────────────────────────────────────────── */
.blog-posts {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── POST CARD ───────────────────────────────────────────── */
.blog-card {
  display: grid;
  grid-template-columns: 1fr;
  border-bottom: 1px solid var(--card-border);
  padding: 28px 0;
  gap: 0;
  transition: background 0.18s;
}

.blog-card:first-child { padding-top: 0; }
.blog-card:last-child { border-bottom: none; }

.blog-card--with-cover {
  grid-template-columns: 200px 1fr;
  gap: 24px;
  align-items: start;
}

.blog-card__img-wrap {
  display: block;
  width: 200px;
  height: 130px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--card-bg);
}

.blog-card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.blog-card__img-wrap:hover img { transform: scale(1.04); }

.blog-card__body { flex: 1; }

.blog-card__cat {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nav-accent);
  text-decoration: none;
  margin-bottom: 0.4rem;
  transition: color 0.18s;
}

.blog-card__cat:hover { color: var(--nav-hover); }

.blog-card__title {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
  line-height: 1.4;
}

.blog-card__title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.18s;
}

.blog-card__title a:hover { color: var(--nav-hover); }

.blog-card__summary {
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0 0 0.7rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 300;
}

.blog-card__reads::before { content: '·'; margin-right: 12px; }

/* ── PAGINATION ──────────────────────────────────────────── */
.blog-pagination {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--card-border);
}

.blog-pagination__btn {
  display: inline-block;
  padding: 8px 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.18s, color 0.18s, transform 0.15s;
}

.blog-pagination__btn:hover { border-color: var(--nav-accent); color: var(--nav-hover); transform: translateY(-1px); }

.blog-pagination__info {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 300;
}

/* ── EMPTY STATE ─────────────────────────────────────────── */
.blog-empty {
  padding: 60px 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 300;
}

/* ── SIDEBAR ─────────────────────────────────────────────── */
.blog-sidebar {
  position: sticky;
  top: 74px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.blog-sidebar__widget {
  background: var(--sidebar-bg);
  border: 1px solid var(--sidebar-border);
  border-radius: 10px;
  padding: 20px;
  backdrop-filter: blur(8px);
}

.blog-sidebar__heading {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.blog-sidebar__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.blog-sidebar__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(198,97,63,0.08);
}

.blog-sidebar__item:last-child { border-bottom: none; }

.blog-sidebar__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  line-height: 1.4;
  transition: color 0.18s;
}

.blog-sidebar__link:hover { color: var(--nav-hover); }
.blog-sidebar__link.current { color: var(--nav-accent); }

.blog-sidebar__reads {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 300;
}

.blog-sidebar__cat-link {
  display: block;
  padding: 5px 0;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.18s;
  border-bottom: 1px solid rgba(198,97,63,0.07);
}

.blog-sidebar__cat-link:last-child { border-bottom: none; }
.blog-sidebar__cat-link:hover { color: var(--nav-hover); }
.blog-sidebar__cat-link.active { color: var(--nav-accent); font-weight: 500; }

/* ── ARTICLE ─────────────────────────────────────────────── */
.blog-article-main {
  min-width: 0;
}

.blog-back {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 1.5rem;
  transition: color 0.18s;
}

.blog-back:hover { color: var(--nav-hover); }

.blog-article__cover {
  width: 100%;
  height: 340px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.blog-article__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-article__header { margin-bottom: 1.5rem; }

.blog-article__title {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.25;
  margin: 0.4rem 0 0.6rem;
  color: var(--text);
}

.blog-article__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 300;
}

.blog-article__summary {
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.7;
  border-left: 3px solid var(--nav-accent);
  padding-left: 16px;
  margin: 0 0 2rem;
}

/* Article body — prose styles */
.blog-article__body {
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.8;
  color: var(--text);
}

.blog-article__body h2 { font-size: 1.4rem; font-weight: 600; margin: 2.2rem 0 0.8rem; letter-spacing: -0.01em; }
.blog-article__body h3 { font-size: 1.15rem; font-weight: 600; margin: 1.8rem 0 0.6rem; }
.blog-article__body p { margin: 0 0 1.3rem; }
.blog-article__body a { color: var(--link-color); text-decoration: underline; text-underline-offset: 3px; }
.blog-article__body a:hover { color: var(--nav-hover); }
.blog-article__body ul, .blog-article__body ol { margin: 0 0 1.3rem; padding-left: 1.5rem; }
.blog-article__body li { margin-bottom: 0.4rem; }
.blog-article__body blockquote {
  margin: 1.5rem 0;
  padding: 12px 20px;
  border-left: 3px solid var(--nav-accent);
  color: var(--text-muted);
  font-style: italic;
}
.blog-article__body code {
  font-family: 'Courier New', monospace;
  font-size: 0.875em;
  background: rgba(198,97,63,0.1);
  border: 1px solid rgba(198,97,63,0.15);
  padding: 1px 5px;
  border-radius: 3px;
}
.blog-article__body pre {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 16px 20px;
  overflow-x: auto;
  margin: 1.5rem 0;
}
.blog-article__body pre code { background: none; border: none; padding: 0; font-size: 0.875rem; }
.blog-article__body img { max-width: 100%; border-radius: 8px; margin: 1rem 0; }
.blog-article__body hr { border: none; border-top: 1px solid var(--card-border); margin: 2rem 0; }

.blog-article__footer { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--card-border); }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 860px) {
  .blog-layout {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 28px 16px 60px;
  }

  .blog-sidebar { position: static; }

  .blog-article__cover { height: 220px; }

  .blog-nav__links { display: none; flex-direction: column; position: fixed; top: 54px; left: 0; right: 0; background: var(--nav-bg); border-bottom: 1px solid var(--nav-border); padding: 8px 0 16px; z-index: 99; }
  .blog-nav__links.open { display: flex; }
  .blog-nav__burger { display: flex; }
  .blog-nav__auth { display: none; }
}

@media (max-width: 600px) {
  .blog-card--with-cover { grid-template-columns: 1fr; }
  .blog-card__img-wrap { width: 100%; height: 180px; }
}
