/* AiWorksBD v3 — Prothom Alo inspired layout */
:root {
  --bg: #f5f5f5;
  --bg-surface: rgba(255, 255, 255, 0.75);
  --bg-elevated: rgba(255, 255, 255, 0.85);
  --bg-hover: rgba(240, 240, 240, 0.8);
  --border: rgba(200, 16, 46, 0.1);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-blur: 20px;
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  --text: #1a1a1a;
  --text-secondary: #555;
  --text-muted: #888;
  --accent: #c8102e;
  --accent-dark: #a00d24;
  --accent-light: #e63357;
  --link: #0066cc;
  --success: #00875a;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.25s ease;
  --font: 'Inter', 'Noto Sans Bengali', -apple-system, sans-serif;
  --max-width: 1200px;
}

/* Dark theme */
[data-theme="dark"] {
  --bg: #0a0a1a;
  --bg-surface: rgba(30, 30, 50, 0.6);
  --bg-elevated: rgba(40, 40, 60, 0.7);
  --bg-hover: rgba(50, 50, 70, 0.8);
  --border: rgba(200, 16, 46, 0.2);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --text: #e8e8e8;
  --text-secondary: #aaa;
  --text-muted: #777;
  --link: #4dabf7;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: linear-gradient(135deg, #f5f5f5 0%, #fff5f6 50%, #f5f5f5 100%); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; min-height: 100vh; }
[data-theme="dark"] body { background: linear-gradient(135deg, #0a0a1a 0%, #1a0a15 50%, #0a0a1a 100%); }
a { color: var(--link); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }

/* ===== HEADER + FOOTER (see header-footer.css) ===== */
/* All header, footer, nav, mobile styles are in header-footer.css */
.top-bar {
  background: var(--accent);
  color: white;
  font-size: 11px;
  padding: 5px 0;
}
.top-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.top-bar a { color: white; opacity: 0.9; }
.top-bar a:hover { opacity: 1; }
.top-bar-date { opacity: 0.85; }

/* ===== HEADER ===== */
.header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Logo — left */
.logo { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.logo img { height: auto; width: 160px; max-width: 160px; }

/* Nav — center */
.header-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; align-items: center; }
.nav-row { display: flex; gap: 0; justify-content: center; }
.nav-row .nav-item {
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: var(--transition);
  border-radius: 4px;
}
.nav-row .nav-item:hover { color: var(--accent); background: var(--bg-hover); }
.nav-row .nav-item.active { color: var(--accent); }

/* Tools — right */
.header-tools { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; flex-shrink: 0; }
.tools-row { display: flex; align-items: center; gap: 6px; }
.tools-row .tagline { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* Search */
.search-wrap { position: relative; }
.search-input {
  width: 140px; height: 30px;
  padding: 0 10px 0 28px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 15px; color: var(--text); font-size: 12px; outline: none;
  transition: border-color 0.2s ease;
  max-width: 100%;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text-muted); }
.search-wrap svg { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); width: 12px; height: 12px; color: var(--text-muted); pointer-events: none; }

/* Icon buttons */
.icon-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Countdown */
.countdown {
  font-size: 11px; font-weight: 600; color: var(--text-secondary);
  padding: 3px 8px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; white-space: nowrap; display: flex; align-items: center; gap: 3px;
}
.countdown .pulse { width: 5px; height: 5px; background: var(--success); border-radius: 50%; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Mobile toggle */
.mobile-toggle {
  display: none;
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  color: var(--text); font-size: 20px;
  cursor: pointer; align-items: center; justify-content: center;
}
.nav-overlay {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4); z-index: 998;
}
.nav-overlay.show { display: block; }
.nav-mobile {
  position: fixed; top: 0; right: -280px; bottom: 0;
  width: 260px; background: var(--bg-surface);
  z-index: 999; flex-direction: column;
  padding: 16px 0; gap: 0; overflow-y: auto;
  transition: right 0.3s ease;
  box-shadow: -4px 0 20px rgba(0,0,0,0.2);
  display: none;
}
.nav-mobile.show { right: 0; display: flex; }
.nav-mobile .nav-item { padding: 14px 20px; border-bottom: 1px solid var(--border); border-radius: 0; }
.nav-mobile .nav-item.active { border-bottom: 1px solid var(--border); border-left: 3px solid var(--accent); }

/* ===== TICKER ===== */
.ticker {
  background: var(--bg-surface);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  height: 34px; overflow: hidden;
  display: flex; align-items: center;
}
.ticker-badge {
  background: var(--accent); color: white;
  padding: 5px 12px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  height: 100%; display: flex; align-items: center;
  flex-shrink: 0; z-index: 2;
}
.ticker-track { display: flex; white-space: nowrap; animation: scroll 40s linear infinite; }
.ticker-track a { color: var(--text-secondary); font-size: 12px; margin-right: 28px; }
.ticker-track a:hover { color: var(--accent); }
@keyframes scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ===== LAYOUT ===== */
.container { max-width: var(--max-width); margin: 0 auto; padding: 20px 16px; }

/* Ad slot */
.ad-slot {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); min-height: 90px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 12px; text-align: center;
  margin-bottom: 20px;
}
.ad-slot::after { content: 'Advertisement'; }

/* ===== HOMEPAGE GRID ===== */
.hero-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.hero-main {
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  position: relative; border-radius: var(--radius); overflow: hidden;
  display: block; transition: var(--transition);
}
.hero-main:hover { box-shadow: var(--shadow-md); }
.hero-main img { width: 100%; height: 400px; object-fit: cover; display: block; }
.hero-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  padding: 24px 20px 16px;
}
.hero-overlay .cat { display: inline-block; padding: 3px 10px; background: var(--accent); color: white; font-size: 11px; font-weight: 600; border-radius: 3px; margin-bottom: 8px; }
.hero-overlay h2 { color: white; font-size: 22px; font-weight: 700; line-height: 1.3; }
.hero-overlay .meta { color: rgba(255,255,255,0.7); font-size: 12px; margin-top: 6px; }

