/*
Theme Name:  GameHost KB
Theme URI:   https://yoursite.com
Author:      GameHost Team
Author URI:  https://yoursite.com
Description: A dark-mode Technical Knowledge Base & Game Server Hosting documentation theme. Supports posts, pages, code blocks with copy button, category sidebars, and sales CTAs.
Version:     1.0.0
License:     GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: gamehost-kb
Tags:        dark, documentation, knowledge-base, technical, gaming, sidebar, custom-menu
*/

/* =====================================================
   DESIGN TOKENS
   ===================================================== */
:root {
  --bg-primary: #0d0f12;
  --bg-secondary: #13161b;
  --bg-card: #1a1e26;
  --bg-hover: #22283a;
  --accent: #00d4ff;
  --accent-dark: #0099cc;
  --accent-glow: rgba(0, 212, 255, 0.18);
  --success: #39d353;
  --warning: #f0b429;
  --danger: #f55858;
  --text-primary: #e8eaf0;
  --text-secondary: #9aa3b5;
  --text-muted: #5a6275;
  --border: #252a36;
  --border-accent: rgba(0, 212, 255, 0.3);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-accent: 0 0 20px rgba(0, 212, 255, 0.15);
  --transition: 0.2s ease;
  --sidebar-w: 260px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* Fix horizontal scroll width issues */
  width: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent);
}

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

ul,
ol {
  padding-left: 1.5rem;
}

/* =====================================================
   TYPOGRAPHY
   ===================================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
}

h3 {
  font-size: 1.3rem;
}

h4 {
  font-size: 1.1rem;
}

p {
  margin-bottom: 1.25rem;
}

p:last-child {
  margin-bottom: 0;
}

/* =====================================================
   LAYOUT HELPERS
   ===================================================== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title span.accent {
  color: var(--accent);
}

/* =====================================================
   SITE HEADER
   ===================================================== */
#site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(13, 15, 18, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 2rem;
}

.site-branding a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.site-branding .logo-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: #000;
  font-weight: 900;
  flex-shrink: 0;
}

.site-branding span {
  color: var(--accent);
}

/* Main Nav */
#primary-navigation {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#primary-navigation a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 0.25rem;
  position: relative;
  transition: color var(--transition);
}

#primary-navigation a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
  border-radius: 2px;
}

#primary-navigation a:hover,
#primary-navigation .current-menu-item a {
  color: var(--accent);
}

#primary-navigation a:hover::after,
#primary-navigation .current-menu-item a::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Header search */
.header-search {
  position: relative;
}

.header-search input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.4rem 1rem 0.4rem 2.2rem;
  color: var(--text-primary);
  font-size: 0.85rem;
  width: 200px;
  transition: all var(--transition);
  outline: none;
}

.header-search input:focus {
  border-color: var(--accent);
  width: 260px;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.header-search .search-icon {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

/* Mobile toggle */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  cursor: pointer;
}

/* =====================================================
   HERO SECTION (Homepage)
   ===================================================== */
.hero-section {
  padding: 5rem 1.5rem 4rem;
  text-align: center;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0, 212, 255, 0.07) 0%, transparent 70%);
  border-bottom: 1px solid var(--border);
}

.hero-section .hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-section h1 {
  margin-bottom: 1rem;
}

.hero-section h1 em {
  color: var(--accent);
  font-style: normal;
}

.hero-section .hero-sub {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 560px;
  margin: 0 auto 2.5rem;
}

/* Hero search bar */
.hero-search-form {
  max-width: 640px;
  margin: 0 auto 1.5rem;
  position: relative;
}

.hero-search-form input {
  width: 100%;
  padding: 1rem 7rem 1rem 1.5rem;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 50px;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-sans);
  outline: none;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-card);
}

.hero-search-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow), var(--shadow-card);
}

.hero-search-form input::placeholder {
  color: var(--text-muted);
}

.hero-search-form button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 40px;
  padding: 0.6rem 1.4rem;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.hero-search-form button:hover {
  background: #fff;
}

/* Live Search Results Dropdown */
.live-search-results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  z-index: 1000;
  text-align: left;
  overflow: hidden;
}

.live-search-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.live-search-list li {
  border-bottom: 1px solid var(--border);
}

.live-search-list li:last-child {
  border-bottom: none;
}

.live-search-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.25rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: background var(--transition);
}

.live-search-list a:hover {
  background: var(--bg-hover);
  color: var(--accent);
}

