/* =====================================================
   assets/css/style.css
   ফ্রন্টএন্ড ডিজাইন সিস্টেম — "এডিটোরিয়াল ইঙ্ক" থিম
   এখানে সব কালার/ফন্ট টোকেন CSS ভ্যারিয়েবল আকারে সংজ্ঞায়িত,
   যেকোনো জায়গায় রঙ বদলাতে চাইলে শুধু নিচের :root অংশ এডিট করলেই হবে।
   ===================================================== */

:root {
  /* --- কালার টোকেন --- */
  --paper: #F6F6F2;
  --paper-alt: #EFEFE8;
  --ink: #171A21;
  --ink-soft: #3B3F4A;
  --primary: #1F6F5C;
  --primary-dark: #144537;
  --primary-light: #E7F1EE;
  --accent: #E5A03B;
  --accent-dark: #B87d1c;
  --line: #E1E1D8;
  --muted: #6B6F76;
  --white: #FFFFFF;
  --danger: #B3413A;

  /* --- টাইপোগ্রাফি টোকেন --- */
  --font-display: 'Fraunces', 'Noto Serif Bengali', Georgia, serif;
  --font-body: 'Inter', 'Hind Siliguri', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
}

/* ---------- বেস/রিসেট ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink-soft);
  line-height: 1.65;
  font-size: 16px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.25;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

::selection { background: var(--accent); color: var(--ink); }

/* কীবোর্ড ফোকাস সবসময় দৃশ্যমান রাখা (অ্যাক্সেসিবিলিটি) */
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

.text-muted-custom { color: var(--muted) !important; }

/* ---------- হেডার / নেভবার ---------- */
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.navbar { padding: 0.9rem 0; }

.navbar-brand {
  display: flex;
  align-items: center;
  font-family: var(--font-display);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
  margin-right: 10px;
  flex-shrink: 0;
}

.brand-name {
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--ink);
}

.navbar-nav .nav-link {
  font-weight: 500;
  color: var(--ink-soft);
  padding: 0.5rem 1rem !important;
}

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

.dropdown-menu {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 28px rgba(23, 26, 33, 0.08);
}

.dropdown-item:active, .dropdown-item.active { background: var(--primary); }
.dropdown-item:hover { background: var(--primary-light); color: var(--primary-dark); }

.nav-search { position: relative; }
.nav-search .form-control {
  border-radius: 999px 0 0 999px;
  border: 1px solid var(--line);
  background: var(--paper-alt);
  min-width: 190px;
}
.nav-search .btn {
  border-radius: 0 999px 999px 0;
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
}
.nav-search .btn:hover { background: var(--primary-dark); }
.nav-search .form-control:focus { box-shadow: none; border-color: var(--primary); }

/* ---------- হিরো / ফিচার্ড পোস্ট ---------- */
.hero-post {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2.5rem;
  align-items: center;
  padding: 3rem 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2.5rem;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.9rem;
}
.hero-eyebrow::before {
  content: '';
  width: 22px;
  height: 2px;
  background: var(--accent);
  display: inline-block;
}

.hero-title {
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  margin-bottom: 1rem;
}
.hero-title a { color: var(--ink); }
.hero-title a:hover { color: var(--primary); }

.hero-excerpt { color: var(--muted); font-size: 1.05rem; margin-bottom: 1.4rem; }

.hero-media {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  position: relative;
  box-shadow: 0 20px 40px rgba(23, 26, 33, 0.12);
}
.hero-media img, .hero-media .post-card-placeholder { width: 100%; height: 100%; object-fit: cover; }

/* ---------- পোস্ট কার্ড গ্রিড ---------- */
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.section-heading h2 { font-size: 1.5rem; margin: 0; }

.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem; }

.post-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 32px rgba(23, 26, 33, 0.1);
}

.post-card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  display: block;
}
.post-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(55%) sepia(8%) saturate(85%);
  transition: filter 0.5s ease, transform 0.6s ease;
}
.post-card-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--primary);
  mix-blend-mode: multiply;
  opacity: 0.26;
  transition: opacity 0.5s ease;
}
.post-card:hover .post-card-media img { filter: grayscale(0%) sepia(0%) saturate(100%); transform: scale(1.045); }
.post-card:hover .post-card-media::after { opacity: 0; }

.post-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: rgba(255,255,255,0.85);
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 600;
}

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

