﻿/* =============================================================================
   HGNews - Main Stylesheet
   World-class dark-mode-first news theme for OpenSim/HyperGrid community
   ============================================================================= */

/* =============================================================================
   1. CSS CUSTOM PROPERTIES - Dark Mode Defaults
   ============================================================================= */
:root {
  /* Dark mode colors (default) */
  --bg-primary: #080F1E;
  --bg-card: #0D1A32;
  --bg-card-elevated: #112248;
  --bg-header: #060B17;
  --bg-footer: #060B17;
  --bg-input: #0D1A32;

  --accent-bright: #00B4FF;
  --accent-primary: #1A7BD4;
  --accent-hover: #0099E6;

  --text-primary: #D8EAFF;
  --text-secondary: #7FA8CA;
  --text-muted: #4A6E8C;
  --text-inverse: #0D1B35;

  --border-color: #162845;
  --border-subtle: #0F1F3C;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 4px 24px rgba(0, 180, 255, 0.15);
  --shadow-glow-hover: 0 8px 32px rgba(0, 180, 255, 0.25);

  --ticker-bg: #1a0a0a;
  --ticker-label-bg: #EF4444;
  --ticker-text: #fff;

  --overlay-gradient: linear-gradient(to top, rgba(8,15,30,0.95) 0%, rgba(8,15,30,0.7) 40%, rgba(8,15,30,0.2) 70%, transparent 100%);

  /* Category colors */
  --cat-grid-news: #00B4FF;
  --cat-events: #FF6B2B;
  --cat-technology: #A855F7;
  --cat-community: #22C55E;
  --cat-tutorials: #EAB308;
  --cat-opensim: #3B82F6;
  --cat-breaking: #EF4444;
  --cat-default: #2D9CDB;

  /* Typography */
  --font-heading: 'Exo 2', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;

  /* Layout — overridden inline by inc/customizer.php based on the
     "Layout Width" Customizer section; these are just the fallback values. */
  --container-max: 1280px;
  --sidebar-width: 320px;
  --header-height: 120px;
  --ticker-height: 38px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-base: 0.3s ease;
  --transition-fast: 0.15s ease;
  --transition-slow: 0.5s ease;
}

/* =============================================================================
   2. LIGHT MODE OVERRIDES
   ============================================================================= */
[data-theme="light"] {
  --bg-primary: #EEF2F7;
  --bg-card: #FFFFFF;
  --bg-card-elevated: #F4F7FB;
  --bg-header: #FFFFFF;
  --bg-input: #F4F7FB;

  --accent-bright: #1A7BD4;
  --accent-primary: #1565C0;
  --accent-hover: #0D47A1;

  --text-primary: #0D1B35;
  --text-secondary: #2A4560;
  --text-muted: #5A7A9A;
  --text-inverse: #D8EAFF;

  --border-color: #C8D8E8;
  --border-subtle: #DCE8F2;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 4px 24px rgba(26, 123, 212, 0.12);
  --shadow-glow-hover: 0 8px 32px rgba(26, 123, 212, 0.2);

  /* Light wash instead of a dark scrim — strongest near the text at the
     bottom, fading out toward the top, so the photo stays visible. */
  --overlay-gradient: linear-gradient(to top, rgba(255,255,255,0.92) 0%, rgba(255,255,255,0.65) 40%, rgba(255,255,255,0.25) 70%, transparent 100%);

  --ticker-bg: #1a0505;
}

/* ── Light mode: fix sections that use hardcoded dark colours ── */

/* Hero text sits on a light wash (not a dark scrim) in light mode, so it
   needs dark, theme-consistent text instead of hardcoded white. */
