

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  max-width: 100vw;
  overflow-x: hidden; 
}

:root {
  --bg: hsl(40, 20%, 98%);
  --fg: hsl(20, 10%, 12%);
  --card: hsl(40, 25%, 97%);
  --primary: hsl(32, 80%, 50%);
  --primary-fg: hsl(40, 20%, 98%);
  --muted: hsl(35, 12%, 92%);
  --muted-fg: hsl(20, 8%, 50%);
  --border: hsl(30, 15%, 88%);
  --radius: 0.75rem;
  --font-display: 'Noto Sans Bengali', 'Playfair Display', Georgia, serif;
  --font-body: 'Noto Sans Bengali', system-ui, sans-serif;
}

html.dark {
  --bg: hsl(20, 10%, 8%);
  --fg: hsl(40, 15%, 90%);
  --card: hsl(20, 10%, 10%);
  --primary: hsl(32, 80%, 55%);
  --primary-fg: hsl(20, 10%, 8%);
  --muted: hsl(20, 8%, 16%);
  --muted-fg: hsl(30, 10%, 55%);
  --border: hsl(20, 8%, 18%);
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; } /* ইমেজের কারণে ওভারফ্লো বন্ধ */

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.header {
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  background: var(--bg); backdrop-filter: blur(8px);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 0;
}
.logo { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
.logo-dot { color: var(--primary); }

.nav-desktop { display: flex; align-items: center; gap: 1.5rem; }
.nav-link {
  font-size: 0.875rem; font-weight: 500; color: var(--muted-fg);
  transition: color 0.2s; cursor: pointer; background: none; border: none;
  font-family: var(--font-body); display: inline-block;
}
.nav-link:hover, .nav-link.active { color: var(--fg); }

.theme-btn {
  padding: 0.5rem; border-radius: 0.5rem; cursor: pointer;
  background: none; border: none; color: var(--muted-fg);
  transition: all 0.2s; display: flex; align-items: center; justify-content: center;
}
.theme-btn:hover { background: var(--muted); color: var(--fg); }

.menu-btn { display: none; padding: 0.5rem; border-radius: 0.5rem; cursor: pointer; background: none; border: none; color: var(--fg); }

.mobile-nav { display: none; border-top: 1px solid var(--border); padding: 1rem 0; }
.mobile-nav.open { display: block; }
.mobile-nav-link {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem; border-radius: 0.5rem; font-size: 0.875rem;
  font-weight: 500; color: var(--muted-fg); transition: all 0.2s;
  cursor: pointer; background: none; border: none; width: 100%;
  font-family: var(--font-body); text-align: left;
}
.mobile-nav-link:hover { background: var(--muted); color: var(--fg); }

@media (max-width: 768px) {
  .nav-desktop { display: none; }
  .menu-btn { display: block; }
}

/* Hero Carousel - Mobile optimized size */
.hero { margin-bottom: 2rem; width: 100%; overflow: hidden; }
.hero-slide {
  background: hsl(32, 80%, 50%, 0.1); border-radius: var(--radius);
  padding: 1.25rem 1rem; display: none; cursor: pointer;
  transition: all 0.3s; width: 100%; box-sizing: border-box;
}
.hero-slide:hover { background: hsl(32, 80%, 50%, 0.15); }
.hero-slide.active { display: block; animation: fadeIn 0.4s ease; }
.hero-cat { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--primary); margin-bottom: 0.5rem; }
.hero-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; line-height: 1.3; margin-bottom: 0.5rem; color: var(--fg); word-wrap: break-word; overflow-wrap: break-word; }
.hero-excerpt { font-size: 0.875rem; color: var(--muted-fg); margin-bottom: 0.5rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; }
.hero-date { font-size: 0.75rem; color: var(--muted-fg); }
.hero-dots { display: flex; justify-content: center; gap: 0.5rem; margin-top: 0.75rem; }
.hero-dot {
  height: 0.5rem; border-radius: 9999px; border: none; cursor: pointer;
  transition: all 0.3s; background: hsl(20, 8%, 50%, 0.3); width: 0.5rem;
}
.hero-dot.active { width: 1.5rem; background: var(--primary); }

@media (min-width: 768px) {
  .hero-title { font-size: 1.75rem; }
  .hero-slide { padding: 1.5rem 2rem; }
  .hero-excerpt { -webkit-line-clamp: 3; }
}

/* Search */
.search-wrap { position: relative; max-width: 28rem; margin-bottom: 1rem; display: block; width: 100%; }
.search-icon { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--muted-fg); display: flex; align-items: center; justify-content: center; }
.search-input {
  width: 100%; padding: 0.625rem 1rem 0.625rem 2.5rem;
  border-radius: 9999px; background: var(--muted); color: var(--fg);
  border: none; outline: none; font-size: 0.875rem;
  font-family: var(--font-body); transition: box-shadow 0.2s; box-sizing: border-box;
}
.search-input::placeholder { color: var(--muted-fg); }
.search-input:focus { box-shadow: 0 0 0 3px hsl(32, 80%, 50%, 0.3); }