.live-search-list .ls-cat {
  font-size: 0.7rem;
  background: var(--bg-primary);
  color: var(--text-secondary);
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
}

.ls-empty {
  padding: 1rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

.hero-search-tags {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.hero-search-tags span {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.hero-search-tags a {
  color: var(--text-secondary);
  font-size: 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  transition: all var(--transition);
}

.hero-search-tags a:hover {
  color: var(--accent);
  border-color: var(--accent-glow);
}

/* =====================================================
   CATEGORY GRID (Homepage)
   ===================================================== */
.categories-section {
  padding: 3rem 1.5rem;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: block;
  color: var(--text-primary);
}

.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.category-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-accent);
  color: var(--text-primary);
}

.category-card:hover::before {
  transform: scaleX(1);
}

.category-card .cat-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.category-card h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.category-card p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.category-card .cat-count {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
}

/* =====================================================
   SEO STATS / BENEFITS (Homepage)
   ===================================================== */
.seo-stats-section {
  padding: 0 1.5rem 4rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  background: radial-gradient(circle at top left, var(--bg-hover) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem;
  text-align: center;
}

.stat-card .stat-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.stat-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.stat-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
}

/* =====================================================
   LATEST DOCS (Homepage)
   ===================================================== */
.latest-docs-section {
  padding: 0 1.5rem 4rem;
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.doc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all var(--transition);
}

.doc-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-accent);
}

.doc-card .doc-cat {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 0.08em;
}

.doc-card h3 {
  font-size: 0.95rem;
}

.doc-card h3 a {
  color: var(--text-primary);
}

.doc-card h3 a:hover {
  color: var(--accent);
}

.doc-card .doc-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.75rem;
}

/* =====================================================
   THREE-COLUMN LAYOUT (Single Post)
   ===================================================== */
.content-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr 280px;
  gap: 2rem;
  align-items: start;
}

/* Prevent any grid child from blowing out the column */
.content-wrapper>* {
  min-width: 0;
}

/* Left Sidebar */
.sidebar-left {
  position: sticky;
  top: 80px;
}

.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.sidebar-widget-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-widget ul li {
  margin-bottom: 0.25rem;
}

.sidebar-widget ul li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.sidebar-widget ul li a:hover {
  color: var(--accent);
  background: var(--bg-hover);
}

.sidebar-widget ul li.current-cat a {
  color: var(--accent);
  background: var(--accent-glow);
}

.sidebar-widget ul li a .cat-badge {
  font-size: 0.7rem;
  background: var(--bg-primary);
  color: var(--text-muted);
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  min-width: 22px;
  text-align: center;
}

/* Right Sidebar */
.sidebar-right {
  position: sticky;
  top: 80px;
}

/* CTA Widget */
.cta-widget {
  background: linear-gradient(135deg, #0d1a2f 0%, #0a1520 100%);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-accent), var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.cta-widget::before {
  content: '';
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 150px;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.12) 0%, transparent 60%);
}

.cta-widget .cta-badge {
  display: inline-block;
  background: rgba(0, 212, 255, 0.15);
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.cta-widget h3 {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 0.75rem;
  color: #fff;
}

.cta-widget p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.cta-widget .cta-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  text-align: left;
}