[data-theme="light"] .hero-title {
  color: var(--text-primary);
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .hero-excerpt {
  color: var(--text-secondary);
}

[data-theme="light"] .hero-meta .post-meta {
  color: var(--text-secondary);
}

/* Hero title is always white (readable on the dark overlay in both modes) */
/* No change needed — overlay-gradient keeps it dark enough */

/* Article card top border stays readable in light mode */
[data-theme="light"] .article-card {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* Category bar in light mode — slight shadow to separate from page */
[data-theme="light"] .category-bar {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Footer always dark regardless of theme */
[data-theme="light"] .site-footer,
[data-theme="light"] .site-footer * {
  /* footer overrides handled in footer section */
}

/* =============================================================================
   3. RESET & BOX SIZING
   ============================================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

/* =============================================================================
   4. BASE HTML ELEMENTS
   ============================================================================= */
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: background-color var(--transition-base), color var(--transition-base);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent-bright);
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

a:hover,
a:focus {
  color: var(--accent-hover);
  text-decoration: none;
}

a:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

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

figure {
  margin: 0;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  line-height: 1;
}

ul, ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

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

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
  transition: color var(--transition-base);
}

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

strong, b {
  font-weight: 600;
  color: var(--text-primary);
}

em, i {
  font-style: italic;
}

blockquote {
  border-left: 4px solid var(--accent-bright);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--bg-card-elevated);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--text-secondary);
}

code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
  background: var(--bg-card-elevated);
  color: var(--accent-bright);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

pre {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-primary);
}

hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 2rem 0;
}

/* =============================================================================
   6. LAYOUT UTILITIES
   ============================================================================= */
.container {
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

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

.grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.grid-4col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.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;
}

/* =============================================================================
   7. ACCESSIBILITY - SKIP LINK
   ============================================================================= */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--accent-bright);
  color: #000;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--text-sm);
  z-index: 9999;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 1rem;
  color: #000;
}

/* =============================================================================
   8. BREAKING NEWS TICKER
   ============================================================================= */
.breaking-ticker {
  background: var(--ticker-bg);
  height: var(--ticker-height);
  display: flex;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid rgba(239, 68, 68, 0.3);
  position: relative;
  z-index: 999;
}

.ticker-label {
  flex-shrink: 0;
  background: var(--ticker-label-bg);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0 1rem;
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
  position: relative;
  z-index: 2;
}

.ticker-label::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 0;
  bottom: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: var(--ticker-height) 0 0 8px;
  border-color: transparent transparent transparent var(--ticker-label-bg);
}

.ticker-wrapper {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.ticker-wrapper::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 40px;
  background: linear-gradient(to right, var(--ticker-bg), transparent);
  z-index: 1;
}

.ticker-track {
  display: flex;
  align-items: center;
  white-space: nowrap;
  animation: ticker-scroll 30s linear infinite;
  padding-left: 2rem;
}

.ticker-track:hover {
  animation-play-state: paused;
}

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item {
  color: var(--ticker-text);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 0 0.5rem;
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.ticker-item:hover {
  color: var(--accent-bright);
}

.ticker-sep {
  color: var(--accent-bright);
  font-size: 0.6rem;
  margin: 0 0.75rem;
  opacity: 0.7;
}

/* =============================================================================
   9. SITE HEADER
   ============================================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  transition: background-color var(--transition-base), box-shadow var(--transition-base), backdrop-filter var(--transition-base);
}

.site-header.scrolled {
  background: rgba(6, 11, 23, 0.85);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: var(--shadow-md);
}

[data-theme="light"] .site-header.scrolled {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 0;
  height: var(--header-height);
  padding-left: 0;   /* logo flush with container left edge */
}

/* Push nav away from logo, controls away from nav */
.primary-nav     { margin-left: 2rem; }
.header-controls { margin-left: 1rem; }

/* Site Branding */
.site-branding {
  flex-shrink: 0;
}

.site-branding .custom-logo {
  max-height: 100px;
  width: auto;
}

/* ── Built-in theme logo (used when no custom logo is set) ── */
.site-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.site-logo {
  max-height: 100px;
  width: auto;
  max-width: min(340px, 55vw);
  display: block;
}

/* Dark mode (default): show dark logo, hide light logo */
.logo-dark  { display: block; }
.logo-light { display: none;  }