/* Category pills */
.cat-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.cat-pill {
  padding: 0.375rem 1rem; border-radius: 9999px; font-size: 0.875rem;
  font-weight: 500; cursor: pointer; border: none; transition: all 0.2s;
  font-family: var(--font-body); background: var(--muted); color: var(--muted-fg);
  display: inline-block;
}
.cat-pill:hover { color: var(--fg); }
.cat-pill.active { background: var(--fg); color: var(--bg); }

/* Section title */
.section-title {
  font-family: var(--font-display); font-size: 1.125rem; font-weight: 600;
  color: var(--muted-fg); text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 1.25rem;
}

/* Blog grid */
.blog-grid { display: grid; gap: 1.25rem; width: 100%; }
@media (min-width: 768px) { .blog-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; } }
@media (min-width: 1024px) { .blog-grid { grid-template-columns: repeat(3, 1fr); } }

/* Blog card */
.blog-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); overflow: hidden; transition: all 0.3s;
  cursor: pointer; display: block; width: 100%; box-sizing: border-box;
}
.blog-card:hover { box-shadow: 0 4px 20px hsl(0 0% 0% / 0.08); border-color: hsl(32, 80%, 50%, 0.2); }
.blog-card img { width: 100%; height: 11rem; object-fit: cover; transition: transform 0.5s; }
.blog-card:hover img { transform: scale(1.05); }
.card-img-wrap { overflow: hidden; }
.card-body { padding: 1.25rem; }
.card-cat { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--primary); margin-bottom: 0.75rem; }
.card-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; line-height: 1.35; margin-bottom: 0.75rem; color: var(--fg); transition: color 0.2s; word-wrap: break-word; overflow-wrap: break-word; }
.blog-card:hover .card-title { color: var(--primary); }
.card-excerpt { color: var(--muted-fg); line-height: 1.6; font-size: 0.875rem; margin-bottom: 1rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-date { font-size: 0.875rem; color: var(--muted-fg); }

@media (min-width: 768px) {
  .blog-card img { height: 12rem; }
  .card-title { font-size: 1.25rem; }
}

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 0.5rem; margin-top: 2.5rem; }
.page-btn {
  width: 2.5rem; height: 2.5rem; border-radius: 50%; border: none;
  font-size: 0.875rem; font-weight: 500; cursor: pointer;
  transition: all 0.2s; background: var(--muted); color: var(--muted-fg);
  font-family: var(--font-body); display: flex; align-items: center; justify-content: center;
}
.page-btn:hover { color: var(--fg); }
.page-btn.active, .page-btn.current { background: var(--primary); color: var(--primary-fg); }

/* Post page */
.post-page { width: 100%; max-width: 42rem; margin: 0 auto; padding: 2rem 0; box-sizing: border-box; overflow: hidden; }
@media (min-width: 768px) { .post-page { padding: 3rem 1.5rem; } }

/* ব্যাক লিংক (আগের মতো অরিজিনাল ডিজাইন) */
.back-link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.875rem; color: var(--muted-fg); margin-bottom: 2rem;
  transition: color 0.2s; cursor: pointer; background: none; border: none;
  font-family: var(--font-body); text-decoration: none; padding: 0;
}
.back-link:hover { color: var(--fg); }

.post-cat { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--primary); margin-bottom: 1rem; display:inline-block; }
.post-title { font-size: 1.75rem; font-weight: 700; line-height: 1.3; margin-bottom: 1.5rem; word-wrap: break-word; overflow-wrap: break-word; }
@media (min-width: 768px) { .post-title { font-size: 2.5rem; } }
.post-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; font-size: 0.875rem; color: var(--muted-fg); margin-bottom: 2rem; }
.post-cover { width: 100%; height: 16rem; object-fit: cover; border-radius: var(--radius); margin-bottom: 2.5rem; }
@media (min-width: 768px) { .post-cover { height: 24rem; margin-bottom: 3rem; } }

/* শেয়ার বাটন (আগের মতো অরিজিনাল ডিজাইন, কোনো ব্যাকগ্রাউন্ড ছাড়া) */
.share-bar { display: flex; align-items: center; gap: 0.25rem; }
.share-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.75rem; border-radius: 9999px; font-size: 0.875rem;
  color: var(--muted-fg); background: none; border: none; cursor: pointer;
  transition: all 0.2s; font-family: var(--font-body); text-decoration: none;
}
.share-btn:hover { background: var(--muted); color: var(--fg); }

