/*
Theme Name: B20 Masala Speed
Theme URI: https://b20masala.co.in
Author: B20 Masala
Author URI: https://b20masala.co.in
Description: A blazing-fast, AdSense-friendly news & entertainment theme for B20 Masala. Built for maximum PageSpeed, mobile-first, and fully customizable.
Version: 1.2.0
Requires at least: 6.0
Tested up to: 6.7
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: b20masala
Tags: news, blog, entertainment, adsense, fast, mobile-first, custom-colors, custom-logo, custom-menu, featured-images, right-sidebar, two-columns, wide-blocks
*/

/* =============================================
   CSS CUSTOM PROPERTIES (THEME VARIABLES)
   ============================================= */
:root {
  --color-primary:    #e8192c;   /* Masala Red */
  --color-secondary:  #111111;   /* Deep Black */
  --color-accent:     #ff6b35;   /* Warm Orange */
  --color-bg:         #f5f5f5;
  --color-surface:    #ffffff;
  --color-text:       #1a1a1a;
  --color-muted:      #666666;
  --color-border:     #e0e0e0;
  --color-tag-bg:     #fff3f3;
  --color-tag-text:   #c8102e;

  --font-heading:     'Teko', 'Bebas Neue', Georgia, serif;
  --font-body:        'Hind', 'Noto Sans', Arial, sans-serif;
  --font-meta:        system-ui, sans-serif;

  --radius:           6px;
  --radius-lg:        10px;
  --shadow-sm:        0 1px 4px rgba(0,0,0,.08);
  --shadow-md:        0 3px 12px rgba(0,0,0,.12);
  --shadow-lg:        0 6px 24px rgba(0,0,0,.16);

  --container:        1200px;
  --sidebar-width:    320px;
  --gap:              24px;

  --header-height:    64px;
  --transition:       0.2s ease;
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.65;
  overflow-x: hidden;
}

img, video { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--color-primary); }

ul, ol { list-style: none; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  letter-spacing: 0.02em;
}

/* =============================================
   UTILITY CLASSES
   ============================================= */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--color-primary);
  margin-bottom: 20px;
}
.section-title::before {
  content: '';
  display: block;
  width: 5px;
  height: 1.4em;
  background: var(--color-primary);
  border-radius: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover {
  background: #b5121e;
  color: #fff;
}
.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}
.btn-outline:hover {
  background: var(--color-primary);
  color: #fff;
}

.category-badge {
  display: inline-block;
  padding: 2px 10px;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 3px;
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  background: var(--color-tag-bg);
  color: var(--color-tag-text);
  font-size: 0.75rem;
  border-radius: 3px;
  border: 1px solid #f0d0d0;
  transition: var(--transition);
}
.tag:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--color-muted);
  font-family: var(--font-meta);
}
.meta a { color: var(--color-muted); }
.meta a:hover { color: var(--color-primary); }

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  z-index: 9999;
  background: var(--color-primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-weight: 700;
  transition: top 0.2s;
}
.skip-link:focus { top: 8px; }

/* =============================================
   LAZY LOAD IMAGES
   ============================================= */
img[loading="lazy"] { opacity: 0; transition: opacity 0.3s; }
img[loading="lazy"].loaded { opacity: 1; }

/* =============================================
   TOP BAR
   ============================================= */
