/*
Theme Name: BHS News
Theme URI: https://bhsnewsonline.com/
Author: BHS News Online
Author URI: https://bhsnewsonline.com/
Description: Official WordPress theme for BHS News Online — "বিএইচএস নিউজ, বরিশালের প্রতিচ্ছবি". Barishal-focused news homepage: large hero, breaking ticker, district sections, video section, most-read and দর্শক প্রিয়. Colours taken from the BHS News logo (dark green and dark red). Responsive with dark mode.
Version: 1.0.6
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bhs-news
Tags: news, bengali, barishal, responsive, dark-mode, custom-logo, custom-menu, featured-images
*/

:root{
  --bg:#f7f7f4; --surface:#ffffff; --surface2:#eef3f0;
  --ink:#17211c; --ink2:#45524b; --line:#dde3de;
  --green:#14572c; --green-deep:#0d3a20; --green-soft:#e4efe6;
  --red:#9d1c21; --red-deep:#7a1418; --gold:#e8a33d;
  --band:#0d3a20;
  --shadow:0 10px 28px rgba(10,40,26,.10);
  --radius:10px;
}
[data-theme="dark"]{
  --bg:#101613; --surface:#1d2f26; --surface2:#17211c;
  --ink:#eaf4ee; --ink2:#a9b8ae; --line:#2b362f;
  --green-soft:#1d2f26; --shadow:0 10px 28px rgba(0,0,0,.35);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:var(--bg);color:var(--ink);
  font-family:"Hind Siliguri",system-ui,-apple-system,"Segoe UI",sans-serif;
  line-height:1.65;font-size:17px}
