/* ===================================================================
   FREELANCE BD HUB — MAIN STYLESHEET
   Design Language: Modern glassmorphic Bengali + English Publishing
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');
@import './themes.css';

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.65;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

img, svg, video, iframe {
  display: block;
  max-width: 100%;
}

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

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* --- Container & Layout Helpers --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.main-content {
  flex: 1 0 auto;
}

/* --- Badges & Chips --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-emerald {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.badge-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  min-height: 44px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  user-select: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--grad-primary);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-muted);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  min-height: 36px;
  font-size: 0.85rem;
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* --- Header & Navigation --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
  background-color: rgba(248, 250, 252, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .site-header {
  background-color: rgba(11, 17, 32, 0.85);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: clamp(0.4rem, 2vw, 0.75rem);
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.header-brand > div {
  min-width: 0;
  overflow: hidden;
}

.brand-logo {
  width: clamp(30px, 8vw, 40px);
  height: clamp(30px, 8vw, 40px);
  border-radius: 10px;
  flex-shrink: 0;
}

.brand-title {
  display: block;
  font-size: clamp(0.85rem, 3.6vw, 1.25rem);
  font-weight: 700;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--text-primary); /* fallback */
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.brand-tagline-mini {
  display: block;
  font-size: clamp(0.6rem, 1.8vw, 0.7rem);
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 1.75rem;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding: 0.25rem 0;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--grad-primary);
  border-radius: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.theme-toggle-btn, .search-toggle-btn, .mobile-menu-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
}

.theme-toggle-btn:hover, .search-toggle-btn:hover, .mobile-menu-btn:hover {
  background: var(--bg-muted);
  color: var(--primary);
  border-color: var(--primary);
}

.lang-toggle-btn {
  height: 42px;
  padding: 0 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.lang-toggle-btn:hover {
  background: var(--bg-muted);
  border-color: var(--primary);
}

.lang-pill {
  padding: 2px 6px;
  border-radius: 4px;
  transition: var(--transition);
  color: #0f172a;
  font-weight: 800;
  opacity: 1;
}

html[data-theme="dark"] .lang-pill {
  color: #f1f5f9;
}

.lang-pill.active {
  background: var(--primary);
  color: #ffffff !important;
}

html[data-theme="dark"] .lang-pill.active {
  color: #0b1220 !important;
  font-weight: 800;
  opacity: 1;
}

.lang-divider {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
  opacity: 1;
}

html[data-theme="dark"] .lang-divider {
  color: #cbd5e1;
}

/* Mobile Nav Drawer */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(320px, 85vw);
  height: 100vh;
  background: var(--bg-surface);
  z-index: 1200;
  padding: 1.5rem;
  box-shadow: var(--shadow-xl);
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.mobile-drawer.open {
  right: 0;
}

.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  color: var(--text-secondary);
}

.drawer-link.admin-nav-item {
  color: var(--text-primary) !important;
  font-weight: 700;
  background: var(--primary-light);
}

.drawer-link:hover, .drawer-link.active {
  background: var(--primary-light);
  color: var(--primary);
}

/* Search Modal Overlay */
.search-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5rem 1.25rem 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.search-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.search-modal-box {
  width: 100%;
  max-width: 600px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: modalSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlide {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.search-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.search-results-list {
  max-height: 400px;
  overflow-y: auto;
  padding: 0.5rem;
}

.search-result-item {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

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

.search-result-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.search-result-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --- Hero Section --- */
.hero-section {
  position: relative;
  padding: 3.5rem 0 2.5rem;
  background: var(--grad-hero);
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
}

.hero-glow-1, .hero-glow-2 {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.35;
}

.hero-glow-1 {
  width: 320px;
  height: 320px;
  background: #1e3a8a;
  top: -100px;
  right: -50px;
}

.hero-glow-2 {
  width: 280px;
  height: 280px;
  background: #0284c7;
  bottom: -100px;
  left: -50px;
}

.hero-content {
  position: relative;
  text-align: center;
  max-width: 820px;
  margin: 0 auto;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.hero-title .gradient-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--primary); /* fallback */
}

.hero-subtitle-bn {
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* --- Section Headers --- */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-title-icon {
  color: var(--primary);
}

.section-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.section-link:hover {
  text-decoration: underline;
}

/* --- Article Cards Grid --- */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.article-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-glow);
}

.card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-muted);
  overflow: hidden;
}

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

