/* ============================================================
   TechBlogHub — Main Stylesheet
   Dark premium design with glassmorphism & micro-animations
   ============================================================ */

/* ── Google Fonts ──────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700;800&display=swap');

/* ── CSS Variables ─────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg:       #0a0a0f;
  --bg2:      #0f0f1a;
  --bg3:      #151525;
  --card:     #13131f;
  --card2:    #1c1c2e;
  --glass:    rgba(255,255,255,0.03);

  /* Borders */
  --border:   rgba(255,255,255,0.07);
  --border2:  rgba(255,255,255,0.12);
  --border3:  rgba(255,255,255,0.18);

  /* Text */
  --text:     #e8e8f4;
  --text2:    #9898b8;
  --text3:    #5c5c8a;
  --text4:    #3a3a6a;

  /* Accent */
  --accent:   #6c63ff;
  --accent2:  #a855f7;
  --accent-g: linear-gradient(135deg, #6c63ff, #a855f7);
  --glow:     rgba(108,99,255,0.25);
  --glow2:    rgba(108,99,255,0.4);

  /* Status */
  --green:    #00d4aa;
  --red:      #ff6b6b;
  --orange:   #ffa94d;
  --yellow:   #ffd43b;

  /* Spacing */
  --radius:   16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow:   0 8px 40px rgba(0,0,0,0.6);
  --shadow-sm:0 4px 16px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 24px rgba(108,99,255,0.3);

  /* Layout */
  --nav-height: 65px;
  --container:  1240px;
  --side-pad:   clamp(16px, 5vw, 80px);
}

/* ── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* ── Custom Scrollbar ──────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent2); }

/* ── Selection ─────────────────────────────────────────── */
::selection { background: rgba(108,99,255,0.3); color: var(--text); }

/* ══════════════════════════════════════════════════════════
   LAYOUT UTILITIES
   ══════════════════════════════════════════════════════════ */

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px);
}

.section  { padding: 64px 0; }
.section-sm { padding: 40px 0; }

/* ── Grid Utilities ────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }

@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ── Flex Utilities ────────────────────────────────────── */
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

/* ══════════════════════════════════════════════════════════
   TYPOGRAPHY
   ══════════════════════════════════════════════════════════ */