a{color:var(--green);text-decoration:none}
a:hover{color:var(--red);text-decoration:underline}
img{max-width:100%;height:auto;display:block}
h1,h2,h3,h4{font-family:"Noto Serif Bengali","Hind Siliguri",serif;line-height:1.35;margin:.4em 0}
.container{max-width:1240px;margin:0 auto;padding:0 16px}
.screen-reader-text{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* Top bar */
.topbar{background:#0a2617;color:#cfe0d5;font-size:14px}
.topbar .container{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;padding-top:6px;padding-bottom:6px}
.topbar a{color:#fff}
.topbar .social a{margin-left:12px}

/* Header — glossy finish (1.0.5), same green palette.
   A vertical green gradient (lighter green at the top fading to the
   deep green), a soft white sheen overlay via ::before, an inset top
   highlight and a subtle bottom edge — tasteful gloss, not garish.
   The header keeps the same dark-green background in both light and
   dark mode, so text stays readable; the sheen is pointer-events:none
   and sits behind the header content (children are z-index:1), so it
   never blocks clicks or the dropdown menus. */
.site-header{background:linear-gradient(180deg,#1d7a3d 0%,var(--green) 45%,var(--green-deep) 100%);color:#fff;position:sticky;top:0;z-index:50;box-shadow:0 2px 12px rgba(0,0,0,.25),inset 0 1px 0 rgba(255,255,255,.28);border-bottom:1px solid rgba(255,255,255,.16)}
.site-header::before{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(255,255,255,.22),rgba(255,255,255,.06) 42%,rgba(255,255,255,0) 62%),radial-gradient(ellipse 70% 90% at 18% 0%,rgba(255,255,255,.14),rgba(255,255,255,0) 70%);pointer-events:none}
.site-header>*{position:relative;z-index:1}
.header-inner{display:flex;align-items:center;gap:16px;padding:12px 16px;flex-wrap:wrap}
.site-logo img{width:76px;height:76px;border-radius:50%;object-fit:cover;background:#fff}
.site-branding .site-title{margin:0;font-size:30px;line-height:1.1}
.site-branding .site-title a{color:#fff}
.site-branding .tagline{margin:2px 0 0;color:#dcebe1;font-size:15px}
.header-actions{margin-left:auto;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.btn{display:inline-block;background:var(--red);color:#fff;padding:9px 16px;border-radius:8px;font-weight:600;border:0;cursor:pointer}
.btn:hover{background:var(--red-deep);color:#fff;text-decoration:none}
.btn-ghost{background:transparent;border:1px solid #fff;color:#fff}
.search-form{display:flex;gap:6px}
.search-form input[type="search"]{padding:9px 10px;border-radius:8px;border:1px solid var(--line);min-width:180px;background:var(--surface);color:var(--ink)}
.menu-toggle{display:none;background:var(--green);color:#fff;border:1px solid #fff;border-radius:8px;padding:9px 12px;cursor:pointer;font-size:16px}

/* Nav */
.main-nav{background:var(--green)}
.main-nav ul{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:2px}
.main-nav li{position:relative}
.main-nav a{display:block;color:#fff;padding:11px 14px;font-weight:600}
.main-nav a:hover,.main-nav .current-menu-item a{background:var(--red);text-decoration:none}
.main-nav ul ul{display:none;position:absolute;left:0;top:100%;background:var(--green-deep);min-width:200px;box-shadow:var(--shadow);z-index:60}
.main-nav li:hover>ul,.main-nav li:focus-within>ul{display:block}
.main-nav ul ul a{padding:10px 14px}

/* Ticker */
.ticker{background:var(--red);color:#fff}
.ticker .container{display:flex;gap:12px;align-items:center;padding-top:8px;padding-bottom:8px}
.ticker-label{background:#fff;color:var(--red);font-weight:700;padding:2px 10px;border-radius:20px;white-space:nowrap}
.ticker-list{list-style:none;margin:0;padding:0;display:flex;gap:24px;overflow:hidden;white-space:nowrap}
.ticker-list a{color:#fff}
.ticker-list li{display:inline}

/* Hero */
.hero{display:grid;grid-template-columns:1.9fr 1fr;gap:20px;margin:24px 0}
.hero-main{background:var(--surface);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow)}
.hero-main .thumb{aspect-ratio:16/9;overflow:hidden;background:var(--surface2)}
.hero-main .thumb img,.card-thumb img{width:100%;height:100%;object-fit:cover}
.hero-body{padding:18px 20px}
.cat-label{display:inline-block;background:var(--red);color:#fff;font-size:13px;font-weight:700;padding:3px 10px;border-radius:20px;margin-bottom:8px}
.hero-main h2{font-size:30px;margin:.2em 0}
.hero-main h2 a{color:var(--ink)}
.post-meta{color:var(--ink2);font-size:14px}
.hero-side{display:flex;flex-direction:column;gap:16px}
.hero-side article,.update-list{background:var(--surface);border-radius:var(--radius);padding:14px 16px;box-shadow:var(--shadow)}
.hero-side h3{font-size:18px;margin:.2em 0}
.hero-side h3 a{color:var(--ink)}
.update-list h3{margin-top:0}
.update-list ul{list-style:none;margin:0;padding:0}
.update-list li{padding:8px 0;border-top:1px solid var(--line)}
.update-list time{color:var(--red);font-weight:700;margin-right:8px}

/* Sections */
.section{margin:28px 0}
.section-head{display:flex;align-items:baseline;gap:14px;border-bottom:3px solid var(--green);margin-bottom:16px;padding-bottom:6px}
.section-head h2{margin:0;font-size:26px;color:var(--green)}
.section-head .more{margin-left:auto;font-weight:600}
.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:20px}
.card{background:var(--surface);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow)}
.card-thumb{aspect-ratio:16/9;background:var(--surface2)}
.card-body{padding:14px 16px}
.card-body h3{font-size:19px;margin:.2em 0}
.card-body h3 a{color:var(--ink)}
.card-body p{color:var(--ink2);margin:.4em 0}
.district-list{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.district-list li{background:var(--surface);border-radius:var(--radius);padding:14px 16px;box-shadow:var(--shadow)}
.district-list a{color:var(--ink);font-weight:600}

/* Video band */
.video-band{background:linear-gradient(135deg,var(--green-deep),var(--red-deep));color:#fff;border-radius:var(--radius);padding:22px}
.video-band h2{color:#fff;margin-top:0}
.video-band a{color:#fff}
.video-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}
.video-card{background:rgba(255,255,255,.1);border-radius:var(--radius);overflow:hidden}
.video-card .card-body h3 a{color:#fff}
.video-card .post-meta{color:#e6efe9}
.duration{position:absolute;background:rgba(0,0,0,.75);color:#fff;padding:2px 8px;border-radius:6px;font-size:13px}
.video-thumb{position:relative;aspect-ratio:16/9;background:#000}
.video-thumb img{width:100%;height:100%;object-fit:cover}
.video-thumb .duration{right:8px;bottom:8px}
/* Facebook video tiles (1.0.5): Facebook returns no usable thumbnail
   image for the Page's videos, so the tile is a styled green-gradient
   play button instead of a photo — no fake image is used. */
.fb-thumb{background:linear-gradient(135deg,#1d7a3d,var(--green-deep) 60%,#0a2617)}
.fb-thumb a{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}
.fb-thumb a:hover{text-decoration:none}
.fb-play{display:inline-flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:50%;background:rgba(255,255,255,.92);color:var(--red);font-size:26px;padding-left:5px;box-shadow:0 4px 16px rgba(0,0,0,.35)}
.fb-thumb a:hover .fb-play{background:#fff;transform:scale(1.06)}
.fb-badge{position:absolute;left:10px;top:10px;background:var(--red);color:#fff;font-size:12px;font-weight:700;padding:3px 10px;border-radius:20px}

/* Ranked lists */
.ranked{display:grid;grid-template-columns:1fr 1fr;gap:20px}
.ranked-box{background:var(--surface);border-radius:var(--radius);padding:18px;box-shadow:var(--shadow)}
.ranked-box h2{color:var(--ink)}
.ranked-box ol{list-style:none;margin:0;padding:0;counter-reset:rank}
.ranked-box li{counter-increment:rank;padding:10px 0 10px 44px;border-top:1px solid var(--line);position:relative}
.ranked-box li::before{content:counter(rank);position:absolute;left:0;top:10px;width:32px;height:32px;border-radius:50%;background:var(--green);color:#fff;text-align:center;line-height:32px;font-weight:700}
.ranked-box li a{color:var(--ink);font-weight:600}
.ranked-box li .post-meta{color:var(--ink2)}
/* FIX (1.0.3): Most Read / sidebar links must never inherit the body
   colour — in OS dark mode the old media query below set body text to
   near-white while surfaces stayed white, so inherited links vanished.
   Every list link now carries an explicit theme colour that is readable
   in both light mode (dark ink on white) and dark mode (light ink on
   dark surface), because --ink/--ink2 switch with [data-theme="dark"]. */
.update-list li a{color:var(--ink)}
.widget li a{color:var(--ink)}
.widget h2,.widget-title{color:var(--ink)}

/* Single / archive */
.article{background:var(--surface);border-radius:var(--radius);padding:24px;box-shadow:var(--shadow);margin:24px 0}
.article h1{font-size:32px}
.article .featured{border-radius:var(--radius);overflow:hidden;margin:16px 0}
.article-content p{margin:1em 0}
.article-content img{border-radius:8px}
.post-nav{display:flex;justify-content:space-between;gap:16px;margin:20px 0;flex-wrap:wrap}
.tags a{display:inline-block;background:var(--green-soft);color:var(--green);padding:4px 10px;border-radius:20px;margin:2px;font-size:14px}
.sidebar{margin:24px 0}
.widget{background:var(--surface);border-radius:var(--radius);padding:16px;box-shadow:var(--shadow);margin-bottom:18px}
.widget h2,.widget-title{font-size:20px;margin-top:0}
.widget ul{list-style:none;margin:0;padding:0}
.widget li{padding:6px 0;border-top:1px solid var(--line)}
.layout{display:grid;grid-template-columns:2fr 1fr;gap:24px;align-items:start}
.no-results,.not-found{background:var(--surface);border-radius:var(--radius);padding:24px;margin:24px 0;box-shadow:var(--shadow)}

/* Footer */
.site-footer{background:#0a2617;color:#cfe0d5;margin-top:40px}
.site-footer a{color:#fff}
.footer-grid{display:grid;grid-template-columns:2fr 1fr 1fr;gap:28px;padding:32px 16px}
.site-footer h3{color:#fff;margin-top:0}
.footer-logo img{width:92px;height:92px;border-radius:50%;background:#fff;margin-bottom:10px}
.footbar{border-top:1px solid rgba(255,255,255,.2);padding:12px 16px;text-align:center;font-size:14px}
.footbar .container{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap}
.footer-contact li{list-style:none;padding:4px 0}

/* Responsive */
@media (max-width:900px){
  .hero,.layout,.ranked{grid-template-columns:1fr}
  .grid,.video-grid{grid-template-columns:repeat(2,1fr)}
  .footer-grid{grid-template-columns:1fr}
  .menu-toggle{display:inline-block}
  .main-nav ul{display:none;flex-direction:column}
  .main-nav.open ul{display:block}
  .main-nav ul ul{position:static;display:block;box-shadow:none}
}
@media (max-width:560px){
  .grid,.video-grid,.district-list{grid-template-columns:1fr}
  .hero-main h2{font-size:24px}
  .site-branding .site-title{font-size:24px}
  .header-inner{flex-direction:column;align-items:flex-start}
}
/* FIX (1.0.3): the old rule here was broken and is DELETED, not replaced.
   It set body text to near-white (#eaf4ee) for any visitor whose OS was
   in dark mode, but never switched the theme's colour variables, so all
   content surfaces stayed white — white text on white cards. That is
   what made "সর্বাধিক পঠিত" (and other inherited-colour text) unreadable.
   Dark mode now applies ONLY through the manual toggle, which sets
   data-theme="dark" on <html> and switches --bg/--surface/--ink/--ink2
   together (see the [data-theme="dark"] block at the top). The
   Additional CSS workaround added on the live site in v1.0.2 is now
   harmless and no longer needed, but keeping it changes nothing. */

/* Auto next-post on single articles (1.0.3) */
.next-post-loading{text-align:center;color:var(--ink2);padding:18px 0}
/* FIX (1.0.4): the auto next-post sentinel was a zero-height empty div
   in v1.0.3 — give it a real 1px box so IntersectionObserver and the
   scroll-position check always have something to measure. */
#bhs-next-sentinel{display:block;min-height:1px}
.next-post-fallback{margin:24px 0;text-align:center}
.next-post-fallback a{display:inline-block;background:var(--green);color:#fff;padding:10px 18px;border-radius:8px;font-weight:600}
.next-post-fallback a:hover{background:var(--red);color:#fff;text-decoration:none}
.next-article{border-top:4px solid var(--green)}

/* "সব খবর" grouped page (1.0.3) */
.all-news-nav{display:flex;flex-wrap:wrap;gap:8px;margin:16px 0 8px}
.all-news-nav a{display:inline-block;background:var(--green-soft);color:var(--green);padding:6px 14px;border-radius:20px;font-weight:600}
.all-news-nav a:hover{background:var(--green);color:#fff;text-decoration:none}
