/* ============================================
   TANVIR BLOG — Complete Stylesheet
   Author: BITSCOL | Design: Modern Professional
   Features: Dark/Light, Bilingual, Responsive
   ============================================ */

/* ----- CSS Variables / Theme ----- */
:root {
  /* Light Mode */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-nav: rgba(255,255,255,0.85);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #dbeafe;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
  --shadow-card: 0 4px 20px rgba(0,0,0,0.06);
  --gradient-hero: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
  --gradient-accent: linear-gradient(135deg, #2563eb, #7c3aed);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-bn: 'Noto Sans Bengali', 'Inter', sans-serif;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-card: #1e293b;
  --bg-nav: rgba(15,23,42,0.9);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-light: #1e3a5f;
  --border: #334155;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.4);
  --shadow-card: 0 4px 20px rgba(0,0,0,0.3);
}

/* ----- Reset & Base ----- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

body.bn-mode {
  font-family: var(--font-bn);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent-hover); }

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul { list-style: none; }

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

.section {
  padding: 100px 0;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 3rem;
}

.text-center { text-align: center; }

/* ----- Scrollbar ----- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.btn-primary {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 4px 15px rgba(37,99,235,0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37,99,235,0.4);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}
.btn-outline:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.85rem;
}

/* ----- Navigation ----- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--bg-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: all var(--transition);
}

.navbar.scrolled {
  box-shadow: var(--shadow-lg);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav-brand {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-brand .brand-icon {
  width: 40px;
  height: 40px;
  background: var(--gradient-accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  padding: 4px 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition);
  border-radius: 2px;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a:hover { color: var(--text-primary); }

.nav-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition);
}

/* Theme toggle switch */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 6px;
  border-radius: 8px;
  transition: background var(--transition);
}
.theme-toggle:hover {
  background: var(--bg-secondary);
}
.theme-lbl {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  transition: color 0.2s;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.theme-lbl i {
  font-size: 0.65rem;
}
.theme-lbl.active {
  color: var(--text-primary);
}
.theme-switch {
  width: 36px;
  height: 20px;
  border-radius: 12px;
  background: var(--border);
  position: relative;
  transition: background 0.25s ease;
  flex-shrink: 0;
}
.theme-toggle.dark-active .theme-switch {
  background: var(--accent);
}
.theme-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform 0.25s ease;
}
.theme-toggle.dark-active .theme-knob {
  transform: translateX(16px);
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 6px;
  border-radius: 8px;
  transition: background var(--transition);
}
.lang-toggle:hover {
  background: var(--bg-secondary);
}
.lang-lbl {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  transition: color 0.2s;
  line-height: 1;
}
.lang-lbl.active {
  color: var(--accent);
}
.lang-switch {
  width: 36px;
  height: 20px;
  border-radius: 12px;
  background: var(--border);
  position: relative;
  transition: background 0.25s ease;
  flex-shrink: 0;
}
.lang-toggle.bn-active .lang-switch {
  background: var(--accent);
}
.lang-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform 0.25s ease;
}
.lang-toggle.bn-active .lang-knob {
  transform: translateX(16px);
}

.lang-toggle:hover {
  background: var(--bg-secondary);
}

/* ----- Hero Section ----- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
  padding-top: 72px;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.05) 0%, transparent 50%),
              radial-gradient(circle at 70% 50%, rgba(255,255,255,0.05) 0%, transparent 50%);
  animation: heroFloat 20s ease-in-out infinite;
}

@keyframes heroFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(20px, -20px) rotate(1deg); }
  66% { transform: translate(-10px, 10px) rotate(-0.5deg); }
}

.hero .container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-content {
  color: #fff;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 24px;
  border: 1px solid rgba(255,255,255,0.2);
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -0.03em;
}

.hero-title .highlight {
  background: linear-gradient(135deg, #fcd34d, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.2rem;
  opacity: 0.9;
  line-height: 1.8;
  margin-bottom: 32px;
  max-width: 520px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-buttons .btn {
  border: 2px solid rgba(255,255,255,0.3);
  color: #fff;
}
.hero-buttons .btn-primary {
  background: #fff;
  color: #1e3a8a;
  border-color: #fff;
}
.hero-buttons .btn-primary:hover {
  background: transparent;
  color: #fff;
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  width: 100%;
  max-width: 400px;
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
  overflow: hidden;
}

.hero-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

/* ====== Card Cover ====== */
.hero-card-cover {
  height: 90px;
  background: var(--gradient-accent);
  position: relative;
  overflow: hidden;
}

.hero-card-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(255,255,255,0.08) 0%, transparent 50%);
}

/* ====== Avatar ====== */
.hero-card-avatar {
  position: absolute;
  bottom: 290px;
  left: 50%;
  transform: translateX(-50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid var(--bg-card);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
  z-index: 2;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: var(--bg-card);
}

.hero-card:hover .hero-card-avatar {
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 4px 20px rgba(37,99,235,0.25);
}

.hero-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ====== Card Body ====== */
.hero-card-body {
  padding: 44px 28px 24px;
  text-align: center;
}

.hero-card-body h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.hero-card-body .hero-card-title-tag {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 18px;
}

/* ====== Stats Row ====== */
.hero-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 18px;
}