.hero-side { display: flex; flex-direction: column; gap: 12px; }
.hero-side-item {
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  display: flex; gap: 10px; background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px; transition: var(--transition);
}
.hero-side-item:hover { box-shadow: var(--shadow-sm); }
.hero-side-item img { width: 80px; height: 70px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink: 0; }
.hero-side-item .info h4 { font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--text); margin-bottom: 4px; }
.hero-side-item .info .meta { font-size: 11px; color: var(--text-muted); }

/* Section title */
.section-bar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.section-bar h3 { font-size: 18px; font-weight: 700; color: var(--text); }
.section-bar .line { flex: 1; height: 2px; background: var(--border); }
.section-bar .badge { background: var(--accent); color: white; padding: 2px 10px; font-size: 11px; font-weight: 600; border-radius: 3px; }

/* Post grid */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
.card {
  background: var(--bg-surface);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius); overflow: hidden; transition: var(--transition);
  display: flex; flex-direction: column;
  box-shadow: var(--glass-shadow);
}
.card:hover { box-shadow: 0 12px 40px rgba(200,16,46,0.12), inset 0 1px 0 rgba(255,255,255,0.6); transform: translateY(-2px); }
.card-img { width: 100%; height: 180px; overflow: hidden; position: relative; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.card:hover .card-img img { transform: scale(1.05); }
.card-badge {
  position: absolute; top: 8px; left: 8px;
  padding: 3px 8px; border-radius: 3px; font-size: 10px; font-weight: 600;
  color: white; backdrop-filter: blur(4px); background: rgba(0,0,0,0.5);
}
.card-body { padding: 12px; flex: 1; display: flex; flex-direction: column; }
.card-title { font-size: 15px; font-weight: 700; line-height: 1.35; margin-bottom: 6px; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); }
.card-excerpt { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { font-size: 11px; color: var(--text-muted); display: flex; gap: 8px; }

/* ===== ARTICLE PAGE ===== */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 16px;
}
.article-main { max-width: 720px; }
.article-cat { display: inline-block; padding: 4px 12px; background: var(--accent); color: white; font-size: 12px; font-weight: 600; border-radius: 3px; margin-bottom: 12px; }
.article-title { font-size: 28px; font-weight: 800; line-height: 1.25; margin-bottom: 12px; color: var(--text); }
.article-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--text-muted); margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.article-img { width: 100%; border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.article-img img { width: 100%; display: block; }
.article-content { font-size: 17px; line-height: 1.85; color: var(--text); }
.article-content h2 { font-size: 20px; font-weight: 700; margin: 24px 0 10px; }
.article-content h3 { font-size: 17px; font-weight: 600; margin: 18px 0 8px; }
.article-content p { margin-bottom: 14px; }
.article-content ul, .article-content ol { margin: 10px 0 14px 22px; }
.article-content li { margin-bottom: 5px; }
.article-content blockquote { border-left: 3px solid var(--accent); padding: 10px 18px; margin: 16px 0; background: var(--bg-surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text-secondary); font-style: italic; }
.article-content a { color: var(--link); }
.article-content code { background: var(--bg-surface); padding: 2px 6px; border-radius: 3px; font-size: 15px; }

/* Article sidebar */
.article-sidebar { display: flex; flex-direction: column; gap: 20px; }
.sidebar-ad { min-height: 250px; }
.sidebar-widget { background: var(--bg-surface); backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur)); border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 16px; box-shadow: var(--glass-shadow); }
.sidebar-widget h4 { font-size: 15px; font-weight: 700; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--accent); }
.sidebar-widget .trend-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.sidebar-widget .trend-item:last-child { border-bottom: none; }
.sidebar-widget .trend-item .num { font-size: 22px; font-weight: 800; color: var(--accent); min-width: 28px; }
.sidebar-widget .trend-item .info h5 { font-size: 13px; font-weight: 600; line-height: 1.3; margin-bottom: 2px; }
.sidebar-widget .trend-item .info a { color: var(--text); }
.sidebar-widget .trend-item .info a:hover { color: var(--accent); }
.sidebar-widget .trend-item .info .meta { font-size: 11px; color: var(--text-muted); }