.topbar {
  background: var(--color-secondary);
  color: #ccc;
  font-size: 0.75rem;
  padding: 5px 0;
  font-family: var(--font-meta);
}
.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar-date { opacity: 0.7; }
.topbar-links { display: flex; gap: 16px; }
.topbar-links a { color: #ccc; opacity: 0.8; }
.topbar-links a:hover { color: #fff; opacity: 1; }

/* Breaking news ticker */
.breaking-bar {
  background: var(--color-primary);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
}
.breaking-bar .container {
  display: flex;
  align-items: center;
  height: 32px;
}
.breaking-label {
  background: var(--color-secondary);
  padding: 0 14px;
  height: 100%;
  display: flex;
  align-items: center;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  flex-shrink: 0;
  margin-right: 16px;
}
.breaking-ticker {
  overflow: hidden;
  flex: 1;
}
.breaking-ticker ul {
  display: flex;
  animation: ticker 30s linear infinite;
}
.breaking-ticker li { padding-right: 60px; }
.breaking-ticker a { color: #fff; }
@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* =============================================
   HEADER
   ============================================= */
.site-header {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: 24px;
}

/* Logo */
.site-logo img {
  height: 48px;
  width: auto;
  object-fit: contain;
}
.site-logo .logo-text {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: var(--color-secondary);
}
.site-logo .logo-text span { color: var(--color-primary); }

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.header-search-btn,
.header-theme-btn,
.header-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius);
  color: var(--color-secondary);
  display: flex;
  align-items: center;
  transition: var(--transition);
}
.header-search-btn:hover,
.header-theme-btn:hover,
.header-menu-btn:hover {
  background: var(--color-bg);
  color: var(--color-primary);
}
.header-menu-btn { display: none; }

/* =============================================
   NAVIGATION
   ============================================= */
.site-nav {
  background: var(--color-secondary);
}
.site-nav .container {
  display: flex;
  align-items: center;
}
.nav-menu {
  display: flex;
  align-items: center;
}
.nav-menu > li > a {
  display: flex;
  align-items: center;
  padding: 0 18px;
  height: 44px;
  color: #ddd;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  transition: var(--transition);
  position: relative;
}
.nav-menu > li > a:hover,
.nav-menu > li.current-menu-item > a,
.nav-menu > li.current-menu-parent > a {
  color: #fff;
  background: rgba(255,255,255,0.08);
}
.nav-menu > li > a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  right: 50%;
  height: 3px;
  background: var(--color-primary);
  transition: left 0.2s, right 0.2s;
}
.nav-menu > li > a:hover::after,
.nav-menu > li.current-menu-item > a::after {
  left: 0;
  right: 0;
}

/* Dropdown */
.nav-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  min-width: 200px;
  box-shadow: var(--shadow-md);
  border-top: 3px solid var(--color-primary);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  border-radius: 0 0 var(--radius) var(--radius);
}
.nav-menu li:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-menu .sub-menu li a {
  display: block;
  padding: 10px 18px;
  color: var(--color-text);
  font-size: 0.82rem;
  border-bottom: 1px solid var(--color-border);
}
.nav-menu .sub-menu li:last-child a { border-bottom: none; }
.nav-menu .sub-menu li a:hover { color: var(--color-primary); background: var(--color-bg); }
.nav-menu li { position: relative; }