.hero-card-stat {
  text-align: center;
  padding: 14px 8px;
  background: var(--bg-secondary);
  transition: background 0.2s ease;
}

.hero-card-stat:hover {
  background: var(--accent-light);
}

.hero-card-stat .num {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  display: block;
  line-height: 1.3;
}

.hero-card-stat .label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ====== Location ====== */
.hero-card-location {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-bottom: 18px;
}

.hero-card-location i {
  color: var(--accent);
  font-size: 0.7rem;
}

/* ====== Actions ====== */
.hero-card-actions {
  display: flex;
  gap: 8px;
}

.hero-card-save-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  font-family: inherit;
}

.hero-card-save-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
  color: #fff;
}

.hero-card-save-btn i {
  font-size: 0.95rem;
}

.hero-card-qr-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.hero-card-qr-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ====== QR Popup ====== */
.hero-card-qr-popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.4);
  align-items: center;
  justify-content: center;
}

.hero-card-qr-popup.open {
  display: flex;
}

.hero-card-qr-popup-inner {
  position: relative;
  background: var(--bg-card);
  padding: 36px;
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  animation: qrFadeIn 0.25s ease;
}

@keyframes qrFadeIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.hero-card-qr-popup-inner img {
  display: block;
  margin: 0 auto 14px;
  border-radius: var(--radius-sm);
}

.hero-card-qr-popup-inner p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
}

.hero-card-qr-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
  padding: 4px;
}

.hero-card-qr-close:hover {
  color: var(--text-primary);
}

/* ----- Featured Posts ----- */
.featured-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 24px;
}

.featured-main {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 420px;
  background: var(--bg-tertiary);
}

.featured-main .post-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  transition: transform 0.5s ease;
}

.featured-main:hover .post-image {
  transform: scale(1.05);
}

.featured-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  color: #fff;
}

.featured-category {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 12px;
  background: var(--accent);
  color: #fff;
}

.featured-main .featured-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.3;
}

.featured-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
  opacity: 0.8;
}

.featured-side {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.featured-side-card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  min-height: 195px;
  position: relative;
  cursor: pointer;
  transition: all var(--transition);
}

.featured-side-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.featured-side-card .post-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0; left: 0;
}

.featured-side-card .featured-overlay {
  padding: 24px;
}

.featured-side-card .featured-title {
  font-size: 1.1rem;
}

/* ----- Category Filter ----- */
.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
  justify-content: center;
}

.filter-btn {
  padding: 8px 22px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ----- Blog Grid ----- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
}

.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
}

.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card);
}

.blog-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 2rem;
}

.blog-card-body {
  padding: 24px;
}

.blog-card-category {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 10px;
  background: var(--accent-light);
  color: var(--accent);
}

.blog-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-excerpt {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 16px;
}

.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.blog-card-date {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.blog-card-read {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

/* ----- About Section ----- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

/* about-image is no longer used — replaced by profile-avatar-section card */

.about-content h2 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 20px;
}

.about-content p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 1.05rem;
  line-height: 1.8;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 32px;
}

.about-stat {
  text-align: center;
  padding: 20px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
}

.about-stat .num {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
}

.about-stat .label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ----- Newsletter ----- */
.newsletter {
  background: var(--gradient-hero);
  padding: 80px 0;
  text-align: center;
  color: #fff;
}

.newsletter h2 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.newsletter p {
  opacity: 0.9;
  margin-bottom: 32px;
  font-size: 1.1rem;
}

.newsletter-form {
  display: flex;
  gap: 12px;
  max-width: 500px;
  margin: 0 auto;
}

.newsletter-form input {
  flex: 1;
  padding: 14px 20px;
  border-radius: 50px;
  border: none;
  font-size: 1rem;
  outline: none;
  font-family: inherit;
}

.newsletter-form .btn {
  background: #f59e0b;
  color: #fff;
  border: none;
}
.newsletter-form .btn:hover {
  background: #d97706;
  transform: translateY(-2px);
}

/* ----- Contact Section ----- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.contact-info h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.contact-info > p {
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
}

.contact-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.contact-item h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.contact-item p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-group textarea {
  min-height: 130px;
  resize: vertical;
}

/* ----- Footer (Improved) ----- */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 0 0 0;
  position: relative;
  margin-top: 80px;
}

.footer-accent {
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #7c3aed, #ec4899, var(--accent));
  background-size: 300% 100%;
  animation: footerGradient 6s ease infinite;
}

@keyframes footerGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.footer .container {
  padding-top: 50px;
  padding-bottom: 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1.2fr 1.3fr;
  gap: 36px;
  margin-bottom: 36px;
}

@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* Brand Column */
.footer-brand .footer-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--gradient-accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 12px;
  text-decoration: none;
}
.footer-brand .footer-logo:hover {
  transform: scale(1.05);
}

.footer-brand h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.7;
  max-width: 340px;
}

/* Social Icons */
.footer-social {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.social-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: all 0.25s ease;
  text-decoration: none;
}