/* Light mode: swap logos */
[data-theme="light"] .logo-dark  { display: none;  }
[data-theme="light"] .logo-light { display: block; }

/* ── Footer logo (footer is always dark, always uses logo-dark) ── */
.footer-logo-link {
  display: inline-block;
  margin-bottom: 1rem;
}

.footer-logo {
  max-height: 90px;
  width: auto;
  max-width: 280px;
  display: block;
}

.site-name-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.site-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  white-space: nowrap;
  background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =============================================================================
   10. PRIMARY NAVIGATION
   ============================================================================= */
.primary-nav {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

/* ── Top-level list only (> ul prevents sub-menu inheriting flex) ── */
.primary-nav > ul {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.primary-nav li {
  position: relative;
}

/* Top-level li: flex row so <a> and any WP-injected toggle button sit side-by-side */
.primary-nav > ul > li {
  display: flex;
  align-items: center;
}

/* Hide ANY WordPress-injected toggle element — target both generically
   and by the specific class WordPress generates (sub-menu-toggle) */
.primary-nav > ul > li > *:not(a):not(ul) {
  display: none !important;
}
.primary-nav .sub-menu-toggle {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  position: absolute !important;
}

/* ── Top-level links — clean text, no box/pill background ── */
.primary-nav > ul > li > a {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.875rem;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.02em;
  transition: color var(--transition-fast);
  /* no background, no border-radius */
}

.primary-nav > ul > li > a:hover,
.primary-nav .current-menu-item > a,
.primary-nav .current-page-ancestor > a {
  color: var(--accent-bright);
  background: none;
}

/* Chevron arrow on items that have a sub-menu */
.primary-nav .menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  width: 0.38em;
  height: 0.38em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.primary-nav .menu-item-has-children:hover > a::after,
.primary-nav .menu-item-has-children:focus-within > a::after {
  transform: rotate(225deg) translateY(2px);
}

/* ── Dropdown panel ── */
.primary-nav .sub-menu {
  /* vertical block, NOT flex */
  display: block;
  list-style: none;
  margin: 0;
  padding: 0.375rem;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 185px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--transition-fast),
              visibility var(--transition-fast),
              transform var(--transition-fast);
  z-index: 500;
}

.primary-nav li:hover > .sub-menu,
.primary-nav li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Sub-menu items — each on its own full-width row */
.primary-nav .sub-menu li {
  display: block;
  width: 100%;
}

.primary-nav .sub-menu a {
  display: block;
  width: 100%;
  padding: 0.5rem 0.875rem;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.primary-nav .sub-menu a:hover {
  color: var(--accent-bright);
  background: var(--c-hover-bg, rgba(0, 180, 255, 0.08));
}

/* Header Controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Search Toggle Button */
.search-toggle,
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast);
}

.search-toggle:hover,
.theme-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-card);
  border-color: var(--accent-bright);
}

