/* ═══════════════════════════════════════════════════════
   SOCIAL EDU — Design System
   Single source of truth. No patches, no overrides.
═══════════════════════════════════════════════════════ */

:root {
  --navy:       #0d0a2e;
  --navy-light: #1a1650;
  --indigo:     #4f46e5;
  --indigo-mid: #6366f1;
  --cyan:       #06b6d4;
  --emerald:    #10b981;
  --white:      #ffffff;
  --slate-50:   #f8fafc;
  --slate-100:  #f1f5f9;
  --slate-200:  #e2e8f0;
  --slate-400:  #94a3b8;
  --slate-500:  #64748b;
  --slate-700:  #334155;
  --slate-900:  #0f172a;

  --font-sans:  'Inter', system-ui, -apple-system, sans-serif;
  --font-head:  'Space Grotesk', var(--font-sans);

  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.14);
  --shadow-card: 0 2px 8px rgba(79,70,229,.06), 0 0 0 1px rgba(79,70,229,.06);

  --grad-brand: linear-gradient(135deg, var(--indigo), var(--cyan));
  --grad-hero:  linear-gradient(160deg, #0d0a2e 0%, #1e1b4b 50%, #1e3a5f 100%);
  --grad-card:  linear-gradient(135deg, var(--indigo), #7c3aed);
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 68px; }

body {
  font-family: var(--font-sans);
  background: var(--slate-50);
  color: var(--slate-900);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; }

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

/* ═══════════════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════════════ */
#site-header {
  background: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  z-index: 300;
  transition: box-shadow .3s;
}

#site-header.scrolled {
  box-shadow: 0 4px 24px rgba(0,0,0,.5);
}

.header-inner {
  max-width: 1140px;
  margin: 0 auto;
  height: 68px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 0;
}

/* Brand */
.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 32px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: var(--grad-brand);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  transition: transform .25s;
}

.site-brand:hover .brand-icon { transform: rotate(8deg) scale(1.1); }

.brand-name {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -.3px;
  white-space: nowrap;
}

.brand-name span {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Desktop nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.site-nav a {
  color: rgba(255,255,255,.65);
  padding: 6px 13px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}

.site-nav a:hover { background: rgba(255,255,255,.08); color: var(--white); }

.site-nav a.active {
  background: rgba(99,102,241,.25);
  color: #a5b4fc;
  font-weight: 600;
}

/* Header right */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}

.search-form {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}

.search-form:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(6,182,212,.15);
}

.search-form input {
  padding: 8px 12px;
  width: 155px;
  border: none;
  background: transparent;
  color: var(--white);
  font-size: 14px;
  font-family: var(--font-sans);
  outline: none;
}

.search-form input::placeholder { color: rgba(255,255,255,.35); }

.search-form button {
  padding: 8px 13px;
  background: transparent;
  border: none;
  border-left: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.55);
  font-size: 15px;
  cursor: pointer;
  transition: color .15s;
}

.search-form button:hover { color: var(--white); }

/* Hamburger */
.nav-toggle {
  display: none;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  color: var(--white);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s;
}

.nav-toggle:hover { background: rgba(255,255,255,.13); }

/* Mobile drawer */
.mobile-nav {
  display: none;
  flex-direction: column;
  background: #0a0820;
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 8px 20px 20px;
}

.mobile-nav.open { display: flex; }

.mobile-nav a {
  color: rgba(255,255,255,.75);
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, color .15s;
}

.mobile-nav a:hover,
.mobile-nav a.active { background: rgba(255,255,255,.08); color: var(--white); }

/* ═══════════════════════════════════════════════════════
   MAIN
═══════════════════════════════════════════════════════ */
main { padding-bottom: 80px; }

/* ═══════════════════════════════════════════════════════
   POST CARDS (category / search listing)
═══════════════════════════════════════════════════════ */
.post-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}

.post-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad-brand);
  opacity: 0;
  transition: opacity .25s;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(99,102,241,.2);
}

.post-card:hover::before { opacity: 1; }

.post-card h2 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 10px;
}

