/*
Theme Name: HindiBlog Pro
Theme URI: https://example.com/hindi-blog-pro
Author: HindiBlog Pro Team
Author URI: https://example.com
Description: A fast, SEO-friendly, AdSense-optimized WordPress theme for Hindi content blogs. Ultra lightweight, mobile-first, with clean design and professional layout.
Version: 1.0.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: hindiblog-pro
Tags: blog, news, hindi, rtl-language-support, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, accessibility-ready, two-columns, left-sidebar, right-sidebar, wide-blocks
*/

/* ============================================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   ============================================================ */
:root {
  /* Brand Colors */
  --color-primary:       #e63946;
  --color-primary-dark:  #c1121f;
  --color-primary-light: #ff6b6b;
  --color-secondary:     #1d3557;
  --color-accent:        #457b9d;

  /* Neutrals */
  --color-white:         #ffffff;
  --color-bg:            #f8f9fa;
  --color-surface:       #ffffff;
  --color-border:        #e0e0e0;
  --color-text:          #212529;
  --color-text-muted:    #6c757d;
  --color-text-light:    #adb5bd;

  /* Typography */
  --font-hindi:          'Noto Sans Devanagari', 'Mangal', sans-serif;
  --font-ui:             -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --font-mono:           'Courier New', Courier, monospace;
  --font-size-base:      16px;
  --line-height-base:    1.7;
  --line-height-heading: 1.3;

  /* Spacing */
  --space-xs:   4px;
  --space-sm:   8px;
  --space-md:   16px;
  --space-lg:   24px;
  --space-xl:   32px;
  --space-2xl:  48px;
  --space-3xl:  64px;

  /* Layout */
  --container-width:     1200px;
  --sidebar-width:       320px;
  --content-width:       820px;
  --border-radius:       6px;
  --border-radius-lg:    12px;

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.12);

  /* Transitions */
  --transition:  all .2s ease;
  --transition-slow: all .35s ease;

  /* Header */
  --header-height: 64px;
  --header-bg: #1d3557;
}

/* Dark Mode Variables */
[data-theme="dark"] {
  --color-bg:       #0f1117;
  --color-surface:  #1a1d27;
  --color-border:   #2d3045;
  --color-text:     #e8eaf0;
  --color-text-muted: #9095a8;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.3);
  --shadow-md:      0 4px 16px rgba(0,0,0,.4);
  --header-bg:      #0f1117;
}

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

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-hindi), var(--font-ui);
  font-size: 1rem;
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: background-color .3s, color .3s;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--color-primary-dark); }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: 1rem; }
h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-hindi), var(--font-ui);
  line-height: var(--line-height-heading);
  color: var(--color-text);
  font-weight: 700;
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}
.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;
}
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.text-muted { color: var(--color-text-muted); }
.text-primary { color: var(--color-primary); }
.hidden { display: none !important; }

/* ============================================================
   SKIP LINK (ACCESSIBILITY)
   ============================================================ */
.skip-link {
  position: absolute; top: -100%; left: 0;
  background: var(--color-primary); color: #fff;
  padding: var(--space-sm) var(--space-md);
  z-index: 9999; font-size: .9rem;
  transition: top .2s;
}
.skip-link:focus { top: 0; }

/* ============================================================
   HEADER
   ============================================================ */
#site-header {
  position: sticky; top: 0; z-index: 1000;
  background: var(--header-bg);
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  height: var(--header-height);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: var(--space-md);
}

/* Logo */
.site-branding { flex-shrink: 0; }
.site-branding a { display: flex; align-items: center; gap: var(--space-sm); }
.custom-logo { height: 40px; width: auto; }
.site-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.5px;
}
.site-title span { color: var(--color-primary-light); }
.site-description { font-size: .75rem; color: rgba(255,255,255,.6); }

/* Primary Navigation */
#primary-navigation { flex: 1; display: flex; justify-content: center; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0;
}

.nav-menu > li { position: relative; }
.nav-menu > li > a {
  display: block;
  padding: 0 var(--space-md);
  height: var(--header-height);
  line-height: var(--header-height);
  color: rgba(255,255,255,.88);
  font-size: .9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: var(--transition);
}
.nav-menu > li > a:hover,
.nav-menu > li.current-menu-item > a {
  color: #fff;
  background: rgba(255,255,255,.1);
}