.social-icon:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}

/* Footer Columns */
.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.footer-col h4 i {
  font-size: 0.75rem;
  opacity: 0.7;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col ul li a {
  color: var(--text-secondary);
  font-size: 0.88rem;
  transition: color 0.2s, padding-left 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-col ul li a:hover {
  color: var(--accent);
  padding-left: 3px;
}

.footer-col ul li a .cat-dot-sm {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* Footer Description */
.footer-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 14px;
}

/* Subscribe Form */
.footer-subscribe {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.footer-subscribe input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.footer-subscribe input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.footer-subscribe input::placeholder {
  color: var(--text-muted);
}

.footer-subscribe button {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: none;
  background: var(--gradient-accent);
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.footer-subscribe button:hover {
  opacity: 0.9;
  transform: scale(1.05);
}

.footer-subscribe button:active {
  transform: scale(0.95);
}

/* Stats */
.footer-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-stats span {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.footer-stats span i {
  font-size: 0.7rem;
  opacity: 0.6;
}

/* Bottom Bar */
.footer-bottom {
  padding-top: 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.footer-bottom a {
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-bottom a:hover {
  color: var(--accent);
}

.footer-divider {
  color: var(--border);
  margin: 0 4px;
}

/* Responsive bottom */
@media (max-width: 640px) {
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  .footer-bottom p { justify-content: center; }
  .footer-brand p { max-width: 100%; }
}

/* ----- Single Post Page ----- */
.post-header {
  padding-top: 120px;
  padding-bottom: 60px;
  background: var(--bg-secondary);
}

.post-header .container {
  max-width: 800px;
}

.post-header .featured-category {
  margin-bottom: 16px;
}

.post-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.post-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-content {
  padding: 60px 0;
}

/* ====== POST CONTENT AREA SIZING ====== */
.post-content .container {
  max-width: 1020px;
}

.post-body {
  font-size: 1.15rem;
  line-height: 1.9;
  color: var(--text-secondary);
}

.post-body p {
  margin-bottom: 26px;
}

.post-body h2 {
  font-size: 1.85rem;
  font-weight: 700;
  margin: 44px 0 18px;
  color: var(--text-primary);
}

.post-body h3 {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 34px 0 14px;
  color: var(--text-primary);
}

.post-body blockquote {
  border-left: 4px solid var(--accent);
  padding: 22px 28px;
  margin: 28px 0;
  background: var(--bg-tertiary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  font-size: 1.15rem;
}

.post-body ul, .post-body ol {
  margin-bottom: 26px;
  padding-left: 28px;
}

.post-body li {
  margin-bottom: 10px;
}

.post-body img {
  border-radius: var(--radius);
  margin: 36px 0;
  width: 100%;
}

/* ----- Share Buttons ----- */
.share-section {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.share-section h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.share-buttons {
  display: flex;
  gap: 10px;
}

.share-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 1.1rem;
}

.share-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ----- Comments Placeholder ----- */
.comments-section {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.comments-section h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.comment-placeholder {
  text-align: center;
  padding: 40px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  color: var(--text-muted);
}

.comment-placeholder .icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

/* ----- Search ----- */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(10px);
  z-index: 2000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
}

.search-overlay.active {
  display: flex;
}

.search-modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 90%;
  max-width: 600px;
  box-shadow: var(--shadow-lg);
}

.search-modal input {
  width: 100%;
  padding: 16px 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1.1rem;
  outline: none;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: inherit;
}

.search-modal input:focus {
  border-color: var(--accent);
}

.search-results {
  margin-top: 20px;
  max-height: 400px;
  overflow-y: auto;
}

.search-result-item {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
  border-radius: var(--radius-sm);
}

.search-result-item:hover {
  background: var(--bg-tertiary);
}

.search-result-item h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.search-result-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.search-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--text-primary);
}

/* ----- Scroll To Top ----- */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gradient-accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 15px rgba(37,99,235,0.3);
  z-index: 999;
  transition: all var(--transition);
}

.scroll-top.visible {
  display: flex;
}

.scroll-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(37,99,235,0.4);
}

/* ----- Animations ----- */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* ----- Loading Skeleton ----- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ====== MEGA MENU ====== */
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text-primary);
  flex-shrink: 0;
  z-index: 1001;
}
.brand-icon {
  width: 40px; height: 40px;
  background: var(--gradient-accent);
  color: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.9rem;
}

/* Desktop nav */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links > li {
  position: relative;
}
.nav-links > li > a {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.88rem;
  border-radius: 8px;
  transition: all var(--transition);
  white-space: nowrap;
}
.nav-links > li > a i {
  font-size: 0.75rem;
  opacity: 0.6;
}
.nav-links > li > a:hover,
.nav-links > li > a.active {
  background: var(--accent-light);
  color: var(--accent);
}
.nav-links > li:hover > a {
  background: var(--accent-light);
  color: var(--accent);
}

/* Mega Dropdown */
.mega-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.25s ease;
  z-index: 1000;
  padding: 12px;
}
.nav-links > li:hover .mega-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.mega-dropdown a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: var(--text-secondary);
  border-radius: 8px;
  transition: all var(--transition);
  font-size: 0.88rem;
}
.mega-dropdown a:hover {
  background: var(--accent-light);
  color: var(--accent);
  transform: translateX(4px);
}
.mega-dropdown a i {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--accent);
  flex-shrink: 0;
}