.font-display { font-family: 'Space Grotesk', sans-serif; }
.text-gradient {
  background: var(--accent-g);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ══════════════════════════════════════════════════════════
   COMPONENTS
   ══════════════════════════════════════════════════════════ */

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  font-family: inherit;
}
.btn-primary {
  background: var(--accent-g);
  color: #fff;
  box-shadow: 0 4px 16px rgba(108,99,255,0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(108,99,255,0.5);
}
.btn-outline {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border2);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-ghost {
  background: var(--bg3);
  color: var(--text2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--card2); color: var(--text); }

.btn-danger {
  background: rgba(255,107,107,0.15);
  color: var(--red);
  border: 1px solid rgba(255,107,107,0.2);
}
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-success {
  background: rgba(0,212,170,0.15);
  color: var(--green);
  border: 1px solid rgba(0,212,170,0.2);
}
.btn-success:hover { background: var(--green); color: #000; }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; border-radius: var(--radius-xs); }
.btn-lg { padding: 14px 32px; font-size: 1rem; border-radius: 14px; }

/* ── Badge / Pill ──────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}
.cat-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 100px; font-size: 0.78rem; font-weight: 700; color: #fff; }

/* ── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all .3s cubic-bezier(0.4,0,0.2,1);
  text-decoration: none;
  color: inherit;
}
.card:hover {
  border-color: rgba(108,99,255,0.35);
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.card-img {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--bg3) 0%, var(--card2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  position: relative;
  overflow: hidden;
}
.card-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 30%, rgba(0,0,0,0.5));
}
.card-img .cat-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
}

.card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-excerpt {
  font-size: 0.875rem;
  color: var(--text2);
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.775rem;
  color: var(--text3);
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: auto;
  flex-wrap: wrap;
}
.card-meta span { display: flex; align-items: center; gap: 4px; }

/* ── Featured Card (large) ─────────────────────────────── */
.card-featured .card-img { aspect-ratio: 4/3; font-size: 5rem; }
.card-featured .card-title { font-size: 1.25rem; -webkit-line-clamp: 3; }
.card-featured .card-excerpt { -webkit-line-clamp: 3; }

/* ── Section Header ────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 12px;
}
.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-title::before {
  content: '';
  width: 4px;
  height: 28px;
  background: var(--accent-g);
  border-radius: 2px;
  flex-shrink: 0;
}
.see-all {
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap .2s;
}
.see-all:hover { gap: 8px; }

/* ── Alert ─────────────────────────────────────────────── */
.alert {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 20px;
}
.alert-success { background: rgba(0,212,170,0.1); border: 1px solid rgba(0,212,170,0.25); color: var(--green); }
.alert-error   { background: rgba(255,107,107,0.1); border: 1px solid rgba(255,107,107,0.25); color: var(--red); }
.alert-info    { background: rgba(108,99,255,0.1); border: 1px solid rgba(108,99,255,0.25); color: var(--accent); }

/* ── Category Tabs ─────────────────────────────────────── */
.cat-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.cat-tab {
  padding: 8px 18px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cat-tab:hover { border-color: var(--accent); color: var(--accent); }
.cat-tab.active {
  background: var(--accent-g);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 16px rgba(108,99,255,0.35);
}

/* ── Pagination ────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 48px;
}
.pg-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all .2s;
}
.pg-btn:hover { background: var(--card2); border-color: var(--accent); color: var(--accent); }
.pg-btn.current { background: var(--accent-g); border-color: transparent; color: #fff; }
.pg-btn.disabled { opacity: 0.3; pointer-events: none; }

/* ── Tag Pills ─────────────────────────────────────────── */
.tags-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px 14px;
  font-size: 0.78rem;
  color: var(--text2);
  transition: all .2s;
}
.tag:hover { border-color: var(--accent); color: var(--accent); }

/* ── Empty State ───────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
}
.empty-state .icon { font-size: 4rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.3rem; color: var(--text2); margin-bottom: 8px; font-family: 'Space Grotesk',sans-serif; }
.empty-state p  { color: var(--text3); font-size: 0.9rem; }

/* ── Forms ─────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
}
.form-label .required { color: var(--red); margin-left: 3px; }
.form-hint { font-size: 0.78rem; color: var(--text3); margin-top: 5px; font-weight: 400; }
.form-error { font-size: 0.8rem; color: var(--red); margin-top: 5px; }

.form-control {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  font-family: inherit;
  transition: border-color .2s;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108,99,255,0.1); }
.form-control.is-error { border-color: var(--red); }
.form-control::placeholder { color: var(--text4); }
textarea.form-control { min-height: 200px; resize: vertical; line-height: 1.6; }
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236c63ff' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

/* ══════════════════════════════════════════════════════════
   NAVBAR
   ══════════════════════════════════════════════════════════ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 999;
  height: var(--nav-height);
  background: rgba(10, 10, 15, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--side-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.nav-logo {
  width: 36px; height: 36px;
  background: var(--accent-g);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 16px rgba(108,99,255,0.3);
}
.nav-brand-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  justify-content: center;
}
.nav-link {
  color: var(--text2);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 7px 13px;
  border-radius: 8px;
  transition: all .2s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--bg3); }
.nav-link.active { color: var(--text); background: rgba(108,99,255,0.12); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.nav-search-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text3);
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all .2s;
  font-family: inherit;
}
.nav-search-btn:hover { border-color: var(--accent); color: var(--text); }
.nav-search-kbd {
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.7rem;
  color: var(--text3);
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-search-kbd { display: none; }
}

/* ══════════════════════════════════════════════════════════
   SEARCH MODAL
   ══════════════════════════════════════════════════════════ */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(12px);
  z-index: 9999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: clamp(60px,10vh,120px);
}
.search-overlay.open { display: flex; animation: fadeIn .2s ease; }

.search-modal {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  width: min(640px, 92vw);
  padding: 24px;
  animation: slideDown .25s ease;
}
.search-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.search-modal-title { font-weight: 700; font-size: 0.95rem; color: var(--text2); }
.search-close-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  width: 30px; height: 30px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: .2s;
}
.search-close-btn:hover { background: var(--card2); color: var(--text); }

