/*
Theme Name: Bhorer Khobor
Theme URI: https://example.com/bhorer-khobor
Author: Your Name
Description: Bangla news portal theme with breaking ticker, hero with সর্বশেষ/জনপ্রিয় tabs, news sections, video gallery, a built-in advertisement manager, SEO schema, AJAX load-more and a responsive layout.
Version: 2.0.0
License: GPLv2 or later
Text Domain: bd-news
*/

:root {
  --accent: #0b7a4b;
  --accent-dark: #075b37;
  --red: #e0202a;
  --text: #222;
  --muted: #666;
  --bg: #f2f3f5;
  --card: #fff;
  --border: #e3e5e8;
  --dark: #1d2328;
  --font: 'Noto Sans Bengali', 'Hind Siliguri', 'Segoe UI', Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.7; font-size: 16px; }
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { line-height: 1.45; }
.container { width: min(1220px, 94%); margin: 0 auto; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff; padding: 8px 12px; z-index: 999; }
.skip-link:focus { left: 10px; top: 10px; }
.thumb-placeholder { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, #dfe7e3, #c9d6cf); }

/* ---------- Top bar ---------- */
.topbar { background: #fff; border-bottom: 1px solid var(--border); font-size: 13px; color: #444; padding: 6px 0; }
.topbar-in { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.top-right { display: flex; align-items: center; gap: 12px; }
.top-right > a { color: #444; font-weight: 600; }
.social { display: inline-flex; gap: 5px; align-items: center; }
.social a { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 700; }
.social .fb { background: #1877f2; }
.social .yt { background: #e62117; }
.social .x { background: #111; }
.social .rss { background: #f26522; }
.social a:hover { opacity: .85; color: #fff; }

/* ---------- Masthead & ads ---------- */
.masthead { background: #fff; padding: 12px 0; }
.masthead-in { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.brand img.custom-logo { max-height: 72px; width: auto; }
.site-logo-text { font-size: 34px; font-weight: 700; color: var(--accent); }
.site-tagline { margin: 0; color: var(--muted); font-size: 14px; }
.masthead-ad { flex: 1; display: flex; justify-content: flex-end; min-width: 0; }

.ad-slot { margin: 16px 0; }
.ad-slot img { width: 100%; height: auto; border-radius: 4px; }
.ad-slot .ad-link, .ad-slot .ad-item { display: block; }
.ad-header { margin: 0; width: 100%; max-width: 728px; }
.ad-fallback { border: 1px dashed #b9bec4; background: #f7f8fa; color: #555; padding: 22px 14px; font-size: 15px; border-radius: 4px; text-align: center; }
.ad-header .ad-fallback { padding: 14px; font-size: 14px; }
.ad-home_hero, .ad-home_full { margin: 18px 0; }
.ad-home_row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ad-home_row .ad-fallback { padding: 40px 14px; }
.ad-sidebar { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.ad-article_top, .ad-article_bottom { margin: 18px 0; }
.footer-ad .ad-fallback { color: #cfd3d8; background: #262d33; border-color: #47505a; }

/* ---------- Ticker ---------- */
.ticker-row { background: #fff; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.ticker-in { display: flex; align-items: center; gap: 12px; }
.ticker-label { background: var(--red); color: #fff; padding: 6px 14px; font-weight: 700; white-space: nowrap; font-size: 14px; }
.ticker-track { flex: 1; overflow: hidden; white-space: nowrap; }
.ticker-track span { display: inline-block; padding: 7px 0; animation: ticker 40s linear infinite; }
.ticker-track a { margin-right: 50px; }
.ticker-track:hover span { animation-play-state: paused; }
@keyframes ticker { from { transform: translateX(100%); } to { transform: translateX(-100%); } }

/* ---------- Navigation ---------- */
.nav { background: var(--accent); position: sticky; top: 0; z-index: 50; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.nav li { position: relative; }
.nav li > a { display: block; color: #fff; padding: 11px 12px; font-size: 14.5px; font-weight: 600; white-space: nowrap; }
.nav li > a:hover, .nav .current-menu-item > a { background: var(--accent-dark); color: #fff; }
.nav li.has-sub > a:after { content: " ▾"; font-size: 11px; }
.nav .sub-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 210px; background: var(--accent-dark); flex-direction: column; box-shadow: 0 8px 18px rgba(0,0,0,.2); z-index: 20; }
.nav .sub-menu a { font-size: 14px; font-weight: 500; padding: 10px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.nav li:hover > .sub-menu, .nav li:focus-within > .sub-menu { display: flex; }
.nav-search { display: flex; flex-shrink: 0; }
.nav-search input { border: 0; padding: 6px 10px; border-radius: 3px 0 0 3px; width: 190px; font-family: inherit; font-size: 14px; }
.nav-search button { background: #fff; border: 0; padding: 0 10px; border-radius: 0 3px 3px 0; cursor: pointer; }
.nav-search.big { justify-content: center; margin: 18px 0; }
.nav-search.big input { width: 320px; border: 1px solid var(--border); border-radius: 4px 0 0 4px; padding: 10px 12px; }
.nav-search.big button { background: var(--accent); color: #fff; padding: 10px 18px; border-radius: 0 4px 4px 0; font-family: inherit; }
.menu-toggle { display: none; background: none; border: 0; color: #fff; font-size: 16px; padding: 11px 6px; cursor: pointer; font-family: inherit; }

/* ---------- Homepage hero ---------- */
.hero-wrap { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); gap: 18px; margin: 20px 0 6px; align-items: start; }
.hero-lead { position: relative; display: block; border-radius: 6px; overflow: hidden; background: #000; }
.hero-img { display: block; height: 420px; }
.hero-img img, .hero-img .thumb-placeholder { width: 100%; height: 100%; object-fit: cover; }
.hero-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 20px 18px; background: linear-gradient(transparent, rgba(0,0,0,.88)); color: #fff; }
.hero-cap h2 { color: #fff; font-size: 26px; margin: 8px 0; }
.hero-cap .meta { color: #ddd; }
.hero-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
.hero-mini { background: var(--card); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.hero-mini-img { display: block; aspect-ratio: 16 / 10; }
.hero-mini-img img, .hero-mini-img .thumb-placeholder { width: 100%; height: 100%; object-fit: cover; }
.hero-mini-title { display: block; padding: 8px 10px 10px; font-size: 14.5px; font-weight: 600; line-height: 1.5; }
.hero-tabs { background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px 14px; }
.btn-all { display: block; text-align: center; margin-top: 12px; background: var(--accent); color: #fff !important; padding: 9px; border-radius: 4px; font-weight: 600; }

/* Tabs */
.tab-nav { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 8px; }
.tab-nav button { flex: 1; background: none; border: 0; padding: 9px 6px; font-family: inherit; font-size: 15px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tab-nav button.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Ranking list */
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.rank-list li:last-child { border-bottom: 0; }
.rank-list li > a { display: flex; gap: 10px; align-items: center; flex: 1; min-width: 0; }
.rank-no { font-weight: 700; color: var(--accent); min-width: 22px; text-align: center; font-size: 17px; }
.rank-list .li-thumb { width: 96px; height: 64px; }

/* Shared list pieces */
.li-thumb { display: block; width: 130px; height: 84px; flex-shrink: 0; border-radius: 4px; overflow: hidden; background: #e6ebe8; }
.li-thumb img { width: 100%; height: 100%; object-fit: cover; }
.li-text { display: block; min-width: 0; }
.li-text h4 { font-size: 15px; font-weight: 600; margin: 0 0 4px; line-height: 1.5; }
.meta { font-size: 12.5px; color: var(--muted); }
.cat-badge { display: inline-block; background: var(--red); color: #fff !important; font-size: 12px; padding: 2px 9px; border-radius: 3px; font-weight: 600; margin-bottom: 6px; }

/* ---------- Section blocks (homepage) ---------- */
.sec-block { margin: 28px 0; }
.sec-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.sec-head h2 { margin: 0; font-size: 20px; font-weight: 700; color: var(--accent); border-bottom: 3px solid var(--accent); padding: 0 2px 8px; margin-bottom: -1px; }
.sec-head.dark { border-bottom-color: #39424b; }
.sec-head.dark h2 { color: #fff; border-bottom-color: var(--red); }
.sec-more { color: var(--accent); font-size: 14px; font-weight: 600; padding-bottom: 8px; white-space: nowrap; }
.sec-head.dark .sec-more { color: #cfd3d8; }
.sec-body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 22px; }
.lead { background: var(--card); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.lead-img { display: block; aspect-ratio: 16 / 10; background: #e6ebe8; }
.lead-img img, .lead-img .thumb-placeholder { width: 100%; height: 100%; object-fit: cover; }
.lead h3 { font-size: 19px; margin: 12px 14px 6px; }
.lead .meta { margin: 0 14px 14px; display: block; }
.sec-list { list-style: none; margin: 0; padding: 0; }
.sec-list li { border-bottom: 1px dashed var(--border); }
.sec-list li:last-child { border-bottom: 0; }
.sec-list li > a { display: flex; gap: 12px; padding: 10px 0; align-items: center; }
.sec-list .li-thumb { width: 120px; height: 80px; }

/* ---------- Video gallery block ---------- */
.video-block { background: var(--dark); color: #fff; border-radius: 6px; padding: 20px; margin: 30px 0; }
.video-block .sec-head h2 { color: #fff; }
.video-body { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; }
.video-lead { position: relative; display: block; border-radius: 6px; overflow: hidden; background: #000; }
.video-thumb { display: block; aspect-ratio: 16 / 9; }
.video-thumb img, .video-thumb .thumb-placeholder { width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.play-icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -60%); width: 64px; height: 64px; border-radius: 50%; background: rgba(224,32,42,.92); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 24px; padding-left: 4px; }
.video-title { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 16px 14px; background: linear-gradient(transparent, rgba(0,0,0,.9)); font-size: 18px; font-weight: 600; color: #fff; }
.video-list { list-style: none; margin: 0; padding: 0; }
.video-list li { border-bottom: 1px solid #39424b; }
.video-list li:last-child { border-bottom: 0; }
.video-list a { display: flex; gap: 12px; padding: 9px 0; align-items: center; color: #fff; }
.video-list .li-thumb { width: 120px; height: 72px; }
.video-list h4 { color: #fff; }

/* ---------- Footer ---------- */
.site-footer { background: var(--dark); color: #cfd3d8; margin-top: 40px; font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 30px; padding: 40px 0 26px; }
.footer-grid h4 { color: #fff; margin: 0 0 10px; font-size: 16px; }
.footer-grid p { margin: 0 0 8px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: #cfd3d8; }
.footer-grid a:hover { color: #fff; }
.f-brand .site-logo-text, .f-name { font-size: 22px; font-weight: 700; color: #fff; margin: 0 0 10px; }
.f-brand .custom-logo { max-height: 60px; width: auto; filter: brightness(1.1); }
.f-brand .social { margin-top: 10px; }
.footer-ad { padding-bottom: 6px; }
.copyright { background: #14181c; text-align: center; padding: 14px 0; font-size: 13px; color: #98a2ac; }
.to-top { position: fixed; right: 18px; bottom: 18px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 16px; cursor: pointer; display: none; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,.25); z-index: 60; }
.to-top.show { display: flex; }

/* ---------- Layout with sidebar (inner pages) ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; margin: 22px auto; }
.content { min-width: 0; }
.sidebar .widget { background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 14px; margin-bottom: 20px; }
.widget-title { font-size: 17px; margin: 0 0 12px; border-bottom: 2px solid var(--accent); padding-bottom: 8px; }

/* Section / archive pages */
.section-hero { background: var(--card); border: 1px solid var(--border); border-left: 5px solid var(--red); border-radius: 6px; padding: 16px 20px; margin-bottom: 18px; }
.section-hero h1 { margin: 2px 0 0; font-size: 26px; }
.crumb { font-size: 13px; color: var(--accent); font-weight: 600; }
.cat-desc { color: var(--muted); margin: 6px 0 0; font-size: 15px; }
.sub-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.chip { padding: 6px 14px; border: 1px solid var(--border); border-radius: 20px; background: var(--card); font-size: 14px; font-weight: 600; }
.chip:hover, .chip.current { background: var(--accent); border-color: var(--accent); color: #fff; }
.empty { background: var(--card); padding: 22px; border-radius: 6px; border: 1px solid var(--border); color: var(--muted); }
.more-wrap { text-align: center; margin: 24px 0 8px; }
.load-more { background: var(--accent); color: #fff; border: 0; padding: 12px 30px; border-radius: 4px; font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit; }
.load-more:disabled { opacity: .6; cursor: wait; }

/* Cards grid */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; }
.card-img { display: block; aspect-ratio: 16 / 10; background: #e6ebe8; }
.card-img img, .card-img .thumb-placeholder { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 12px 14px 16px; }
.card h3 { font-size: 16.5px; margin: 0 0 8px; }

/* Pagination */
.navigation .nav-links { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 24px; }
.page-numbers { padding: 8px 14px; background: var(--card); border: 1px solid var(--border); border-radius: 4px; }
.page-numbers.current { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Single article */
.article { background: var(--card); padding: 26px; border-radius: 6px; border: 1px solid var(--border); }
.article-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.parent-cat { font-size: 13px; color: var(--muted); }
.article-title { font-size: 31px; line-height: 1.4; margin: 10px 0; }
.article-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--muted); padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.article-meta .byline { color: var(--text); font-weight: 600; }
.share-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0 18px; }
.share-label { font-size: 14px; font-weight: 600; margin-right: 4px; }
.share { display: inline-block; color: #fff !important; font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 4px; border: 0; cursor: pointer; font-family: inherit; }
.share:hover { opacity: .88; }
.share.fb { background: #1877f2; } .share.wa { background: #25d366; } .share.x { background: #111; } .share.copy { background: #6b7280; }
.featured { margin: 0 0 20px; }
.featured img { width: 100%; border-radius: 6px; }
.featured figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }
.video-embed { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 6px; margin-bottom: 18px; background: #000; }
.video-embed iframe, .video-embed video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.article-content { font-size: 18px; line-height: 1.9; }
.article-content p { margin: 0 0 1.2em; }
.article-content h2, .article-content h3 { margin: 1.4em 0 .6em; }
.article-content img { border-radius: 6px; margin: 1em auto; }
.article-content blockquote { margin: 1.4em 0; padding: 12px 18px; border-left: 4px solid var(--accent); background: #f6faf8; }
.article-content a { color: var(--accent); text-decoration: underline; }
.tags { margin-top: 22px; font-size: 14px; }
.tags a { display: inline-block; background: #eef2f0; padding: 3px 10px; border-radius: 20px; margin: 4px 4px 0 0; }
.related { margin-top: 26px; }
.comments-wrap { margin-top: 22px; background: var(--card); padding: 22px 26px; border: 1px solid var(--border); border-radius: 6px; }
.comments-wrap textarea, .comments-wrap input[type=text], .comments-wrap input[type=email], .comments-wrap input[type=url] { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 4px; font-family: inherit; margin-bottom: 10px; }
.comments-wrap .submit { background: var(--accent); color: #fff; border: 0; padding: 10px 22px; border-radius: 4px; cursor: pointer; font-family: inherit; }

/* 404 */
.notfound { text-align: center; padding: 48px 28px; }
.nf-code { font-size: 64px; font-weight: 700; color: var(--red); margin: 0; line-height: 1; }
.btn { display: inline-block; background: var(--accent); color: #fff !important; padding: 10px 22px; border-radius: 4px; font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .hero-row { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .hero-wrap, .sec-body, .video-body, .layout { grid-template-columns: 1fr; }
  .masthead-in { flex-direction: column; align-items: flex-start; }
  .masthead-ad { justify-content: flex-start; width: 100%; }
  .menu-toggle { display: block; }
  .nav-inner { flex-wrap: wrap; }
  .nav ul { display: none; flex-direction: column; width: 100%; }
  .nav.open ul { display: flex; }
  .nav .sub-menu { position: static; box-shadow: none; background: rgba(0,0,0,.12); min-width: 0; }
  .nav.open .sub-menu { display: flex; }
  .nav li:hover > .sub-menu { display: none; }
  .nav.open li.sub-open > .sub-menu { display: flex; }
  .nav.open li.sub-open > a:after { content: " ▴"; }
  .nav-search { width: 100%; order: 3; }
  .nav-search input { flex: 1; width: auto; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ad-home_row { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
}
@media (max-width: 600px) {
  body { font-size: 15px; }
  .grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .topbar-in { font-size: 12px; }
  .hero-img { height: 260px; }
  .hero-cap h2 { font-size: 20px; }
  .hero-row { grid-template-columns: 1fr 1fr; }
  .article-title { font-size: 23px; }
  .article-content { font-size: 16.5px; }
  .section-hero h1 { font-size: 21px; }
  .li-thumb, .sec-list .li-thumb, .video-list .li-thumb { width: 96px; height: 62px; }
  .ticker-label { font-size: 12px; padding: 5px 10px; }
  .site-logo-text { font-size: 26px; }
  .nav-search.big input { width: 100%; }
}