/* Dropdown */
.nav-menu .sub-menu {
  position: absolute; top: 100%; left: 0;
  min-width: 200px;
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  border-top: 3px solid var(--color-primary);
  opacity: 0; visibility: hidden;
  transform: translateY(-8px);
  transition: var(--transition);
  z-index: 100;
}
.nav-menu li:hover > .sub-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-menu .sub-menu li a {
  display: block; padding: var(--space-sm) var(--space-md);
  color: var(--color-text); font-size: .875rem;
  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 { background: var(--color-bg); color: var(--color-primary); }

/* Header Controls */
.header-controls {
  display: flex; align-items: center; gap: var(--space-sm);
}

/* Header Search */
.header-search { position: relative; }
.header-search-toggle {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.header-search-toggle:hover { background: rgba(255,255,255,.22); }

.header-search-form {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 280px; background: var(--color-surface);
  box-shadow: var(--shadow-lg); border-radius: var(--border-radius);
  padding: var(--space-sm); display: none;
}
.header-search-form.active { display: flex; gap: var(--space-xs); }
.header-search-form input {
  flex: 1; padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border); border-radius: var(--border-radius);
  background: var(--color-bg); color: var(--color-text); font-size: .875rem;
}
.header-search-form button {
  padding: var(--space-sm) var(--space-md);
  background: var(--color-primary); color: #fff;
  border-radius: var(--border-radius); font-size: .875rem;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.dark-mode-toggle:hover { background: rgba(255,255,255,.22); }

/* Hamburger Menu */
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  width: 36px; height: 36px; align-items: center; justify-content: center;
  background: rgba(255,255,255,.12); border-radius: var(--border-radius);
}
.hamburger span {
  display: block; width: 20px; height: 2px;
  background: #fff; border-radius: 2px; transition: var(--transition);
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile Menu */
.mobile-menu {
  display: block; position: fixed;
  top: var(--header-height); left: 0; right: 0; bottom: 0;
  background: var(--color-secondary);
  overflow-y: auto; z-index: 9998;
  transform: translateX(-100%);
  visibility: hidden;
  opacity: 0;
  transition: transform .35s cubic-bezier(.4,0,.2,1), opacity .35s ease, visibility .35s;
}
.mobile-menu.active {
  transform: translateX(0);
  visibility: visible;
  opacity: 1;
}
.mobile-menu-inner { padding: 16px 20px 40px; }
.mobile-menu .nav-menu {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  align-items: stretch !important;
  list-style: none !important;
  margin: 0 !important; padding: 0 !important;
  width: 100%;
}
.mobile-menu .nav-menu > li {
  width: 100%;
  position: relative;
}
.mobile-menu .nav-menu > li > a {
  display: flex !important;
  align-items: center;
  width: 100%;
  height: auto !important;
  line-height: 1.5 !important;
  padding: 15px 12px !important;
  font-size: 1rem !important;
  font-weight: 600;
  color: #fff !important;
  letter-spacing: .02em;
  border-bottom: 1px solid rgba(255,255,255,.12) !important;
  background: transparent !important;
  white-space: normal !important;
  text-decoration: none;
  transition: color .2s, background .2s, padding-left .2s;
}
.mobile-menu .nav-menu > li > a:hover,
.mobile-menu .nav-menu > li > a:focus {
  color: #f9c74f !important;
  background: rgba(255,255,255,.07) !important;
  padding-left: 20px !important;
}
.mobile-menu .nav-menu > li.current-menu-item > a {
  color: #f9c74f !important;
  border-left: 3px solid #f9c74f;
  padding-left: 20px !important;
}
.mobile-menu .nav-menu > li:last-child > a { border-bottom: none !important; }
.mobile-menu .sub-menu {
  display: block !important;
  position: static !important;
  opacity: 1 !important; visibility: visible !important;
  transform: none !important; box-shadow: none !important;
  background: rgba(0,0,0,.3) !important;
  border-radius: 6px !important;
  border-top: none !important;
  padding: 4px 0 !important;
  margin: 0 0 6px 16px !important;
  min-width: unset !important;
}
.mobile-menu .sub-menu li a {
  color: rgba(255,255,255,.8) !important;
  font-weight: 400 !important;
  padding: 11px 16px !important;
  font-size: .9rem !important;
  height: auto !important;
  line-height: 1.5 !important;
  border-bottom: 1px solid rgba(255,255,255,.07) !important;
  white-space: normal !important;
}
.mobile-menu .sub-menu li:last-child a { border-bottom: none !important; }
.mobile-menu .sub-menu li a:hover { color: #fff !important; background: rgba(255,255,255,.08) !important; }

/* Mobile menu overlay backdrop */
.mobile-menu-backdrop {
  display: none; position: fixed;
  inset: 0; background: rgba(0,0,0,.45);
  z-index: 9997; backdrop-filter: blur(2px);
}
.mobile-menu-backdrop.active { display: block; }

/* ============================================================
   TOP BAR / TICKER
   ============================================================ */
.top-bar {
  background: var(--color-primary);
  color: #fff; font-size: .8rem;
  overflow: hidden;
  height: 32px; display: flex; align-items: center;
}
.ticker-label {
  background: var(--color-secondary);
  padding: 0 var(--space-md);
  height: 32px; display: flex; align-items: center;
  white-space: nowrap; flex-shrink: 0;
  font-weight: 700; font-size: .75rem;
  letter-spacing: .5px; text-transform: uppercase;
}
.ticker-wrapper { flex: 1; overflow: hidden; position: relative; }
.ticker-items { display: flex; gap: var(--space-2xl); white-space: nowrap; animation: ticker 30s linear infinite; }
.ticker-items a { color: rgba(255,255,255,.9); }
.ticker-items a:hover { color: #fff; text-decoration: underline; }
@keyframes ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ============================================================
   HEADER AD AREA
   ============================================================ */
.header-ad-area {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-sm) 0;
  text-align: center;
}
.ad-label {
  font-size: .7rem; color: var(--color-text-light);
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 4px;
}
.ad-slot {
  display: inline-block; background: var(--color-bg);
  border: 1px dashed var(--color-border);
  min-height: 90px; min-width: 728px; max-width: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-muted); font-size: .875rem;
  border-radius: var(--border-radius);
  margin: 0 auto;
}
.ad-slot-sidebar {
  min-height: 250px; min-width: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-bg); border: 1px dashed var(--color-border);
  color: var(--color-text-muted); font-size: .875rem;
  border-radius: var(--border-radius);
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb-wrap {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-sm) 0;
}
.breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: var(--space-xs); font-size: .8rem; color: var(--color-text-muted);
}
.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb a:hover { color: var(--color-primary); }
.breadcrumb .sep { color: var(--color-text-light); }
.breadcrumb .current { color: var(--color-text); font-weight: 500; }

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
#main-content { padding: var(--space-xl) 0; }

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

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