.search-input-wrap { position: relative; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 1.1rem; pointer-events: none; }
.search-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 13px 16px 13px 44px;
  font-size: 1.05rem;
  color: var(--text);
  outline: none;
  transition: border-color .2s;
  font-family: inherit;
}
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108,99,255,0.1); }
.search-input::placeholder { color: var(--text3); }
.search-hint { font-size: 0.78rem; color: var(--text3); margin-top: 10px; }

/* ══════════════════════════════════════════════════════════
   HERO SECTION
   ══════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(64px, 10vw, 128px) var(--side-pad) clamp(48px, 6vw, 80px);
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(108,99,255,0.18) 0%, transparent 65%),
    radial-gradient(ellipse 40% 30% at 85% 70%, rgba(168,85,247,0.1) 0%, transparent 50%);
}
.hero-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(108,99,255,0.12) 1px, transparent 1px);
  background-size: 32px 32px;
  animation: dotsDrift 30s linear infinite;
}
@keyframes dotsDrift { from { transform: translateX(0); } to { transform: translateX(32px); } }

.hero-content { position: relative; z-index: 1; max-width: 780px; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(108,99,255,0.12);
  border: 1px solid rgba(108,99,255,0.28);
  border-radius: 100px;
  padding: 7px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #a29aff;
  margin-bottom: 28px;
  animation: slideUp .5s ease both;
}
.hero-badge-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s ease infinite;
}
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(.8)} }

.hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 22px;
  animation: slideUp .6s ease .05s both;
}
.hero p {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text2);
  max-width: 540px;
  line-height: 1.7;
  margin-bottom: 36px;
  animation: slideUp .7s ease .1s both;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  animation: slideUp .8s ease .15s both;
}

/* ── Stats Bar ──────────────────────────────────────────── */
.stats-bar {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 20px var(--side-pad);
  display: flex;
  gap: 40px;
  overflow-x: auto;
  scrollbar-width: none;
}
.stats-bar::-webkit-scrollbar { display: none; }

.stat-item { display: flex; align-items: center; gap: 14px; white-space: nowrap; flex-shrink: 0; }
.stat-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.stat-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
}
.stat-label { font-size: 0.75rem; color: var(--text3); margin-top: 2px; }

/* ── Featured Grid ──────────────────────────────────────── */
.featured-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 20px;
}
.featured-grid .card:first-child { grid-row: 1 / 3; }

@media (max-width: 780px) {
  .featured-grid { grid-template-columns: 1fr; }
  .featured-grid .card:first-child { grid-row: auto; }
}

/* ══════════════════════════════════════════════════════════
   SINGLE POST
   ══════════════════════════════════════════════════════════ */
.post-hero {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 48px var(--side-pad) 0;
}
.post-header { max-width: 820px; }

.post-breadcrumb {
  font-size: 0.82rem;
  color: var(--text3);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.post-breadcrumb a { color: var(--accent); }
.post-breadcrumb a:hover { text-decoration: underline; }
.post-breadcrumb .sep { color: var(--text4); }

.post-header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 16px 0 20px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.85rem;
  color: var(--text3);
  margin-bottom: 36px;
}
.post-meta span { display: flex; align-items: center; gap: 6px; }

.post-banner {
  max-width: 820px;
  height: clamp(180px, 30vw, 320px);
  background: linear-gradient(135deg, var(--bg3), var(--card2));
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(4rem, 10vw, 7rem);
  overflow: hidden;
  position: relative;
}
.post-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(108,99,255,0.1), transparent 60%);
}