.article-card:hover .card-img {
  transform: scale(1.04);
}

.card-category-chip {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
}

.card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text-primary);
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.author-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.75rem;
}

.card-meta-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* --- Featured Articles (Hero 3 cards) --- */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.featured-card {
  border: 1px solid rgba(37, 99, 235, 0.25);
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.12);
}

/* --- Categories Grid & Chips --- */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 3rem;
}

.category-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.category-chip:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  background: var(--primary-light);
}

.cat-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.cat-info {
  overflow: hidden;
}

.cat-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --- Trending Tags --- */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 3rem;
}

.tag-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
}

.tag-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* --- Advertisements Container --- */
.fbh-ad-container {
  width: 100%;
  max-width: 970px;
  margin: 1.75rem auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px dashed var(--border-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.fbh-ad-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  padding: 0.25rem 0.5rem;
  align-self: flex-start;
  opacity: 0.75;
}

.fbh-ad-body {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
}

@media (min-width: 768px) {
  .fbh-ad-body {
    min-height: 120px;
  }
}

/* Auto-collapse empty ad slots */
.fbh-ad-container.collapsed,
.fbh-ad-container:empty {
  display: none !important;
}

/* Sticky mobile ad */
.fbh-sticky-mobile-ad {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 990;
  background: var(--bg-surface);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
  margin: 0;
  max-width: 100%;
  border-radius: 0;
  border-top: 1px solid var(--border-strong);
}

/* --- Newsletter Box --- */
.newsletter-card {
  background: var(--grad-primary);
  color: #ffffff;
  border-radius: var(--radius-xl);
  padding: 3rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin: 3.5rem 0;
  box-shadow: 0 10px 25px var(--primary-glow);
}

.newsletter-title {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.newsletter-desc {
  font-size: 1rem;
  opacity: 0.9;
  max-width: 520px;
  margin: 0 auto 1.75rem;
}

.newsletter-form {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  max-width: 480px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.newsletter-input {
  flex: 1;
  min-width: 240px;
  min-height: 46px;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a; /* always dark text on white input field */
  outline: none;
}

[data-theme="dark"] .newsletter-input {
  background: var(--bg-input);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

[data-theme="dark"] .newsletter-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.newsletter-input:focus {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* --- Article Details Page (article.html) --- */
.article-header-wrap {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2rem;
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.breadcrumb-separator {
  opacity: 0.5;
}

.article-page-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.article-short-desc {
  font-size: 1.15rem;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.article-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.article-meta-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.article-featured-image-box {
  width: 100%;
  max-height: 520px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 1.5rem 0 2rem;
  box-shadow: var(--shadow-md);
  background: var(--bg-muted);
}

.article-featured-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Auto Table of Contents */
.toc-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1.5rem 0 2rem;
}

.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  user-select: none;
}

.toc-list {
  list-style: none;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toc-list.collapsed {
  display: none;
}

.toc-link {
  color: var(--text-secondary);
  font-size: 0.95rem;
  transition: var(--transition);
}

.toc-link:hover {
  color: var(--primary);
  padding-left: 4px;
}

.toc-h3 {
  padding-left: 1.25rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Article Renderer Iframe Host */
.article-render-container {
  width: 100%;
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  min-height: 250px;
}

.article-sandbox-frame {
  width: 100%;
  border: none;
  min-height: 300px;
  background: transparent;
  transition: height 0.15s ease;
}

/* Share Bar */
.share-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 0;
  margin: 2rem 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.share-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-right: 0.5rem;
}

.btn-share {
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #ffffff !important;
  text-decoration: none;
}

.btn-share span {
  color: #ffffff !important;
}

.btn-facebook { background: #1877f2; }
.btn-whatsapp { background: #128c7e; }
.btn-copy { background: #334155; color: #ffffff !important; }

/* Prev/Next Navigation */
.prev-next-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 2rem 0;
}

@media (min-width: 640px) {
  .prev-next-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.prev-next-card {
  padding: 1rem 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.prev-next-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.prev-next-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.prev-next-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Comments Section */
.comments-section {
  margin: 3rem 0;
  padding: 2rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.comment-item {
  padding: 1.25rem;
  border-radius: var(--radius-md);
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
}

.comment-author-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.comment-author-name {
  font-weight: 700;
  color: var(--text-primary);
}

.comment-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.comment-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-line;
}

/* --- Footer --- */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.footer-col p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--primary);
  padding-left: 4px;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 1rem;
}

/* --- Toast System --- */
#fbh-toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
  max-width: 380px;
  width: calc(100% - 3rem);
}

.fbh-toast {
  pointer-events: auto;
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.92rem;
  color: var(--text-primary);
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.fbh-toast.success { border-left: 4px solid #10b981; }
.fbh-toast.error { border-left: 4px solid #ef4444; }
.fbh-toast.info { border-left: 4px solid #0284c7; }
.fbh-toast.warning { border-left: 4px solid #f59e0b; }

@keyframes toastIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* --- Skeleton Loaders & Empty States --- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-muted) 25%, var(--border-subtle) 50%, var(--bg-muted) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

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

.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.empty-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

/* ══════════════════════════════════════════════════════════════════
   ARTICLE BODY — Direct render typography
   Used when article has no custom JavaScript. Mirrors the sandbox
   typography so articles look identical in both render modes.
   Scoped to .article-body to avoid affecting site chrome.
   ══════════════════════════════════════════════════════════════════ */

.article-body {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--text-secondary);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.35;
  margin-top: 1.8rem;
  margin-bottom: 0.8rem;
  scroll-margin-top: 90px;
}

.article-body h1 { font-size: 2rem; }
.article-body h2 {
  font-size: 1.6rem;
  border-bottom: 2px solid rgba(99, 102, 241, 0.2);
  padding-bottom: 0.35rem;
}
.article-body h3 { font-size: 1.3rem; }
.article-body h4 { font-size: 1.15rem; }

.article-body p { margin-bottom: 1.25rem; }
.article-body p:first-of-type { margin-top: 0; }

.article-body a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: var(--transition);
}
.article-body a:hover { color: var(--primary-hover); }

.article-body strong, .article-body b { font-weight: 700; color: var(--text-primary); }
.article-body em, .article-body i { font-style: italic; }

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 1.5rem auto;
  display: block;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.article-body figure { margin: 1.5rem 0; }
.article-body figure img { margin-bottom: 0.5rem; }
.article-body figcaption {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.4rem;
}

.article-body blockquote {
  border-left: 4px solid var(--primary);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: rgba(99, 102, 241, 0.06);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-primary);
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.25rem 1.75rem;
  padding-left: 0;
}
.article-body li { margin-bottom: 0.4rem; }

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  border-radius: 10px;
  overflow: hidden;
}
.article-body th,
.article-body td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-subtle);
  text-align: left;
}
.article-body th {
  background: var(--bg-muted);
  font-weight: 700;
  color: var(--text-primary);
}

.article-body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.2rem 0.4rem;
  background: var(--bg-muted);
  color: #be123c;
  border-radius: 4px;
}

.article-body pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.25rem;
  border-radius: 10px;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
}
.article-body pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.article-body hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
  margin: 2rem 0;
}

.article-body details {
  margin: 1.25rem 0;
  padding: 0.75rem 1rem;
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}
.article-body summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--text-primary);
}
.article-body details[open] summary { margin-bottom: 0.75rem; }

/* Dark mode adjustments */
[data-theme="dark"] .article-body h2 { border-bottom-color: rgba(56, 189, 248, 0.25); }
[data-theme="dark"] .article-body code { color: #fbbf24; }

/* Mobile tweaks */
@media (max-width: 640px) {
  .article-body { font-size: 1rem; }
  .article-body h1 { font-size: 1.75rem; }
  .article-body h2 { font-size: 1.4rem; }
  .article-body h3 { font-size: 1.15rem; }
  .article-body pre { font-size: 0.82rem; padding: 1rem; }
  .article-body table { font-size: 0.88rem; }
  .article-body th, .article-body td { padding: 0.6rem 0.75rem; }
}

/* Admin nav — readable when visible (logged-in) */
.admin-nav-item,
a.admin-nav-item,
.drawer-link.admin-nav-item {
  color: var(--text-primary) !important;
  font-weight: 700 !important;
}
.nav-link.admin-nav-item {
  color: var(--primary) !important;
}