/* Mobile menu */
.mobile-menu {
  display: none;
  background: var(--color-secondary);
  padding: 12px 0;
}
.mobile-menu.open { display: block; }
.mobile-menu ul { padding: 0 16px; }
.mobile-menu li a {
  display: block;
  padding: 10px 0;
  color: #ccc;
  font-size: 0.9rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.mobile-menu li a:hover { color: #fff; }

/* Search overlay */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.search-overlay.open { opacity: 1; visibility: visible; }
.search-overlay form {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 600px;
  padding: 0 16px;
  gap: 12px;
}
.search-overlay input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 3px solid var(--color-primary);
  color: #fff;
  font-size: 2rem;
  padding: 12px 0;
  outline: none;
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
}
.search-overlay input::placeholder { color: rgba(255,255,255,0.4); }
.search-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.search-close:hover { opacity: 1; }

/* =============================================
   LAYOUT
   ============================================= */
.site-main {
  padding: 28px 0;
}

.content-area {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: var(--gap);
  align-items: start;
}

.main-content { min-width: 0; }

/* =============================================
   HERO / FEATURED POST
   ============================================= */
.hero-section { margin-bottom: 28px; }

.hero-post {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-secondary);
  box-shadow: var(--shadow-md);
}
.hero-post a.hero-link {
  display: block;
}
.hero-post img {
  width: 100%;
  aspect-ratio: 16/7;
  object-fit: cover;
  opacity: 0.7;
  transition: opacity 0.4s, transform 0.4s;
}
.hero-post:hover img { opacity: 0.55; transform: scale(1.03); }
.hero-body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 32px 28px 24px;
  background: linear-gradient(transparent, rgba(0,0,0,0.95));
}
.hero-title {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  margin: 10px 0 12px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.hero-excerpt {
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
}
.hero-meta { color: rgba(255,255,255,0.6); }

/* =============================================
   AD SLOTS (ADSENSE FRIENDLY)
   ============================================= */
.ad-slot {
  background: #f9f9f9;
  border: 1px solid #e8e8e8;
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
}
.ad-slot-label {
  font-size: 0.6rem;
  color: #bbb;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 4px;
  background: #f0f0f0;
  display: block;
}
.ad-slot-leaderboard { width: 100%; min-height: 100px; }
.ad-slot-rectangle   { width: 100%; min-height: 280px; }
.ad-slot-halfpage    { width: 100%; min-height: 600px; }
.ad-slot-inline      { width: 100%; min-height: 90px; margin: 20px 0; }

/* =============================================
   POST CARD
   ============================================= */
.post-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
}
.post-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.post-card-img {
  position: relative;
  overflow: hidden;
  background: #eee;
}
.post-card-img img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  transition: transform 0.4s;
}
.post-card:hover .post-card-img img { transform: scale(1.06); }
.post-card-img .category-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
}
.post-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.post-card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 8px 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-title a:hover { color: var(--color-primary); }
.post-card-excerpt {
  font-size: 0.82rem;
  color: var(--color-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
  flex: 1;
}
.post-card-footer {
  border-top: 1px solid var(--color-border);
  padding-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.read-more {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 4px;
}
.read-more::after { content: '→'; }
.read-more:hover { color: #b5121e; }

/* Grid variants */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.posts-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* List post card (compact) */
.post-list-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
  align-items: flex-start;
}
.post-list-item:last-child { border-bottom: none; }
.post-list-img {
  flex-shrink: 0;
  width: 90px;
  height: 68px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #eee;
}
.post-list-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.post-list-item:hover .post-list-img img { transform: scale(1.08); }
.post-list-body { flex: 1; min-width: 0; }
.post-list-title {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}
.post-list-title a:hover { color: var(--color-primary); }

/* Numbered list (Hot Masala) */
.numbered-post {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
  align-items: flex-start;
}
.numbered-post:last-child { border-bottom: none; }
.post-number {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 900;
  color: var(--color-border);
  line-height: 1;
  min-width: 32px;
  text-align: center;
}
.numbered-post:hover .post-number { color: var(--color-primary); }

/* =============================================
   CATEGORY SECTION
   ============================================= */
.category-section { margin-bottom: 32px; }
.category-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--color-primary);
}
.view-all {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 4px;
}
.view-all::after { content: '→'; }
.view-all:hover { color: #b5121e; }

/* Tab navigation */
.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 16px;
}
.tab-btn {
  padding: 8px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
  transition: var(--transition);
}
.tab-btn.active, .tab-btn:hover {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar { position: sticky; top: calc(var(--header-height) + 16px); }

.sidebar-widget {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.widget-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-secondary);
  padding-bottom: 10px;
  border-bottom: 3px solid var(--color-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Search widget */
.widget-search form {
  display: flex;
  gap: 8px;
}
.widget-search input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}
.widget-search input:focus { border-color: var(--color-primary); }
.widget-search button {
  padding: 9px 14px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s;
}
.widget-search button:hover { background: #b5121e; }

/* Popular posts widget */
.popular-list { display: flex; flex-direction: column; }
.popular-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}
.popular-item:last-child { border-bottom: none; }
.popular-rank {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--color-border);
  line-height: 1;
  min-width: 24px;
}
.popular-item:hover .popular-rank { color: var(--color-primary); }
.popular-img {
  width: 70px;
  height: 52px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: #eee;
}
.popular-img img { width: 100%; height: 100%; object-fit: cover; }
.popular-title {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.popular-title a:hover { color: var(--color-primary); }

/* Tag cloud widget */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

/* Categories widget */
.category-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.88rem;
}
.category-list li:last-child { border-bottom: none; }
.category-list a { font-weight: 600; }
.category-list a:hover { color: var(--color-primary); }
.cat-count {
  background: var(--color-bg);
  border-radius: 20px;
  padding: 1px 8px;
  font-size: 0.72rem;
  color: var(--color-muted);
}