/* ── Post Layout ───────────────────────────────────────── */
.post-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  padding: 48px 0 80px;
  max-width: 1100px;
  margin: 0 auto;
}
@media (max-width: 960px) { .post-layout { grid-template-columns: 1fr; } }

/* ── Post Content ───────────────────────────────────────── */
.post-content { font-size: 1.05rem; line-height: 1.85; color: var(--text2); }
.post-content h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text);
  margin: 40px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.post-content h3 { font-size: 1.2rem; font-weight: 700; color: var(--text); margin: 28px 0 12px; }
.post-content p  { margin-bottom: 20px; }
.post-content ul, .post-content ol { margin: 0 0 20px 24px; }
.post-content li { margin-bottom: 8px; }
.post-content strong { color: var(--text); font-weight: 700; }
.post-content a { color: var(--accent); }
.post-content a:hover { text-decoration: underline; }
.post-content blockquote {
  border-left: 4px solid var(--accent);
  padding: 16px 24px;
  background: rgba(108,99,255,0.05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 24px 0;
  color: var(--text);
  font-style: italic;
}
.post-content code {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.88em;
  color: #a29aff;
}
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 0.9rem;
}
.post-content th {
  background: var(--bg3);
  border: 1px solid var(--border2);
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  color: var(--text);
}
.post-content td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  color: var(--text2);
}
.post-content tr:hover td { background: var(--bg3); }

/* ── Author Box ─────────────────────────────────────────── */
.author-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 40px;
}
.author-avatar {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--accent-g);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}
.author-name { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.author-bio  { font-size: 0.85rem; color: var(--text3); line-height: 1.5; }

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 24px; }
.sidebar-widget {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.widget-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.related-item {
  display: flex;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  transition: .2s;
}
.related-item:last-child { border-bottom: none; padding-bottom: 0; }
.related-item:hover .related-title { color: var(--accent); }
.related-thumb {
  width: 52px; height: 52px;
  border-radius: 10px;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.related-title { font-size: 0.85rem; font-weight: 600; line-height: 1.3; color: var(--text); }
.related-meta  { font-size: 0.74rem; color: var(--text3); margin-top: 4px; }

.cat-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text2);
  transition: .2s;
}
.cat-list-item:last-child { border-bottom: none; }
.cat-list-item:hover { color: var(--accent); }
.cat-count {
  background: var(--bg3);
  border-radius: 100px;
  padding: 2px 10px;
  font-size: 0.75rem;
  color: var(--text3);
}

/* ── Newsletter Widget ─────────────────────────────────── */
.subscribe-form { display: flex; flex-direction: column; gap: 10px; }
.subscribe-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  font-family: inherit;
}
.subscribe-input:focus { border-color: var(--accent); }
.subscribe-input::placeholder { color: var(--text4); }

/* ══════════════════════════════════════════════════════════
   NEWSLETTER SECTION (full-width)
   ══════════════════════════════════════════════════════════ */
.newsletter-section {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 72px var(--side-pad);
  position: relative;
  overflow: hidden;
}
.newsletter-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 50%, rgba(108,99,255,0.06), transparent);
  pointer-events: none;
}
.newsletter-inner {
  max-width: 580px;
  margin: 0 auto;
  text-align: center;
  position: relative;
}
.newsletter-emoji { font-size: 2.8rem; margin-bottom: 16px; }
.newsletter-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 800;
  margin-bottom: 10px;
}
.newsletter-subtitle { color: var(--text3); font-size: 0.95rem; margin-bottom: 32px; line-height: 1.6; }

.newsletter-form {
  display: flex;
  gap: 10px;
  max-width: 460px;
  margin: 0 auto;
}
.newsletter-form input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  font-family: inherit;
}
.newsletter-form input:focus { border-color: var(--accent); }
.newsletter-form input::placeholder { color: var(--text4); }
@media (max-width: 540px) { .newsletter-form { flex-direction: column; } }

/* ══════════════════════════════════════════════════════════
   ADMIN PANEL
   ══════════════════════════════════════════════════════════ */