.prose p { margin-bottom: 1.5rem; font-size: 1.125rem; line-height: 1.8; }
.prose h2 { font-size: 1.5rem; font-weight: 600; margin-top: 2.5rem; margin-bottom: 1rem; word-wrap: break-word; }
.prose h3 { font-size: 1.25rem; font-weight: 600; margin-top: 2rem; margin-bottom: 0.75rem; word-wrap: break-word; }
.prose blockquote { border-left: 4px solid var(--primary); padding-left: 1.5rem; font-style: italic; margin: 1.5rem 0; color: var(--muted-fg); }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius); margin: 1.5rem 0; }

/* Contact Page New Layout */
.contact-page-wrapper { max-width: 64rem; margin: 0 auto; padding-top: 1rem; }
.contact-grid { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 768px) { .contact-grid { grid-template-columns: 1fr 1.2fr; gap: 4rem; } }

.profile-section { margin-bottom: 2rem; }
.profile-img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; margin-bottom: 1.25rem; border: 3px solid var(--border); padding: 4px; }
.profile-name { font-size: 1.5rem; font-family: var(--font-display); font-weight: 700; margin-bottom: 0.75rem; color: var(--fg); }
.profile-bio { font-size: 0.95rem; color: var(--muted-fg); line-height: 1.8; }
@media (min-width: 768px) { .profile-name { font-size: 1.75rem; } }

.social-links { display: flex; flex-direction: column; gap: 1rem; }
.social-card { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); transition: all 0.3s; text-decoration: none; }
.social-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: 0 4px 20px hsl(0 0% 0% / 0.05); }
.social-icon { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: var(--muted); color: var(--fg); transition: color 0.3s, background 0.3s; }
.social-card:hover .social-icon { background: var(--primary); color: var(--primary-fg); }
.social-text { display: flex; flex-direction: column; }
.social-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-fg); margin-bottom: 0.15rem; }
.social-value { font-size: 0.95rem; font-weight: 500; color: var(--fg); font-family: var(--font-body); }

/* Contact Form */
.contact-form { width: 100%; background: var(--card); padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--border); box-sizing: border-box; }
@media (min-width: 768px) { .contact-form { padding: 2.5rem; } }
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.5rem; }
.form-input, .form-textarea { width: 100%; padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: 0.375rem; background: var(--bg); color: var(--fg); font-size: 0.9rem; font-family: var(--font-body); outline: none; transition: border-color 0.2s; box-sizing: border-box; }
.form-input:focus, .form-textarea:focus { border-color: var(--primary); }
.form-textarea { resize: vertical; min-height: 8rem; }
.submit-btn { width: 100%; padding: 0.75rem; border: none; border-radius: 0.375rem; background: var(--fg); color: var(--bg); font-size: 0.9rem; font-weight: 500; cursor: pointer; font-family: var(--font-body); transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.submit-btn:hover { opacity: 0.9; }

/* Page header */
.page-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 2rem; border-bottom: 1px solid var(--border); padding-bottom: 1rem; }
.page-header-icon { color: var(--primary); display: flex; align-items: center; justify-content: center; }
.page-header h1 { font-size: 1.6rem; font-weight: 700; }
@media (min-width: 768px) { .page-header h1 { font-size: 1.875rem; } }

/* Categories Page */
.categories-page-wrapper { padding-top: 1rem; }
.cat-grid { display: grid; gap: 1.25rem; }
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
.cat-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 1.5rem; cursor: pointer; transition: all 0.3s; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.cat-card:hover { border-color: hsl(32, 80%, 50%, 0.4); box-shadow: 0 4px 20px hsl(0 0% 0% / 0.08); }
.cat-card-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--fg); transition: color 0.2s; }
.cat-card:hover .cat-card-title { color: var(--primary); }
.cat-card-count { font-size: 0.85rem; font-weight: 500; color: var(--muted-fg); display: inline-flex; align-items: center; gap: 0.3rem; }

/* Footer */
.footer { border-top: 1px solid var(--border); margin-top: 4rem; padding: 2rem 0; text-align: center; font-size: 0.875rem; color: var(--muted-fg); }

/* Empty state */
.empty { text-align: center; padding: 4rem 0; color: var(--muted-fg); font-size: 1.125rem; }

/* Divider */
.divider { border-top: 1px solid var(--border); margin-bottom: 1.5rem; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.4s ease forwards; }

/* Toast */
.toast { position: fixed; bottom: 1.5rem; right: 1.5rem; padding: 0.75rem 1.25rem; border-radius: var(--radius); font-size: 0.875rem; z-index: 100; background: var(--fg); color: var(--bg); animation: fadeIn 0.3s ease; box-shadow: 0 4px 20px hsl(0 0% 0% / 0.15); display: inline-flex; align-items: center; gap: 0.5rem; }

main { flex: 1; }