/* Wide Mega Menu (for Books, Gallery etc) */
.mega-wide {
  width: 480px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.mega-wide .mega-featured {
  grid-column: 1 / -1;
  padding: 16px;
  background: var(--gradient-accent);
  border-radius: 8px;
  color: #fff;
  margin-bottom: 4px;
}
.mega-wide .mega-featured h4 { color: #fff; font-size: 1rem; margin-bottom: 4px; }
.mega-wide .mega-featured p { color: rgba(255,255,255,0.8); font-size: 0.8rem; }

/* Center-align specific menus */
.mega-center {
  left: 50%;
  transform: translateX(-50%) translateY(8px);
}
.nav-links > li:hover .mega-center {
  transform: translateX(-50%) translateY(0);
}

/* Right-align */
.mega-right {
  left: auto;
  right: 0;
}

/* Mobile Drawer */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}
.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* Mobile overlay */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 998;
  backdrop-filter: blur(4px);
}
.mobile-overlay.active { display: block; }

/* Mobile drawer panel */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100vh;
  background: var(--bg-primary);
  z-index: 999;
  overflow-y: auto;
  transition: right 0.35s ease;
  padding: 24px;
  padding-top: 90px;
  box-shadow: -4px 0 40px rgba(0,0,0,0.15);
}
.mobile-drawer.open { right: 0; }
.mobile-drawer .drawer-header {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mobile-drawer .drawer-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-primary);
  cursor: pointer;
}
.mobile-drawer .drawer-nav { list-style: none; padding: 0; margin: 0; }
.mobile-drawer .drawer-nav > li { border-bottom: 1px solid var(--border); }
.mobile-drawer .drawer-nav > li > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.05rem;
}
.mobile-drawer .drawer-nav > li > a i { opacity: 0.4; font-size: 0.8rem; }
.mobile-drawer .drawer-sub {
  list-style: none;
  padding: 0 0 12px 16px;
  display: none;
}
.mobile-drawer .drawer-sub.open { display: block; }
.mobile-drawer .drawer-sub li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
}
.mobile-drawer .drawer-sub li a i { width: 20px; color: var(--accent); }

/* ====== TOGGLE PANEL (Right Settings Panel) ====== */
.panel-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  transition: background var(--transition);
}
.panel-toggle-btn:hover {
  background: var(--bg-secondary);
}

/* Toggle overlay */
.toggle-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 999;
  backdrop-filter: blur(4px);
}
.toggle-overlay.active { display: block; }

/* Toggle panel */
.toggle-panel {
  position: fixed;
  top: 0;
  right: -340px;
  width: 320px;
  height: 100%;
  background: var(--bg-primary);
  z-index: 1000;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 24px;
  box-shadow: -4px 0 40px rgba(0,0,0,0.15);
  overflow-y: auto;
}
.toggle-panel.open { right: 0; }

.toggle-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.toggle-panel-header span {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}
.toggle-panel-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-primary);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.toggle-panel-close:hover {
  background: var(--bg-secondary);
}

/* Toggle groups inside panel */
.toggle-group {
  margin-bottom: 28px;
}
.toggle-group-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.toggle-panel .lang-toggle,
.toggle-panel .theme-toggle {
  width: 100%;
  justify-content: center;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
}
.toggle-panel .lang-toggle:hover,
.toggle-panel .theme-toggle:hover {
  background: var(--bg-tertiary);
}
.toggle-panel .lang-lbl,
.toggle-panel .theme-lbl {
  font-size: 0.85rem;
}
.toggle-panel .lang-switch,
.toggle-panel .theme-switch {
  width: 44px;
  height: 24px;
}
.toggle-panel .lang-knob,
.toggle-panel .theme-knob {
  width: 20px;
  height: 20px;
}
.toggle-panel .lang-toggle.bn-active .lang-knob,
.toggle-panel .theme-toggle.dark-active .theme-knob {
  transform: translateX(20px);
}

/* ====== PROFILE PAGE ====== */
.profile-page {
  padding-top: 100px;
  padding-bottom: 80px;
}
.profile-header {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 48px;
  align-items: start;
  margin-bottom: 60px;
}