/* Newsletter widget */
.newsletter-widget { background: var(--color-primary); }
.newsletter-widget .widget-title { color: #fff; border-color: rgba(255,255,255,0.4); }
.newsletter-widget p { color: rgba(255,255,255,0.85); font-size: 0.85rem; margin-bottom: 14px; }
.newsletter-form { display: flex; flex-direction: column; gap: 10px; }
.newsletter-form input {
  padding: 10px 12px;
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
}
.newsletter-form input::placeholder { color: rgba(255,255,255,0.6); }
.newsletter-form input:focus { border-color: #fff; }
.newsletter-form button {
  padding: 10px;
  background: var(--color-secondary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 0.85rem;
}
.newsletter-form button:hover { background: #333; }

/* =============================================
   SINGLE POST
   ============================================= */
.single-header { margin-bottom: 24px; }
.single-title {
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1.15;
  margin: 14px 0 16px;
  letter-spacing: 0.02em;
}
.single-featured {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}
.single-featured img {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
}
.single-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--color-text);
}
.single-content h2, .single-content h3 {
  margin: 28px 0 12px;
  color: var(--color-secondary);
}
.single-content p { margin-bottom: 18px; }
.single-content a { color: var(--color-primary); text-decoration: underline; }
.single-content img {
  border-radius: var(--radius);
  margin: 20px auto;
}
.single-content blockquote {
  border-left: 4px solid var(--color-primary);
  padding: 12px 20px;
  background: var(--color-bg);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--color-muted);
  margin: 20px 0;
}
.single-content ul, .single-content ol {
  padding-left: 24px;
  margin-bottom: 18px;
}
.single-content ul { list-style: disc; }
.single-content ol { list-style: decimal; }
.single-content li { margin-bottom: 6px; }

/* Post tags */
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
.post-tags-label { font-size: 0.82rem; font-weight: 700; color: var(--color-muted); }

/* Author box */
.author-box {
  display: flex;
  gap: 20px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--color-border);
  margin: 28px 0;
  align-items: flex-start;
}
.author-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--color-bg);
  border: 3px solid var(--color-primary);
}
.author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-name {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 4px;
  font-family: var(--font-heading);
}
.author-bio { font-size: 0.88rem; color: var(--color-muted); }

/* Related posts */
.related-posts { margin: 32px 0; }

