/*
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.0.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; }
}