.cta-widget .cta-features li {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.cta-widget .cta-features li::before {
  content: '✓';
  color: var(--success);
  font-weight: 700;
}

.cta-btn {
  display: block;
  width: 100%;
  background: var(--accent);
  color: #000;
  font-size: 0.875rem;
  font-weight: 800;
  text-align: center;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.02em;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.cta-btn:hover {
  background: #fff;
  color: #000;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
  transform: translateY(-2px);
}

.cta-widget .cta-note {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

/* Recent Posts widget */
.recent-posts-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.recent-posts-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.recent-posts-list li:last-child {
  border-bottom: none;
}

.recent-posts-list li a {
  font-size: 0.83rem;
  color: var(--text-secondary);
  display: block;
  line-height: 1.4;
}

.recent-posts-list li a:hover {
  color: var(--accent);
}

.recent-posts-list li .rp-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* =====================================================
   ARTICLE CONTENT
   ===================================================== */
.article-header {
  margin-bottom: 2rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.article-cat {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  letter-spacing: 0.08em;
}

.article-meta span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.article-summary {
  background: var(--bg-card);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Content styling */
.entry-content {
  max-width: none;
}

.entry-content h2 {
  margin: 2.5rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.entry-content h3 {
  margin: 2rem 0 0.75rem;
  color: var(--accent);
}

.entry-content h4 {
  margin: 1.5rem 0 0.5rem;
}

.entry-content ul,
.entry-content ol {
  margin-bottom: 1.25rem;
}

.entry-content li {
  margin-bottom: 0.4rem;
  color: var(--text-secondary);
}

.entry-content strong {
  color: var(--text-primary);
}

.entry-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1.25rem;
  background: var(--bg-card);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.5rem 0;
  color: var(--text-secondary);
  font-style: italic;
}

/* Alert Boxes */
.alert-box {
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.9rem;
}

.alert-box .alert-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.alert-box p {
  margin: 0;
}

.alert-box strong {
  display: block;
  margin-bottom: 0.25rem;
}

.alert-warning {
  background: rgba(240, 180, 41, 0.08);
  border: 1px solid rgba(240, 180, 41, 0.3);
  color: var(--warning);
}

.alert-tip {
  background: rgba(0, 212, 255, 0.06);
  border: 1px solid var(--border-accent);
  color: var(--accent);
}

.alert-danger {
  background: rgba(245, 88, 88, 0.08);
  border: 1px solid rgba(245, 88, 88, 0.3);
  color: var(--danger);
}

.alert-success {
  background: rgba(57, 211, 83, 0.08);
  border: 1px solid rgba(57, 211, 83, 0.3);
  color: var(--success);
}

/* Step list */
.step-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  counter-reset: step-counter;
}

.step-list li {
  counter-increment: step-counter;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
}

.step-list li::before {
  content: counter(step-counter);
  background: var(--accent);
  color: #000;
  font-size: 0.75rem;
  font-weight: 800;
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* =====================================================
   CODE BLOCKS
   ===================================================== */
pre,
.code-block {
  background: #0a0c10;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  color: #c9d1d9;
  margin: 1.5rem 0;
  position: relative;
}

pre code {
  background: none;
  padding: 0;
  border: none;
  font-size: inherit;
  color: inherit;
}

code {
  background: rgba(0, 212, 255, 0.08);
  color: var(--accent);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.875em;
}

.code-block-wrapper {
  position: relative;
  margin: 1.5rem 0;
  /* Prevent long code lines from expanding grid column */
  max-width: 100%;
  overflow-x: auto;
}

.code-block-wrapper pre {
  margin: 0;
}

.copy-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-sans);
}

.copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.copy-btn.copied {
  color: var(--success);
  border-color: var(--success);
}

.code-lang {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  position: absolute;
  top: 0.6rem;
  left: 1rem;
}

/* Code syntax colors */
.token-keyword {
  color: #ff79c6;
}

.token-string {
  color: #f1fa8c;
}

.token-comment {
  color: #6272a4;
  font-style: italic;
}

.token-number {
  color: #bd93f9;
}

.token-function {
  color: #50fa7b;
}

/* =====================================================
   ARTICLE-END CTA
   ===================================================== */
.article-cta {
  background: linear-gradient(135deg, #0d1a2f 0%, #0a1520 100%);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 3rem 0 1.5rem;
  display: flex;
  gap: 2rem;
  align-items: center;
  box-shadow: var(--shadow-accent);
}

.article-cta .cta-text {
  flex: 1;
}

.article-cta h3 {
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 0.5rem;
}

.article-cta p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 0;
}

.article-cta .cta-action {
  flex-shrink: 0;
}

.article-cta .cta-btn-large {
  display: inline-block;
  background: var(--accent);
  color: #000;
  font-size: 0.875rem;
  font-weight: 800;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: all 0.3s ease;
}

.article-cta .cta-btn-large:hover {
  background: #fff;
  transform: scale(1.03);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

/* =====================================================
   TAGS
   ===================================================== */
.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.5rem 0;
}

.tags-list a {
  display: inline-block;
  font-size: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  transition: all var(--transition);
}

.tags-list a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* =====================================================
   ARCHIVE PAGE
   ===================================================== */
.archive-header {
  padding: 3rem 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
}

.archive-header h1 {
  margin-bottom: 0.5rem;
}

.archive-header p {
  color: var(--text-secondary);
}

.archive-listing {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: var(--sidebar-w) 1fr;
}

.archive-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.archive-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  transition: all var(--transition);
}

.archive-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-accent);
  transform: translateX(4px);
}

