/*
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.25
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;scroll-padding-top:calc(var(--topbar-h,34px) + 100px)}
/* FIX (1.0.21): anchored jumps used to land with the heading hidden
   under the sticky topbar + sticky header. scroll-padding-top keeps
   every jump target below the pinned bars. */
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;position:sticky;top:0;z-index:60}
.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}
/* Live clock (1.0.9, font fix 1.0.10): 24-hour Bangladesh time,
   top-right of the bar. Noto Serif Bengali, NOT Hind Siliguri —
   Hind Siliguri's Bengali "১" is hard to read at small sizes. */
.header-clock{font-family:"Noto Serif Bengali","Hind Siliguri",serif;font-weight:700;font-size:15px;color:#fff;font-variant-numeric:tabular-nums;white-space:nowrap;margin-right:4px}

/* 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:var(--topbar-h,34px);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}
.sub-toggle{display:none}

/* 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;flex:1;min-width:0;padding-right:24px;-webkit-mask-image:linear-gradient(90deg,#000 88%,transparent 100%);mask-image:linear-gradient(90deg,#000 88%,transparent 100%)}
/* FIX (1.0.21): the ticker text used to be cut mid-word hard at the
   right edge. The fade mask makes the cut look deliberate. */
.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 body in Noto Serif Bengali (Sabbir, 2026-11-16) — newspaper-style serif for reading news; site chrome/UI stays in Hind Siliguri. */
.article-content{font-family:"Noto Serif Bengali","Hind Siliguri",serif}
.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}
  /* FIX (1.0.13): the standalone topbar date span is REMOVED from
     header.php (Sabbir, 2026-11-17 ~21:36) — the clock now carries
     "বরিশাল |" itself, so the date appears exactly once on all
     screens. The old .topbar-date hide rule is gone with it.
     Search bar hidden on mobile (Sabbir, same instruction) —
     desktop keeps the search form. */
  .header-actions .search-form{display:none}
  .menu-toggle{display:inline-block}
  .main-nav ul{display:none;flex-direction:column}
  /* FIX (1.0.22): the old rule ".main-nav.open ul" matched EVERY
     descendant ul, so opening the menu forced all submenus visible
     and defeated the 1.0.21 collapse. It now targets only the
     top-level ul (nav > div.container > ul); submenus open only
     via their own ▾ toggle (.sub-open). */
  .main-nav.open>.container>ul{display:block}
  /* FIX (1.0.21): submenus used to render fully expanded on mobile
     — ~27 rows at once. They now start collapsed; a ▾ button beside
     each parent item opens its submenu (see main.js). The hover rule
     is neutralised here so a tap cannot re-open a closed submenu. */
  .main-nav ul ul{position:static;display:none;box-shadow:none}
  .main-nav li:hover>ul{display:none}
  .main-nav li.sub-open>ul{display:block}
  .main-nav li.menu-item-has-children>a{padding-right:52px}
  .sub-toggle{display:inline-block;position:absolute;right:8px;top:7px;background:rgba(255,255,255,.14);color:#fff;border:1px solid rgba(255,255,255,.45);border-radius:6px;padding:3px 10px;cursor:pointer;font-size:15px;line-height:1.2}
}
@media (max-width:560px){
  .grid,.video-grid,.district-list{grid-template-columns:1fr}
  .hero-main h2{font-size:24px}
  /* FIX (1.0.21, Sabbir 2026-11-18): the mobile header was a tall
     stack — logo on its own row, title + tagline below it, buttons
     on a third row. It is now ONE compact row: small logo, the
     "BHS NEWS / বিএইচএস নিউজ, বরিশালের প্রতিচ্ছবি" text to the
     RIGHT of the logo, and the theme toggle + menu button up in
     the same row at the right. The old column rule is deleted. */
  .header-inner{flex-direction:row;flex-wrap:wrap;gap:10px;padding:8px 12px;align-items:center}
  .site-logo img{width:48px;height:48px}
  .site-branding{flex:1;min-width:0}
  .site-branding .site-title{font-size:20px;line-height:1.15}
  .site-branding .tagline{font-size:12px;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .header-actions{gap:6px;flex-wrap:nowrap}
  .header-actions .btn-ghost{padding:7px 10px}
  .menu-toggle{padding:7px 10px;font-size:15px}
  .victory-header-text{font-size:14px;padding:4px 12px}
  /* FIX (1.0.21): the 16/9 cover-crop on the lead photo could cut
     a yellow banner/headline baked into the photo itself in half.
     On phones the lead photo now shows whole, uncropped. */
  .hero-main .thumb{aspect-ratio:auto}
  .hero-main .thumb img{height:auto}
}
/* 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}

/* Victory-55 (1.0.15–1.0.16, Sabbir 2026-11-17): December 2026 is
   the 55th year of victory. In December the HEADER itself becomes
   the Bangladesh flag — a waving-flag background with the
   "বিজয়ের পঞ্চান্ন বছর" pill on it — and on entry the visitor
   gets round confetti, fireworks and round balloons (js/victory.js).
   Everything is gated to 1–31 Dec 2026 (bhs_news_victory_month()). */
.site-header.victory-mode::before{content:"";position:absolute;inset:0;background-image:linear-gradient(180deg,rgba(0,0,0,.12),rgba(0,0,0,0) 35%,rgba(0,0,0,.28)),url(images/flag-silk.jpg);background-size:140% 100%,140% 100%;background-position:0% 50%,0% 50%;background-repeat:no-repeat;animation:victory-wave 12s ease-in-out infinite alternate;pointer-events:none}
.site-header.victory-mode .main-nav{background:transparent}
.victory-header-text{font-family:"Noto Serif Bengali",serif;font-weight:800;font-size:19px;color:#fff;background:rgba(0,40,24,.45);border:2px solid #f42a41;border-radius:999px;padding:6px 18px;white-space:nowrap;text-shadow:0 1px 3px rgba(0,0,0,.5)}
.victory-confetti{position:fixed;inset:0;width:100%;height:100%;pointer-events:none;z-index:9998}
.victory-float{position:fixed;left:50%;bottom:8%;transform:translateX(-50%);z-index:9999;text-align:center;pointer-events:none;animation:victory-rise 6.5s ease-in forwards}
.victory-float-logo{position:relative;display:block;width:min(72vw,300px);aspect-ratio:1;margin:0 auto}
.victory-float-logo img{width:100%;height:100%;border-radius:50%;opacity:.38;display:block;box-shadow:0 16px 48px rgba(0,0,0,.35)}
.victory-float-logo-text{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);font-family:"Noto Serif Bengali",serif;font-weight:800;font-size:clamp(24px,5.5vw,36px);line-height:1.2;color:#ffd23f;background:rgba(0,45,28,.62);border:2px solid rgba(255,210,63,.65);border-radius:999px;padding:8px 22px;white-space:nowrap;text-shadow:0 2px 6px rgba(0,0,0,.6)}
.victory-float-sub{margin-top:6px;font-family:"Noto Serif Bengali",serif;font-weight:700;font-size:clamp(13px,2.2vw,16px);color:#fff;background:#006a4e;border-radius:999px;padding:3px 14px}
@keyframes victory-wave{
	from{background-position:0% 50%,0% 50%}
	to{background-position:100% 50%,100% 50%}
}
@keyframes victory-rise{
	0%{transform:translate(-50%,40px) scale(.9);opacity:0}
	12%{transform:translate(-50%,0) scale(1);opacity:1}
	70%{opacity:1}
	100%{transform:translate(-50%,-46vh) scale(1.02);opacity:0}
}

/* FIX (1.0.24, Sabbir 2026-11-19): December Victory header on phones.
   Verified in the Customizer mobile preview (?victory-preview=1):
   the "বিজয়ের পঞ্চান্ন বছর" pill shared the logo row, the branding
   shrank to ~0 so the "BHS NEWS" title wrapped and ran underneath
   the pill ("BHS NEW[S]"), the tagline cut to "বি…", and the moon +
   menu buttons wrapped to a second row. The pill now takes its own
   centred row below the logo row in victory-mode, so row 1 stays the
   compact one-row header. The mobile dropdown also had no solid
   background — white text sat on the busy flag photo — so in
   victory-mode the nav gets its solid green back at the hamburger
   breakpoint (<=900px). Secondary: the nowrap live clock clipped at
   ~300px widths; 13px at <=560px keeps it inside the top bar. */
@media (max-width:900px){
  .site-header.victory-mode .main-nav{background:var(--green)}
}
@media (max-width:560px){
  .site-header.victory-mode .victory-header-text{order:5;flex:0 0 auto;margin:4px auto 0}
  .header-clock{font-size:13px}
}

/* FIX (1.0.25, Sabbir 2026-11-19): live clock clipped at ~300px widths.
   .header-clock was white-space:nowrap, so the full "বরিশাল |
   weekday, date | time অপরাহ্ণ" line could not wrap and its tail
   ("অপর…") was cut off with a horizontal scrollbar. On phones the
   clock may now wrap at spaces, so nothing is ever clipped. */
@media (max-width:560px){
  .header-clock{white-space:normal}
}