/* ============================================================
   CATEGORY TABS / FILTER
   ============================================================ */
.category-tabs {
  display: flex; align-items: center; gap: var(--space-sm);
  flex-wrap: wrap; margin-bottom: var(--space-lg);
  border-bottom: 2px solid var(--color-border);
  padding-bottom: var(--space-sm);
}
.category-tab {
  padding: var(--space-xs) var(--space-md);
  border-radius: 20px; font-size: .85rem; font-weight: 600;
  color: var(--color-text-muted); background: transparent;
  border: 2px solid transparent; transition: var(--transition);
}
.category-tab:hover, .category-tab.active {
  color: var(--color-primary); border-color: var(--color-primary);
  background: rgba(230,57,70,.05);
}

/* ============================================================
   SECTION HEADING
   ============================================================ */
.section-heading {
  display: flex; align-items: center; gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.section-heading h2 {
  font-size: 1.25rem; font-weight: 800;
  color: var(--color-text);
  position: relative;
}
.section-heading h2::before {
  content: '';
  display: inline-block; width: 4px; height: 1.25em;
  background: var(--color-primary); border-radius: 2px;
  margin-right: var(--space-sm); vertical-align: middle;
}
.section-heading .view-all {
  margin-left: auto; font-size: .8rem; font-weight: 600;
  color: var(--color-primary); border: 1px solid var(--color-primary);
  padding: 3px var(--space-sm); border-radius: 20px;
}
.section-heading .view-all:hover { background: var(--color-primary); color: #fff; }

/* ============================================================
   FEATURED / HERO POST
   ============================================================ */
.hero-post {
  position: relative; border-radius: var(--border-radius-lg);
  overflow: hidden; margin-bottom: var(--space-xl);
  box-shadow: var(--shadow-lg);
}
.hero-post-img {
  width: 100%; height: 420px; object-fit: cover;
  transition: transform .4s ease;
}
.hero-post:hover .hero-post-img { transform: scale(1.03); }
.hero-post-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.1) 60%, transparent 100%);
}
.hero-post-content {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: var(--space-xl);
}
.hero-post-category {
  display: inline-block; background: var(--color-primary);
  color: #fff; font-size: .75rem; font-weight: 700;
  padding: 2px var(--space-sm); border-radius: 3px;
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: var(--space-sm);
}
.hero-post-title {
  font-size: 1.75rem; color: #fff; font-weight: 800;
  margin-bottom: var(--space-sm); line-height: 1.25;
}
.hero-post-meta { display: flex; gap: var(--space-md); color: rgba(255,255,255,.7); font-size: .8rem; }