/* Dark Mode Toggle Icons */
.icon-moon,
.icon-sun {
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

[data-theme="dark"] .icon-moon {
  display: block;
}

[data-theme="dark"] .icon-sun {
  display: none;
}

[data-theme="light"] .icon-moon {
  display: none;
}

[data-theme="light"] .icon-sun {
  display: block;
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
}

.hamburger-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 1px;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.nav-open .nav-toggle .hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-open .nav-toggle .hamburger-bar:nth-child(2) {
  opacity: 0;
}

.nav-open .nav-toggle .hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Header Search Bar — hidden by default, revealed by JS .is-open */
.header-search-bar {
  max-height: 0;
  padding: 0;
  overflow: hidden;
  border-top: 1px solid transparent;
  transition: max-height var(--transition-base),
              padding    var(--transition-base),
              border-color var(--transition-base);
}

.header-search-bar.is-open {
  max-height: 80px;
  padding: 0.625rem 0;
  border-top-color: var(--border-color);
}

/* Search form layout — used in header, sidebar, search page, 404 */
.search-form {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.search-field {
  flex: 1;
  min-width: 0; /* allow the input to shrink below its default content width instead of pushing the button out of the card */
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  padding: 0.55rem 1rem;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  /* Suppress browser autocomplete styling */
  -webkit-text-fill-color: var(--text-primary);
}

.search-field:focus {
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px rgba(0, 180, 255, 0.12);
}

.search-field::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.search-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--accent-primary);
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.search-submit:hover {
  background: var(--accent-bright);
}

.search-submit svg {
  flex-shrink: 0;
  color: #fff;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =============================================================================
   11. CATEGORY QUICK-NAV BAR
   ============================================================================= */
.category-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: var(--header-height);
  z-index: 99;
  transition: background-color var(--transition-base);
}

.category-bar .container {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  height: 42px;
}

.category-bar .container::-webkit-scrollbar {
  display: none;
}

.cat-nav-link {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  height: 100%;
  font-size: var(--text-xs);
  font-weight: 600;
  font-family: var(--font-heading);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  position: relative;
}

.cat-nav-link:hover {
  color: var(--cat-color, var(--accent-bright));
  border-bottom-color: var(--cat-color, var(--accent-bright));
}

/* =============================================================================
   12. HERO SECTION
   ============================================================================= */
.hero-section {
  position: relative;
  width: 100%;
  min-height: 480px;
  height: 70vh;
  max-height: 720px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  background-color: var(--bg-card);
}

.hero-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(1.03);
  transition: transform 8s ease;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: scale-down;
}

.hero-section:hover .hero-bg {
  transform: scale(1.06);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay-gradient);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 3rem 0;
}

.hero-content .container {
  max-width: var(--container-max);
  padding-left: 3rem;
  padding-right: 3rem;
}

.hero-inner {
  max-width: 720px;
}

.hero-category {
  margin-bottom: 0.75rem;
}

.hero-title {
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 1rem;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.hero-excerpt {
  font-size: var(--text-lg);
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  max-width: 600px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.hero-meta .post-meta {
  color: rgba(255, 255, 255, 0.7);
}

.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-bright);
  color: #000;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  transition: background-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  text-decoration: none;
}

.btn-hero:hover {
  background: #fff;
  color: #000;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 180, 255, 0.4);
}

/* =============================================================================
   13. SECTION HEADERS
   ============================================================================= */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.section-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  letter-spacing: -0.02em;
}

.section-title::before {
  content: '';
  display: block;
  width: 4px;
  height: 1.25em;
  background: linear-gradient(to bottom, var(--accent-bright), var(--accent-primary));
  border-radius: 2px;
  flex-shrink: 0;
}

.section-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--accent-bright);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.section-link:hover {
  color: var(--accent-hover);
}

/* Content Sections */
.content-section {
  padding: 3rem 0;
}

/* =============================================================================
   14. ARTICLE CARDS
   ============================================================================= */
.article-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-top-width: 3px;
  border-top-color: var(--cat-color, var(--accent-primary));
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow-hover);
  border-color: var(--cat-color, var(--accent-bright));
}

/* Card Image Container - 16:9 aspect ratio */
.card-image {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  overflow: hidden;
  background: var(--bg-card-elevated);
  flex-shrink: 0;
}

.card-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: scale-down;
  background-color: var(--bg-card-elevated);
  transition: transform var(--transition-slow);
}

.article-card:hover .card-image img {
  transform: scale(1.06);
}

/* Placeholder image */
.card-image-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-card-elevated), var(--border-color));
  color: var(--text-muted);
  font-size: 3rem;
}

.card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.75rem;
}

.card-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  transition: color var(--transition-fast);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-title a {
  color: inherit;
  text-decoration: none;
}

.card-title a:hover {
  color: var(--accent-bright);
}

