/* ============================================================
   blog/blog.css — Agasoft Blog
   Self-contained: header + blog styles. No HS theme dependency.
   ============================================================ */

/* ── CSS VARIABLES (mirrors main site) ──────────────────── */
:root {
  --bg-primary: #f8f6f1;
  --bg-secondary: #ffffff;
  --bg-surface: #f0ede6;
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a68;
  --text-muted: #8888aa;
  --accent: #c8973a;
  --accent-dark: #a87a28;
  --navy: #1a1a2e;
  --border: rgba(26,26,46,0.12);
  --shadow: 0 4px 24px rgba(26,26,46,0.10);
  --shadow-lg: 0 16px 56px rgba(26,26,46,0.14);
  --card-bg: #ffffff;
  --code-bg: #f5f7fa;
  --transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
[data-theme="dark"] {
  --bg-primary: #0d0d1a;
  --bg-secondary: #111124;
  --bg-surface: #16162e;
  --text-primary: #e8e6f0;
  --text-secondary: #a0a0c8;
  --text-muted: #6060a0;
  --accent: #d4a843;
  --accent-dark: #c8973a;
  --navy: #0d0d1a;
  --border: rgba(200,151,58,0.15);
  --shadow: 0 4px 24px rgba(0,0,0,0.40);
  --shadow-lg: 0 16px 56px rgba(0,0,0,0.50);
  --card-bg: #16162e;
  --code-bg: #1e1e36;
}

/* ── BASE ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Rubik', sans-serif;
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.7;
  transition: background 0.35s ease, color 0.35s ease;
  overflow-x: hidden;
}
h1, h2, h3, h4, h5, h6 {
  font-family: 'Frank Ruhl Libre', serif;
  font-weight: 400;
  line-height: 1.25;
  color: var(--text-primary);
}
a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; height: auto; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ── HEADER ─────────────────────────────────────────────── */
#site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 12px rgba(0,0,0,0.06);
  transition: background 0.3s ease;
}
[data-theme="dark"] #site-header {
  background: #111124;
  box-shadow: 0 1px 12px rgba(0,0,0,0.3);
}
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}
.nav-logo img { height: 36px; }

.nav-center {
  display: none;
  align-items: center;
  gap: 28px;
  list-style: none;
}
@media (min-width: 992px) { .nav-center { display: flex; } }
.nav-center a {
  font-family: 'Rubik', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  position: relative;
  padding-bottom: 4px;
}
.nav-center a:hover, .nav-center a.active { color: var(--text-primary); }
.nav-center a::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}
.nav-center a:hover::after, .nav-center a.active::after { width: 100%; }

.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-pill {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: 'Rubik', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 3px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-block;
}
.nav-pill:hover { background: var(--accent); border-color: var(--accent); color: #fff !important; }
.theme-btn {
  background: none;
  border: 1px solid var(--border);
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.theme-btn:hover { background: var(--accent); border-color: var(--accent); }

.hamburger-btn {
  display: flex;
  background: none; border: none;
  cursor: pointer; padding: 4px;
  flex-direction: column; gap: 5px;
}
@media (min-width: 992px) { .hamburger-btn { display: none; } }
.hamburger-btn span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}
.hamburger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  display: none;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 16px 24px;
}
.mobile-menu.open { display: block; }
.mobile-menu ul { list-style: none; }
.mobile-menu ul li { padding: 9px 0; border-bottom: 1px solid var(--border); }
.mobile-menu ul li:last-child { border: none; }
.mobile-menu ul a { color: var(--text-secondary); font-size: 15px; font-weight: 600; }
.mobile-menu-controls { margin-top: 14px; display: flex; gap: 8px; }

/* ── BLOG LISTING HERO ──────────────────────────────────── */
.blog-listing-hero {
  min-height: 260px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  position: relative;
}
.blog-listing-hero::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(13,13,26,0.65);
}
.blog-listing-hero .container { position: relative; z-index: 1; }
.blog-listing-hero h1 {
  font-family: 'Frank Ruhl Libre', serif;
  color: #fff;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 6px;
}
.blog-listing-hero p { color: rgba(255,255,255,0.72); font-size: 15px; }
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin-bottom: 12px;
  font-size: 13px;
}
.breadcrumb a { color: rgba(255,255,255,0.65); }
.breadcrumb a:hover { color: #fff; }
.breadcrumb-item.active { color: rgba(255,255,255,0.9); }
.breadcrumb-item + .breadcrumb-item::before { content: '‹'; margin-left: 4px; color: rgba(255,255,255,0.4); }

/* ── CATEGORY PILL ──────────────────────────────────────── */
.category-pill {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 10px;
  text-transform: uppercase;
  font-family: 'Rubik', sans-serif;
}

/* ── BLOG CARDS (listing page) ──────────────────────────── */
.blog-cards-section {
  padding: 72px 0;
  background: var(--bg-primary);
}
.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  margin-top: 0;
}
@media (min-width: 600px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .blog-grid { grid-template-columns: repeat(3, 1fr); } }