.badge-category {
  display: inline-block;
  align-self: flex-start;
  background: var(--accent);
  color: #4a2f04;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.7rem;
}
a.badge-category:hover { background: var(--accent-dark); color: #fff; }

.post-card-title {
  font-size: 1.12rem;
  margin-bottom: 0.55rem;
  line-height: 1.4;
}
.post-card-title a { color: var(--ink); }
.post-card-title a:hover { color: var(--primary); }

.post-card-excerpt { color: var(--muted); font-size: 0.92rem; margin-bottom: 0.9rem; flex-grow: 1; }

.post-meta {
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
}
.post-meta .dot::before { content: '·'; margin: 0 2px; }

/* ---------- পেজিনেশন ---------- */
.pagination { margin-top: 2.5rem; }
.page-link {
  color: var(--ink-soft);
  border: 1px solid var(--line);
  margin: 0 3px;
  border-radius: var(--radius-sm) !important;
}
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); }
.page-link:hover { background: var(--primary-light); color: var(--primary-dark); }
.page-item.disabled .page-link { color: #b7bbc0; background: transparent; border-color: var(--line); }

/* ---------- ক্যাটাগরি ফিল্টার পিল (category.php, search.php) ---------- */
.page-intro { padding: 2.2rem 0 1rem; }
.page-intro-eyebrow { color: var(--primary); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.page-intro h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0.4rem 0 0.3rem; }

.category-pills { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.2rem 0 2rem; }
.category-pill {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink-soft);
  padding: 0.42rem 1rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
}
.category-pill:hover { border-color: var(--primary); color: var(--primary); }
.category-pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- সিঙ্গেল পোস্ট পেজ ---------- */
.post-hero-media {
  width: 100%;
  max-height: 460px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin: 1.6rem 0 2.2rem;
  aspect-ratio: 21 / 9;
}
.post-hero-media img, .post-hero-media .post-card-placeholder { width: 100%; height: 100%; object-fit: cover; }

.post-article { max-width: 760px; margin: 0 auto; padding: 2.2rem 0 3rem; }

.post-article-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin: 0.7rem 0 1rem;
}

.post-article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2rem;
}
.post-article-meta .author-name { color: var(--ink-soft); font-weight: 600; }

.post-content { font-size: 1.08rem; color: var(--ink-soft); }
.post-content p { margin-bottom: 1.3rem; }
.post-content h2, .post-content h3 { margin: 2rem 0 1rem; }
.post-content img { max-width: 100%; height: auto; border-radius: var(--radius-md); margin: 1rem 0; }
.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.4rem 1.4rem;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  margin: 1.6rem 0;
}
.post-content ul, .post-content ol { margin-bottom: 1.3rem; padding-left: 1.4rem; }
.post-content a { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }

/* শেয়ার বাটন */
.share-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 2.2rem 0;
  padding: 1.2rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.share-label { font-weight: 600; color: var(--ink); font-size: 0.9rem; margin-right: 0.3rem; }
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--paper-alt);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}
.share-btn:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }
.share-btn svg { width: 17px; height: 17px; }

/* ---------- রিলেটেড পোস্ট ---------- */
.related-posts { padding: 2.5rem 0; border-top: 1px solid var(--line); margin-top: 1rem; }

/* ---------- কমেন্ট সেকশন ---------- */
.comments-section { max-width: 760px; margin: 0 auto; padding: 1rem 0 3rem; }
.comments-count { font-size: 1.3rem; margin-bottom: 1.5rem; }

.comment-item {
  display: flex;
  gap: 1rem;
  padding: 1.3rem 0;
  border-bottom: 1px solid var(--line);
}
.comment-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--font-display);
  flex-shrink: 0;
}
.comment-name { font-weight: 600; color: var(--ink); margin-right: 0.5rem; }
.comment-date { font-size: 0.8rem; color: var(--muted); }
.comment-text { margin-top: 0.35rem; color: var(--ink-soft); }

.comment-form-wrap {
  background: var(--paper-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.8rem;
  margin-top: 1.5rem;
}
.comment-form-wrap h3 { font-size: 1.2rem; margin-bottom: 1.1rem; }

.form-control, .form-select {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
label.form-label { font-weight: 500; color: var(--ink-soft); font-size: 0.92rem; }

.btn-brand {
  background: var(--primary);
  border: 1px solid var(--primary);
  color: #fff;
  font-weight: 600;
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius-sm);
}
.btn-brand:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }

/* honeypot ফিল্ড লুকানোর জন্য (স্প্যাম বট প্রতিরোধ) */
.hp-field { position: absolute; left: -9999px; top: -9999px; opacity: 0; height: 0; }

/* ---------- খালি স্টেট ---------- */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
}
.empty-state svg { color: var(--line); margin-bottom: 1rem; }
.empty-state h3 { color: var(--ink); margin-bottom: 0.5rem; }

/* ---------- ফুটার ---------- */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.72);
  padding: 3.2rem 0 1.4rem;
  margin-top: 3rem;
}
.footer-brand { display: flex; align-items: center; font-family: var(--font-display); margin-bottom: 0.7rem; }
.footer-brand .brand-name { color: #fff; }
.footer-tagline { color: rgba(255,255,255,0.55); font-size: 0.92rem; }
.footer-heading { color: #fff; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 0.6rem; }
.footer-links a { color: rgba(255,255,255,0.65); font-size: 0.94rem; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  margin-top: 2.2rem;
  padding-top: 1.4rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
}

/* ---------- রেসপন্সিভ ---------- */
@media (max-width: 991px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-post { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero-media { order: -1; aspect-ratio: 16/9; }
  .nav-search { margin-top: 0.8rem; }
  .nav-search .form-control { min-width: 0; flex-grow: 1; }
}

@media (max-width: 575px) {
  .post-grid { grid-template-columns: 1fr; }
  .hero-post { padding: 2rem 0; }
  .post-article { padding: 1.4rem 0 2rem; }
  .comment-item { flex-direction: row; }
  .share-row { gap: 0.5rem; }
}