/* ============================================================
   POST GRID — PROFESSIONAL LARGE CARDS
   ============================================================ */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

/* First card spans full width for editorial punch */
.posts-grid .post-card:first-child {
  grid-column: 1 / -1;
  flex-direction: row;
}
.posts-grid .post-card:first-child .post-card-img-wrap {
  flex: 0 0 55%;
  padding-top: 0;
  min-height: 320px;
}
.posts-grid .post-card:first-child .post-card-body {
  padding: var(--space-xl) var(--space-xl);
  justify-content: center;
}
.posts-grid .post-card:first-child .post-card-title {
  font-size: 1.6rem;
  -webkit-line-clamp: 3;
}
.posts-grid .post-card:first-child .post-card-excerpt {
  font-size: 1rem;
  -webkit-line-clamp: 4;
}

.post-card {
  background: var(--color-surface);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-slow);
  display: flex; flex-direction: column;
  border: 1px solid var(--color-border);
}
.post-card:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,.13);
  transform: translateY(-5px);
  border-color: var(--color-primary);
}
.post-card-img-wrap {
  position: relative; overflow: hidden;
  padding-top: 58%; /* 5:3 aspect ratio */
}
.post-card-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease;
}
.post-card:hover .post-card-img { transform: scale(1.06); }
.post-card-category {
  position: absolute; top: var(--space-md); left: var(--space-md);
  background: var(--color-primary); color: #fff;
  font-size: .72rem; font-weight: 700;
  padding: 4px 12px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: .04em;
  box-shadow: 0 2px 8px rgba(230,57,70,.4);
}
.post-card-body {
  padding: var(--space-lg) var(--space-lg) var(--space-md);
  flex: 1; display: flex; flex-direction: column;
}
.post-card-title {
  font-size: 1.15rem; font-weight: 800; margin-bottom: var(--space-sm);
  line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card-title a { color: var(--color-text); }
.post-card-title a:hover { color: var(--color-primary); }
.post-card-excerpt {
  font-size: .9rem; color: var(--color-text-muted); margin-bottom: var(--space-md);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  line-height: 1.65;
  flex: 1;
}
.post-card-footer-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: var(--space-sm); border-top: 1px solid var(--color-border);
}
.post-card-meta {
  display: flex; align-items: center; gap: var(--space-sm);
  font-size: .78rem; color: var(--color-text-muted);
  flex-wrap: wrap;
}
.post-card-meta .author-avatar {
  width: 26px; height: 26px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--color-primary);
}
.post-card-meta .reading-time {
  background: var(--color-bg);
  padding: 2px 8px; border-radius: 10px;
  font-size: .72rem; font-weight: 600;
  color: var(--color-accent);
  margin-left: auto;
}
.meta-dot { color: var(--color-border); }

/* Read more link inside card */
.post-card-readmore {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .8rem; font-weight: 700;
  color: var(--color-primary);
  margin-top: var(--space-sm);
  transition: gap .2s;
}
.post-card-readmore:hover { gap: 8px; color: var(--color-primary-dark); }

/* ============================================================
   POST LIST (Sidebar style)
   ============================================================ */
.posts-list { display: flex; flex-direction: column; gap: var(--space-md); }

