/* ==========================================================================
   খবর২৪ — Public site design system
   Editorial / newspaper-inspired, reinterpreted for a responsive web app.
   ========================================================================== */

@font-face {
  font-family: "Tiro Bangla";
  src: url("../fonts/TiroBangla-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Tiro Bangla";
  src: url("../fonts/TiroBangla-Italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Hind Siliguri";
  src: url("../fonts/HindSiliguri-Light.woff2") format("woff2");
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Hind Siliguri";
  src: url("../fonts/HindSiliguri-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Hind Siliguri";
  src: url("../fonts/HindSiliguri-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Hind Siliguri";
  src: url("../fonts/HindSiliguri-SemiBold.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Hind Siliguri";
  src: url("../fonts/HindSiliguri-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  /* -- Palette -- */
  --ink: #1a1410;
  --ink-soft: #6b5d52;
  --paper: #fbf6ec;
  --paper-raised: #ffffff;
  --maroon: #7a1f2b;
  --maroon-deep: #591620;
  --gold: #e8a33d;
  --line: #e4d9c9;
  --green: #2f7a4f;

  /* -- Type -- */
  --font-display: "Tiro Bangla", "Noto Serif Bengali", Georgia, serif;
  --font-body: "Hind Siliguri", "Noto Sans Bengali", system-ui, sans-serif;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(26, 20, 16, 0.06), 0 8px 24px -12px rgba(26, 20, 16, 0.18);

  color-scheme: light;
}

[data-theme="dark"] {
  --ink: #f2ece2;
  --ink-soft: #b9ab9c;
  --paper: #17130f;
  --paper-raised: #201a15;
  --maroon: #d9707c;
  --maroon-deep: #c24b57;
  --gold: #f0b65a;
  --line: #35291f;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  transition: background 0.25s ease, color 0.25s ease;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--maroon); }

::selection { background: var(--gold); color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
}

:focus-visible {
  outline: 2px solid var(--maroon);
  outline-offset: 2px;
}

.container-kh { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ---------------------------------------------------------------- masthead */
.breaking-bar {
  background: var(--maroon-deep);
  color: #fff8ee;
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--font-body);
  font-size: 14px;
}
.breaking-bar__inner { display: flex; align-items: center; }
.breaking-bar__tag {
  flex: none;
  background: var(--gold);
  color: #2a1c05;
  font-weight: 700;
  padding: 7px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.breaking-bar__track {
  overflow: hidden;
  flex: 1;
  position: relative;
  height: 34px;
}
.breaking-bar__scroll {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 48px;
  padding-inline-start: 24px;
  height: 100%;
  animation: ticker 32s linear infinite;
}
.breaking-bar__scroll:hover { animation-play-state: paused; }
.breaking-bar__scroll a { color: #fff8ee; opacity: 0.95; }
.breaking-bar__scroll a:hover { color: var(--gold); }
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.masthead {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 18px 0 14px;
}
.masthead__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.masthead__logo {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--maroon);
  line-height: 1;
}
.masthead__logo span { color: var(--ink); }
.masthead__date {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 3px;
}
.masthead__tools { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper-raised);
  color: var(--ink);
  font-size: 17px;
}
.icon-btn:hover { border-color: var(--maroon); color: var(--maroon); }

.category-nav {
  background: var(--paper-raised);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.category-nav__scroll {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 0;
}
.category-nav__scroll::-webkit-scrollbar { display: none; }
.category-nav__link {
  flex: none;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.category-nav__link:hover,
.category-nav__link.is-active { color: var(--maroon); border-bottom-color: var(--maroon); }

/* -------------------------------------------------------- search dropdown */
.search-wrap { position: relative; }
.search-suggest {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 8px);
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 80;
  max-height: 70vh;
  overflow-y: auto;
  display: none;
}
.search-suggest.is-open { display: block; }
.search-suggest__item {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.search-suggest__item:last-child { border-bottom: none; }
.search-suggest__item img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; flex: none; }
.search-suggest__item:hover { background: var(--paper); }
.search-suggest__cat { font-size: 12px; color: var(--maroon); font-weight: 600; }

/* -------------------------------------------------------------------- hero */
.hero { padding: 26px 0 8px; }
.hero__grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 24px;
}
.hero__feature { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--paper-raised); box-shadow: var(--shadow); }
.hero__feature img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.hero__feature-body { padding: 18px 20px 22px; }
.hero__badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--maroon); color: #fff8ee;
  font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  margin-bottom: 10px;
}
.hero__feature h1 {
  font-family: var(--font-display);
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.28;
  margin: 0 0 10px;
}
.hero__feature p { color: var(--ink-soft); margin: 0 0 10px; }

.digest { display: flex; flex-direction: column; gap: 14px; }
.digest__title { font-family: var(--font-display); font-size: 18px; border-bottom: 2px solid var(--ink); padding-bottom: 8px; }
.digest__item { display: flex; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.digest__item:last-child { border-bottom: none; }
.digest__item img { width: 84px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; }
.digest__item h3 { font-size: 15px; line-height: 1.4; margin: 0 0 4px; }

.meta-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-soft); }
.meta-row i { margin-inline-end: 4px; }

/* --------------------------------------------------------------- sections */
.section { padding: 30px 0; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; border-bottom: 2px solid var(--ink); padding-bottom: 8px; }
.section__title { font-family: var(--font-display); font-size: 21px; display: flex; align-items: center; gap: 10px; }
.section__title .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--maroon); display: inline-block; }
.section__more { font-size: 14px; font-weight: 600; color: var(--maroon); white-space: nowrap; }

.card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.article-card { background: var(--paper-raised); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform 0.18s ease; }
.article-card:hover { transform: translateY(-3px); }
.article-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.article-card__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.article-card__cat { font-size: 12px; font-weight: 700; color: var(--maroon); }
.article-card h3 { font-size: 15.5px; line-height: 1.4; margin: 0; }
.article-card__meta { margin-top: auto; font-size: 12px; color: var(--ink-soft); }

/* -------------------------------------------------------------- most-read */
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rank-list li:last-child { border-bottom: none; }
.rank-list .rank-num { font-family: var(--font-display); font-size: 26px; color: var(--line); font-weight: 700; line-height: 1; min-width: 30px; }
[data-theme="dark"] .rank-list .rank-num { color: #3c2e22; }
.rank-list h4 { font-size: 14.5px; line-height: 1.4; margin: 0 0 4px; }

.side-panel { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.side-panel__title { font-family: var(--font-display); font-size: 18px; border-bottom: 2px solid var(--ink); padding-bottom: 8px; margin-bottom: 4px; }

/* --------------------------------------------------------------- article */
.article-hero { padding: 24px 0 0; }
.article-hero .eyebrow-cat { color: var(--maroon); font-weight: 700; font-size: 14px; }
.article-hero h1 { font-family: var(--font-display); font-size: clamp(26px, 4.4vw, 42px); line-height: 1.25; margin: 10px 0 14px; }
.article-hero__img { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.article-hero__img img { width: 100%; max-height: 480px; object-fit: cover; display: block; }
.article-hero__caption { font-size: 13px; color: var(--ink-soft); padding: 8px 2px; }

.article-body {
  font-size: 18px;
  line-height: 1.9;
  max-width: 74ch;
}
.article-body p { margin: 0 0 20px; }
.article-body img { max-width: 100%; border-radius: 8px; height: auto; }
.article-body h2, .article-body h3 { font-family: var(--font-display); margin: 28px 0 12px; }
.article-body blockquote {
  border-inline-start: 4px solid var(--maroon);
  margin: 20px 0; padding: 4px 18px;
  font-family: var(--font-display); font-size: 20px; color: var(--ink-soft);
}

.tag-chip {
  display: inline-block; padding: 5px 12px; border-radius: 999px;
  background: var(--paper-raised); border: 1px solid var(--line);
  font-size: 13px; margin: 0 6px 6px 0;
}
.tag-chip:hover { border-color: var(--maroon); color: var(--maroon); }

.share-rail { display: flex; gap: 8px; }
.share-rail a {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--paper-raised); border: 1px solid var(--line);
}
.share-rail a:hover { background: var(--maroon); color: #fff8ee; border-color: var(--maroon); }

.reading-progress {
  position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 200;
  background: var(--gold); width: 0%; transition: width 0.1s linear;
}

/* -------------------------------------------------------------- comments */
.comment {
  padding: 16px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px;
}
.comment__avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--maroon); color: #fff8ee;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; flex: none;
}
.comment__name { font-weight: 700; font-size: 14.5px; }
.comment__time { font-size: 12px; color: var(--ink-soft); }

/* ----------------------------------------------------------------- forms */
.kh-form .form-control, .kh-form .form-select {
  background: var(--paper-raised); border: 1px solid var(--line); color: var(--ink);
  border-radius: 8px;
}
.kh-form .form-control:focus, .kh-form .form-select:focus {
  border-color: var(--maroon); box-shadow: 0 0 0 3px rgba(122, 31, 43, 0.12);
}
.btn-maroon {
  background: var(--maroon); border-color: var(--maroon); color: #fff8ee;
  border-radius: 8px; font-weight: 600; padding: 10px 20px;
}
.btn-maroon:hover { background: var(--maroon-deep); border-color: var(--maroon-deep); color: #fff8ee; }
.btn-outline-maroon { border: 1px solid var(--maroon); color: var(--maroon); border-radius: 8px; font-weight: 600; background: transparent; }
.btn-outline-maroon:hover { background: var(--maroon); color: #fff8ee; }

/* ----------------------------------------------------------------- footer */
.site-footer { background: var(--maroon-deep); color: #f4e8de; margin-top: 40px; padding: 40px 0 18px; }
.site-footer h5 { font-family: var(--font-display); font-size: 18px; margin-bottom: 14px; color: #fff; }
.site-footer a { color: #f4e8de; opacity: 0.85; }
.site-footer a:hover { opacity: 1; color: var(--gold); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.site-footer .bottom-strip { border-top: 1px solid rgba(255,255,255,0.15); margin-top: 28px; padding-top: 16px; font-size: 13px; opacity: 0.8; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ------------------------------------------------------------ back-to-top */
.back-to-top {
  position: fixed; bottom: 84px; inset-inline-end: 18px; z-index: 60;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--maroon); color: #fff8ee;
  display: none; align-items: center; justify-content: center;
  box-shadow: var(--shadow); border: none;
}
.back-to-top.is-visible { display: inline-flex; }

/* ---------------------------------------------------------- mobile bottom nav */
.mobile-tabbar {
  display: none;
  position: fixed; bottom: 0; inset-inline: 0; z-index: 90;
  background: var(--paper-raised); border-top: 1px solid var(--line);
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
}
.mobile-tabbar__row { display: flex; justify-content: space-around; }
.mobile-tabbar a, .mobile-tabbar button {
  background: none; border: none; color: var(--ink-soft);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; padding: 4px 8px;
}
.mobile-tabbar a.is-active, .mobile-tabbar a:hover, .mobile-tabbar button:hover { color: var(--maroon); }
.mobile-tabbar i { font-size: 19px; }

/* ------------------------------------------------------------------ misc */
.pagination .page-link { color: var(--ink); border-color: var(--line); background: var(--paper-raised); }
.pagination .page-item.active .page-link { background: var(--maroon); border-color: var(--maroon); }
.badge-status-draft { background: #cf9b2e; }
.badge-status-published { background: var(--green); }
.skeleton { background: linear-gradient(90deg, var(--line) 25%, var(--paper) 37%, var(--line) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* --------------------------------------------------------------- responsive */
@media (max-width: 991px) {
  .hero__grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 576px) {
  .masthead__logo { font-size: 26px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .hero__feature h1 { font-size: 22px; }
  .article-body { font-size: 16.5px; }
  .mobile-tabbar { display: block; }
  body { padding-bottom: 62px; }
  .back-to-top { bottom: 78px; }
}

@media (min-width: 577px) {
  .mobile-tabbar { display: none !important; }
}