.post-card h2 a {
  color: var(--slate-900);
  text-decoration: none;
  transition: color .15s;
}

.post-card h2 a:hover { color: var(--indigo); }

.post-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--slate-500);
  margin-bottom: 12px;
}

.post-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: var(--slate-100);
  border-radius: 20px;
}

/* ═══════════════════════════════════════════════════════
   TAGS & CATEGORIES
═══════════════════════════════════════════════════════ */
.tag, .category {
  display: inline-flex;
  align-items: center;
  background: var(--grad-card);
  color: var(--white);
  padding: 4px 13px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  margin: 3px;
  transition: opacity .2s, transform .2s;
}

.tag:hover, .category:hover {
  opacity: .85;
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════
   POST CONTENT (show page)
═══════════════════════════════════════════════════════ */
.post-content {
  font-size: 16px;
  line-height: 1.85;
  color: var(--slate-700);
}

.post-content p { margin-bottom: 20px; }

.post-content h2,
.post-content h3,
.post-content h4 {
  font-family: var(--font-head);
  color: var(--slate-900);
  margin: 36px 0 14px;
  line-height: 1.3;
}

.post-content h2 { font-size: 24px; font-weight: 700; }
.post-content h3 { font-size: 20px; font-weight: 700; }
.post-content h4 { font-size: 17px; font-weight: 600; }

.post-content a {
  color: var(--indigo);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-content a:hover { color: #7c3aed; }

.post-content img {
  max-width: 100%;
  border-radius: var(--radius-md);
  margin: 24px 0;
  box-shadow: var(--shadow-md);
}

.post-content blockquote {
  border-left: 4px solid var(--indigo);
  padding: 16px 20px;
  margin: 28px 0;
  background: rgba(79,70,229,.04);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--slate-500);
  font-style: italic;
}

.post-content ul,
.post-content ol { padding-left: 24px; margin-bottom: 20px; }

.post-content li { margin-bottom: 8px; }

.post-content code {
  background: var(--slate-100);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
  color: #7c3aed;
}

.post-content pre {
  background: var(--navy);
  color: #e2e8f0;
  padding: 20px 24px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 24px 0;
}

.post-content pre code { background: none; color: inherit; padding: 0; }

.post-content table { width: 100%; border-collapse: collapse; margin: 24px 0; }
.post-content th { background: var(--slate-100); padding: 10px 14px; text-align: left; font-weight: 600; border: 1px solid var(--slate-200); }
.post-content td { padding: 10px 14px; border: 1px solid var(--slate-200); }
.post-content tr:nth-child(even) td { background: var(--slate-50); }

/* ═══════════════════════════════════════════════════════
   PAGINATION
═══════════════════════════════════════════════════════ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 48px 0;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: all .2s;
}

.pagination a {
  background: var(--white);
  color: var(--slate-700);
  border: 1px solid var(--slate-200);
}

.pagination a:hover {
  background: var(--indigo);
  color: var(--white);
  border-color: var(--indigo);
  transform: translateY(-2px);
}

.pagination span.current {
  background: var(--grad-brand);
  color: var(--white);
  border: 1px solid transparent;
}

.pagination .dots { color: var(--slate-400); padding: 9px 4px; }

/* ═══════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════ */
footer {
  background: var(--navy);
  color: rgba(255,255,255,.55);
  text-align: center;
  padding: 40px 24px;
  border-top: 1px solid rgba(255,255,255,.06);
  font-size: 14px;
}

footer a {
  color: var(--cyan);
  text-decoration: none;
  font-weight: 500;
  transition: color .15s;
}

footer a:hover { color: var(--white); }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .search-form input { width: 120px; }
}

@media (max-width: 768px) {
  .header-inner { padding: 0 16px; }
  .site-nav { display: none; }
  .nav-toggle { display: block; }
  .search-form input { width: 110px; }
  .post-card { padding: 22px 20px; }
  main { padding-bottom: 60px; }
}

@media (max-width: 480px) {
  .brand-name { font-size: 18px; }
  .container { padding: 0 16px; }
  .search-form { display: none; }
}