.post-list-item {
  display: flex; gap: var(--space-md);
  background: var(--color-surface);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.post-list-item:hover { box-shadow: var(--shadow-md); }
.post-list-thumb {
  width: 100px; flex-shrink: 0;
  overflow: hidden;
}
.post-list-thumb img {
  width: 100%; height: 80px; object-fit: cover;
  transition: transform .3s;
}
.post-list-item:hover .post-list-thumb img { transform: scale(1.05); }
.post-list-content { padding: var(--space-sm) var(--space-sm) var(--space-sm) 0; flex: 1; min-width: 0; }
.post-list-cat {
  font-size: .7rem; font-weight: 700; color: var(--color-primary);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px;
}
.post-list-title {
  font-size: .9rem; font-weight: 700; margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-list-title a { color: var(--color-text); }
.post-list-title a:hover { color: var(--color-primary); }
.post-list-meta { font-size: .72rem; color: var(--color-text-muted); }

/* ============================================================
   IN-CONTENT AD
   ============================================================ */
.in-content-ad {
  margin: var(--space-lg) 0; text-align: center;
  padding: var(--space-sm); background: var(--color-surface);
  border-radius: var(--border-radius); border: 1px solid var(--color-border);
}
.in-content-ad .ad-label { margin-bottom: 6px; }

/* ============================================================
   SIDEBAR
   ============================================================ */
#sidebar { position: sticky; top: calc(var(--header-height) + var(--space-md)); }

.widget {
  background: var(--color-surface);
  border-radius: var(--border-radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-sm);
}
.widget-title {
  font-size: 1rem; font-weight: 800;
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-primary);
  margin-bottom: var(--space-md);
  position: relative;
}
.widget-title::after {
  content: ''; position: absolute;
  left: 0; bottom: -2px; width: 40px; height: 2px;
  background: var(--color-secondary);
}

/* Recent Posts Widget */
.widget-posts { display: flex; flex-direction: column; gap: var(--space-sm); }
.widget-post-item { display: flex; gap: var(--space-sm); align-items: flex-start; }
.widget-post-item + .widget-post-item { padding-top: var(--space-sm); border-top: 1px solid var(--color-border); }
.widget-post-num {
  font-size: 1.5rem; font-weight: 900; color: var(--color-primary);
  opacity: .3; line-height: 1; flex-shrink: 0; min-width: 28px;
}
.widget-post-title {
  font-size: .85rem; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.widget-post-title a { color: var(--color-text); }
.widget-post-title a:hover { color: var(--color-primary); }
.widget-post-date { font-size: .72rem; color: var(--color-text-muted); }

/* Category Widget */
.widget-categories { display: flex; flex-direction: column; gap: 2px; }
.widget-cat-item a {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--space-sm); border-radius: var(--border-radius);
  font-size: .875rem; color: var(--color-text);
  transition: var(--transition);
}
.widget-cat-item a:hover { background: var(--color-bg); color: var(--color-primary); padding-left: var(--space-md); }
.widget-cat-count {
  background: var(--color-bg); color: var(--color-text-muted);
  font-size: .72rem; padding: 2px 6px; border-radius: 20px;
}

/* Tags Widget */
.widget-tags { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.widget-tag {
  display: inline-block; background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted); font-size: .78rem;
  padding: 3px var(--space-sm); border-radius: 20px;
  transition: var(--transition);
}
.widget-tag:hover { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

/* ============================================================
   SINGLE POST
   ============================================================ */
.single-post-wrap { background: var(--color-surface); border-radius: var(--border-radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }

.post-featured-img {
  width: 100%; max-height: 480px; object-fit: cover;
  display: block;
}

.post-content-wrap { padding: var(--space-xl); }

.post-header { margin-bottom: var(--space-lg); }
.post-categories { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-bottom: var(--space-md); }
.post-cat-badge {
  background: var(--color-primary); color: #fff;
  font-size: .72rem; font-weight: 700; padding: 3px 10px;
  border-radius: 3px; text-transform: uppercase; letter-spacing: .5px;
}
.post-title {
  font-size: 2rem; font-weight: 900; line-height: 1.2;
  color: var(--color-text); margin-bottom: var(--space-md);
}
.post-meta-bar {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--space-md); font-size: .82rem; color: var(--color-text-muted);
  padding: var(--space-md) 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.post-meta-bar .author { display: flex; align-items: center; gap: var(--space-xs); }
.post-meta-bar .author img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.post-meta-bar .author a { color: var(--color-text); font-weight: 600; }
.post-meta-bar .author a:hover { color: var(--color-primary); }
.post-meta-bar .updated-date { font-size: .78rem; }

/* Social Share - Top */
.social-share { margin: var(--space-lg) 0; }
.social-share-title { font-size: .85rem; font-weight: 700; margin-bottom: var(--space-sm); color: var(--color-text-muted); }
.share-buttons { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.share-btn {
  display: inline-flex; align-items: center; gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md); border-radius: 20px;
  font-size: .8rem; font-weight: 600; color: #fff;
  transition: var(--transition); opacity: .9;
}
.share-btn:hover { opacity: 1; transform: translateY(-2px); color: #fff; }
.share-btn.facebook { background: #1877f2; }
.share-btn.twitter  { background: #1da1f2; }
.share-btn.whatsapp { background: #25d366; }
.share-btn.telegram { background: #0088cc; }
.share-btn.copy-link { background: var(--color-secondary); }

/* Table of Contents */
.toc-box {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--border-radius);
  padding: var(--space-lg);
  margin: var(--space-xl) 0;
}
.toc-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: var(--space-md); cursor: pointer;
}
.toc-title { font-size: 1rem; font-weight: 800; }
.toc-toggle { font-size: .8rem; color: var(--color-primary); }
.toc-list { padding-left: var(--space-md); }
.toc-list li { margin: var(--space-xs) 0; }
.toc-list a { color: var(--color-accent); font-size: .875rem; }
.toc-list a:hover { color: var(--color-primary); text-decoration: underline; }
.toc-list .toc-h3 { padding-left: var(--space-md); font-size: .82rem; }

/* Post Body */
.post-body { font-size: 1rem; line-height: 1.85; color: var(--color-text); }
.post-body h2 { font-size: 1.5rem; margin: var(--space-xl) 0 var(--space-md); padding-bottom: var(--space-sm); border-bottom: 2px solid var(--color-border); }
.post-body h3 { font-size: 1.2rem; margin: var(--space-lg) 0 var(--space-sm); }
.post-body h4 { font-size: 1.05rem; margin: var(--space-md) 0 var(--space-xs); }
.post-body p { margin-bottom: var(--space-md); }
.post-body ul, .post-body ol { margin: 0 0 var(--space-md) var(--space-xl); list-style: revert; }
.post-body li { margin-bottom: var(--space-xs); }
.post-body blockquote {
  margin: var(--space-xl) 0;
  padding: var(--space-lg) var(--space-lg) var(--space-lg) var(--space-xl);
  border-left: 4px solid var(--color-primary);
  background: rgba(230,57,70,.05);
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  font-style: italic; font-size: 1.05rem;
}
.post-body pre {
  background: #1a1d27; color: #e8eaf0;
  padding: var(--space-lg); border-radius: var(--border-radius);
  overflow-x: auto; font-size: .875rem; margin-bottom: var(--space-md);
}
.post-body code {
  font-family: var(--font-mono); font-size: .875em;
  background: rgba(0,0,0,.07); padding: 2px 6px; border-radius: 3px;
}
.post-body pre code { background: none; padding: 0; }
.post-body table { width: 100%; border-collapse: collapse; margin-bottom: var(--space-md); }
.post-body table th, .post-body table td {
  border: 1px solid var(--color-border); padding: var(--space-sm) var(--space-md);
  text-align: left; font-size: .9rem;
}
.post-body table th { background: var(--color-bg); font-weight: 700; }
.post-body img { border-radius: var(--border-radius); margin: var(--space-md) 0; }
.post-body a { color: var(--color-primary); text-decoration: underline; }

/* Post Tags */
.post-tags { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin: var(--space-lg) 0; align-items: center; }
.post-tags-label { font-size: .85rem; font-weight: 700; color: var(--color-text-muted); margin-right: var(--space-xs); }
.post-tag {
  background: var(--color-bg); border: 1px solid var(--color-border);
  color: var(--color-text-muted); font-size: .78rem;
  padding: 3px var(--space-sm); border-radius: 20px; transition: var(--transition);
}
.post-tag:hover { background: var(--color-secondary); color: #fff; border-color: var(--color-secondary); }

/* Author Box */
.author-box {
  background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg); padding: var(--space-xl);
  margin: var(--space-xl) 0; display: flex; gap: var(--space-lg);
}
.author-box-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  border: 3px solid var(--color-primary);
}
.author-box-content {}
.author-box-name { font-size: 1.1rem; font-weight: 800; margin-bottom: 2px; }
.author-box-role { font-size: .78rem; color: var(--color-primary); font-weight: 600; text-transform: uppercase; margin-bottom: var(--space-sm); }
.author-box-bio { font-size: .9rem; color: var(--color-text-muted); margin-bottom: var(--space-sm); }
.author-social { display: flex; gap: var(--space-sm); }
.author-social a {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--color-surface); border: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; color: var(--color-text-muted);
  transition: var(--transition);
}
.author-social a:hover { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

/* Related Posts */
.related-posts { margin-top: var(--space-2xl); }
.related-posts-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-md);
}

/* ============================================================
   COMMENTS
   ============================================================ */
.comments-section {
  background: var(--color-surface); border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm); padding: var(--space-xl);
  margin-top: var(--space-lg);
}
.comment-list { list-style: none; }
.comment-item {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border);
}
.comment-meta { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-sm); }
.comment-avatar { width: 36px; height: 36px; border-radius: 50%; }
.comment-author { font-weight: 700; font-size: .9rem; }
.comment-date { font-size: .78rem; color: var(--color-text-muted); }
.comment-body { font-size: .9rem; }
.comment-reply-link { font-size: .78rem; color: var(--color-primary); font-weight: 600; }