.archive-card .ac-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  display: flex;
  gap: 0.75rem;
}

.archive-card h2 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.archive-card h2 a {
  color: var(--text-primary);
}

.archive-card h2 a:hover {
  color: var(--accent);
}

.archive-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.read-more {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.5rem;
}

/* =====================================================
   SEARCH PAGE
   ===================================================== */
.search-header {
  padding: 3rem 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
  background: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(0, 212, 255, 0.05) 0%, transparent 70%);
}

.search-header h1 {
  margin-bottom: 1rem;
  font-size: 1.6rem;
}

.search-header h1 span {
  color: var(--accent);
}

/* =====================================================
   CONTACT PAGE
   ===================================================== */
.contact-layout {
  max-width: 960px;
  margin: 3rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2.5rem;
}

.contact-form-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.contact-form-wrap h2 {
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: all var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group textarea {
  height: 160px;
  resize: vertical;
}

.form-submit-btn {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 0.85rem 2rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  width: 100%;
  transition: all 0.3s ease;
  font-family: var(--font-sans);
}

.form-submit-btn:hover {
  background: #fff;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
}

.contact-info-card h3 {
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.contact-info-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

.contact-info-card a {
  color: var(--accent);
}

/* =====================================================
   SITE FOOTER
   ===================================================== */
#site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 3rem 1.5rem 1.5rem;
  margin-top: 4rem;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.footer-brand .site-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.footer-brand .site-name span {
  color: var(--accent);
}

.footer-brand p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-width: 280px;
  margin-bottom: 1rem;
}

.footer-location {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: inline-flex;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
}

.footer-col h4 {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col ul li {
  margin-bottom: 0.4rem;
}

.footer-col ul li a {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.footer-col ul li a:hover {
  color: var(--accent);
}

.footer-col .contact-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.footer-col .contact-item a {
  color: var(--text-secondary);
}

.footer-col .contact-item a:hover {
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-bottom a {
  color: var(--text-muted);
}

.footer-bottom a:hover {
  color: var(--accent);
}

/* =====================================================
   404 PAGE
   ===================================================== */
.not-found-wrap {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
}

.not-found-wrap .error-code {
  font-size: 8rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
  opacity: 0.15;
}

.not-found-wrap h1 {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

.not-found-wrap p {
  color: var(--text-secondary);
  max-width: 440px;
  margin: 0 auto 2rem;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
}

.btn-primary {
  background: var(--accent);
  color: #000;
}

.btn-primary:hover {
  background: #fff;
  color: #000;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: #000;
}

/* =====================================================
   PAGINATION
   ===================================================== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 2rem 0;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.pagination a:hover,
.pagination .current {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

/* =====================================================
   UTILITIES
   ===================================================== */
.text-accent {
  color: var(--accent);
}

.text-muted {
  color: var(--text-muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* =====================================================
   TABLE OF CONTENTS (inline, top of article)
   ===================================================== */
.toc-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.toc-block h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.toc-block ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-block ul li {
  margin-bottom: 0.2rem;
}

.toc-block ul li a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: block;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.toc-block ul li a:hover,
.toc-block ul li a.toc-active {
  color: var(--accent);
  background: var(--accent-glow);
}

.toc-h3-item a {
  padding-left: 1.5rem !important;
  font-size: 0.8rem !important;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1100px) {

  /* Three-col → two-col */
  .content-wrapper {
    grid-template-columns: var(--sidebar-w) 1fr;
    padding: 1.5rem 1rem;
  }

  .sidebar-right {
    display: none;
  }

  .article-cta {
    flex-direction: column;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {

  /* Layout */
  .content-wrapper {
    grid-template-columns: 1fr;
    padding: 1.25rem 1rem;
  }

  /* Sidebars */
  .sidebar-left {
    position: static;
    display: none;
    /* hidden; user can enable via mobile toggle if needed */
  }

  .sidebar-right {
    display: none;
  }

  /* Main content full-width */
  .main-content-area {
    min-width: 0;
    max-width: 100%;
  }

  /* TOC stays inline, just shrink */
  .toc-block {
    padding: 1rem;
  }

  /* Header nav */
  #primary-navigation {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    z-index: 999;
    gap: 0.25rem;
  }

  #primary-navigation.open {
    display: flex;
  }

  #primary-navigation li {
    width: 100%;
  }

  #primary-navigation a {
    display: block;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    border: 1px solid transparent;
  }

  #primary-navigation a:hover {
    background: var(--bg-card);
    border-color: var(--border);
  }

  #primary-navigation a::after {
    display: none;
    /* hide underline on mobile */
  }

  .nav-toggle {
    display: block;
  }

  .header-search {
    display: none;
  }

  /* Contact page */
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .contact-info {
    grid-template-columns: 1fr;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* Archive listing */
  .archive-listing {
    grid-template-columns: 1fr;
  }

  /* archive/search have a 2-col layout at larger sizes */
  .archive-wrap {
    display: block;
  }

  /* Article CTA */
  .article-cta {
    padding: 1.5rem;
    flex-direction: column;
    gap: 1rem;
  }

  .cta-text h3 {
    font-size: 1.1rem;
  }

  /* Categories grid */
  .categories-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Stats grid */
  .stats-grid {
    grid-template-columns: 1fr;
  }

  /* Docs grid on homepage */
  .docs-grid {
    grid-template-columns: 1fr;
  }

  /* Hero search */
  .hero-section {
    padding: 3rem 1rem 2.5rem;
  }

  .hero-search-form {
    margin-bottom: 1rem;
  }

  /* Article heading */
  .entry-content h1,
  .entry-content h2 {
    font-size: 1.3rem;
  }

  /* Post nav */
  .post-navigation {
    flex-direction: column;
    gap: 0.75rem;
  }

  .post-navigation a {
    max-width: 100% !important;
    margin-left: 0 !important;
  }

  /* Tags */
  .tags-list {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  /* Page contact form grid */
  .contact-form-wrap form div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .categories-grid {
    grid-template-columns: 1fr;
  }

  .docs-grid {
    grid-template-columns: 1fr;
  }

  .hero-section h1 {
    font-size: 1.7rem;
  }

  .site-branding a {
    font-size: 1.05rem;
  }

  .cta-btn-large {
    font-size: 0.85rem;
    padding: 0.75rem 1.25rem;
  }

  .header-inner {
    gap: 0.75rem;
  }
}

/* =====================================================
   BREADCRUMBS
   ===================================================== */
.breadcrumbs {
  padding: 0.75rem 0 0;
  margin-bottom: 1.25rem;
}

.breadcrumbs ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.breadcrumbs li+li::before {
  content: '›';
  margin-right: 0.25rem;
}

.breadcrumbs a {
  color: var(--text-muted);
}

.breadcrumbs a:hover {
  color: var(--accent);
}

/* =====================================================
   DIFFICULTY BADGE
   ===================================================== */
.difficulty-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.diff-beginner {
  background: rgba(57, 211, 83, .15);
  color: #39d353;
}

.diff-intermediate {
  background: rgba(240, 180, 41, .15);
  color: #f0b429;
}

.diff-advanced {
  background: rgba(245, 88, 88, .15);
  color: #f55858;
}

.last-updated {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

/* =====================================================
   SOCIAL SHARE BUTTONS
   ===================================================== */
.social-share {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1.75rem 0;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.share-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 0.25rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all var(--transition);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--bg-primary);
}

.share-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--accent);
}

.share-x:hover {
  color: #fff;
  border-color: #555;
}

.share-reddit:hover {
  color: #ff4500;
  border-color: #ff4500;
}

.share-whatsapp:hover {
  color: #25d366;
  border-color: #25d366;
}

/* =====================================================
   ARTICLE RATING
   ===================================================== */
.article-rating {
  text-align: center;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 1.75rem 0;
}

.rating-question {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.rating-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.rating-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-hover);
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.rating-btn:hover,
.rating-btn.voted {
  border-color: var(--accent);
  box-shadow: 0 0 14px var(--accent-glow);
  transform: translateY(-2px);
}

.rating-btn .rating-count {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.rating-thanks {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--success);
}

/* =====================================================
   RELATED POSTS
   ===================================================== */
.related-posts {
  margin-top: 2.5rem;
}

.related-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.related-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: all var(--transition);
  color: var(--text-primary);
}

.related-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  color: var(--text-primary);
}

.related-cat {
  font-size: 0.68rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.related-card h4 {
  font-size: 0.88rem;
  line-height: 1.35;
}

.related-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: auto;
}

/* =====================================================
   READING PROGRESS BAR
   ===================================================== */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #0099cc);
  z-index: 9999;
  transition: width 0.1s linear;
  border-radius: 0 3px 3px 0;
}

