/*
Theme Name: The Bengal
Theme URI: https://example.com/the-bengal
Author: The Bengal Team
Author URI: https://example.com
Description: A modern Bangla-language online newspaper theme. Clean, editorial, minimal and fully optimized for Bengali script. Inspired by leading Bangladeshi news portals.
Version: 1.1.0
Requires at least: 5.8
Tested up to: 6.5
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: the-bengal
Tags: news, blog, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, rtl-language-support, two-columns, three-columns, right-sidebar
*/

/* =========================================================
   The Bengal — Main Stylesheet
   ========================================================= */

:root {
  --color-primary: #C0392B;
  --color-primary-dark: #a3301f;
  --color-bg: #F9F9F7;
  --color-text: #1A1A1A;
  --color-body: #444444;
  --color-border: #E0E0E0;
  --color-footer: #1C1C1C;
  --color-white: #ffffff;
  --font-bn-heading: 'Hind Siliguri', 'Noto Sans Bengali', 'SolaimanLipi', sans-serif;
  --font-bn-body: 'Noto Sans Bengali', 'Hind Siliguri', 'SolaimanLipi', sans-serif;
  --font-en: 'Inter', 'Source Sans Pro', system-ui, -apple-system, sans-serif;
  --container: 1240px;
  --radius: 4px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-body);
  font-family: var(--font-bn-body);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html[lang="en"] body { font-family: var(--font-en); }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--color-primary); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-bn-heading);
  color: var(--color-text);
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 .6em;
}

.container { max-width: var(--container); margin-inline: auto; padding-inline: 16px; }

/* ---------- Utility Bar ---------- */
.utility-bar {
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
  color: #666;
}
.utility-bar .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 36px;
}
.utility-bar .social { display: flex; gap: 14px; }
.utility-bar .social a { display: inline-flex; }
.utility-bar .social svg { width: 16px; height: 16px; fill: #666; }
.utility-bar .social a:hover svg { fill: var(--color-primary); }

/* ---------- Header ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  padding: 22px 0 0;
}
.site-branding { text-align: center; padding: 12px 0 18px; }
.site-title {
  font-family: var(--font-bn-heading);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
  letter-spacing: -0.5px;
}
.site-title a:hover { color: var(--color-text); }
.site-description {
  font-size: 13px; color: #777; margin-top: 4px; letter-spacing: 1px; text-transform: uppercase;
}

/* Primary Nav */
.primary-nav-wrap {
  border-top: 1px solid var(--color-border);
  position: relative;
}
.primary-nav {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; flex-wrap: wrap;
}
.primary-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center;
}
.primary-nav li a {
  display: block; padding: 14px 16px;
  font-family: var(--font-bn-heading);
  font-weight: 700; font-size: 16px; color: var(--color-text);
}
.primary-nav li a:hover,
.primary-nav li.current-menu-item a { color: var(--color-primary); }

.lang-toggle {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 1px solid var(--color-border);
  padding: 6px 12px; font-size: 13px; cursor: pointer; border-radius: var(--radius);
  font-family: var(--font-en);
}
.lang-toggle:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.menu-toggle {
  display: none;
  background: transparent; border: none; cursor: pointer;
  padding: 10px; font-size: 24px;
}

/* ---------- Breaking News Ticker ---------- */
.breaking-news {
  background: var(--color-primary); color: #fff;
  display: flex; align-items: center;
  overflow: hidden; height: 44px;
}
.breaking-news .label {
  background: rgba(0,0,0,0.18);
  font-family: var(--font-bn-heading); font-weight: 700;
  padding: 0 18px; height: 100%;
  display: flex; align-items: center; flex-shrink: 0;
  letter-spacing: .3px;
}
.ticker-viewport { overflow: hidden; flex: 1; position: relative; }
.ticker-track {
  display: inline-flex; gap: 60px; padding-left: 100%;
  white-space: nowrap;
  animation: marquee 45s linear infinite;
}
.ticker-track a {
  color: #fff; font-weight: 500; font-size: 15px;
}
.ticker-track a:hover { text-decoration: underline; }
@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}
.breaking-news:hover .ticker-track { animation-play-state: paused; }