.card-excerpt {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

/* =============================================================================
   15. CATEGORY BADGES
   ============================================================================= */
.category-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2em 0.65em;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  font-family: var(--font-heading);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--cat-color, var(--accent-primary)) 20%, transparent);
  color: var(--cat-color, var(--accent-primary));
  border: 1px solid color-mix(in srgb, var(--cat-color, var(--accent-primary)) 40%, transparent);
  text-decoration: none;
  transition: background-color var(--transition-fast);
}

.category-badge:hover {
  background: color-mix(in srgb, var(--cat-color, var(--accent-primary)) 30%, transparent);
  color: var(--cat-color, var(--accent-primary));
}

/* =============================================================================
   16. CATEGORY CLASS SELECTORS
   ============================================================================= */
.cat--grid-news { --cat-color: var(--cat-grid-news); }
.cat--events { --cat-color: var(--cat-events); }
.cat--technology { --cat-color: var(--cat-technology); }
.cat--community { --cat-color: var(--cat-community); }
.cat--tutorials { --cat-color: var(--cat-tutorials); }
.cat--opensim { --cat-color: var(--cat-opensim); }
.cat--breaking-news { --cat-color: var(--cat-breaking); }

/* =============================================================================
   17. POST META
   ============================================================================= */
.post-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.post-meta a {
  color: var(--text-muted);
  font-weight: 500;
}

.post-meta a:hover {
  color: var(--accent-bright);
}

.post-meta-sep {
  color: var(--text-muted);
  opacity: 0.5;
}

.post-meta .avatar {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 1px solid var(--border-color);
}

.post-meta .reading-time {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* =============================================================================
   19. SIDEBAR
   ============================================================================= */
.site-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 2rem;
  align-items: start;
  padding: 2rem 0;
}

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

.site-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 42px + 1rem);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.widget {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: background-color var(--transition-base);
}

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

.widget ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
}

.widget ul li a {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0;
}

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

/* =============================================================================
   20. FOOTER (ALWAYS DARK)
   ============================================================================= */
.site-footer {
  background: #060B17 !important;
  color: #7FA8CA;
  border-top: 1px solid rgba(22, 40, 69, 0.8);
  margin-top: auto;
}

[data-theme="light"] .site-footer,
[data-theme="light"] .site-footer * {
  --bg-primary: #080F1E;
  --bg-card: #0D1A32;
  --bg-card-elevated: #112248;
  --text-primary: #D8EAFF;
  --text-secondary: #7FA8CA;
  --text-muted: #4A6E8C;
  --border-color: #162845;
}

.footer-widgets {
  padding: 3rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.footer-widget h3 {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #D8EAFF;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #162845;
}

.footer-widget ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-widget ul a {
  font-size: var(--text-sm);
  color: #7FA8CA;
  transition: color var(--transition-fast);
}

.footer-widget ul a:hover {
  color: #00B4FF;
}

.footer-about p {
  font-size: var(--text-sm);
  color: #7FA8CA;
  line-height: 1.6;
  margin-bottom: 0;
}

.footer-bottom {
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid #162845;
  padding: 1rem 0;
}

.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-copyright {
  font-size: var(--text-xs);
  color: #4A6E8C;
}

.footer-tagline {
  font-size: var(--text-xs);
  color: #4A6E8C;
  font-style: italic;
}

.footer-social {
  display: flex;
  gap: 0.75rem;
}

.footer-social a {
  color: #4A6E8C;
  font-size: var(--text-sm);
  transition: color var(--transition-fast);
}

.footer-social a:hover {
  color: #00B4FF;
}

/* =============================================================================
   21. SINGLE POST
   ============================================================================= */
.single-post-hero {
  width: 100%;
  height: 60vh;
  min-height: 360px;
  max-height: 600px;
  overflow: hidden;
  position: relative;
  background: var(--bg-card);
}

.single-post-hero img {
  width: 100%;
  height: 100%;
  object-fit: scale-down;
}

.single-post-hero-overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay-gradient);
}