/* =============================================
   PAGINATION
   ============================================= */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 32px 0;
  flex-wrap: wrap;
}
.page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.88rem;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  transition: var(--transition);
}
.page-numbers:hover, .page-numbers.current {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.page-numbers.prev, .page-numbers.next { width: auto; padding: 0 14px; }

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  background: var(--color-secondary);
  color: #bbb;
  margin-top: 40px;
}
.footer-widgets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  padding: 48px 0 36px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-widget-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-primary);
}
.footer-widget p { font-size: 0.85rem; line-height: 1.65; }
.footer-widget ul li { padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.footer-widget ul li:last-child { border-bottom: none; }
.footer-widget ul li a { font-size: 0.85rem; color: #bbb; display: flex; align-items: center; gap: 6px; }
.footer-widget ul li a:hover { color: var(--color-primary); }
.footer-widget ul li a::before { content: '›'; color: var(--color-primary); font-weight: 700; }

.footer-logo { font-family: var(--font-heading); font-size: 2rem; font-weight: 900; color: #fff; margin-bottom: 12px; }
.footer-logo span { color: var(--color-primary); }
.footer-tagline { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.12em; color: #888; margin-top: 4px; }

.footer-bottom {
  padding: 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-copyright { font-size: 0.8rem; }
.footer-legal { display: flex; gap: 20px; }
.footer-legal a { font-size: 0.78rem; color: #888; }
.footer-legal a:hover { color: var(--color-primary); }

/* Social links */
.social-links { display: flex; gap: 10px; margin-top: 14px; }
.social-link {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
  transition: var(--transition);
  font-size: 0.85rem;
}
.social-link:hover {
  background: var(--color-primary);
  color: #fff;
}

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, transform 0.2s;
  z-index: 900;
  font-size: 1.2rem;
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { transform: translateY(-3px); background: #b5121e; }

/* =============================================
   DARK MODE
   ============================================= */
body.dark-mode {
  --color-bg:      #0f0f0f;
  --color-surface: #1a1a1a;
  --color-text:    #e8e8e8;
  --color-muted:   #999;
  --color-border:  #2a2a2a;
  --color-tag-bg:  #2a1a1a;
  --shadow-sm:     0 1px 4px rgba(0,0,0,0.3);
  --shadow-md:     0 3px 12px rgba(0,0,0,0.4);
}
body.dark-mode .site-header { background: #111; }
body.dark-mode .topbar { background: #080808; }
body.dark-mode .ad-placeholder { background: #222; border-color: #333; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
  .content-area {
    grid-template-columns: 1fr;
  }
  .sidebar { position: static; }
  .footer-widgets { grid-template-columns: repeat(2, 1fr); }
  .posts-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --gap: 16px; }

  .topbar { display: none; }
  .header-ad { display: none; }
  .header-menu-btn { display: flex; }
  .site-nav { display: none; }

  .hero-title { font-size: 1.5rem; }
  .hero-body { padding: 20px 16px 16px; }

  .posts-grid { grid-template-columns: 1fr; }
  .posts-grid-3 { grid-template-columns: 1fr; }

  .footer-widgets { grid-template-columns: 1fr 1fr; gap: 24px; padding: 32px 0 24px; }

  .single-title { font-size: 1.6rem; }

  .author-box { flex-direction: column; }

  .footer-bottom { flex-direction: column; text-align: center; }
  .footer-legal { justify-content: center; }
}

@media (max-width: 480px) {
  .footer-widgets { grid-template-columns: 1fr; }
  .numbered-post { gap: 10px; }
  .hero-title { font-size: 1.3rem; }
}

/* =============================================
   PRINT
   ============================================= */
@media print {
  .site-header, .site-nav, .sidebar, .site-footer,
  .breaking-bar, .ad-slot, .back-to-top { display: none !important; }
  .content-area { grid-template-columns: 1fr; }
  body { background: #fff; }
}

/* =============================================
   HERO SLIDER ENHANCEMENTS
   ============================================= */

/* Smoother image transition */
.hero-post img {
  transition: opacity 0.4s ease, transform 0.6s ease !important;
}

/* Hero actions row */
.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 4px;
}

/* Thumbnail strip */
.hero-thumbs {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.hero-thumbs::-webkit-scrollbar { display: none; }

.hero-thumb-btn {
  background: rgba(255,255,255,0.12);
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.2s, transform 0.2s;
  width: 110px;
  flex-shrink: 0;
  text-align: left;
}
.hero-thumb-btn:hover,
.hero-thumb-btn.active {
  border-color: var(--color-primary);
  transform: translateY(-2px);
}
.hero-thumb-btn img {
  width: 100%;
  height: 55px !important;
  object-fit: cover;
  opacity: 1 !important;
  transition: none !important;
  aspect-ratio: unset !important;
  display: block;
}
.hero-thumb-placeholder {
  width: 100%;
  height: 55px;
  background: rgba(255,255,255,0.08);
}
.hero-thumb-title {
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  padding: 4px 6px 5px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-thumb-btn.active .hero-thumb-title { color: #fff; }

/* Auto-rotate progress bar */
.hero-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.15);
  overflow: hidden;
}
#heroProgressBar {
  height: 100%;
  width: 0%;
  background: var(--color-primary);
}

/* Bigger hero gradient */
.hero-body {
  background: linear-gradient(to top, rgba(0,0,0,0.97) 0%, rgba(0,0,0,0.7) 55%, transparent 100%) !important;
  padding: 60px 28px 28px !important;
}

/* Hero gradient badge animation */
.hero-section .category-badge {
  animation: badgePop 0.4s ease both;
}
@keyframes badgePop {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* =============================================
   HOT MASALA — LIVE BADGE
   ============================================= */
.hot-masala-section .category-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--color-primary);
}
.hot-live-badge {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-primary);
  background: #fff3f3;
  border: 1px solid #f5c0c0;
  border-radius: 3px;
  padding: 2px 7px;
  animation: livePulse 2s ease-in-out infinite;
  cursor: default;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}
#hotMasalaList {
  transition: opacity 0.25s ease;
}

/* =============================================
   FOOTER ACCENT BAR (NEW)
   ============================================= */
.footer-accent-bar {
  background: linear-gradient(135deg, #1a0a0a 0%, #2d0808 40%, #1a0000 100%);
  border-bottom: 1px solid rgba(232,25,44,0.25);
  padding: 22px 0;
}
.footer-accent-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}
.footer-brand-mark {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.footer-logo-text {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 900;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.03em;
}
.footer-logo-text span { color: var(--color-primary); }
.footer-logo-text:hover { color: #fff; }
.footer-tagline-accent {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.4);
}

/* Social pills */
.footer-social-prominent {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.social-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(255,255,255,0.08);
  color: #ddd;
  border: 1px solid rgba(255,255,255,0.12);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  text-decoration: none;
}
.social-pill:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.social-pill-yt:hover { background: #c4302b; border-color: #c4302b; }

/* Footer stats */
.footer-stats {
  display: flex;
  gap: 20px;
  margin-top: 14px;
}
.footer-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.footer-stat-num {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--color-primary);
  line-height: 1;
}
.footer-stat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #777;
}

/* Footer newsletter form */
.footer-newsletter-form {
  display: flex;
  gap: 0;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 6px;
}
.footer-newsletter-form input {
  flex: 1;
  padding: 10px 12px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-right: none;
  color: #fff;
  font-size: 0.82rem;
  outline: none;
  border-radius: var(--radius) 0 0 var(--radius);
}
.footer-newsletter-form input::placeholder { color: #666; }
.footer-newsletter-form input:focus { border-color: var(--color-primary); }
.footer-newsletter-form button {
  padding: 10px 16px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s;
  border-radius: 0 var(--radius) var(--radius) 0;
  white-space: nowrap;
}
.footer-newsletter-form button:hover { background: #b5121e; }

/* Footer custom logo size in accent bar */
.footer-brand-mark .custom-logo { max-height: 44px; width: auto; }

/* =============================================
   FOOTER EXISTING — POLISH UPDATES
   ============================================= */
.site-footer {
  background: #111 !important;
}
.footer-widgets {
  padding: 40px 0 32px !important;
}
.footer-widget p {
  color: #999;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.07);
}
.footer-copyright strong { color: var(--color-primary); }

/* =============================================
   SEARCH BAR REMOVAL — HIDE ALL INSTANCES
   ============================================= */
.header-search-btn,
.search-overlay,
#searchOverlay,
#searchToggle,
.sidebar-widget:has(> h3.widget-title:first-child) .widget-search,
.widget-search { display: none !important; }

/* The sidebar search widget entire block */
.sidebar > .sidebar-widget:first-child:has(.widget-search) { display: none !important; }

/* =============================================
   POST CARD — VISUAL LIFT
   ============================================= */
.post-card {
  border-bottom: 3px solid transparent;
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease !important;
}
.post-card:hover {
  border-bottom-color: var(--color-primary);
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 28px rgba(0,0,0,0.14) !important;
}
.post-card-title { font-size: 0.95rem !important; }
.post-card-body { padding: 14px 16px 16px !important; }

/* =============================================
   RESPONSIVE — HERO SLIDER
   ============================================= */
@media (max-width: 768px) {
  .hero-body {
    padding: 40px 16px 20px !important;
  }
  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .hero-thumbs {
    width: 100%;
  }
  .hero-thumb-btn {
    width: 90px;
  }
  .footer-accent-inner {
    flex-direction: column;
    gap: 14px;
  }
  .footer-social-prominent {
    gap: 8px;
  }
  .social-pill {
    font-size: 0.7rem;
    padding: 6px 10px;
  }
}

@media (max-width: 480px) {
  .hero-thumbs { gap: 7px; }
  .hero-thumb-btn { width: 78px; }
  .footer-newsletter-form { flex-direction: column; }
  .footer-newsletter-form input,
  .footer-newsletter-form button {
    border-radius: var(--radius);
    border-right: 1px solid rgba(255,255,255,0.15);
  }
  .footer-newsletter-form button { border-top: none; }
}

/* =============================================
   ACCESSIBILITY FIXES — v1.2
   Lighthouse score improvements: contrast, touch
   targets, ARIA, list structure
   ============================================= */

/* --- TOUCH TARGETS: min 44×44px for all interactive elements --- */
.touch-target {
  min-width: 44px !important;
  min-height: 44px !important;
}

/* Header buttons already have height from flex; ensure min */
.header-theme-btn,
.header-menu-btn,
.header-search-btn {
  min-width: 44px;
  min-height: 44px;
}

/* Back-to-top */
.back-to-top {
  width: 48px !important;
  height: 48px !important;
}

/* Nav menu links — adequate tap size on mobile */
.nav-menu > li > a,
.mobile-menu a {
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* Tab buttons */
.tab-btn {
  min-height: 44px;
  padding: 0 18px !important;
}

/* Hero thumb buttons */
.hero-thumb-btn {
  min-height: 44px;
}

/* View-all, read-more, btn links */
.view-all,
.read-more,
.btn {
  min-height: 40px;
  padding-top: 10px;
  padding-bottom: 10px;
}

/* --- CONTRAST FIXES --- */

/* Body muted text: #666 on white is only 5.74:1 — keep.
   But on grey background (#f5f5f5) it drops — bump to #595959 (7:1) */
:root {
  --color-muted: #595959;
}

/* Hero meta: rgba(255,255,255,0.6) on dark overlay = ~3.5:1 — fix to 0.85 */
.hero-meta,
.hero-meta span,
.hero-excerpt {
  color: rgba(255,255,255,0.88) !important;
}

/* Topbar: #ccc with opacity 0.7 on #111 = very low. Fix: opaque #b0b0b0 → #c8c8c8 min */
.topbar-date {
  opacity: 1 !important;
  color: #c8c8c8 !important;
}
.topbar-links a {
  color: #c8c8c8 !important;
  opacity: 1 !important;
}
.topbar-links a:hover { color: #fff !important; }

/* Ad slot label: #bbb on #f0f0f0 = ~2.5:1 — fix to #767676 (4.54:1 on white) */
.ad-slot-label {
  color: #767676 !important;
  background: #e8e8e8 !important;
}

/* Footer: #bbb on #111 background = ~7.8:1 — fine. #888 on #111 = ~4.5:1 — borderline, bump */
.footer-legal a,
.footer-tagline,
.footer-copyright,
.site-footer,
.site-footer p,
.footer-widget p {
  color: #c0c0c0 !important;
}
.footer-legal a:hover { color: var(--color-primary) !important; }

/* Footer tagline accent: rgba white 0.4 on dark — too low. Fix */
.footer-tagline-accent {
  color: rgba(255,255,255,0.65) !important;
}

/* Footer stat label: #777 on #111 = ~5.8:1 — ok, but tighten */
.footer-stat-label {
  color: #aaa !important;
}

/* Footer widget title already #fff — fine */

/* Post card excerpt on white background */
.post-card-excerpt {
  color: #595959 !important;
}

/* Meta text */
.meta,
.meta span,
.meta a {
  color: #595959 !important;
}

/* Category list count badge */
.cat-count {
  color: #595959 !important;
  background: #e8e8e8 !important;
}

/* Tag on light bg: tag-text was #c8102e on #fff3f3 — that's fine (4.75:1) */

/* Breaking label: white on --color-secondary (#111) — good */

/* Hot masala live badge: red on #fff3f3 */
.hot-live-badge {
  color: #b5121e !important; /* slightly darker red for better contrast */
  background: #fff0f0 !important;
}

/* Popular post rank (grey number on white) - was --color-border (#e0e0e0) too light */
.popular-rank {
  color: #aaaaaa !important;
}
.popular-item:hover .popular-rank { color: var(--color-primary) !important; }

.post-number {
  color: #aaaaaa !important;
}
.numbered-post:hover .post-number { color: var(--color-primary) !important; }

/* Single post muted text */
.single-content,
.author-bio {
  color: #333333 !important;
}

/* --- LIST STRUCTURE FIXES --- */

/* wp_list_categories outputs <li class="cat-item"> directly into the footer column div.
   We wrap it in <ul> in footer.php above, so the existing CSS still applies */
.footer-widget > ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-widget > ul li {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.footer-widget > ul li:last-child { border-bottom: none; }
.footer-widget > ul li a {
  font-size: 0.85rem;
  color: #c0c0c0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.footer-widget > ul li a::before { content: '›'; color: var(--color-primary); font-weight: 700; }
.footer-widget > ul li a:hover { color: var(--color-primary); }

/* Footer sub-title for the info list heading */
.footer-sub-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 16px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* Footer legal separator */
.footer-legal-sep {
  color: #555;
  margin: 0 4px;
}

/* --- IDENTICAL LINKS FIX ---
   Privacy Policy appears in both footer column list AND footer-bottom nav.
   We differentiate them with screen-reader context via visually-hidden spans.
   The footer-bottom one already has a distinct nav aria-label="Site legal links"
   so assistive tech distinguishes them automatically by landmark. */

/* --- DARK MODE CONTRAST UPDATES --- */
body.dark-mode .meta,
body.dark-mode .meta span { color: #aaa !important; }
body.dark-mode .post-card-excerpt { color: #aaa !important; }
body.dark-mode .ad-slot-label { color: #999 !important; background: #2a2a2a !important; }

/* --- FOCUS STYLES for keyboard navigation --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Ensure skip link is always reachable */
.skip-link:focus {
  top: 8px !important;
  z-index: 99999;
}
