/* The Wildcut — public site design
   Palette: primary #2A661C · white #FFFFFF · leaf #7CAF31 · charcoal #2D2D2D · grey #D1D1D1
   Type: 'Noto Serif Bengali' + 'Noto Serif' everywhere (weight per element). */
:root {
  --green: #2a661c;
  --green-dark: #1e4a14;
  --leaf: #7caf31;
  --ink: #2d2d2d;
  --grey: #d1d1d1;
  --soft: #f5f8f3;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(42, 102, 28, 0.14);
  /* theme tokens (light) */
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #2d2d2d;
  --muted: #666666;
  --faint: #888888;
  --border: #e7e7e7;
  --header-bg: rgba(255, 255, 255, 0.96);
  --chip-bg: #f5f8f3;
  --byline-name: #2a661c;
  --skel-a: #eef3ea;
  --skel-b: #f7faf4;
}
[data-theme="dark"] {
  --bg: #000000;
  --surface: #141414;
  --text: #f2f2f2;
  --muted: #b3b3b3;
  --faint: #8f8f8f;
  --border: #2e2e2e;
  --soft: #141414;
  --header-bg: rgba(0, 0, 0, 0.96);
  --chip-bg: #1d1d1d;
  --byline-name: #7caf31;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --skel-a: #1a1a1a;
  --skel-b: #262626;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Noto Serif Bengali', 'Noto Serif', serif;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}
h1, h2, h3, h4 { font-weight: 700; }
img { max-width: 100%; }
a { color: var(--green); text-decoration: none; }
[data-theme="dark"] a { color: var(--leaf); }
a:hover { text-decoration: underline; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--leaf); outline-offset: 2px; }
.icon { width: 1em; height: 1em; flex: 0 0 auto; vertical-align: -0.12em; }
.icon-external { width: 0.82em; height: 0.82em; opacity: 0.75; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
}
.header-bar {
  min-height: 68px; display: flex; align-items: center; gap: 1rem;
  padding: 0.45rem 1.1rem;
}
.brand { display: flex; align-items: center; flex: 0 0 auto; min-width: 0; }
.brand img { height: 46px; width: auto; display: block; border-radius: 6px; }
.brand .logo-dark { display: none; }
[data-theme="dark"] .brand .logo-light { display: none; }
[data-theme="dark"] .brand .logo-dark { display: block; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 0.4rem; margin-left: auto; flex: 1 1 auto; min-width: 0; }
.icon-btn {
  background: transparent; border: 1px solid transparent; border-radius: 999px;
  width: 40px; height: 40px; font-size: 1.1rem; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: var(--text); flex: 0 0 auto;
}
.icon-btn:hover { border-color: var(--border); background: var(--chip-bg); }
.nav-toggle { display: none; }
.main-nav { display: flex; align-items: center; gap: 0.45rem 1.1rem; flex-wrap: wrap; padding: 0 1.1rem 0.6rem; }
.nav-category-links { display: contents; }
.main-nav a { color: var(--text); font-weight: 600; font-size: 0.98rem; display: inline-flex; align-items: center; gap: 0.35rem; }
.main-nav a:hover { color: var(--green); text-decoration: none; }
[data-theme="dark"] .main-nav a:hover { color: var(--leaf); }

/* Header search — elongated pill bar (always visible on wide screens,
   icon-expanded full-width row under the header on small screens) */
.search-box {
  display: none; align-items: center; min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 0.16rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-box:focus-within { border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(124, 175, 49, 0.18); }
.search-box input {
  font: inherit; flex: 1 1 auto; min-width: 0; border: 0; background: transparent;
  padding: 0.38rem 0.3rem 0.38rem 0.85rem; color: var(--text);
}
.search-box input:focus { outline: none; }
.search-box input::placeholder { color: var(--faint); }
.search-submit {
  flex: 0 0 auto; width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: var(--green); color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.2s ease;
}
.search-submit:hover { background: var(--green-dark); }
.search-submit .icon { width: 16px; height: 16px; }
#search-toggle .icon { width: 20px; height: 20px; }
/* Click-to-open: the search icon stays in the header at every width;
   clicking it opens one long pill bar under the header (client's choice). */
.site-header.search-open .search-box {
  display: flex; position: absolute; top: calc(100% + 0.5rem); left: 50%;
  transform: translateX(-50%); width: min(680px, calc(100% - 1.6rem)); z-index: 60;
  padding: 0.3rem; background: var(--surface);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.22);
}