.comment-form-wrap { margin-top: var(--space-xl); }
.comment-form-wrap h3 { margin-bottom: var(--space-lg); }
.comment-form { display: grid; gap: var(--space-md); }
.comment-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
.form-group { display: flex; flex-direction: column; gap: var(--space-xs); }
.form-group label { font-size: .85rem; font-weight: 600; }
.form-group input, .form-group textarea {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border); border-radius: var(--border-radius);
  background: var(--color-bg); color: var(--color-text);
  transition: var(--transition);
}
.form-group input:focus, .form-group textarea:focus {
  outline: none; border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(230,57,70,.12);
}
.form-group textarea { min-height: 120px; resize: vertical; }
.submit-btn {
  display: inline-flex; align-items: center; gap: var(--space-sm);
  background: var(--color-primary); color: #fff;
  padding: var(--space-sm) var(--space-xl);
  border-radius: var(--border-radius); font-size: .9rem; font-weight: 700;
  transition: var(--transition); cursor: pointer; border: none;
}
.submit-btn:hover { background: var(--color-primary-dark); transform: translateY(-1px); }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex; justify-content: center; align-items: center;
  gap: var(--space-xs); margin: var(--space-2xl) 0;
}
.page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--border-radius);
  font-size: .875rem; font-weight: 600; color: var(--color-text-muted);
  background: var(--color-surface); 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.dots { background: none; border: none; cursor: default; }