/* =====================================================
   BACK TO TOP BUTTON
   ===================================================== */
#back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  opacity: 0;
  pointer-events: none;
  z-index: 500;
  box-shadow: var(--shadow-card);
}

#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

#back-to-top:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  transform: translateY(-3px);
}

/* =====================================================
   DARK / LIGHT MODE TOGGLE
   ===================================================== */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: all var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Light Mode overrides */
body.light-mode {
  --bg-primary: #f5f7fa;
  --bg-secondary: #eef0f5;
  --bg-card: #ffffff;
  --bg-hover: #e8ebf2;
  --text-primary: #1a1d23;
  --text-secondary: #4a5568;
  --text-muted: #8896a5;
  --border: #d1d9e6;
  --border-accent: rgba(0, 152, 204, 0.35);
  --accent: #0099cc;
  --accent-glow: rgba(0, 152, 204, 0.12);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.08);
}

body.light-mode #site-header {
  background: rgba(245, 247, 250, 0.96);
}

body.light-mode .code-block,
body.light-mode pre {
  background: #1a1e26;
  color: #cdd6f4;
}

/* =====================================================
   RESPONSIVE – new elements
   ===================================================== */
@media (max-width: 768px) {
  .related-grid {
    grid-template-columns: 1fr;
  }

  #back-to-top {
    bottom: 1rem;
    right: 1rem;
  }
}