/* ----- Redesigned Left Profile Card ----- */
.profile-avatar-section {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  position: relative;
  overflow: hidden;
}
.profile-avatar-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #7c3aed 100%);
  opacity: 0.9;
}
.profile-avatar-wrap {
  position: relative;
  z-index: 1;
  display: inline-block;
  margin-top: 20px;
}
.profile-avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  color: #2563eb;
  font-weight: 800;
  box-shadow: 0 4px 16px rgba(37,99,235,0.25);
  border: 4px solid #fff;
  margin: 0 auto;
  overflow: hidden;
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.profile-card-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 16px;
  margin-bottom: 4px;
}
.profile-card-title {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 16px;
}
.profile-badges {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.profile-badge {
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.profile-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  padding: 12px 0;
}
.profile-card-stat {
  text-align: center;
}
.profile-card-stat-num {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
}
.profile-card-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.profile-name {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.profile-title {
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 16px;
}
.profile-bio-text {
  color: var(--text-secondary);
  line-height: 1.8;
  text-align: justify;
  margin-bottom: 24px;
  max-width: 800px;
}
.profile-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.profile-meta-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: 10px;
}
.profile-meta-item i {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 8px;
  font-size: 0.9rem;
}
.profile-meta-item h4 { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 2px; }
.profile-meta-item p { font-size: 0.92rem; font-weight: 500; }

/* Profile tabs */
.profile-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.profile-tab {
  padding: 12px 24px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.92rem;
}
.profile-tab:hover { color: var(--text-primary); }
.profile-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.profile-panel { display: none; }
.profile-panel.active { display: block; }

.timeline {
  position: relative;
  padding-left: 30px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  margin-bottom: 32px;
  padding-left: 20px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -26px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-primary);
}
.timeline-item h4 { font-size: 1.05rem; margin-bottom: 4px; }
.timeline-item .timeline-date {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 6px;
}
.timeline-item p { color: var(--text-secondary); font-size: 0.92rem; }

/* ====== BOOKS / GALLERY / PODCAST PAGES ====== */
.page-hero {
  padding: 120px 0 60px;
  background: var(--bg-secondary);
  text-align: center;
}
.page-hero h1 {
  font-size: 2.6rem;
  font-weight: 800;
  margin-bottom: 12px;
}
.page-hero p {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.05rem;
}

/* ====== STATS GRID (Explore Topics on homepage) ====== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  max-width: 900px;
  margin: 0 auto;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  border-color: var(--accent);
}

.stat-card i {
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0 0 2px;
  line-height: 1.2;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin: 0;
  font-weight: 500;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.book-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all var(--transition);
}
.book-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.book-cover {
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #fff;
}
.book-info { padding: 20px; }
.book-info h3 { font-size: 1.1rem; margin-bottom: 6px; }
.book-info p { color: var(--text-secondary); font-size: 0.88rem; margin-bottom: 12px; }
.book-info .btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}
.book-info .btn-sm:hover { background: var(--accent-hover); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16/10;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.gallery-item:hover { transform: scale(1.02); box-shadow: var(--shadow-lg); }
.gallery-item .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  opacity: 0;
  transition: opacity var(--transition);
}
.gallery-item:hover .overlay { opacity: 1; }
.gallery-item .overlay h4 { color: #fff; font-size: 1rem; }
.gallery-item .overlay p { color: rgba(255,255,255,0.7); font-size: 0.82rem; }

.podcast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}
.podcast-card {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all var(--transition);
}
.podcast-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.podcast-thumb {
  width: 100px;
  height: 100px;
  border-radius: 10px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--accent);
  flex-shrink: 0;
}
.podcast-info { flex: 1; }
.podcast-info h4 { font-size: 1rem; margin-bottom: 4px; }
.podcast-info p { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 8px; }
.podcast-play {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--accent);
  color: #fff;
  border-radius: 20px;
  font-size: 0.8rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}
.podcast-play:hover { background: var(--accent-hover); }

/* Placeholder page content */
.placeholder-content {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.placeholder-content i { font-size: 4rem; margin-bottom: 20px; display: block; }
.placeholder-content h3 { font-size: 1.5rem; color: var(--text-primary); margin-bottom: 12px; }
.placeholder-content p { max-width: 500px; margin: 0 auto; }

/* Profile social links */
.profile-social {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 18px;
}
.profile-social a {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: 8px;
  color: var(--text-secondary);
  transition: all var(--transition);
  font-size: 1rem;
}
.profile-social a:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}

/* Save contact button row */
.profile-save-row {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.profile-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
  font-family: inherit;
  border: none;
  cursor: pointer;
  flex: 1;
  justify-content: center;
}
.profile-save-btn:hover {
  background: var(--accent-hover, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}
.profile-qr-btn {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}
.profile-qr-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ============================================
   POST ENHANCEMENTS — Reading Progress, TOC,
   Author Box, Tags, Related, Share, etc.
   ============================================ */

/* ----- Reading Progress Bar ----- */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #7c3aed, var(--accent));
  z-index: 1002;
  width: 0%;
  transition: width 0.1s linear;
}

/* ----- Table of Contents — Desktop ----- */
.post-toc-desktop {
  position: sticky;
  top: 100px;
  max-height: 70vh;
  overflow-y: auto;
  border-left: 3px solid var(--accent);
  padding: 16px 0 16px 20px;
  font-size: 0.85rem;
}
.post-toc-desktop a {
  display: block;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 4px 0;
  transition: color var(--transition);
}
.post-toc-desktop a:hover {
  color: var(--accent);
}
.post-toc-desktop a.active {
  color: var(--accent);
  font-weight: 600;
}
/* ----- Table of Contents — Mobile ----- */
.post-toc-mobile {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 24px;
  display: none;
}
@media (max-width: 1023px) {
  .post-toc-mobile { display: block; }
}