.single-post-content {
  max-width: 780px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.entry-content {
  font-size: var(--text-lg);
  line-height: 1.8;
  color: var(--text-secondary);
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

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

.entry-content ul,
.entry-content ol {
  margin: 1rem 0 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.entry-content ul {
  list-style: disc;
}

.entry-content ol {
  list-style: decimal;
}

.entry-content li {
  color: var(--text-secondary);
  line-height: 1.6;
}

.entry-content img {
  border-radius: var(--radius-md);
  margin: 2rem 0;
}

.entry-content a {
  color: var(--accent-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Post Tags */
.post-tags {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-color);
  margin-top: 2rem;
}

.post-tags-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
}

.tag-link {
  display: inline-flex;
  padding: 0.25rem 0.75rem;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.tag-link:hover {
  border-color: var(--accent-bright);
  color: var(--accent-bright);
}

/* Share Section */
.post-share {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-color);
}

.post-share-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.875rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  background: var(--bg-card-elevated);
  transition: all var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
}

.share-btn:hover {
  border-color: var(--accent-bright);
  color: var(--accent-bright);
  background: color-mix(in srgb, var(--accent-bright) 10%, transparent);
}

/* =============================================================================
   22. AUTHOR BIO BOX
   ============================================================================= */
.author-bio {
  display: flex;
  gap: 1.5rem;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 2.5rem 0;
}

.author-bio-avatar {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 2px solid var(--accent-primary);
}

.author-bio-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-bio-info {
  flex: 1;
}

.author-bio-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.author-bio-name {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.author-bio-name a {
  color: inherit;
}

.author-bio-name a:hover {
  color: var(--accent-bright);
}

.author-bio-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.author-bio-social {
  display: flex;
  gap: 0.75rem;
}

.author-bio-social a {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
}

.author-bio-social a:hover {
  color: var(--accent-bright);
}

/* =============================================================================
   23. RELATED POSTS
   ============================================================================= */
.related-posts {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border-color);
}

.related-posts .section-title {
  margin-bottom: 1.5rem;
}

.related-posts .grid-3col {
  margin-top: 1rem;
}

/* =============================================================================
   24. BREADCRUMBS
   ============================================================================= */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: 1rem;
}

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

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

.breadcrumbs-sep {
  color: var(--text-muted);
  opacity: 0.4;
}

.breadcrumbs .current {
  color: var(--text-secondary);
  font-weight: 500;
}

/* =============================================================================
   25. PAGINATION
   ============================================================================= */
.pagination,
.posts-navigation,
.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 2rem 0;
  flex-wrap: wrap;
}

.page-numbers,
.nav-links a,
.nav-links span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 0.625rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.page-numbers:hover,
.nav-links a:hover {
  background: var(--bg-card-elevated);
  border-color: var(--accent-bright);
  color: var(--accent-bright);
}

.page-numbers.current,
.nav-links .current {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

.page-numbers.dots {
  background: transparent;
  border-color: transparent;
  cursor: default;
}

/* =============================================================================
   26. COMMENTS
   ============================================================================= */
.comments-section {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border-color);
}

.comments-title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.comment-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.comment-body {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: background-color var(--transition-base);
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
}

.comment-author-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: var(--text-sm);
}

.comment-author-name a {
  color: inherit;
}