/* =====================================================
   LIGHT MODE — Hover & Interaction Overrides
   Fixes elements that use hardcoded dark-theme colors
   ===================================================== */

/* Navigation */
body.light-mode #primary-navigation a {
  color: var(--text-secondary);
}

body.light-mode #primary-navigation a:hover,
body.light-mode #primary-navigation .current-menu-item a {
  color: var(--accent);
}

/* Cards */
body.light-mode .category-card:hover,
body.light-mode .related-card:hover,
body.light-mode .doc-card:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

body.light-mode .category-card h3,
body.light-mode .related-card h4,
body.light-mode .doc-card h3 {
  color: var(--text-primary);
}

/* Buttons */
body.light-mode .btn-primary {
  background: var(--accent);
  color: #fff;
}

body.light-mode .btn-primary:hover {
  background: #007aaa;
  color: #fff;
}

body.light-mode .btn-outline {
  color: var(--accent);
  border-color: var(--accent);
}

body.light-mode .btn-outline:hover {
  background: var(--accent);
  color: #fff;
}

/* Tags / pills */
body.light-mode .tags-list a {
  color: var(--text-secondary);
  background: var(--bg-hover);
}

body.light-mode .tags-list a:hover {
  color: var(--accent);
  background: var(--accent-glow);
}

/* Sidebar links */
body.light-mode .sidebar-widget a {
  color: var(--text-secondary);
}

body.light-mode .sidebar-widget a:hover {
  color: var(--accent);
}

/* Social share — X button hover should be dark bg in light mode too */
body.light-mode .share-x:hover {
  background: #27292d;
  color: #fff;
  border-color: #27292d;
}

/* Pagination */
body.light-mode .pagination a:hover,
body.light-mode .pagination .current {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Copy button */
body.light-mode .copy-btn {
  background: var(--bg-hover);
  color: var(--text-secondary);
  border-color: var(--border);
}

body.light-mode .copy-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Back to top */
body.light-mode #back-to-top {
  background: #fff;
  color: var(--text-secondary);
}

body.light-mode #back-to-top:hover {
  background: var(--accent);
  color: #fff;
}

/* CTA section is always dark; preserve white text */
body.light-mode .article-cta {
  background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
}

body.light-mode .article-cta h3,
body.light-mode .cta-widget h3 {
  color: #fff;
}

/* =====================================================
   AI SUMMARIZE WIDGET
   ===================================================== */
.ai-summarize {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.ai-summarize-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}

.ai-summarize-icon {
  font-size: 1rem;
}

.ai-summarize-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1.5px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.ai-btn svg {
  flex-shrink: 0;
}

/* ChatGPT — black/dark */
.ai-btn-chatgpt {
  background: #1a1a1a;
  color: #fff;
  border-color: #333;
}

.ai-btn-chatgpt:hover {
  background: #10a37f;
  border-color: #10a37f;
  color: #fff;
  transform: translateY(-1px);
}

/* Grok — dark with X brand feel */
.ai-btn-grok {
  background: #151515;
  color: #fff;
  border-color: #333;
}