.admin-topbar {
  height: var(--nav-height);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--side-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 99;
}
.admin-topbar-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.admin-topbar-logo {
  width: 32px; height: 32px;
  background: var(--accent-g);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.admin-topbar-sub { color: var(--text3); font-size: 0.85rem; font-weight: 400; }

.admin-main { max-width: 1200px; margin: 0 auto; padding: 40px clamp(16px,4vw,40px) 80px; }

.admin-stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.admin-stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  text-align: center;
  transition: .2s;
}
.admin-stat-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.admin-stat-card .num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}
.admin-stat-card .lbl { font-size: 0.78rem; color: var(--text3); }

.admin-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 860px) { .admin-grid { grid-template-columns: 1fr; } }

.admin-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.admin-panel-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.post-list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.post-list-row:last-child { border-bottom: none; }
.post-list-title {
  flex: 1;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.post-list-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ── Post Form ─────────────────────────────────────────── */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-grid-2 { grid-template-columns: 1fr; } }
.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 8px; }

/* ── Admin Login ───────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg);
  position: relative;
}
.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 40%, rgba(108,99,255,0.1), transparent 60%);
  pointer-events: none;
}
.login-card {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: clamp(32px, 5vw, 52px);
  width: min(420px, 100%);
  position: relative;
  z-index: 1;
}
.login-logo {
  width: 56px; height: 56px;
  background: var(--accent-g);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 24px;
  box-shadow: var(--shadow-glow);
}
.login-title { font-family: 'Space Grotesk', sans-serif; font-size: 1.6rem; font-weight: 800; text-align: center; margin-bottom: 6px; }
.login-sub { color: var(--text3); font-size: 0.875rem; text-align: center; margin-bottom: 32px; }

/* ══════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════ */
.footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 56px var(--side-pad) 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.footer-brand-icon {
  width: 40px; height: 40px;
  background: var(--accent-g);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.footer-brand-name { font-family: 'Space Grotesk', sans-serif; font-weight: 800; font-size: 1.1rem; }
.footer-desc { color: var(--text3); font-size: 0.875rem; line-height: 1.7; max-width: 280px; }

.footer-col-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 16px; color: var(--text); }
.footer-link {
  display: block;
  color: var(--text3);
  font-size: 0.875rem;
  margin-bottom: 10px;
  transition: color .2s;
}
.footer-link:hover { color: var(--accent); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text3);
}

/* ══════════════════════════════════════════════════════════
   ERROR PAGES
   ══════════════════════════════════════════════════════════ */
.error-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}
.error-code {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(5rem, 15vw, 10rem);
  font-weight: 900;
  background: var(--accent-g);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 16px;
}
.error-msg { font-size: 1.2rem; color: var(--text2); margin-bottom: 8px; }
.error-sub { color: var(--text3); font-size: 0.9rem; margin-bottom: 32px; }

/* ══════════════════════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════════════════════ */
@keyframes slideUp   { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
@keyframes slideDown { from { opacity:0; transform:translateY(-12px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeIn    { from { opacity:0; } to { opacity:1; } }
@keyframes scaleIn   { from { opacity:0; transform:scale(.95); } to { opacity:1; transform:scale(1); } }

.anim-fade { animation: fadeIn .4s ease both; }
.anim-up   { animation: slideUp .5s ease both; }

/* Stagger children */
.stagger > *:nth-child(1) { animation-delay: .05s; }
.stagger > *:nth-child(2) { animation-delay: .10s; }
.stagger > *:nth-child(3) { animation-delay: .15s; }
.stagger > *:nth-child(4) { animation-delay: .20s; }
.stagger > *:nth-child(5) { animation-delay: .25s; }
.stagger > *:nth-child(6) { animation-delay: .30s; }

/* ── Intersection Observer Fade ────────────────────────── */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE TWEAKS
   ══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .hero h1 { font-size: 2rem; }
  .hero { padding: 56px 16px 40px; }
  .stats-bar { padding: 16px; gap: 24px; }
  .section { padding: 40px 0; }
}