/* ----- Author Box ----- */
.author-box {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 32px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
  background: var(--bg-card);
  border-radius: var(--radius);
}
.author-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  flex-shrink: 0;
}

/* ----- Tags ----- */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 32px 0;
}
.post-tag {
  padding: 6px 16px;
  border-radius: 20px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: opacity var(--transition);
}
.post-tag:hover {
  opacity: 0.8;
}

/* ----- Related Articles ----- */
.related-posts {
  margin-top: 48px;
  border-top: 1px solid var(--border);
  padding-top: 32px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.related-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}
.related-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ----- Prev / Next Navigation ----- */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.post-nav-link {
  padding: 16px 20px;
  border-radius: var(--radius);
  background: var(--bg-card);
  transition: background var(--transition);
}
.post-nav-link:hover {
  background: var(--accent-light);
}
.post-nav-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.post-nav-title {
  font-weight: 600;
}

/* ----- Drop Cap ----- */
.post-body > .en-text > p:first-of-type::first-letter {
  float: left;
  font-size: 4rem;
  font-weight: 800;
  line-height: 0.8;
  padding-right: 12px;
  color: var(--accent);
}

/* ----- Featured Image ----- */
.post-featured-image {
  height: 400px;
  border-radius: 16px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  color: rgba(255, 255, 255, 0.3);
}

/* ----- Share Button Count ----- */
.share-btn .count {
  font-size: 0.7rem;
  display: block;
  opacity: 0.7;
}

/* ----- Post Content Layout ----- */
/* The flex layout is defined in post.html inline styles (.post-layout).
   This just ensures the container is wide enough. */
.post-content .container {
  max-width: 1020px;
}
@media (max-width: 1023px) {
  .post-content .container {
    padding: 0 16px;
  }
}