/* ============================================================
   FOOTER
   ============================================================ */
#site-footer {
  background: var(--color-secondary);
  color: rgba(255,255,255,.75);
  margin-top: var(--space-3xl);
}

.footer-top { padding: var(--space-3xl) 0 var(--space-2xl); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
}

.footer-widget-title {
  font-size: .9rem; font-weight: 800;
  color: #fff; text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid rgba(255,255,255,.1);
}
.footer-about-logo { height: 36px; width: auto; margin-bottom: var(--space-md); filter: brightness(0) invert(1); }
.footer-about-text { font-size: .875rem; line-height: 1.7; margin-bottom: var(--space-md); }
.footer-social { display: flex; gap: var(--space-sm); }
.footer-social a {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center;
  font-size: .85rem; color: rgba(255,255,255,.75);
  transition: var(--transition);
}
.footer-social a:hover { background: var(--color-primary); color: #fff; }

.footer-links { display: flex; flex-direction: column; gap: 6px; }
.footer-links a {
  font-size: .875rem; color: rgba(255,255,255,.65);
  padding: 3px 0; transition: var(--transition);
  border-bottom: 1px solid transparent;
}
.footer-links a:hover { color: #fff; padding-left: 6px; }

.footer-ad { display: flex; flex-direction: column; gap: var(--space-sm); }
.footer-ad-slot {
  background: rgba(255,255,255,.05); border: 1px dashed rgba(255,255,255,.15);
  border-radius: var(--border-radius); padding: var(--space-md);
  text-align: center; font-size: .8rem; color: rgba(255,255,255,.4);
  min-height: 100px; display: flex; align-items: center; justify-content: center;
}

.footer-bottom {
  background: rgba(0,0,0,.25);
  padding: var(--space-md) 0;
}
.footer-bottom-inner {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .8rem; flex-wrap: wrap; gap: var(--space-sm);
}
.footer-bottom-menu { display: flex; gap: var(--space-md); }
.footer-bottom-menu a { color: rgba(255,255,255,.55); }
.footer-bottom-menu a:hover { color: rgba(255,255,255,.9); }
.copyright { color: rgba(255,255,255,.5); }

/* Footer Ad Bar */
.footer-ad-bar {
  background: var(--color-surface); border-top: 1px solid var(--color-border);
  padding: var(--space-sm) 0; text-align: center;
}

/* ============================================================
   BACK TO TOP
   ============================================================ */
.back-to-top {
  position: fixed; bottom: var(--space-xl); right: var(--space-xl); z-index: 500;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--color-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: var(--transition-slow);
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--color-primary-dark); color: #fff; transform: translateY(-2px); }

/* ============================================================
   SEARCH PAGE
   ============================================================ */
.search-hero {
  background: var(--color-secondary); color: #fff;
  padding: var(--space-2xl) 0; text-align: center;
}
.search-hero h1 { font-size: 2rem; margin-bottom: var(--space-md); }
.search-form-large {
  display: flex; max-width: 600px; margin: 0 auto;
  background: #fff; border-radius: 40px; overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.search-form-large input {
  flex: 1; padding: var(--space-md) var(--space-xl);
  border: none; font-size: 1rem; color: #333;
  outline: none;
}
.search-form-large button {
  padding: var(--space-md) var(--space-xl);
  background: var(--color-primary); color: #fff;
  font-size: 1rem; font-weight: 700;
}

/* ============================================================
   404 PAGE
   ============================================================ */
.error-404 {
  text-align: center; padding: var(--space-3xl) 0;
}
.error-404 .error-code {
  font-size: 8rem; font-weight: 900; color: var(--color-primary);
  line-height: 1; margin-bottom: var(--space-md); opacity: .2;
}
.error-404 h2 { font-size: 2rem; margin-bottom: var(--space-md); }
.error-404 p { color: var(--color-text-muted); margin-bottom: var(--space-xl); }

/* ============================================================
   ARCHIVE PAGE — PROFESSIONAL HEADER
   ============================================================ */
.archive-header {
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-accent) 100%);
  border-radius: var(--border-radius-lg);
  padding: var(--space-2xl) var(--space-xl);
  margin-bottom: var(--space-xl);
  box-shadow: var(--shadow-md);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.archive-header::before {
  content: '';
  position: absolute; top: -40px; right: -40px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.archive-header h1 {
  font-size: 2rem; margin-bottom: var(--space-sm);
  color: #fff; font-weight: 900;
}
.archive-header p { color: rgba(255,255,255,.75); font-size: .95rem; }
.archive-header .archive-count {
  display: inline-block;
  background: rgba(255,255,255,.15);
  padding: 4px 14px; border-radius: 20px;
  font-size: .82rem; font-weight: 600;
  margin-top: var(--space-sm);
  backdrop-filter: blur(4px);
}

/* ============================================================
   READING PROGRESS BAR
   ============================================================ */
.reading-progress {
  position: fixed; top: 0; left: 0; z-index: 9999;
  height: 3px; background: var(--color-primary);
  width: 0%; transition: width .1s linear;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp .4s ease forwards; }

/* Lazy load blur-up */
img.lazy { filter: blur(5px); transition: filter .3s; }
img.lazy.loaded { filter: blur(0); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  :root { --sidebar-width: 280px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-xl); }
  .related-posts-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --font-size-base: 15px; }

  #primary-navigation { display: none; }
  .hamburger { display: flex; }


  .content-area {
    grid-template-columns: 1fr;
  }
  #sidebar {
    position: static;
    order: 2;
  }

  /* Reset featured first card on mobile */
  .posts-grid .post-card:first-child {
    grid-column: auto;
    flex-direction: column;
  }
  .posts-grid .post-card:first-child .post-card-img-wrap {
    flex: none;
    padding-top: 58%;
    min-height: auto;
  }
  .posts-grid .post-card:first-child .post-card-title { font-size: 1.15rem; }

  .posts-grid { grid-template-columns: 1fr; }
  .hero-post-title { font-size: 1.3rem; }
  .hero-post-img { height: 280px; }
  .post-title { font-size: 1.5rem; }
  .comment-form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-lg); }
  .author-box { flex-direction: column; }
  .related-posts-grid { grid-template-columns: 1fr; }
  .ad-slot { min-width: 300px; }
  .back-to-top { bottom: var(--space-md); right: var(--space-md); }
}