.comment-date {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

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

.reply a {
  font-size: var(--text-xs);
  color: var(--accent-bright);
  font-weight: 500;
  margin-top: 0.75rem;
  display: inline-block;
}

.children {
  list-style: none;
  padding-left: 2rem;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Comment Form */
.comment-respond {
  margin-top: 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.comment-reply-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.comment-form label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  padding: 0.625rem 1rem;
  transition: border-color var(--transition-fast);
  outline: none;
  margin-bottom: 1rem;
}

.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px rgba(0, 180, 255, 0.1);
}

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

.comment-form .form-submit .submit {
  background: var(--accent-primary);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-sm);
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.comment-form .form-submit .submit:hover {
  background: var(--accent-bright);
}

.comment-notes {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.required-field-message {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* =============================================================================
   27. 404 PAGE
   ============================================================================= */
.error-404 {
  text-align: center;
  padding: 5rem 1.5rem;
  max-width: 600px;
  margin: 0 auto;
}

.error-404-number {
  font-family: var(--font-heading);
  font-size: clamp(6rem, 20vw, 12rem);
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent-bright), var(--accent-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0;
}

.error-404-title {
  font-size: var(--text-2xl);
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.error-404-message {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.error-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-primary);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-sm);
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.btn-primary:hover {
  background: var(--accent-bright);
  transform: translateY(-2px);
  color: #000;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card-elevated);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-sm);
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
}

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

/* =============================================================================
   28. ARCHIVE / CATEGORY PAGE
   ============================================================================= */
.archive-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 2.5rem 0;
  margin-bottom: 2rem;
}

.archive-title {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.archive-description {
  color: var(--text-muted);
  font-size: var(--text-lg);
  max-width: 600px;
}

/* =============================================================================
   30. SMOOTH TRANSITIONS ON MAJOR ELEMENTS
   ============================================================================= */
.site-header,
.site-footer,
.article-card,
.widget,
.comment-body,
.comment-respond,
.author-bio,
.category-bar,
.archive-header,
.single-post-content,
input,
textarea,
select {
  transition: background-color var(--transition-base), color var(--transition-base), border-color var(--transition-base);
}

/* =============================================================================
   31. SEARCH RESULTS PAGE
   ============================================================================= */
.search-header {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

.search-title {
  font-size: var(--text-2xl);
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.search-query {
  color: var(--accent-bright);
}

.search-count {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.search-refine {
  max-width: 480px;
  margin-top: 1rem;
}

/* =============================================================================
   32. NO RESULTS / CONTENT NONE
   ============================================================================= */
.no-results {
  text-align: center;
  padding: 4rem 1.5rem;
}

.no-results-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.no-results-title {
  font-size: var(--text-2xl);
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.no-results-text {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* =============================================================================
   33. FORMS - GENERAL
   ============================================================================= */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="number"],
textarea,
select {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  padding: 0.625rem 1rem;
  width: 100%;
  outline: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px rgba(0, 180, 255, 0.1);
}

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

/* =============================================================================
   34. PAGE TEMPLATE
   ============================================================================= */
.page-header {
  padding: 2.5rem 0 1.5rem;
}

.page-title {
  font-size: var(--text-3xl);
  color: var(--text-primary);
}

.page-content {
  max-width: 780px;
}

/* =============================================================================
   35. UTILITY CLASSES
   ============================================================================= */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Alignment classes from WP */
.alignleft {
  float: left;
  margin: 0 1.5rem 1rem 0;
}

.alignright {
  float: right;
  margin: 0 0 1rem 1.5rem;
}

.aligncenter {
  margin-left: auto;
  margin-right: auto;
  display: block;
}

/* =============================================================================
   36. RESPONSIVE: 1200px
   ============================================================================= */
@media (max-width: 1200px) {
  :root {
    --container-max: 100%;
  }

  .grid-4col {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =============================================================================
   37. RESPONSIVE: 992px (Tablet)
   ============================================================================= */
@media (max-width: 992px) {
  :root {
    --header-height: 96px;
  }

  .site-logo,
  .site-branding .custom-logo { max-height: 78px; max-width: min(280px, 52vw); }

  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }

  .primary-nav {
    position: fixed;
    top: 0;
    right: -100%;
    bottom: 0;
    width: 280px;
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    flex-direction: column;
    justify-content: flex-start;
    padding: 5rem 1.5rem 2rem;
    transition: right var(--transition-base);
    overflow-y: auto;
    z-index: 998;
  }

  .nav-open .primary-nav {
    right: 0;
    box-shadow: var(--shadow-lg);
  }

  .primary-nav > ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
  }

  .primary-nav li {
    width: 100%;
  }

  /* All nav links in mobile panel */
  .primary-nav > ul > li > a,
  .primary-nav .sub-menu a {
    padding: 0.75rem 0.5rem;
    font-size: var(--text-base);
    border-radius: 0;
    border-bottom: 1px solid var(--border-subtle);
    width: 100%;
  }

  /* In mobile: hide the chevron, show sub-menu inline */
  .primary-nav .menu-item-has-children > a::after {
    display: none;
  }

  .primary-nav .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    background: var(--bg-card-elevated);
    padding: 0 0 0 1rem;
    border-radius: 0;
    margin-top: 0;
    min-width: unset;
  }

  .nav-toggle {
    display: flex;
  }

  .site-layout {
    grid-template-columns: 1fr;
  }

  .site-sidebar {
    position: static;
  }

  .grid-3col {
    grid-template-columns: repeat(2, 1fr);
  }

  .related-posts .grid-3col {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =============================================================================
   38. RESPONSIVE: 768px (Mobile Landscape)
   ============================================================================= */
@media (max-width: 768px) {
  .grid-3col,
  .grid-2col {
    grid-template-columns: 1fr;
  }

  .hero-section {
    min-height: 380px;
    height: 60vh;
  }

  .hero-title {
    font-size: var(--text-2xl);
  }

  .hero-content .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .hero-excerpt {
    display: none;
  }

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

  .author-bio {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .author-bio-social {
    justify-content: center;
  }

  .single-post-content {
    padding: 1.5rem 1rem;
  }

  .error-links {
    flex-direction: column;
    align-items: center;
  }

  .footer-bottom-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* =============================================================================
   39. RESPONSIVE: 480px (Mobile Portrait)
   ============================================================================= */
@media (max-width: 480px) {
  :root {
    --header-height: 76px;
    --ticker-height: 34px;
  }

  .site-logo,
  .site-branding .custom-logo { max-height: 58px; max-width: min(210px, 50vw); }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  h1 { font-size: var(--text-2xl); }
  h2 { font-size: var(--text-xl); }

  .section-title {
    font-size: var(--text-lg);
  }

  .breaking-ticker {
    height: var(--ticker-height);
  }

  .ticker-label {
    font-size: 0.65rem;
    padding: 0 0.75rem;
  }

  .category-bar .container {
    height: 36px;
  }

  .cat-nav-link {
    padding: 0 0.75rem;
    font-size: 0.65rem;
  }

  .hero-section {
    min-height: 300px;
    height: 50vh;
  }

  .btn-hero {
    padding: 0.5rem 1rem;
    font-size: var(--text-xs);
  }

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

  .header-controls .search-toggle {
    display: none;
  }

  .error-404-number {
    font-size: 6rem;
  }

  .children {
    padding-left: 1rem;
  }

  .post-share {
    flex-wrap: wrap;
  }

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

/* =============================================================================
   40. PRINT STYLES
   ============================================================================= */
@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }

  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  pre {
    white-space: pre-wrap !important;
  }

  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  thead {
    display: table-header-group;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }

  .breaking-ticker,
  .site-header,
  .category-bar,
  .site-sidebar,
  .site-footer,
  .comments-section,
  .post-share,
  .related-posts,
  .nav-toggle,
  .theme-toggle,
  .search-toggle {
    display: none !important;
  }

  .single-post-content {
    max-width: 100%;
    padding: 0;
  }

  .site-layout {
    display: block;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }

  h1 { font-size: 22pt; }
  h2 { font-size: 18pt; }
  h3 { font-size: 14pt; }
}

/* =============================================================================
   41. ACCESSIBILITY - FOCUS STYLES
   ============================================================================= */
:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
}

/* =============================================================================
   42. CUSTOM SCROLLBAR (webkit)
   ============================================================================= */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* =============================================================================
   43. SELECTION
   ============================================================================= */
::selection {
  background: rgba(0, 180, 255, 0.25);
  color: var(--text-primary);
}

/* =============================================================================
   44. SCREEN OVERLAY (mobile nav)
   ============================================================================= */
.nav-open::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 997;
  backdrop-filter: blur(2px);
}