/* ---------- Hero / Featured ---------- */
.section { padding: 36px 0; }
.section-heading {
  font-family: var(--font-bn-heading);
  font-size: 22px; font-weight: 700;
  border-inline-start: 4px solid var(--color-primary);
  padding-inline-start: 12px;
  margin: 0 0 22px;
  display: flex; align-items: center; justify-content: space-between;
}
.section-heading .more-link {
  font-size: 14px; color: var(--color-primary); font-weight: 600;
  border: 0; padding: 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 65fr 35fr;
  gap: 28px;
}
.hero-main {
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius);
  overflow: hidden;
}
.hero-main .thumb { aspect-ratio: 16 / 9; overflow: hidden; }
.hero-main .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.hero-main:hover .thumb img { transform: scale(1.03); }
.hero-main .content { padding: 22px; }
.hero-main h2 {
  font-size: clamp(22px, 2.4vw, 32px); margin: 10px 0;
}
.hero-main .excerpt {
  color: var(--color-body); font-size: 16px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-side { display: flex; flex-direction: column; gap: 14px; }
.hero-side .post-mini {
  display: grid; grid-template-columns: 110px 1fr; gap: 12px;
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 10px; align-items: center;
}
.hero-side .post-mini .thumb { aspect-ratio: 1 / 1; overflow: hidden; border-radius: 3px; }
.hero-side .post-mini img { width: 100%; height: 100%; object-fit: cover; }
.hero-side .post-mini h3 {
  font-size: 15px; line-height: 1.4; margin: 0 0 6px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* Category pill */
.cat-pill {
  display: inline-block; background: var(--color-primary); color: #fff;
  font-family: var(--font-bn-heading); font-weight: 700;
  font-size: 12px; padding: 4px 10px; border-radius: 2px;
  text-transform: uppercase; letter-spacing: .5px;
}
.cat-pill:hover { background: var(--color-primary-dark); color: #fff; }

.meta-row {
  font-size: 13px; color: #888; margin-top: 8px;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.meta-row .dot { width: 3px; height: 3px; background: #ccc; border-radius: 50%; }

/* ---------- Post Card Grid ---------- */
.post-grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(3, 1fr);
}
.post-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.post-card {
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius);
  overflow: hidden; transition: box-shadow .2s ease, transform .2s ease;
  display: flex; flex-direction: column;
}
.post-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.post-card .thumb { aspect-ratio: 16 / 9; overflow: hidden; background: #eee; }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card .content { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.post-card h3 {
  font-size: 17px; line-height: 1.45; margin: 10px 0 8px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card .excerpt {
  font-size: 14px; color: var(--color-body); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 12px;
}
.post-card .meta-row { margin-top: auto; }

/* List style variant */
.post-list { display: flex; flex-direction: column; gap: 14px; }
.post-list .post-item {
  display: grid; grid-template-columns: 130px 1fr; gap: 14px;
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 12px; align-items: center;
}
.post-list .post-item .thumb { aspect-ratio: 1 / 1; overflow: hidden; border-radius: 3px; }
.post-list .post-item img { width: 100%; height: 100%; object-fit: cover; }
.post-list .post-item h3 {
  font-size: 16px; line-height: 1.45; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* Load more */
.load-more-wrap { text-align: center; margin-top: 28px; }
.btn {
  display: inline-block; padding: 12px 28px;
  background: var(--color-primary); color: #fff;
  font-family: var(--font-bn-heading); font-weight: 700;
  border: none; border-radius: var(--radius); cursor: pointer;
  font-size: 15px; transition: background .15s ease;
}
.btn:hover { background: var(--color-primary-dark); color: #fff; }
.btn.btn-outline {
  background: transparent; color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn.btn-outline:hover { background: var(--color-text); color: #fff; border-color: var(--color-text); }

/* ---------- Layout with Sidebar ---------- */
.layout-with-sidebar {
  display: grid; grid-template-columns: 1fr 320px; gap: 32px;
}

/* Popular widget */
.widget {
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 20px; margin-bottom: 24px;
}
.widget-title {
  font-family: var(--font-bn-heading); font-weight: 700;
  font-size: 18px; margin: 0 0 16px;
  padding-bottom: 10px; border-bottom: 2px solid var(--color-primary);
}
.popular-list { list-style: none; margin: 0; padding: 0; counter-reset: pop; }
.popular-list li {
  display: grid; grid-template-columns: 36px 80px 1fr; gap: 10px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--color-border);
}
.popular-list li:last-child { border-bottom: none; }
.popular-list li::before {
  counter-increment: pop;
  content: counter(pop, bengali);
  font-family: var(--font-bn-heading); font-weight: 700;
  font-size: 26px; color: var(--color-primary); text-align: center;
}
.popular-list .thumb { aspect-ratio: 1; overflow: hidden; border-radius: 3px; }
.popular-list .thumb img { width: 100%; height: 100%; object-fit: cover; }
.popular-list h4 {
  font-size: 14px; line-height: 1.45; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.popular-list .views { font-size: 12px; color: #999; margin-top: 4px; display: block; }

/* ---------- Single Post ---------- */
.single-hero { background: #fff; border-bottom: 1px solid var(--color-border); }
.single-hero .featured-image { max-height: 500px; overflow: hidden; }
.single-hero .featured-image img { width: 100%; height: 500px; object-fit: cover; }
.single-header { max-width: 820px; margin: 0 auto; padding: 28px 16px 0; text-align: center; }
.single-header h1 {
  font-size: clamp(26px, 3.4vw, 40px); margin: 14px 0;
}
.single-meta {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 14px; font-size: 14px; color: #777; padding-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
}
.author-info { display: inline-flex; align-items: center; gap: 8px; }
.author-info img { width: 32px; height: 32px; border-radius: 50%; }

.article-body {
  max-width: 760px; margin: 28px auto; padding: 0 16px;
  font-size: 18px; line-height: 1.9; color: var(--color-text);
}
.article-body p { margin: 0 0 1.4em; }
.article-body h2, .article-body h3 { margin-top: 1.6em; }
.article-body img { border-radius: var(--radius); margin: 1.2em 0; }
.article-body blockquote {
  border-inline-start: 4px solid var(--color-primary);
  background: #fff; margin: 1.5em 0; padding: 16px 22px;
  font-style: italic; color: #555;
}

/* Share */
.share-row {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin: 22px auto; max-width: 760px; padding: 0 16px;
}
.share-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 30px; background: #fff;
  border: 1px solid var(--color-border); cursor: pointer; font-size: 14px;
  font-family: var(--font-bn-body);
}
.share-btn svg { width: 16px; height: 16px; }
.share-btn:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.share-btn:hover svg { fill: #fff; }

.tags-row { max-width: 760px; margin: 24px auto; padding: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.tags-row a {
  font-size: 13px; padding: 4px 12px; background: #fff;
  border: 1px solid var(--color-border); border-radius: 20px;
}
.tags-row a:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.related-posts { background: #fff; border-top: 1px solid var(--color-border); padding: 40px 0; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-footer); color: #ccc;
  padding: 50px 0 20px; margin-top: 40px;
}
.site-footer h4 { color: #fff; font-size: 16px; margin: 0 0 14px; }
.footer-top { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr; gap: 32px; }
.footer-brand .logo { color: #fff; font-family: var(--font-bn-heading); font-weight: 700; font-size: 26px; }
.footer-brand p { margin: 10px 0; font-size: 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col ul li { padding: 4px 0; font-size: 14px; }
.footer-col ul li a:hover { color: var(--color-primary); }
.footer-social { display: flex; gap: 12px; margin-top: 14px; }
.footer-social a {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: inline-flex; align-items: center; justify-content: center;
}
.footer-social svg { width: 16px; height: 16px; fill: #fff; }
.footer-social a:hover { background: var(--color-primary); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 36px; padding-top: 18px; text-align: center;
  font-size: 13px; color: #888;
}

/* ---------- 404 / Page ---------- */
.page-404 { text-align: center; padding: 80px 16px; }
.page-404 .code { font-size: 120px; font-weight: 700; color: var(--color-primary); line-height: 1; }
.page-404 h1 { font-size: 28px; margin: 10px 0 20px; }

.page-content {
  max-width: 820px; margin: 30px auto; padding: 30px;
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius);
}
.page-content h1 { font-size: 32px; }

/* Search */
.search-form { display: flex; gap: 8px; margin: 30px 0; }
.search-form input[type="search"] {
  flex: 1; padding: 12px 14px; border: 1px solid var(--color-border);
  border-radius: var(--radius); font-family: inherit; font-size: 15px;
}
.search-form button { background: var(--color-primary); color: #fff; border: none; padding: 0 22px; border-radius: var(--radius); cursor: pointer; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .footer-top { grid-template-columns: 1fr 1fr 1fr; }
  .post-grid.cols-4 { grid-template-columns: repeat(3, 1fr); }
  .layout-with-sidebar { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .menu-toggle { display: inline-flex; position: absolute; left: 8px; top: 50%; transform: translateY(-50%); }
  .lang-toggle { right: 8px; }
  .primary-nav ul {
    display: none; flex-direction: column; width: 100%;
    background: #fff; border-top: 1px solid var(--color-border);
  }
  .primary-nav.open ul { display: flex; }
  .primary-nav li { width: 100%; text-align: center; border-bottom: 1px solid var(--color-border); }

  .hero-grid { grid-template-columns: 1fr; }
  .post-grid, .post-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .breaking-news { height: 38px; font-size: 14px; }
  .breaking-news .label { padding: 0 12px; font-size: 14px; }
  .ticker-track a { font-size: 14px; }
  .single-hero .featured-image img { height: 280px; }
  .article-body { font-size: 17px; }
}

@media (max-width: 480px) {
  .post-grid, .post-grid.cols-4 { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .utility-bar { font-size: 12px; }
  .hero-side .post-mini { grid-template-columns: 90px 1fr; }
  .section { padding: 24px 0; }
}

/* Accessibility — focus rings + skip link */
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--color-primary); color: #fff; padding: 8px 16px; z-index: 9999;
}
.skip-link:focus { left: 8px; top: 8px; }

/* Touch targets */
@media (pointer: coarse) {
  .primary-nav li a, .btn, .share-btn { min-height: 44px; }
}