.ai-btn-grok:hover {
  background: #27292d;
  border-color: #555;
  color: #fff;
  transform: translateY(-1px);
}

/* Perplexity — purple brand */
.ai-btn-perplexity {
  background: #1c1535;
  color: #c9b8ff;
  border-color: #3d2e7c;
}

.ai-btn-perplexity:hover {
  background: #20a4ab;
  border-color: #20a4ab;
  color: #fff;
  transform: translateY(-1px);
}

/* Light mode tweaks */
body.light-mode .ai-summarize {
  background: var(--bg-card);
  border-color: var(--border);
}

body.light-mode .ai-btn-chatgpt {
  background: #f0f0f0;
  color: #1a1a1a;
  border-color: #ccc;
}

body.light-mode .ai-btn-chatgpt:hover {
  background: #10a37f;
  border-color: #10a37f;
  color: #fff;
}

body.light-mode .ai-btn-grok {
  background: #f0f0f0;
  color: #1a1a1a;
  border-color: #ccc;
}

body.light-mode .ai-btn-grok:hover {
  background: #27292d;
  border-color: #555;
  color: #fff;
}

@media (max-width: 640px) {
  .ai-summarize {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .ai-summarize-header {
    white-space: normal;
  }
}

/* =====================================================
   SUPPORT CTA BAR
   ===================================================== */
.support-cta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.07) 0%, rgba(0, 153, 204, 0.04) 100%);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.support-cta-bar span {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.support-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #000 !important;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.55rem 1.25rem;
  border-radius: 50px;
  white-space: nowrap;
  transition: all var(--transition);
  text-decoration: none;
}

.support-cta-btn:hover {
  background: #fff;
  color: #000 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 212, 255, 0.3);
}

@media (max-width: 600px) {
  .support-cta-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .support-cta-btn {
    width: 100%;
    justify-content: center;
  }
}

/* =====================================================
   COMMENTS SECTION
   ===================================================== */
.comments-area {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.comments-title,
.comment-reply-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
}

.comment-body {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  position: relative;
}

.comment-author .fn {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
}

.comment-metadata {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.comment-metadata a {
  color: var(--text-muted);
}

.comment-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.reply a {
  font-size: 0.78rem;
  color: var(--accent);
}

/* Comment Form */
.comment-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea,
#comments textarea,
#commentform textarea,
#commentform input[type="text"],
#commentform input[type="email"],
#commentform input[type="url"] {
  width: 100%;
  background: var(--bg-card) !important;
  background-color: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm);
  color: var(--text-primary) !important;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  padding: 0.6rem 0.9rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  margin-bottom: 1rem;
}

.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.comment-form textarea {
  min-height: 120px;
  resize: vertical;
}

.comment-form .form-submit input[type="submit"],
#submit {
  background: var(--accent);
  color: #000;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.65rem 1.5rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all var(--transition);
}

.comment-form .form-submit input[type="submit"]:hover,
#submit:hover {
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 212, 255, 0.3);
}

.comment-notes,
.comment-form .logged-in-as {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* =====================================================
   POPUP PLUGIN OVERLAY
   ===================================================== */
#ggpopup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  animation: ggpopup-fadein 0.35s ease forwards;
}

@keyframes ggpopup-fadein {
  to {
    opacity: 1;
  }
}

#ggpopup-box {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), var(--shadow-accent);
  position: relative;
  overflow: hidden;
  animation: ggpopup-slidein 0.4s cubic-bezier(.22, 1, .36, 1) forwards;
  transform: translateY(30px);
}

@keyframes ggpopup-slidein {
  to {
    transform: translateY(0);
  }
}

#ggpopup-box img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
}

#ggpopup-body {
  padding: 1.5rem;
}

#ggpopup-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

#ggpopup-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

#ggpopup-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.65rem 1.5rem;
  border-radius: 50px;
  text-decoration: none;
  transition: all var(--transition);
}

#ggpopup-cta:hover {
  background: #fff;
  color: #000;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 212, 255, 0.3);
}

#ggpopup-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background var(--transition);
  z-index: 1;
}

#ggpopup-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 480px) {
  #ggpopup-box {
    border-radius: var(--radius-md);
  }

  #ggpopup-box img {
    max-height: 160px;
  }

  #ggpopup-body {
    padding: 1.25rem;
  }

  #ggpopup-title {
    font-size: 1.05rem;
  }
}