@media (max-width: 480px) {
  .posts-grid { grid-template-columns: 1fr; }
  .footer-bottom-inner { flex-direction: column; text-align: center; }
  .post-content-wrap { padding: var(--space-md); }
  .post-title { font-size: 1.3rem; }
}

/* ============================================================
   LAYOUT VARIANTS (Customizer-driven)
   ============================================================ */

/* 3-column grid variant */
.posts-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr) !important;
}
.posts-grid.cols-3 .post-card:first-child {
  grid-column: auto;
  flex-direction: column;
}
.posts-grid.cols-3 .post-card:first-child .post-card-img-wrap {
  flex: none;
  padding-top: 58%;
  min-height: auto;
}
.posts-grid.cols-3 .post-card:first-child .post-card-title {
  font-size: 1rem;
}

/* 1-column layout */
.posts-grid.cols-1 {
  grid-template-columns: 1fr !important;
}
.posts-grid.cols-1 .post-card {
  flex-direction: row;
  max-height: 220px;
}
.posts-grid.cols-1 .post-card .post-card-img-wrap {
  flex: 0 0 38%;
  padding-top: 0;
  min-height: 180px;
}
.posts-grid.cols-1 .post-card .post-card-title { font-size: 1.2rem; }

/* Light / White Header style */
.header-style-light #site-header {
  background: #ffffff !important;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.header-style-light .site-title,
.header-style-light .nav-menu > li > a,
.header-style-light .header-actions .btn-icon {
  color: var(--color-secondary) !important;
}
.header-style-light .hamburger span { background: var(--color-secondary) !important; }

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  #site-header, #sidebar, .social-share, .author-box,
  .related-posts, .comments-section, #site-footer,
  .back-to-top, .in-content-ad, .header-ad-area { display: none !important; }
  .content-area { grid-template-columns: 1fr; }
  body { font-size: 12pt; }
}