/* ----- Search ----- */
.search-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 4px 16px;
  border: 2px solid var(--border);
}
.search-input-wrap:focus-within {
  border-color: var(--accent);
}
.search-input-icon {
  color: var(--text-muted);
  margin-right: 12px;
  font-size: 1.1rem;
}
.search-hint {
  padding: 2px 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: inherit;
}
.search-input-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1rem;
  outline: none;
  color: var(--text-primary);
}
.search-filters {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search-filter-group {
  flex: 1;
  min-width: 140px;
}
.search-filter-group label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: block;
}
.search-filter-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
}
.search-filter-group select:focus {
  border-color: var(--accent);
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition);
}
.search-result-item:hover {
  background: var(--bg-secondary);
}
.search-result-item .category-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  color: white;
}
.search-result-item h4 {
  flex: 1;
  font-size: 0.95rem;
}
.search-result-item p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ----- Responsive ----- */
@media (max-width: 1024px) {
  .hero .container {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-desc { margin: 0 auto 32px; }
  .hero-buttons { justify-content: center; }
  .hero-visual { display: none; }
  .hero-title { font-size: 2.8rem; }
  .featured-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .related-grid { grid-template-columns: 1fr 1fr; }
}

/* ====== RESPONSIVE: ≤ 900px — switch to mobile drawer nav ====== */
@media (max-width: 900px) {
  /* Hide desktop nav links, show hamburger */
  .nav-links { display: none; }
  .nav-toggle { display: flex; }

  /* Hide mega menus in desktop nav (they're in drawer) */
  .mega-dropdown { display: none; }

  /* Mobile drawer adjustments */
  .mobile-drawer { width: 300px; }
  .mobile-drawer .drawer-nav {
    padding: 80px 0 24px;
  }
  .mobile-drawer .drawer-nav > li > a {
    padding: 14px 20px;
    font-size: 1rem;
  }
  .mobile-drawer .drawer-sub {
    padding: 0 0 8px 20px;
  }
  .mobile-drawer .drawer-sub li a {
    padding: 8px 16px;
    font-size: 0.9rem;
  }

  /* Hero */
  .hero-title { font-size: 2.4rem; }
  .hero { min-height: auto; padding: 120px 0 80px; }

  /* Sections */
  .section { padding: 50px 0; }
  .container { padding: 0 20px; }
}

@media (max-width: 768px) {
  /* Remove the old conflicting nav-links sliding panel */
  .nav-links { display: none; }
  .nav-links.open { transform: none; }

  .hero-title { font-size: 2rem; }
  .hero-desc { font-size: 1rem; }
  .hero-buttons .btn { font-size: 0.9rem; padding: 12px 20px; }

  .section-title { font-size: 1.6rem; }
  .section-subtitle { font-size: 0.95rem; }

  .blog-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .post-title { font-size: 1.6rem; }

  /* Blog cards */
  .blog-card { margin: 0; }
  .blog-card-image { height: 180px; }

  /* Featured */
  .featured-grid { gap: 16px; }
  .featured-main { min-height: 240px; }
  .featured-side-card { min-height: 180px; }

  /* Posts */
  .post-body { font-size: 1.05rem; line-height: 1.8; }
  .post-body h2 { font-size: 1.5rem; }
  .author-bio-box { flex-direction: column; align-items: center; text-align: center; }
  .related-grid { grid-template-columns: 1fr; }

  /* Profile page */
  .profile-header { grid-template-columns: 1fr; gap: 32px; text-align: center; }
  .profile-avatar { width: 140px; height: 140px; }
  .profile-avatar-section { padding: 24px 16px; }
  .profile-card-name { font-size: 1.15rem; }
  .profile-name { font-size: 1.8rem; }
  .profile-title { font-size: 1rem; }
  .profile-bio-text { text-align: left; max-width: 100%; }
  .profile-meta { grid-template-columns: 1fr; }
  .profile-tabs { justify-content: center; gap: 0; }
  .profile-tab { padding: 10px 14px; font-size: 0.85rem; }
  .timeline { padding-left: 24px; }
  .timeline-item { padding-left: 16px; }

  /* Newsletter */
  .newsletter-form { flex-direction: column; }
  .newsletter-form input { width: 100%; }
  .newsletter-form .btn { width: 100%; }

  /* Footer */
  .footer-bottom { flex-direction: column; text-align: center; gap: 8px; }

  /* Search */
  .search-modal { width: 95%; padding: 24px; }
  .search-filters { flex-direction: column; gap: 8px; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.6rem; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .hero-buttons .btn { width: 100%; max-width: 280px; }
  .container { padding: 0 14px; }
  .featured-overlay { padding: 16px; }
  .featured-main .featured-title { font-size: 1.2rem; }
  .featured-side-card .featured-title { font-size: 1rem; }
  .post-header { padding: 40px 0 20px; }
  .post-meta { flex-wrap: wrap; gap: 8px; }
  .post-body { font-size: 1rem; }
  .post-tags { gap: 6px; }
  .post-tag { font-size: 0.75rem; padding: 4px 10px; }
  .share-btn { padding: 6px 10px; font-size: 0.78rem; }
  .blog-card-image { height: 160px; }
  .blog-card-body { padding: 14px; }
  .category-filter { gap: 6px; }
  .filter-btn { padding: 8px 14px; font-size: 0.82rem; }

  /* Profile page - small mobile */
  .profile-avatar { width: 120px; height: 120px; }
  .profile-avatar-section { padding: 20px 12px; }
  .profile-card-name { font-size: 1rem; }
  .profile-card-title { font-size: 0.8rem; }
  .profile-card-stats { padding: 8px 0; }
  .profile-card-stat-num { font-size: 0.95rem; }
  .profile-name { font-size: 1.4rem; }
  .profile-tab { padding: 8px 10px; font-size: 0.78rem; }
  .profile-meta-item { padding: 10px 12px; }
  .profile-badge { font-size: 0.72rem; padding: 4px 10px; }
  .profile-page { padding-top: 80px; padding-bottom: 40px; }

  /* Mobile drawer full width on very small screens */
  .mobile-drawer { width: 280px; }
}

/* ----- Print ----- */
@media print {
  .navbar, .scroll-top, .newsletter, .share-section { display: none; }
  body { color: #000; background: #fff; }
}

/* ============================================
   SEARCH OVERLAY — Global (all pages)
   ============================================ */
.search-toggle-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.05rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.search-toggle-btn:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.search-toggle-btn .search-kbd {
  display: none;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 0.65rem;
  font-family: inherit;
  font-weight: 600;
}
@media (min-width: 768px) {
  .search-toggle-btn .search-kbd { display: inline; }
}
.search-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.55);
  z-index: 10001;
  align-items: flex-start;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding-top: 80px;
  animation: searchFadeIn 0.2s ease;
}
.search-overlay.open { display: flex; }
@keyframes searchFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes searchSlideDown {
  from { opacity: 0; transform: translateY(-20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.search-overlay-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 92%;
  max-width: 580px;
  box-shadow: 0 25px 80px rgba(0,0,0,0.35);
  overflow: hidden;
  animation: searchSlideDown 0.25s ease;
}
.search-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.search-overlay-header h3 {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.search-overlay-header h3 i { color: var(--accent); font-size: 0.9rem; }
.search-overlay-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}
.search-overlay-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}
.search-overlay-body {
  padding: 20px 24px;
}
.search-overlay-body .search-input-wrap {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.search-overlay-body .search-input-wrap input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 1.05rem;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.search-overlay-body .search-input-wrap input:focus {
  border-color: var(--accent);
}
.search-overlay-body .search-input-wrap input::placeholder {
  color: var(--text-muted);
}
.search-overlay-body .search-input-wrap select {
  padding: 8px 12px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  min-width: 100px;
}
.search-overlay-body .search-input-wrap select:focus {
  border-color: var(--accent);
}
.search-overlay-hints {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.search-overlay-hints .hint-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: 4px;
}
.search-overlay-hints .hint-label i { font-size: 0.7rem; }
.search-overlay-hints .category-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.76rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.search-overlay-hints .category-chip:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}
.search-overlay-hints .category-chip i { font-size: 0.6rem; }
.search-overlay-footer {
  display: flex;
  gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  justify-content: space-between;
  align-items: center;
}
.search-overlay-footer .footer-left {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-overlay-footer .footer-left kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  font-size: 0.7rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--text-muted);
}
.search-overlay-footer .footer-right {
  display: flex;
  gap: 8px;
}
.search-overlay-btn {
  padding: 10px 22px;
  border-radius: 8px;
  border: none;
  background: var(--gradient-accent);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.search-overlay-btn:hover { opacity: 0.9; }
.search-overlay-btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}
.search-overlay-btn-secondary:hover { opacity: 0.8; }

/* ── Live Search Results (Overlay) ── */
.live-search-results {
  margin-top: 14px;
  max-height: 400px;
  overflow-y: auto;
  display: none;
}
.live-search-results.has-results {
  display: block;
  animation: searchSlideDown 0.2s ease;
}
.live-search-status {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.live-search-status i { margin-right: 6px; }
.live-search-empty {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.live-search-empty i {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
  opacity: 0.4;
}
.live-search-header {
  padding: 6px 4px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.live-search-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.live-search-item {
  display: flex;
  gap: 14px;
  padding: 12px 8px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
}
.live-search-item:last-child { border-bottom: none; }
.live-search-item:hover {
  background: var(--bg-secondary);
}
.lsr-img {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-tertiary);
}
.lsr-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.2rem;
}
.lsr-body {
  flex: 1;
  min-width: 0;
}
.lsr-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lsr-excerpt {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.lsr-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.lsr-cat {
  font-weight: 600;
}
.lsr-type i {
  margin-right: 3px;
  font-size: 0.7rem;
}
.lsr-date {
  color: var(--text-muted);
}

/* ── Inline Live Search (Articles Page) ── */
.inline-live-results {
  margin-top: 10px;
  display: none;
}
.inline-live-results.has-results { display: block; }
.inline-live-results .live-search-item {
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}
.inline-live-results .live-search-item:hover {
  background: var(--bg-secondary);
  border-color: var(--accent);
}
.inline-live-results .live-search-empty {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
}

@media (max-width: 640px) {
  .search-overlay { padding-top: 60px; }
  .search-overlay-body .search-input-wrap { flex-direction: column; }
  .search-overlay-body .search-input-wrap select { width: 100%; }
  .search-overlay-footer { flex-direction: column; gap: 8px; align-items: stretch; text-align: center; }
  .search-overlay-footer .footer-left { justify-content: center; }
  .search-overlay-footer .footer-right { justify-content: center; }
}

/* ----- Floating Chat Button & Popup ----- */
.chat-fab {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--hero-gradient, linear-gradient(135deg, #2563eb, #1d4ed8));
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(37,99,235,0.35);
  cursor: pointer;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}
.chat-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(37,99,235,0.5);
}
.chat-fab:active { transform: scale(0.95); }
.chat-fab .chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  display: none;
}

.chat-popup {
  position: fixed;
  bottom: 90px;
  left: 24px;
  z-index: 9998;
  width: 340px;
  max-height: 460px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: chatSlideUp 0.3s ease;
}
.chat-popup.open { display: flex; }
@keyframes chatSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.chat-popup-header {
  padding: 14px 16px;
  background: var(--hero-gradient, linear-gradient(135deg, #2563eb, #1d4ed8));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 14px;
}
.chat-popup-header .chat-close-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.chat-popup-header .chat-close-btn:hover { color: #fff; }
.chat-popup-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}
.chat-popup-body .chat-form-group { margin-bottom: 10px; }
.chat-popup-body .chat-form-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 4px;
}
.chat-popup-body .chat-form-group input,
.chat-popup-body .chat-form-group textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-color, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  color: var(--text-color, #0f172a);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.chat-popup-body .chat-form-group input:focus,
.chat-popup-body .chat-form-group textarea:focus {
  border-color: var(--accent, #2563eb);
}
.chat-popup-body .chat-form-group textarea {
  min-height: 64px;
  resize: vertical;
  font-size: 13px;
}
.chat-popup-body .chat-send-btn {
  width: 100%;
  padding: 10px;
  background: var(--hero-gradient, linear-gradient(135deg, #2563eb, #1d4ed8));
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.chat-popup-body .chat-send-btn:hover { opacity: 0.9; }
.chat-popup-body .chat-send-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.chat-popup-body .chat-error {
  color: #ef4444;
  font-size: 12px;
  margin-bottom: 8px;
  display: none;
}
.chat-popup-body .chat-success {
  text-align: center;
  padding: 20px 10px;
  display: none;
}
.chat-popup-body .chat-success i {
  font-size: 36px;
  color: #22c55e;
  margin-bottom: 8px;
}
.chat-popup-body .chat-success h4 {
  font-size: 15px;
  margin-bottom: 4px;
  color: var(--text-color, #0f172a);
}
.chat-popup-body .chat-success p {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  margin: 0;
}
@media (max-width: 480px) {
  .chat-popup { width: calc(100% - 32px); left: 16px; right: 16px; bottom: 80px; }
  .chat-fab { bottom: 16px; left: 16px; width: 50px; height: 50px; font-size: 20px; }
}