/* Dark-mode switch — pill track with a sliding sun/moon knob */
.theme-switch {
  position: relative; flex: 0 0 auto; width: 58px; height: 32px; padding: 0;
  border-radius: 999px; border: 1px solid var(--border); background: var(--chip-bg);
  cursor: pointer; transition: background 0.3s ease, border-color 0.3s ease;
}
.theme-switch:hover { border-color: var(--leaf); }
.theme-knob {
  position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #ffffff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
}
.theme-knob .icon { width: 15px; height: 15px; }
/* Clean line icons in brand greens (no emoji-orange): moon invites dark
   mode in light theme; sun invites light mode in dark theme. */
.theme-knob .icon-sun { display: none; color: var(--leaf); }
.theme-knob .icon-moon { color: var(--green); }
[data-theme="dark"] .theme-switch { background: #1d1d1d; }
[data-theme="dark"] .theme-knob { transform: translateX(28px); background: #333333; }
[data-theme="dark"] .theme-knob .icon-sun { display: block; }
[data-theme="dark"] .theme-knob .icon-moon { display: none; }

/* ---------- News ticker ---------- */
.ticker {
  display: flex; align-items: center; gap: 0.7rem;
  background: var(--green-dark); color: #fff;
  padding: 0.38rem 1.1rem; overflow: hidden;
}
.ticker-label {
  flex: 0 0 auto; background: var(--leaf); color: #fff;
  font-size: 0.8rem; font-weight: 700; padding: 0.14rem 0.6rem; border-radius: 999px;
  position: relative; z-index: 2;
}
.ticker-viewport { flex: 1; overflow: hidden; }
.ticker-track {
  display: inline-flex; align-items: center; gap: 2.4rem; white-space: nowrap;
  animation: tickerScroll 55s linear infinite; will-change: transform;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item { color: #fff !important; font-size: 0.95rem; }
.ticker-item:hover { text-decoration: underline; }
.ticker-dot { color: var(--leaf); font-weight: 700; }
@keyframes tickerScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Layout ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 1.1rem; }
.section { margin: 2.4rem 0; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  border-bottom: 2px solid var(--soft); padding-bottom: 0.4rem; margin-bottom: 1.1rem;
}
.section-head h2 {
  margin: 0; font-size: 1.45rem; font-weight: 700;
  border-left: 5px solid var(--leaf); padding-left: 0.55rem;
}
.section-head .clear-search { font-size: 0.9rem; font-weight: 600; white-space: nowrap; }

/* ---------- Hero (cinematic) ---------- */
.hero {
  position: relative; display: block; border-radius: 0;
  min-height: 420px; overflow: hidden; color: #fff;
  background: linear-gradient(120deg, var(--green-dark), var(--green));
}
.hero-slide {
  position: absolute; inset: 0; display: block; color: #fff;
  opacity: 0; pointer-events: none; transition: opacity 0.85s ease;
}
.hero-slide.is-active { opacity: 1; pointer-events: auto; z-index: 1; }
.hero-media { display: contents; }
/* The whole slide is a link; in dark mode the generic link colour must
   never wash the banner text green. */
[data-theme="dark"] .hero-slide { color: #fff; }
[data-theme="dark"] .hero-content h1 { color: #fff; }
.hero-slide:hover { text-decoration: none; }
.hero-slide img.hero-bg {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 28%;
  animation: heroZoom 14s ease-in-out infinite alternate;
}
.hero-slide::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(7, 20, 4, 0.04) 0%, rgba(7, 20, 4, 0.34) 46%, rgba(4, 13, 2, 0.96) 100%);
}
.hero-dots {
  position: absolute; z-index: 5; right: 1.1rem; bottom: 1rem;
  display: flex; gap: 0.45rem;
}
.hero-dot {
  width: 9px; height: 9px; padding: 0; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, 0.45);
  transition: width 0.3s ease, background 0.3s ease;
}
.hero-dot.is-active { width: 24px; background: #fff; }
.hero-content {
  position: relative; z-index: 2; max-width: 1180px; margin: 0 auto;
  padding: 9.5rem 1.1rem 2.2rem;
  animation: fadeUp 0.9s ease both;
}
.hero-content h1 { font-size: clamp(1.7rem, 4.2vw, 2.9rem); line-height: 1.25; margin: 0.5rem 0; max-width: 22ch; }
.hero-content p { max-width: 62ch; opacity: 0.94; margin: 0.3rem 0 0; }
.hero-excerpt {
  display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
}
.hero:hover { text-decoration: none; }
@keyframes heroZoom { from { transform: scale(1); } to { transform: scale(1.06); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- Byline (author photo + name) ---------- */
.byline { display: flex; align-items: center; gap: 0.7rem; margin: 0.9rem 0 1.1rem; }
.byline-avatar {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
  border: 2px solid var(--leaf); background: var(--soft);
}
.byline-text { display: flex; flex-direction: column; line-height: 1.35; }
.byline-name { color: var(--byline-name); font-weight: 700; }
.byline-text time, .byline-text .reading-time { color: var(--muted); font-size: 0.9rem; }
.hero-byline { display: flex; align-items: center; gap: 0.55rem; margin-top: 0.7rem; opacity: 1 !important; }
.hero-byline .byline-avatar { width: 34px; height: 34px; border-color: rgba(255, 255, 255, 0.75); }
.hero-byline .byline-name { color: #fff; }

/* ---------- Chips / cards ---------- */
.chip {
  display: inline-block; background: var(--leaf); color: #fff !important;
  font-size: 0.82rem; font-weight: 700; padding: 0.18rem 0.65rem; border-radius: 999px;
}
.chip:hover { text-decoration: none; background: var(--green); }
.chip-row {
  display: flex; gap: 0.55rem; overflow-x: auto; padding: 0.8rem 0 0.2rem;
  scrollbar-width: none; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip-row .chip {
  background: var(--chip-bg); color: var(--green) !important; border: 1px solid var(--border);
  white-space: nowrap; scroll-snap-align: start;
}
[data-theme="dark"] .chip-row .chip { color: var(--leaf) !important; }
.chip-row .chip:hover { background: var(--green); color: #fff !important; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 1.15rem; }
.card {
  display: flex; flex-direction: column; height: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; color: var(--text);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); text-decoration: none; }
.card-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; background: var(--soft); }
.card-ph {
  aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--green), var(--leaf)); color: #fff;
  font-weight: 800; letter-spacing: 0.12em;
}
.card-body { padding: 0.85rem 1rem 1rem; display: flex; flex-direction: column; flex: 1; }
.card-body h3 {
  margin: 0.25rem 0 0.35rem; font-size: 1.08rem; line-height: 1.45; font-weight: 700;
  display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  min-height: 2.9em;
}
.card-body p {
  margin: 0 0 0.5rem; color: var(--muted); font-size: 0.94rem;
  display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}
.card-body time { margin-top: auto; }
.card-body time { color: var(--faint); font-size: 0.83rem; }
.card-cat { color: var(--green); font-weight: 700; font-size: 0.8rem; }
[data-theme="dark"] .card-cat { color: var(--leaf); }

.load-more {
  display: block; margin: 1.6rem auto 0; padding: 0.65rem 2rem;
  background: var(--green); color: #fff; border: 0; border-radius: 999px;
  font: inherit; font-weight: 700; cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.load-more:hover { background: var(--green-dark); transform: translateY(-1px); }
.empty-note {
  color: var(--muted); text-align: center; padding: 2.2rem 1rem;
  background: var(--soft); border: 1px dashed var(--border); border-radius: var(--radius);
  grid-column: 1 / -1;
}

/* ---------- Loading skeletons ---------- */
.skel { pointer-events: none; }
.skel-img, .skel-line {
  background: linear-gradient(100deg, var(--skel-a) 40%, var(--skel-b) 50%, var(--skel-a) 60%);
  background-size: 200% 100%; animation: skelShimmer 1.3s linear infinite;
}
.skel-img { aspect-ratio: 16/9; }
.skel-line { height: 0.85rem; border-radius: 6px; margin: 0.45rem 0; }
.skel-line.w40 { width: 40%; } .skel-line.w70 { width: 70%; } .skel-line.w90 { width: 90%; }
@keyframes skelShimmer { from { background-position: 180% 0; } to { background-position: -20% 0; } }

/* ---------- Reveal animation (purposeful, subtle) ---------- */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.in { opacity: 1; transform: none; transition: opacity 0.55s ease, transform 0.55s ease; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .hero img.hero-bg, .hero-slide img.hero-bg { animation: none; }
  .hero-slide { transition: none; }
  .theme-knob { transition: none; }
  .ticker-track { animation: none; }
  .skel-img, .skel-line { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Article ---------- */
.article-wrap { max-width: 840px; margin: 0 auto; padding: 1.4rem 1.1rem 3rem; }
.article h1 { font-size: clamp(1.55rem, 3.6vw, 2.3rem); line-height: 1.35; margin: 0.7rem 0 0.5rem; }
.article-meta { display: flex; gap: 1rem; flex-wrap: wrap; color: var(--muted); font-size: 0.92rem; margin-bottom: 1rem; }
.article-cover { width: 100%; border-radius: var(--radius); margin-bottom: 1.2rem; }
.article-body p { font-size: 1.12rem; line-height: 1.95; margin: 0 0 1.1rem; }
.article-figure { margin: 1.2rem 0; }
.article-figure img { width: 100%; border-radius: var(--radius); }
.article-figure figcaption { color: var(--muted); font-size: 0.9rem; text-align: center; margin-top: 0.35rem; }
.source-line { color: var(--muted); border-top: 1px solid var(--border); padding-top: 0.8rem; }
.share-row { margin: 1.6rem 0; }
.share-btn {
  display: inline-flex; align-items: center; gap: 0.45rem; background: var(--green); color: #fff !important; font-weight: 700;
  padding: 0.6rem 1.4rem; border-radius: 999px;
}
.share-btn:hover { background: var(--green-dark); text-decoration: none; }
.related { margin-top: 2.6rem; }
.related h2 { border-left: 5px solid var(--leaf); padding-left: 0.55rem; }

/* ---------- Static pages ---------- */
.page-body { max-width: 840px; margin: 0 auto; padding: 2rem 1.1rem 3rem; }
.page-body h1 { margin-top: 0; }
.page-body p { font-size: 1.05rem; line-height: 1.9; }
.contact-row { font-size: 1.05rem; display: flex; align-items: center; gap: 0.55rem; }
.contact-icon { color: var(--green); display: inline-flex; font-size: 1.15rem; }
[data-theme="dark"] .contact-icon { color: var(--leaf); }
.contact-row a { font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 3rem; background: var(--green-dark); color: #eaf3e6; text-align: center;
  padding: 2.2rem 1.1rem 1.6rem;
}
.site-footer .footer-logo { max-width: 520px; width: 92%; border-radius: 10px; margin-bottom: 1rem; }
.footer-desc { max-width: 680px; margin: 0 auto 1rem !important; line-height: 1.7; }
.footer-nav { display: flex; justify-content: center; align-items: center; gap: 0.55rem 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.footer-nav a, .footer-category-links a { color: #fff; font-weight: 600; display: inline-flex; align-items: center; gap: 0.35rem; }
.footer-categories { margin: 0 auto 1.2rem; }
.footer-categories h2 { font-size: 1rem; margin: 0 0 0.55rem; color: #fff; letter-spacing: 0.02em; }
.footer-category-links { display: flex; justify-content: center; gap: 0.45rem 1rem; flex-wrap: wrap; }
.site-footer p { margin: 0.25rem 0; font-size: 0.92rem; opacity: 0.92; }
.site-footer .dev-credit { color: inherit; font-weight: 700; }
.site-footer .dev-credit:hover { text-decoration: underline; }

/* ---------- Mobile / tablet ---------- */
@media (max-width: 860px) {
  .header-bar { min-height: 64px; padding: 0.35rem 0.8rem; gap: 0.5rem; }
  .brand img { height: 36px; }
  .nav-toggle { display: inline-flex; }
  .main-nav {
    display: none; width: 100%;
    flex-direction: column; gap: 0; padding: 0.4rem 0 0.6rem;
    border-top: 1px solid var(--border); background: var(--header-bg); box-shadow: 0 18px 30px rgba(0, 0, 0, 0.12);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 0.5rem 0.2rem; font-size: 1rem; }
  /* Mobile banner = classic overlay: headline/byline INSIDE the banner,
     over the photo (owner's explicit choice). Height is moderate — tall
     enough for chip + 3-line headline + excerpt + byline + date without
     clipping, never the full screen. */
  .hero { min-height: 330px; height: min(94vw, 400px); max-height: none; aspect-ratio: auto; }
  .hero-slide img.hero-bg { object-position: center 30%; animation: none; }
  .hero-slide::after {
    background: linear-gradient(180deg, rgba(7, 20, 4, 0.16) 0%, rgba(7, 20, 4, 0.5) 46%, rgba(4, 13, 2, 0.95) 100%);
  }
  .hero-content { position: absolute; left: 0; right: 0; bottom: 0; padding: 1rem 1rem 2.1rem; }
  .hero-content h1 {
    font-size: clamp(1.35rem, 5.2vw, 1.65rem); line-height: 1.38;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  }
  .hero-content p { font-size: 0.94rem; line-height: 1.55; }
  .hero-content .hero-byline { font-size: 0.9rem; }
  .hero-content time { font-size: 0.85rem; }
  .hero-dots { right: 0.9rem; bottom: 0.85rem; }
  .section { margin: 1.8rem 0; }
  .section-head h2 { font-size: 1.25rem; }
  .card-body { padding: 0.75rem 0.9rem 0.95rem; }
  .card-body h3 { font-size: 1rem; line-height: 1.42; }
  .card-body p { font-size: 0.9rem; line-height: 1.55; }
  .card-body time { font-size: 0.8rem; }
  .ticker { padding: 0.32rem 0.8rem; }
  .ticker-item { font-size: 0.85rem; }
  .ticker-label { font-size: 0.76rem; }
  .byline-avatar { width: 38px; height: 38px; }
}
@media (max-width: 640px) {
  .section-head h2 { font-size: 1.2rem; }
  .article-body p { font-size: 1.05rem; line-height: 1.9; }
}

@media (max-width: 640px) {
  .hero-excerpt { -webkit-line-clamp: 2; }
}
@media (max-width: 480px) {
  .header-bar { min-height: 62px; padding: 0.32rem 0.65rem; gap: 0.35rem; }
  .brand img { height: 32px; }
  .header-actions { gap: 0.2rem; }
  .icon-btn { width: 36px; height: 36px; }
  .theme-switch { width: 48px; height: 28px; }
  .theme-knob { width: 20px; height: 20px; }
  [data-theme="dark"] .theme-knob { transform: translateX(20px); }
  .main-nav { padding: 0.35rem 0.8rem 0.7rem; }
  .main-nav a { width: 100%; padding: 0.52rem 0.15rem; }
  .nav-facebook { width: 100%; }
}