.blog-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  display: flex;
  flex-direction: column;
}
.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}
.blog-card-img {
  height: 190px;
  object-fit: cover;
  width: 100%;
  display: block;
}
.blog-card-body { padding: 22px 22px 24px; flex: 1; display: flex; flex-direction: column; }
.blog-card-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; font-family: 'Rubik', sans-serif; }
.blog-card-title {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 1.15rem;
  color: var(--text-primary);
  margin: 0 0 10px;
  line-height: 1.35;
}
.blog-card-summary {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 18px;
  flex: 1;
}
.btn-read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--accent);
  font-family: 'Rubik', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 8px 20px;
  border-radius: 20px;
  border: 1px solid var(--accent);
  transition: var(--transition);
  align-self: flex-start;
}
.btn-read-more:hover {
  background: var(--accent);
  color: #fff;
}

/* ── POST HERO ──────────────────────────────────────────── */
.blog-post-hero {
  min-height: 340px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  position: relative;
}
.blog-post-hero::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(13,13,26,0.82) 0%, rgba(13,13,26,0.4) 55%, transparent 100%);
}
.blog-post-hero .container {
  position: relative; z-index: 1;
  padding-bottom: 48px;
  padding-top: 80px;
}
.blog-post-hero h1 {
  font-family: 'Frank Ruhl Libre', serif;
  color: #fff;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  line-height: 1.3;
  margin-bottom: 12px;
}
.post-meta { color: rgba(255,255,255,0.72); font-size: 13px; font-family: 'Rubik', sans-serif; }
.post-meta span { margin-left: 16px; }

/* ── POST BODY ──────────────────────────────────────────── */
.post-body-section {
  padding: 72px 0;
  background: var(--bg-secondary);
}
.post-body-row {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
}
.post-article { flex: 1 1 600px; min-width: 0; }
.post-sidebar-col { flex: 0 0 260px; }
@media (max-width: 900px) { .post-sidebar-col { flex: 0 0 100%; } }

article.post-content {
  font-size: 16px;
  line-height: 1.9;
  color: var(--text-secondary);
}
article.post-content h2 {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 1.5rem;
  color: var(--text-primary);
  margin: 2.4rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
}
article.post-content h3 {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 1.2rem;
  color: var(--text-primary);
  margin: 1.8rem 0 0.7rem;
}
article.post-content p { margin-bottom: 1.2rem; }
article.post-content ul,
article.post-content ol { padding-right: 1.4rem; margin-bottom: 1.2rem; }
article.post-content li { margin-bottom: 0.5rem; }
article.post-content pre {
  background: var(--code-bg);
  border-right: 3px solid var(--accent);
  padding: 1rem 1.2rem;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 13.5px;
  direction: ltr;
  text-align: left;
  margin-bottom: 1.4rem;
  color: var(--text-primary);
}
article.post-content code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 14px;
  direction: ltr;
  display: inline-block;
  color: var(--accent);
}
article.post-content pre code { background: none; padding: 0; color: inherit; }
article.post-content blockquote {
  border-right: 3px solid var(--accent);
  padding: 0.8rem 1.2rem;
  margin: 1.6rem 0;
  color: var(--text-secondary);
  font-style: italic;
  background: var(--bg-surface);
  border-radius: 0 4px 4px 0;
}
article.post-content a { color: var(--accent); text-decoration: underline; }
article.post-content strong { color: var(--text-primary); }

.post-tags-row { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--border); }
.post-tags-row .label { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }

/* ── SIDEBAR ────────────────────────────────────────────── */
.sidebar-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
}
.sidebar-box h5 {
  font-family: 'Rubik', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.sidebar-cta {
  background: var(--navy);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 22px 20px;
}
[data-theme="dark"] .sidebar-cta { background: #16162e; }
.sidebar-cta h5 {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 8px;
  border: none;
  padding: 0;
  text-transform: none;
  letter-spacing: 0;
}
.sidebar-cta p { font-size: 13px; color: rgba(255,255,255,0.65); margin-bottom: 14px; }
.sidebar-cta .btn-cta {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-family: 'Rubik', sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 22px;
  border-radius: 4px;
  transition: var(--transition);
}
.sidebar-cta .btn-cta:hover { background: var(--accent-dark); }

/* ── TAG PILLS ──────────────────────────────────────────── */
.tag-pill {
  display: inline-block;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 12px;
  font-family: 'Rubik', sans-serif;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 20px;
  margin: 0 0 6px 6px;
  text-decoration: none;
  transition: var(--transition);
}
.tag-pill:hover { background: var(--accent); color: #fff !important; }

/* ── BACK BAR ───────────────────────────────────────────── */
.blog-back-bar {
  background: var(--bg-surface);
  padding: 20px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Rubik', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 20px;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.btn-back:hover { border-color: var(--accent); color: var(--accent); }

/* ── FOOTER ─────────────────────────────────────────────── */
.blog-footer {
  background: #1a1a2e;
  padding: 24px 0;
  text-align: center;
}
.blog-footer p { font-size: 13px; color: rgba(255,255,255,0.4); }
.blog-footer a { color: rgba(255,255,255,0.4); transition: var(--transition); }
.blog-footer a:hover { color: var(--accent); }

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 767px) {
  .blog-listing-hero { min-height: 220px; }
  .blog-post-hero    { min-height: 260px; }
  article.post-content { font-size: 15px; }
}