/* Source/tags */
.source-box { margin-top: 24px; padding: 14px 18px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; color: var(--text-muted); }
.tag { display: inline-block; padding: 3px 10px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 20px; margin: 3px; font-size: 12px; color: var(--text-secondary); }

/* Share */
.share-bar { display: flex; align-items: center; gap: 8px; margin: 20px 0; }
.share-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-surface); color: var(--text); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 14px; transition: var(--transition); }
.share-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Social follow box at end of posts */
.social-follow-box { background: linear-gradient(135deg,rgba(200,16,46,0.05),rgba(200,16,46,0.02)); border: 1px solid rgba(200,16,46,0.15); border-radius: 12px; padding: 20px; margin: 24px 0; text-align: center; }
.follow-cta { font-weight: 600; font-size: 15px; margin-bottom: 12px; color: var(--text-primary); }
.follow-links { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.follow-links a { display: inline-flex; align-items: center; gap: 4px; padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; text-decoration: none; transition: 0.3s; }
.follow-links a:nth-child(1) { background: #1877f2; color: white; }
.follow-links a:nth-child(1):hover { background: #1463d4; }
.follow-links a:nth-child(2) { background: #0088cc; color: white; }
.follow-links a:nth-child(2):hover { background: #0077b3; }
.follow-links a:nth-child(3) { background: #ff6b00; color: white; }
.follow-links a:nth-child(3):hover { background: #e06000; }

/* Ad slots */
.ad-slot { background: var(--bg-secondary); border: 1px dashed rgba(200,16,46,0.2); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 11px; }
.ad-slot::before { content: 'Ad'; opacity: 0.4; }

/* Related */
.related-section { max-width: var(--max-width); margin: 0 auto; padding: 0 16px 32px; }
.related-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 4px; margin: 24px 0; }
.pagination a, .pagination span { padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-surface); color: var(--text); font-size: 14px; }
.pagination .current { background: var(--accent); border-color: var(--accent); color: white; }
.pagination a:hover { border-color: var(--accent); }

/* Newsletter */
.newsletter-box { max-width: 560px; margin: 40px auto; text-align: center; padding: 28px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); }
.newsletter-box h3 { font-size: 18px; margin-bottom: 4px; }
.newsletter-box p { color: var(--text-secondary); margin-bottom: 16px; font-size: 14px; }
.newsletter-form { display: flex; gap: 8px; max-width: 380px; margin: 0 auto; }
.newsletter-form input { flex: 1; padding: 10px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 20px; color: var(--text); font-size: 14px; outline: none; }
.newsletter-form input:focus { border-color: var(--accent); }
.newsletter-form button { padding: 10px 22px; background: var(--accent); border: none; border-radius: 20px; color: white; font-weight: 600; cursor: pointer; font-size: 14px; }
.newsletter-form button:hover { background: var(--accent-dark); }

/* ALL FOOTER STYLES IN header-footer.css — nothing here */

/* Empty state */
.empty-state { text-align: center; padding: 40px 16px; color: var(--text-muted); }
.empty-state h3 { font-size: 18px; color: var(--text); margin-bottom: 4px; }

/* Copy alert */
.copy-alert {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: white; padding: 8px 24px;
  border-radius: 20px; font-size: 13px; font-weight: 600;
  z-index: 9999; opacity: 0; transition: opacity 0.3s; pointer-events: none;
  box-shadow: var(--shadow-md);
}
.copy-alert.show { opacity: 1; }

/* Animations */
.fade-up { animation: fadeUp 0.4s ease forwards; opacity: 0; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
.fade-up { transform: translateY(12px); }
.fade-up:nth-child(1) { animation-delay: 0.05s; }
.fade-up:nth-child(2) { animation-delay: 0.1s; }
.fade-up:nth-child(3) { animation-delay: 0.15s; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .hero-section { grid-template-columns: 1fr; }
  .hero-main img { height: 280px; }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { display: none; }
  .countdown { display: none; }
  .header-nav { display: none; }
  .mobile-toggle { display: flex; }
  .nav-mobile { display: none; }
  .nav-mobile.show { display: flex; }
}

@media (max-width: 600px) {
  .header-inner { padding: 8px 12px; gap: 8px; }
  .logo img { width: 130px; max-width: 130px; }
  .header-tools { flex-direction: row; align-items: center; gap: 4px; }
  .tools-row:first-child { gap: 4px; }
  .search-wrap { display: none; }
  .tools-row:last-child { display: none; }
  .container { padding: 16px 12px; }
  .hero-main img { height: 220px; }
  .hero-overlay h2 { font-size: 17px; }
  .hero-side-item img { width: 70px; height: 60px; }
  .post-grid { grid-template-columns: 1fr; gap: 12px; }
  .article-title { font-size: 22px; }
  .article-content { font-size: 16px; }
  .newsletter-form { flex-direction: column; }
  .newsletter-form button { width: 100%; }
  .top-bar-inner { font-size: 10px; }
  .top-bar-inner span:last-child { display: none; }
}

/* SVG safety */
svg { max-width: 100%; height: auto; }