/*
Theme Name: Scilok
Theme URI: https://scilok.com
Author: Scilok Team
Author URI: https://scilok.com
Description: A modern WordPress theme with Liquid Glass design principles inspired by premium newsroom aesthetics. WCAG 2.1 AA compliant with comprehensive accessibility features. Performance-optimized with lazy loading, proper image dimensions, Verge-style sidebar comments with Markdown support, streamlined article actions bar, widget areas, and complete archive templates.
Version: 1.62.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: scilok
Tags: blog, news, modern, minimal, glassmorphism, accessibility, wcag-aa, dyslexia-friendly, comments, widgets, performance
*/

/* ============================================
   FONT IMPORTS
   ============================================ */
@import url('https://fonts.cdnfonts.com/css/digital-7-mono');
@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400;1,700&display=swap');

/* ============================================
   CSS VARIABLES - Design System
   ============================================ */
:root {
  /* Colors - WCAG AA Compliant */
  --color-bg-primary: #ffffff;
  --color-bg-secondary: #f5f5f7;
  --color-text-primary: #1d1d1f;
  --color-text-secondary: #6e6e73; /* Updated from #86868b for better contrast (4.54:1 ratio) */
  --color-accent: #0071e3;
  --color-accent-hover: #0077ed;

  /* Typography - System Fonts */
  --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Spacing */
  --spacing-xs: 8px;
  --spacing-sm: 16px;
  --spacing-md: 24px;
  --spacing-lg: 48px;
  --spacing-xl: 80px;

  /* Border Radius */
  --border-radius-sm: 4px;
  --border-radius-md: 8px;
  --border-radius-lg: 12px;
  --border-radius-xl: 16px;

  /* Glassmorphism - Liquid Glass */
  --glass-blur: 20px;
  --glass-opacity: 0.7;
  --glass-border: rgba(255, 255, 255, 0.18);

  /* Layout */
  --max-width: 1440px;
  --header-height: 48px;
}

/* Dark mode support - class-based (takes priority) */
.dark-mode {
  --color-bg-primary: #000000;
  --color-bg-secondary: #1d1d1f;
  --color-text-primary: #f5f5f7;
  --color-text-secondary: #86868b;
  --glass-border: rgba(255, 255, 255, 0.1);
}

/* Light mode support - class-based (takes priority) */
.light-mode {
  --color-bg-primary: #ffffff;
  --color-bg-secondary: #f5f5f7;
  --color-text-primary: #1d1d1f;
  --color-text-secondary: #86868b;
  --glass-border: rgba(255, 255, 255, 0.18);
}

/* Fallback for prefers-color-scheme (when no class is set) */
@media (prefers-color-scheme: dark) {
  html:not(.light-mode):not(.dark-mode) {
    --color-bg-primary: #000000;
    --color-bg-secondary: #1d1d1f;
    --color-text-primary: #f5f5f7;
    --color-text-secondary: #86868b;
    --glass-border: rgba(255, 255, 255, 0.1);
  }
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-regular);
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

a:hover {
  opacity: 0.7;
}

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

/* ============================================
   UTILITY CLASSES - Glassmorphism
   ============================================ */
.glass-effect {
  background: rgba(255, 255, 255, var(--glass-opacity));
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 16px;
}

@media (prefers-color-scheme: dark) {
  .glass-effect {
    background: rgba(29, 29, 31, var(--glass-opacity));
  }
}

/* ============================================
   ACCESSIBILITY FEATURES
   ============================================ */

/* Skip to Content Link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-accent);
  color: #ffffff;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 10000;
  border-radius: 0 0 4px 0;
  font-weight: var(--font-weight-semibold);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid #ffffff;
  outline-offset: 2px;
}

/* Screen Reader Text */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: var(--color-bg-secondary);
  clip: auto !important;
  clip-path: none;
  color: var(--color-text-primary);
  display: block;
  font-size: 0.875rem;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

/* Focus Styles - High Visibility */
*:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

*:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.2);
}

.dark-mode button:focus-visible,
.dark-mode a:focus-visible,
.dark-mode input:focus-visible,
.dark-mode textarea:focus-visible,
.dark-mode select:focus-visible {
  outline-color: #0a84ff;
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.3);
}

/* Accessibility - Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* User-enabled reduced motion */
body.a11y-reduce-motion *,
body.a11y-reduce-motion *::before,
body.a11y-reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

/* Accessibility - Reduced transparency */
@media (prefers-reduced-transparency: reduce) {
  .glass-effect {
    background: var(--color-bg-primary);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* User-enabled reduced transparency */
body.a11y-reduce-transparency .glass-effect,
body.a11y-reduce-transparency .header-island,
body.a11y-reduce-transparency .search-dropdown,
body.a11y-reduce-transparency .settings-panel,
body.a11y-reduce-transparency .main-navigation-mobile,
body.a11y-reduce-transparency .footer-content,
body.a11y-reduce-transparency .comments-sidebar {
  background: var(--color-bg-primary) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.dark-mode.a11y-reduce-transparency .glass-effect,
.dark-mode.a11y-reduce-transparency .header-island,
.dark-mode.a11y-reduce-transparency .search-dropdown,
.dark-mode.a11y-reduce-transparency .settings-panel,
.dark-mode.a11y-reduce-transparency .main-navigation-mobile,
.dark-mode.a11y-reduce-transparency .footer-content,
.dark-mode.a11y-reduce-transparency .comments-sidebar {
  background: var(--color-bg-secondary) !important;
  border-color: rgba(255, 255, 255, 0.15);
}

/* Dyslexia-Friendly Font - Atkinson Hyperlegible */
body.a11y-dyslexia-font {
  font-family: 'Atkinson Hyperlegible', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body.a11y-dyslexia-font * {
  font-family: 'Atkinson Hyperlegible', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Increased Contrast */
body.a11y-high-contrast {
  --color-text-primary: #000000;
  --color-text-secondary: #424242;
  --color-bg-primary: #ffffff;
  --color-bg-secondary: #f0f0f0;
  --color-accent: #0056b3;
}

html.dark-mode body.a11y-high-contrast {
  --color-text-primary: #ffffff;
  --color-text-secondary: #d0d0d0;
  --color-bg-primary: #000000;
  --color-bg-secondary: #1a1a1a;
  --color-accent: #66b3ff;
}

/* Color Vision Deficiency Filters */
body.a11y-filter-protanopia {
  filter: url('#protanopia-filter');
}

body.a11y-filter-deuteranopia {
  filter: url('#deuteranopia-filter');
}

body.a11y-filter-tritanopia {
  filter: url('#tritanopia-filter');
}

body.a11y-filter-monochrome {
  filter: grayscale(100%);
}

/* Preserve backdrop-filter when color filters are active */
body[class*="a11y-filter-"] .glass-effect,
body[class*="a11y-filter-"] .header-island,
body[class*="a11y-filter-"] .search-dropdown,
body[class*="a11y-filter-"] .settings-panel,
body[class*="a11y-filter-"] .main-navigation-mobile,
body[class*="a11y-filter-"] .footer-content,
body[class*="a11y-filter-"] .comments-sidebar,
body[class*="a11y-filter-"] .sidebar-comment,
body[class*="a11y-filter-"] .hero-quote-wrapper::before,
body[class*="a11y-filter-"] .hero-image-wrapper::before,
body[class*="a11y-filter-"] .hero-datetime::before,
body[class*="a11y-filter-"] .lightbox-overlay.active {
  isolation: isolate;
}

/* CSS Fallback for color filters (approximations) */
@supports not (filter: url('#protanopia-filter')) {
  body.a11y-filter-protanopia {
    filter: sepia(0.2) saturate(0.8) hue-rotate(-10deg);
  }

  body.a11y-filter-deuteranopia {
    filter: sepia(0.15) saturate(0.85) hue-rotate(5deg);
  }

  body.a11y-filter-tritanopia {
    filter: sepia(0.1) saturate(0.9) hue-rotate(-5deg);
  }
}

/* Increased Line Height */
body.a11y-line-height,
body.a11y-line-height * {
  line-height: 1.8 !important;
}

body.a11y-line-height p,
body.a11y-line-height li,
body.a11y-line-height .article-content {
  line-height: 2 !important;
}

/* Increased Letter Spacing */
body.a11y-letter-spacing,
body.a11y-letter-spacing * {
  letter-spacing: 0.05em !important;
}

body.a11y-letter-spacing h1,
body.a11y-letter-spacing h2,
body.a11y-letter-spacing h3 {
  letter-spacing: 0.03em !important;
}

/* Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* ============================================
   HEADER & NAVIGATION - Island Layout
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  height: var(--header-height);
  background: transparent;
  border: none;
}

/* Islands Container */
.header-islands-container {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 10px var(--spacing-md);
  gap: 10px;
  height: 100%;
}

/* Individual Island Styling */
.header-island {
  position: relative;
  background: rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 32px;
  padding: 6px 16px;
  transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06),
              0 1px 0 0 rgba(255, 255, 255, 0.9) inset;
  /* Safari WebGL fallback */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

/* Dark mode islands - Important to override liquidGL canvas background */
.dark-mode .header-island {
  background: rgba(0, 0, 0, 0.25) !important;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.4),
              0 1px 0 0 rgba(255, 255, 255, 0.08) inset;
}

/* liquidGL content wrapper for islands */
.header-island .content {
  position: relative;
  z-index: 10;
  pointer-events: auto;
}

/* Ensure liquidGL canvas doesn't block clicks and stays visible */
.header-island canvas {
  pointer-events: none !important;
  z-index: 1;
  border-radius: 32px;
  /* Force visibility for Safari - prevent liquidGL from hiding islands */
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
}

/* Force islands to always be visible - Safari fix */
.header-island {
  visibility: visible !important;
  display: block !important;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Logo Island */
.logo-island {
  padding: 6px 16px;
  margin-right: auto;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

/* Menu Island */
.menu-island {
  padding: 4px 12px;
}

.menu-island .main-navigation {
  white-space: nowrap;
}

/* Actions Island */
.actions-island {
  padding: 4px 6px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.site-logo {
  display: flex;
  align-items: center;
  line-height: 1;
}

.site-logo img,
.site-logo .custom-logo {
  max-height: 32px;
  width: auto;
  display: block;
}

.site-title {
  font-size: 1.125rem;
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.02em;
}

.site-title a {
  color: var(--color-text-primary);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.site-title a:hover {
  opacity: 0.7;
}

/* Main Navigation */
.main-navigation ul {
  display: flex;
  list-style: none;
  gap: var(--spacing-xs);
  justify-content: center;
  margin: 0;
  padding: 0;
}

.main-navigation li {
  margin: 0;
}

.main-navigation a {
  font-size: 0.9375rem;
  font-weight: var(--font-weight-regular);
  padding: 8px 14px;
  display: block;
  color: var(--color-text-primary);
  text-decoration: none;
  border-radius: 16px;
  transition: background 0.2s ease, opacity 0.2s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.main-navigation a:hover {
  background: rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

.dark-mode .main-navigation a:hover {
  background: rgba(255, 255, 255, 0.1);
}

.main-navigation a:active {
  transform: scale(0.98);
}

/* Responsive Islands - Tablet */
@media (max-width: 1024px) {
  .header-islands-container {
    gap: 8px;
  }
}

/* Hide mobile navigation on desktop */
.main-navigation-mobile {
  display: none;
}

/* Responsive Islands - Mobile */
@media (max-width: 768px) {
  .header-islands-container {
    padding: 8px var(--spacing-sm);
    gap: 8px;
    justify-content: space-between;
  }

  .header-island {
    border-radius: 28px;
    padding: 6px 12px;
  }

  .header-island canvas {
    border-radius: 28px;
  }

  .logo-island {
    padding: 6px 12px;
    margin-right: 0;
  }

  .menu-island {
    display: none !important; /* Completely hide menu island on mobile */
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .actions-island {
    padding: 4px 6px;
  }

  .site-title {
    font-size: 1rem;
  }

  /* Show mobile navigation */
  .main-navigation-mobile {
    display: block;
  }
}

/* ============================================
   HEADER ACTION BUTTONS
   ============================================ */
.search-toggle,
.settings-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--color-text-primary);
  transition: background 0.2s ease, transform 0.2s ease;
}

.search-toggle:hover,
.settings-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
}

.search-toggle:active,
.settings-toggle:active {
  transform: scale(0.95);
}

.dark-mode .search-toggle:hover,
.dark-mode .settings-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ============================================
   SEARCH DROPDOWN
   ============================================ */
.search-dropdown {
  position: fixed;
  top: calc(var(--header-height) + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - var(--spacing-lg) * 2);
  max-width: 600px;
  z-index: 1900;
  opacity: 0;
  visibility: hidden;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 28px;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12),
              0 1px 0 0 rgba(255, 255, 255, 0.9) inset;
  -webkit-transform: translateX(-50%) translateZ(0);
  transform: translateX(-50%) translateZ(0);
  isolation: isolate;
}

.dark-mode .search-dropdown {
  background: rgba(0, 0, 0, 0.25) !important;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5),
              0 1px 0 0 rgba(255, 255, 255, 0.08) inset;
}

.search-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  max-height: 100px;
}

.search-dropdown .content {
  position: relative;
  z-index: 10;
  padding: var(--spacing-sm) var(--spacing-md);
}

.search-dropdown canvas {
  pointer-events: none !important;
  z-index: 1;
  border-radius: 28px;
  opacity: 1 !important;
  visibility: visible !important;
}

.search-form {
  position: relative;
  display: flex;
  align-items: center;
  background: transparent;
  border: none;
  border-radius: 16px;
  padding: 0;
  gap: var(--spacing-xs);
}

.search-field {
  flex: 1;
  font-size: 0.9375rem;
  padding: 10px 14px;
  border: none;
  background: rgba(255, 255, 255, 0.3);
  color: var(--color-text-primary);
  font-family: var(--font-primary);
  font-weight: var(--font-weight-regular);
  outline: none;
  min-width: 0;
  border-radius: 12px;
  transition: background 0.2s ease;
}

.dark-mode .search-field {
  background: rgba(0, 0, 0, 0.2);
}

.search-field:focus {
  background: rgba(255, 255, 255, 0.5);
}

.dark-mode .search-field:focus {
  background: rgba(0, 0, 0, 0.3);
}

/* Mobile search fixes */
@media (max-width: 768px) {
  .search-dropdown {
    top: calc(var(--header-height) + 8px);
    width: calc(100% - var(--spacing-sm) * 2);
    border-radius: 24px;
  }

  .search-dropdown canvas {
    border-radius: 24px;
  }

  .search-field {
    font-size: 0.875rem;
    padding: 8px 12px;
  }

  .search-submit {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }
}

/* ============================================
   SETTINGS PANEL
   ============================================ */
.settings-panel {
  position: fixed;
  top: calc(var(--header-height) + 10px);
  right: var(--spacing-md);
  width: 360px;
  max-width: calc(100vw - var(--spacing-lg) * 2);
  z-index: 1900;
  opacity: 0;
  visibility: hidden;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 24px;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12),
              0 1px 0 0 rgba(255, 255, 255, 0.9) inset;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  isolation: isolate;
}

.dark-mode .settings-panel {
  background: rgba(0, 0, 0, 0.25) !important;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5),
              0 1px 0 0 rgba(255, 255, 255, 0.08) inset;
}

.settings-panel.is-open {
  opacity: 1;
  visibility: visible;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.settings-panel .content {
  position: relative;
  z-index: 10;
  padding: var(--spacing-md);
  /* Add safe area padding for mobile devices with bottom navigation/gesture bars */
  padding-bottom: max(var(--spacing-md), calc(var(--spacing-md) + env(safe-area-inset-bottom, 0px)));
}

.settings-panel canvas {
  pointer-events: none !important;
  z-index: 1;
  border-radius: 24px;
  opacity: 1 !important;
  visibility: visible !important;
}

.settings-panel-title {
  font-size: 1.25rem;
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--spacing-md);
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

/* Section Styles */
.settings-section {
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.dark-mode .settings-section {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.settings-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.settings-section-title {
  font-size: 0.9375rem;
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--spacing-sm);
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Subsection Styles */
.settings-subsection {
  margin-top: var(--spacing-sm);
  padding-left: 12px;
}

.settings-subsection-title {
  font-size: 0.8125rem;
  font-weight: var(--font-weight-medium);
  margin-bottom: 8px;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Theme Toggle Buttons */
.theme-toggle-wrapper {
  display: flex;
  gap: 8px;
}

.theme-toggle-button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.2);
  border: 1.5px solid transparent;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.dark-mode .theme-toggle-button {
  background: rgba(0, 0, 0, 0.2);
}

.theme-toggle-button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.dark-mode .theme-toggle-button:hover {
  background: rgba(0, 0, 0, 0.3);
}

.theme-toggle-button[aria-pressed="true"] {
  background: var(--color-accent);
  color: #ffffff;
  border-color: var(--color-accent);
}

.dark-mode .theme-toggle-button[aria-pressed="true"] {
  background: #0a84ff;
  border-color: #0a84ff;
}

/* Options */
.settings-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.settings-option:hover {
  opacity: 0.8;
}

.settings-checkbox,
.settings-radio {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--color-accent);
  flex-shrink: 0;
}

.dark-mode .settings-checkbox,
.dark-mode .settings-radio {
  accent-color: #0a84ff;
}

.settings-label {
  font-size: 0.9375rem;
  color: var(--color-text-primary);
  cursor: pointer;
  user-select: none;
}

/* Reset Button */
.settings-reset {
  width: 100%;
  padding: 12px 16px;
  background: var(--color-accent);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: var(--spacing-sm);
}

.settings-reset:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
}

.dark-mode .settings-reset {
  background: #0a84ff;
}

.dark-mode .settings-reset:hover {
  background: #0077ed;
}

/* Mobile Settings Panel */
@media (max-width: 768px) {
  .settings-panel {
    right: var(--spacing-sm);
    left: var(--spacing-sm);
    width: auto;
    max-width: none;
    border-radius: 20px;
  }

  .settings-panel canvas {
    border-radius: 20px;
  }

  .settings-panel .content {
    padding: var(--spacing-sm);
    /* Extra padding for Android navigation pill/gesture bar */
    padding-bottom: max(calc(var(--spacing-sm) + 24px), calc(var(--spacing-sm) + env(safe-area-inset-bottom, 0px) + 16px));
  }

  .settings-panel-title {
    font-size: 1.125rem;
  }

  .settings-section-title {
    font-size: 0.875rem;
  }

  .settings-subsection-title {
    font-size: 0.75rem;
  }

  .settings-label {
    font-size: 0.875rem;
  }

  .theme-toggle-button {
    font-size: 0.8125rem;
    padding: 8px 12px;
  }
}

.search-field::placeholder {
  color: var(--color-text-secondary);
  opacity: 0.6;
}

.search-submit {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent);
  border: none;
  border-radius: 12px;
  color: white;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.search-submit:hover {
  background: var(--color-accent-hover);
  transform: scale(1.05);
}

.search-submit:active {
  transform: scale(0.95);
}

/* ============================================
   MOBILE MENU TOGGLE
   ============================================ */
.mobile-menu-toggle {
  position: relative;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 20px;
}

.hamburger .line {
  width: 100%;
  height: 2px;
  background: var(--color-text-primary);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger .line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger .line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger .line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

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

/* ============================================
   RESPONSIVE MOBILE MENU
   ============================================ */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .main-navigation-mobile {
    position: fixed;
    top: calc(var(--header-height) + 8px);
    left: var(--spacing-sm);
    right: var(--spacing-sm);
    max-height: 0;
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    padding: 0 var(--spacing-md);
    z-index: 999;
    border-radius: 28px;
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06),
                0 1px 0 0 rgba(255, 255, 255, 0.9) inset;
    opacity: 0;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }

  .dark-mode .main-navigation-mobile {
    background: rgba(0, 0, 0, 0.25) !important;
    border: 0.5px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.4),
                0 1px 0 0 rgba(255, 255, 255, 0.08) inset;
  }

  .main-navigation-mobile.is-open {
    max-height: calc(100vh - var(--header-height) - 16px);
    overflow-y: auto;
    padding-top: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    opacity: 1;
  }

  .main-navigation-mobile .content {
    position: relative;
    z-index: 10;
  }

  .main-navigation-mobile canvas {
    pointer-events: none !important;
    z-index: 1;
    border-radius: 28px;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .main-navigation-mobile ul,
  .main-navigation-mobile .nav-menu,
  .main-navigation-mobile .menu {
    flex-direction: column;
    gap: 2px;
    display: block;
  }

  .main-navigation-mobile li,
  .main-navigation-mobile .menu-item {
    display: block;
  }

  .main-navigation-mobile a {
    font-size: 1.0625rem;
    padding: 12px 16px;
    color: var(--color-text-primary);
    display: block;
    border-radius: 16px;
    transition: background 0.2s ease, transform 0.2s ease;
  }

  .main-navigation-mobile a:hover {
    background: rgba(0, 0, 0, 0.08);
    transform: translateX(4px);
  }

  .dark-mode .main-navigation-mobile a:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  body.menu-open {
    overflow: hidden;
  }
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.site-main {
  min-height: calc(100vh - var(--header-height));
  padding: 0;
  padding-top: var(--header-height);
}

/* ============================================
   COMPACT HERO SECTION
   ============================================ */
.hero-section {
  position: relative;
  margin-bottom: var(--spacing-md);
  margin-top: calc(-2 * var(--spacing-md));
  margin-left: calc(-1 * var(--spacing-md));
  margin-right: calc(-1 * var(--spacing-md));
  padding: var(--spacing-sm) var(--spacing-lg);
  min-height: 80px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  isolation: isolate;
}

/* Black overlay for better text readability */
.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 0;
}

.dark-mode .hero-section::before {
  background: rgba(0, 0, 0, 0.5);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: var(--spacing-md);
  font-size: 1.0625rem;
  color: var(--color-text-secondary);
}

.hero-greeting {
  font-weight: var(--font-weight-bold);
  color: #ffffff;
  font-size: 1.25rem;
  position: relative;
  padding: 4px 12px;
  isolation: isolate;
}

.hero-greeting::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 6px;
  z-index: -1;
}

.dark-mode .hero-greeting::before {
  background: rgba(0, 0, 0, 0.4);
}

.hero-greeting-link {
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.hero-greeting-custom {
  font-weight: var(--font-weight-bold);
  font-size: 1.25rem;
  color: #ffffff;
  position: relative;
  padding: 4px 12px;
  isolation: isolate;
}

.hero-greeting-custom::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 6px;
  z-index: -1;
}

.dark-mode .hero-greeting-custom::before {
  background: rgba(0, 0, 0, 0.4);
}

/* Digital DateTime Display */
.hero-datetime {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 10px 16px;
  isolation: isolate;
  min-width: 140px;
}

.hero-datetime::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 50px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3),
              inset 0 1px 1px rgba(255, 255, 255, 0.1);
  z-index: -1;
}

.dark-mode .hero-datetime::before {
  background: rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.2);
}

.hero-date {
  color: #ffffff;
  font-weight: var(--font-weight-medium);
  font-size: 0.75rem;
  letter-spacing: 1px;
  font-family: 'Digital-7 Mono', 'Courier New', Courier, monospace;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5),
               0 0 20px rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
}

.hero-clock {
  color: #ffffff;
  font-weight: var(--font-weight-bold);
  font-size: 1.125rem;
  font-family: 'Digital-7 Mono', 'Courier New', Courier, monospace;
  letter-spacing: 2px;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.8),
               0 0 30px rgba(255, 255, 255, 0.4);
}

.hero-quote-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  padding: 8px 14px;
  isolation: isolate;
}

.hero-quote-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 6px;
  z-index: -1;
}

.dark-mode .hero-quote-wrapper::before {
  background: rgba(0, 0, 0, 0.4);
}

.hero-quote {
  font-style: italic;
  color: #ffffff;
  line-height: 1.4;
  font-size: 0.9375rem;
}

/* HTML formatting support in quotes */
.hero-quote strong,
.hero-quote b {
  font-weight: var(--font-weight-bold);
  color: #ffffff;
}

.hero-quote em,
.hero-quote i {
  font-style: italic;
}

.hero-quote a {
  color: #ffffff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.5);
  text-underline-offset: 2px;
  transition: all var(--transition-fast);
}

.hero-quote a:hover {
  text-decoration-color: rgba(255, 255, 255, 1);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.hero-quote-author {
  font-size: 0.8125rem;
  color: #ffffff;
  opacity: 0.8;
  font-weight: var(--font-weight-medium);
}

/* HTML formatting support in quote author */
.hero-quote-author strong,
.hero-quote-author b {
  font-weight: var(--font-weight-bold);
}

.hero-quote-author em,
.hero-quote-author i {
  font-style: italic;
}

.hero-quote-author a {
  color: #ffffff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.4);
  text-underline-offset: 2px;
  transition: all var(--transition-fast);
}

.hero-quote-author a:hover {
  text-decoration-color: rgba(255, 255, 255, 0.8);
}

.hero-image-wrapper {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  flex-shrink: 0;
  position: relative;
  isolation: isolate;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease;
  width: fit-content;
}

.hero-image-wrapper:hover {
  transform: scale(1.05);
}

.hero-image-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 113, 227, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 8px;
  border: 1px solid rgba(0, 113, 227, 0.2);
  z-index: -1;
}

.dark-mode .hero-image-wrapper::before {
  background: rgba(10, 132, 255, 0.2);
  border-color: rgba(10, 132, 255, 0.25);
}

.hero-image-label {
  font-size: 0.625rem;
  font-weight: var(--font-weight-semibold);
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
  max-width: 64px;
  word-wrap: break-word;
}

.hero-nasa-link {
  display: block;
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

.hero-nasa-link:hover {
  transform: scale(1.08);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
  cursor: zoom-in;
}

.dark-mode .hero-nasa-link:hover {
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.5);
}

.hero-nasa-thumbnail {
  width: 64px;
  height: 64px;
  object-fit: cover;
  display: block;
}

/* Hero Section Responsive */
@media (min-width: 769px) and (max-width: 1200px) {
  /* Tablet layout - show quote with reduced size */
  .hero-quote-wrapper {
    padding: 6px 12px;
  }

  .hero-quote {
    font-size: 0.8125rem;
    line-height: 1.4;
  }

  .hero-quote-author {
    font-size: 0.6875rem;
  }
}

@media (max-width: 768px) {
  .container {
    overflow: visible !important;
  }

  .site-main {
    padding-top: calc(var(--header-height) - 8px) !important;
    overflow: visible !important;
  }

  .hero-section {
    margin-top: calc(-2 * var(--spacing-md)) !important;
    padding: 6px var(--spacing-md) !important;
    min-height: 60px !important;
  }

  .hero-content {
    display: grid !important;
    grid-template-columns: auto 1fr auto !important;
    grid-template-rows: auto auto auto !important;
    gap: 6px !important;
    align-items: center !important;
  }

  .hero-greeting,
  .hero-greeting-link,
  .hero-greeting-custom {
    display: block !important;
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    font-size: 0.9375rem !important;
    padding: 4px 10px !important;
    justify-self: start !important;
    width: fit-content !important;
  }

  .hero-datetime {
    grid-column: 1 !important;
    grid-row: 2 !important;
    justify-self: start !important;
    padding: 4px 6px !important;
    min-width: auto !important;
    gap: 1px !important;
  }

  .hero-date {
    font-size: 0.5rem !important;
    letter-spacing: 0.2px !important;
  }

  .hero-clock {
    font-size: 0.75rem !important;
    letter-spacing: 0.8px !important;
  }

  .hero-quote-wrapper {
    display: flex !important;
    flex-direction: column !important;
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
    justify-self: center !important;
    padding: 3px 6px !important;
    gap: 1px !important;
    max-width: 100% !important;
    overflow: visible !important;
  }

  .hero-quote {
    font-size: 0.5625rem !important;
    line-height: 1.3 !important;
    text-align: center !important;
    overflow-wrap: break-word !important;
    word-wrap: break-word !important;
  }

  .hero-quote-author {
    font-size: 0.5rem !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .hero-image-wrapper {
    grid-column: 3 !important;
    grid-row: 2 !important;
    justify-self: end !important;
    padding: 5px 6px !important;
    width: auto !important;
  }

  .hero-image-label {
    font-size: 0.4375rem !important;
    letter-spacing: 0.1px !important;
    max-width: 48px !important;
  }

  .hero-nasa-thumbnail {
    width: 48px !important;
    height: 48px !important;
  }
}

/* ============================================
   LIGHTBOX
   ============================================ */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md);
  transition: background 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              backdrop-filter 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
}

.lightbox-overlay.is-open {
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  opacity: 1;
}

.lightbox-overlay.closing {
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  opacity: 0;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox-overlay.is-open .lightbox-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.lightbox-overlay.closing .lightbox-content {
  transform: scale(0.95) translateY(10px);
  opacity: 0;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s ease;
  z-index: 1;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.lightbox-image {
  max-width: 100%;
  max-height: calc(90vh - 60px);
  display: block;
  border-radius: 8px;
}

.lightbox-caption {
  color: white;
  text-align: center;
  margin-top: var(--spacing-sm);
  font-size: 0.875rem;
  font-weight: var(--font-weight-medium);
}

/* HTML formatting support in lightbox captions */
.lightbox-caption strong,
.lightbox-caption b {
  font-weight: var(--font-weight-bold);
  color: #ffffff;
}

.lightbox-caption em,
.lightbox-caption i {
  font-style: italic;
}

.lightbox-caption a {
  color: #ffffff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.6);
  text-underline-offset: 2px;
  transition: all var(--transition-fast);
}

.lightbox-caption a:hover {
  text-decoration-color: rgba(255, 255, 255, 1);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

body.lightbox-open {
  overflow: hidden;
}

/* ============================================
   ARTICLE CARDS
   ============================================ */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.article-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* liquidGL hover effect for article cards */
.article-card.liquidGL-hover {
  perspective: 1000px;
  transform-style: preserve-3d;
}

.article-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.dark-mode .article-card:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.article-card a {
  display: block;
  height: 100%;
  text-decoration: none;
}

.article-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.4) 40%,
    rgba(0, 0, 0, 0.1) 60%,
    transparent 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--spacing-lg);
}

.article-category {
  font-size: 0.75rem;
  font-weight: var(--font-weight-semibold);
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--spacing-sm);
}

.article-title {
  font-size: 1.75rem;
  font-weight: var(--font-weight-bold);
  color: #ffffff;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: var(--spacing-sm);
}

.article-date {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.75);
  font-weight: var(--font-weight-regular);
}

/* Article card placeholder for posts without featured images */
.article-card-placeholder {
  background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-accent) 100%);
}

/* Responsive card sizing */
@media (max-width: 1200px) {
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .articles-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  .article-card-overlay {
    padding: var(--spacing-md);
  }

  .article-title {
    font-size: 1.5rem;
  }
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
  margin: var(--spacing-xl) 0;
  padding: var(--spacing-lg) 0;
  border-top: 1px solid var(--color-border);
}

.dark-mode .pagination {
  border-top-color: rgba(255, 255, 255, 0.1);
}

.nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-xs);
  flex-wrap: wrap;
}

.nav-links .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 var(--spacing-sm);
  font-size: 0.9375rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  background: transparent;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.nav-links .page-numbers:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: var(--color-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transform: translateY(-2px);
}

.dark-mode .nav-links .page-numbers:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav-links .page-numbers.current {
  color: #ffffff;
  background: var(--color-accent);
  border-color: var(--color-accent);
  cursor: default;
}

.dark-mode .nav-links .page-numbers.current {
  color: #000000;
  background: #0a84ff;
  border-color: #0a84ff;
}

.nav-links .page-numbers.current:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.dark-mode .nav-links .page-numbers.current:hover {
  background: #0a84ff;
  border-color: #0a84ff;
}

.nav-links .page-numbers.dots {
  cursor: default;
  border: none;
  color: var(--color-text-secondary);
}

.nav-links .page-numbers.dots:hover {
  background: transparent;
  border: none;
}

.nav-links .prev,
.nav-links .next {
  font-weight: var(--font-weight-medium);
  padding: 0 var(--spacing-md);
}

@media (max-width: 768px) {
  .pagination {
    margin: var(--spacing-lg) 0;
  }

  .nav-links .page-numbers {
    min-width: 40px;
    height: 40px;
    font-size: 0.875rem;
  }

  .nav-links .prev,
  .nav-links .next {
    padding: 0 var(--spacing-sm);
  }
}

/* ============================================
   ARCHIVE PAGES (CATEGORY, TAG, ETC.)
   ============================================ */
.archive-header {
  text-align: center;
  padding: var(--spacing-xl) 0 var(--spacing-lg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  margin-bottom: var(--spacing-lg);
}

.dark-mode .archive-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.author-avatar {
  margin: 0 auto var(--spacing-md);
  width: 120px;
  height: 120px;
}

.author-avatar img {
  border-radius: 50%;
  border: 4px solid var(--color-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dark-mode .author-avatar img {
  border-color: rgba(255, 255, 255, 0.1);
}

.author-bio {
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.archive-category-label {
  font-size: 0.875rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--spacing-sm);
}

.archive-title {
  font-size: 3rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: var(--spacing-sm);
}

.archive-description {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  max-width: 700px;
  margin: 0 auto var(--spacing-sm);
  line-height: 1.6;
}

.archive-description p {
  margin: 0;
}

.archive-count {
  font-size: 1rem;
  color: var(--color-text-secondary);
  margin: 0;
}

/* Responsive archive header */
@media (max-width: 768px) {
  .archive-title {
    font-size: 2rem;
  }

  .archive-description {
    font-size: 1rem;
  }
}

/* ============================================
   SEARCH RESULTS PAGE
   ============================================ */
.search-header {
  text-align: center;
  padding: var(--spacing-xl) 0 var(--spacing-lg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  margin-bottom: var(--spacing-lg);
}

.dark-mode .search-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.search-title {
  font-size: 2.5rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: var(--spacing-sm);
}

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

.search-count {
  font-size: 1rem;
  color: var(--color-text-secondary);
  margin: 0;
}

.no-results {
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-md);
  max-width: 600px;
  margin: 0 auto;
}

.no-results p {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-lg);
}

.search-again {
  margin-top: var(--spacing-lg);
}

.search-form-inline {
  display: flex;
  gap: var(--spacing-sm);
  max-width: 500px;
  margin: 0 auto;
}

.search-field-inline {
  flex: 1;
  font-size: 1rem;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  font-family: var(--font-primary);
  outline: none;
  transition: border-color 0.2s ease;
}

.search-field-inline:focus {
  border-color: var(--color-accent);
}

.dark-mode .search-field-inline {
  border-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .search-field-inline:focus {
  border-color: var(--color-accent);
}

.search-submit-inline {
  padding: var(--spacing-sm) var(--spacing-lg);
  background: var(--color-accent);
  border: none;
  border-radius: 8px;
  color: white;
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: background 0.2s ease;
  white-space: nowrap;
}

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

/* Responsive search page */
@media (max-width: 768px) {
  .search-title {
    font-size: 1.75rem;
  }

  .search-form-inline {
    flex-direction: column;
  }

  .search-submit-inline {
    width: 100%;
  }
}

/* ============================================
   SINGLE POST
   ============================================ */
.single-article {
  max-width: 800px;
  margin: 0 auto;
}

.article-header {
  text-align: center;
  padding: var(--spacing-lg) 0 var(--spacing-md);
}

.single-article .article-category {
  color: var(--color-text-secondary);
  display: inline-block;
  margin-bottom: var(--spacing-sm);
}

.single-article .article-title {
  font-size: 2.75rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: var(--spacing-md);
}

.article-meta {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  font-weight: var(--font-weight-medium);
}

.article-meta .article-date {
  color: var(--color-text-secondary);
  opacity: 1;
}

.dark-mode .article-meta .article-date {
  color: var(--color-text-secondary);
}

.article-featured-image {
  margin-bottom: var(--spacing-lg);
  border-radius: 16px;
  overflow: hidden;
}

.article-featured-image img {
  width: 100%;
  height: auto;
}

.article-content {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--color-text-primary);
}

.article-content p {
  margin-bottom: var(--spacing-md);
}

.article-content a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.article-content a:hover {
  color: var(--color-accent-hover);
  text-decoration-color: var(--color-accent-hover);
}

.article-content h2,
.article-content h3,
.article-content h4 {
  font-weight: var(--font-weight-bold);
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-sm);
  letter-spacing: -0.02em;
}

.article-content h2 {
  font-size: 2rem;
}

.article-content h3 {
  font-size: 1.5rem;
}

.article-content h4 {
  font-size: 1.25rem;
}

/* ============================================
   BLOCK EDITOR / GUTENBERG SUPPORT
   ============================================ */

/* Wide alignment */
.article-content .alignwide,
.page-content .alignwide {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  width: calc(100% + 400px);
  max-width: calc(100% + 400px);
  margin-left: -200px;
  margin-right: -200px;
}

/* Full alignment */
.article-content .alignfull,
.page-content .alignfull {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* Responsive wide/full on mobile */
@media (max-width: 1200px) {
  .article-content .alignwide,
  .page-content .alignwide {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}

/* Block spacing */
.article-content > *,
.page-content > * {
  margin-bottom: var(--spacing-md);
}

/* Image blocks */
.article-content .wp-block-image img,
.page-content .wp-block-image img {
  border-radius: 16px;
}

/* Quote blocks */
.article-content .wp-block-quote,
.page-content .wp-block-quote {
  border-left: 4px solid var(--color-accent);
  padding-left: 1.5em;
  margin: 2em 0;
  font-style: italic;
  color: var(--color-text-secondary);
}

/* Button blocks */
.article-content .wp-block-button__link,
.page-content .wp-block-button__link {
  background-color: var(--color-accent);
  color: #ffffff;
  padding: 0.75em 1.5em;
  border-radius: 8px;
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.2s ease;
}

.article-content .wp-block-button__link:hover,
.page-content .wp-block-button__link:hover {
  background-color: var(--color-accent-hover);
}

/* Cover blocks */
.article-content .wp-block-cover,
.page-content .wp-block-cover {
  border-radius: 18px;
  overflow: hidden;
}

/* Group blocks */
.article-content .wp-block-group,
.page-content .wp-block-group {
  padding: var(--spacing-lg);
  background-color: var(--color-bg-secondary);
  border-radius: 12px;
}

/* Separator blocks */
.article-content .wp-block-separator,
.page-content .wp-block-separator {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  margin: 3em auto;
}

.dark-mode .article-content .wp-block-separator,
.dark-mode .page-content .wp-block-separator {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   404 ERROR PAGE
   ============================================ */
.error-404-page {
  min-height: calc(100vh - var(--header-height) - 200px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--spacing-xl) 0;
}

.error-404-content {
  text-align: center;
  max-width: 700px;
  margin: 0 auto var(--spacing-xl);
}

.error-404-number {
  font-size: 8rem;
  font-weight: var(--font-weight-bold);
  line-height: 1;
  background: linear-gradient(135deg, var(--color-accent), #0a84ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--spacing-md);
  letter-spacing: -0.05em;
}

.error-404-title {
  font-size: 2.5rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-sm);
  letter-spacing: -0.02em;
}

.error-404-message {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-xs);
  line-height: 1.6;
}

.error-404-message-english {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  opacity: 0.8;
  font-style: italic;
  margin-bottom: var(--spacing-lg);
}

.error-404-search {
  margin: var(--spacing-xl) 0;
}

.search-form-404 {
  display: flex;
  max-width: 500px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: var(--spacing-xs);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.dark-mode .search-form-404 {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

.search-form-404:focus-within {
  border-color: var(--color-accent);
  box-shadow: 0 6px 24px rgba(0, 113, 227, 0.2);
}

.search-field-404 {
  flex: 1;
  font-size: 1.125rem;
  padding: var(--spacing-sm) var(--spacing-md);
  border: none;
  background: transparent;
  color: var(--color-text-primary);
  font-family: var(--font-primary);
  outline: none;
}

.search-field-404::placeholder {
  color: var(--color-text-secondary);
  opacity: 0.6;
}

.search-submit-404 {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent);
  border: none;
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dark-mode .search-submit-404 {
  background: #0a84ff;
}

.search-submit-404:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.error-404-actions {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--spacing-lg);
}

.button-404 {
  display: inline-flex;
  align-items: center;
  padding: var(--spacing-sm) var(--spacing-lg);
  font-size: 1rem;
  font-weight: var(--font-weight-semibold);
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
}

.button-404-primary {
  background: var(--color-accent);
  color: #ffffff;
}

.dark-mode .button-404-primary {
  background: #0a84ff;
}

.button-404-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 113, 227, 0.3);
}

.button-404-secondary {
  background: transparent;
  color: var(--color-text-primary);
  border-color: var(--color-border);
}

.button-404-secondary:hover {
  background: var(--color-bg-secondary);
  transform: translateY(-2px);
}

.error-404-recent {
  width: 100%;
  max-width: 1200px;
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-xl);
  border-top: 1px solid var(--color-border);
}

.error-404-recent-title {
  font-size: 1.75rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-lg);
  text-align: center;
}

.error-404-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
}

.error-404-post-card {
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: var(--color-bg-secondary);
}

.error-404-post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.error-404-post-card a {
  display: block;
  text-decoration: none;
}

.error-404-post-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.error-404-post-placeholder {
  background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-accent) 100%);
}

.error-404-post-content {
  padding: var(--spacing-md);
}

.error-404-post-category {
  font-size: 0.75rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--spacing-xs);
}

.error-404-post-title {
  font-size: 1.125rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  line-height: 1.4;
  margin-bottom: var(--spacing-xs);
}

.error-404-post-date {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

/* 404 Responsive */
@media (max-width: 1200px) {
  .error-404-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .error-404-number {
    font-size: 5rem;
  }

  .error-404-title {
    font-size: 1.75rem;
  }

  .error-404-message {
    font-size: 1rem;
  }

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

  .error-404-actions {
    flex-direction: column;
  }

  .button-404 {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================
   RELATED POSTS
   ============================================ */
.related-posts {
  max-width: 1200px;
  margin: var(--spacing-xl) auto 0;
  padding-top: var(--spacing-xl);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.dark-mode .related-posts {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.related-posts-title {
  font-size: 2rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  text-align: center;
  margin-bottom: var(--spacing-lg);
  letter-spacing: -0.02em;
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.related-post-card {
  border-radius: 18px;
  overflow: hidden;
  background: var(--color-bg-secondary);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* liquidGL hover effect for related post cards */
.related-post-card.liquidGL-hover {
  perspective: 1000px;
  transform-style: preserve-3d;
}

.related-post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.dark-mode .related-post-card:hover {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.related-post-card a {
  display: block;
  text-decoration: none;
}

.related-post-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.related-post-placeholder {
  background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-accent) 100%);
}

.related-post-content {
  padding: var(--spacing-md);
}

.related-post-category {
  font-size: 0.75rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--spacing-xs);
}

.related-post-title {
  font-size: 1.25rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: var(--spacing-xs);
}

.related-post-date {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  display: block;
}

/* Responsive related posts */
@media (max-width: 768px) {
  .related-posts-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  .related-posts-title {
    font-size: 1.5rem;
  }

  .related-post-title {
    font-size: 1.125rem;
  }

  .single-article .article-title {
    font-size: 1.75rem;
  }
}

/* ============================================
   PAGE TEMPLATE
   ============================================ */
.single-page {
  max-width: 800px;
  margin: 0 auto;
}

.page-header {
  text-align: center;
  padding: var(--spacing-lg) 0 var(--spacing-md);
}

.page-title {
  font-size: 3rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: var(--spacing-md);
}

.page-featured-image {
  margin-bottom: var(--spacing-lg);
  border-radius: 16px;
  overflow: hidden;
}

.page-featured-image img {
  width: 100%;
  height: auto;
}

.page-content {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--color-text-primary);
}

.page-content p {
  margin-bottom: var(--spacing-md);
}

.page-content a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.page-content a:hover {
  color: var(--color-accent-hover);
  text-decoration-color: var(--color-accent-hover);
}

.page-content h2,
.page-content h3,
.page-content h4 {
  font-weight: var(--font-weight-bold);
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-sm);
  letter-spacing: -0.02em;
}

.page-content h2 {
  font-size: 2rem;
}

.page-content h3 {
  font-size: 1.5rem;
}

.page-content h4 {
  font-size: 1.25rem;
}

/* Responsive page styling */
@media (max-width: 768px) {
  .page-title {
    font-size: 2rem;
  }

  .page-content {
    font-size: 1rem;
  }
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--color-bg-secondary);
  padding: var(--spacing-lg) 0;
  text-align: center;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Footer Content with liquidGL */
.footer-content {
  position: relative;
  background: rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 32px;
  padding: var(--spacing-lg);
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08),
              0 1px 0 0 rgba(255, 255, 255, 0.9) inset;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  max-width: 800px;
  margin: 0 auto;
}

.dark-mode .footer-content {
  background: rgba(0, 0, 0, 0.25) !important;
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4),
              0 1px 0 0 rgba(255, 255, 255, 0.08) inset;
}

.footer-content .content {
  position: relative;
  z-index: 10;
}

.footer-content canvas {
  pointer-events: none !important;
  z-index: 1;
  border-radius: 32px;
}

.footer-navigation {
  margin-bottom: var(--spacing-md);
}

.footer-menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-md);
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-menu li {
  margin: 0;
}

.footer-menu a {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  transition: color 0.2s ease;
}

.footer-menu a:hover {
  color: var(--color-text-primary);
}

.footer-copyright {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin: 0;
}

/* Footer Social Links */
.footer-social {
  margin: var(--spacing-lg) 0;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  transition: all 0.2s ease;
  text-decoration: none;
}

.social-link svg {
  width: 22px;
  height: 22px;
}

.social-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.social-link:active {
  transform: translateY(0);
}

.social-facebook {
  background-color: #1877F2;
  color: white;
}

.social-facebook:hover {
  background-color: #145DBF;
}

.social-twitter {
  background-color: #000000;
  color: white;
}

.social-twitter:hover {
  background-color: #333333;
}

.social-instagram {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: white;
}

.social-instagram:hover {
  background: linear-gradient(45deg, #d87e2f 0%, #c95a34 25%, #c0213a 50%, #b51e5c 75%, #a51478 100%);
}

/* Mobile footer */
@media (max-width: 768px) {
  .footer-menu {
    flex-direction: column;
    gap: var(--spacing-sm);
  }

  .footer-menu a {
    font-size: 0.8125rem;
  }

  .footer-copyright {
    font-size: 0.8125rem;
  }
}

@media (prefers-color-scheme: dark) {
  .site-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
}

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

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  :root {
    --spacing-lg: 32px;
    --spacing-xl: 48px;
  }

  .main-navigation ul {
    display: none; /* Mobile menu to be added in future iteration */
  }

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

/* ============================================
   CUSTOM BLOCKS
   ============================================ */

/* Guest Author Card */
.guest-author-card {
  display: flex;
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
  background: var(--color-bg-secondary);
  border-radius: 16px;
  margin: var(--spacing-lg) 0;
  border-left: 4px solid var(--color-accent);
}

.guest-author-image {
  flex-shrink: 0;
}

.guest-author-image img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-accent);
}

.guest-author-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.guest-author-name {
  margin: 0;
  font-size: 1.5rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
}

.guest-author-bio {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

.guest-author-links {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.guest-author-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: var(--color-accent);
  color: #ffffff !important;
  text-decoration: none !important;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: var(--font-weight-medium);
  transition: background 0.2s ease;
}

.guest-author-link:hover {
  background: var(--color-accent-hover);
}

/* Mobile Guest Author Card */
@media (max-width: 768px) {
  .guest-author-card {
    flex-direction: column;
    text-align: center;
    padding: var(--spacing-md);
  }

  .guest-author-image {
    align-self: center;
  }

  .guest-author-image img {
    width: 100px;
    height: 100px;
  }

  .guest-author-links {
    justify-content: center;
  }
}

/* Glossary Term */
.glossary-term {
  position: relative;
  display: inline;
  border-bottom: 2px dotted var(--color-accent);
  color: var(--color-accent);
  cursor: help;
  transition: color 0.2s ease;
}

.glossary-term:hover {
  color: var(--color-accent-hover);
  border-bottom-color: var(--color-accent-hover);
}

.glossary-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: normal;
  max-width: 300px;
  min-width: 200px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--color-border);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  z-index: 1000;
}

.glossary-tooltip::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--color-bg-primary);
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.1));
}

.glossary-term:hover .glossary-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-12px);
  pointer-events: auto;
}

/* Glossary Tooltip Links */
.glossary-tooltip a {
  color: var(--color-accent);
  text-decoration: underline;
  font-weight: var(--font-weight-medium);
  transition: color 0.2s ease;
}

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

/* Mobile Glossary Tooltip - Fixed Positioning */
@media (max-width: 768px) {
  .glossary-tooltip {
    /* Use fixed positioning relative to viewport */
    position: fixed;
    /* Width that's readable but respects viewport */
    width: min(280px, calc(100vw - 32px)) !important;
    max-width: none !important;
    /* Allow height to expand for content */
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    /* JS will set position, but fallback to centered */
    left: 50%;
    transform: translateX(-50%);
    /* Ensure text wraps properly */
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Dynamic arrow positioning using CSS custom property */
  .glossary-tooltip::before {
    left: var(--arrow-offset, 50%);
  }

  .glossary-term:hover .glossary-tooltip {
    /* No transform change needed, JS handles it */
  }

  /* Ensure glossary terms don't break layout */
  .glossary-term {
    word-break: break-word;
  }
}

/* Share Buttons */
.share-buttons {
  margin: var(--spacing-xl) 0;
  padding: var(--spacing-lg);
  background: var(--color-bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

.share-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-md);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.share-buttons-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: all 0.2s ease;
  text-decoration: none;
  position: relative;
}

.share-button svg {
  width: 20px;
  height: 20px;
}

.share-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.share-button:active {
  transform: translateY(0);
}

/* Platform-specific colors */
.share-native {
  background: linear-gradient(135deg, var(--color-accent), #0a84ff);
  color: white;
  border: none;
  cursor: pointer;
}

.share-native:hover {
  background: linear-gradient(135deg, var(--color-accent-hover), #0066cc);
}

.share-whatsapp {
  background-color: #25D366;
  color: white;
}

.share-whatsapp:hover {
  background-color: #20BA5A;
}

.share-facebook {
  background-color: #1877F2;
  color: white;
}

.share-facebook:hover {
  background-color: #145DBF;
}

.share-twitter {
  background-color: #000000;
  color: white;
}

.share-twitter:hover {
  background-color: #333333;
}

.share-bluesky {
  background-color: #0085FF;
  color: white;
}

.share-bluesky:hover {
  background-color: #006DD1;
}

.share-threads {
  background-color: #000000;
  color: white;
}

.share-threads:hover {
  background-color: #333333;
}

.share-reddit {
  background-color: #FF4500;
  color: white;
}

.share-reddit:hover {
  background-color: #E03D00;
}

.share-linkedin {
  background-color: #0A66C2;
  color: white;
}

.share-linkedin:hover {
  background-color: #084F96;
}

/* Mobile Share Buttons */
@media (max-width: 768px) {
  .share-buttons {
    padding: var(--spacing-md);
  }

  .share-button {
    width: 44px;
    height: 44px;
  }

  .share-button svg {
    width: 22px;
    height: 22px;
  }
}

/* Copy Message Notification */
.copy-message {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--color-border);
  font-size: 0.875rem;
  font-weight: var(--font-weight-medium);
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.copy-message.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
  .copy-message {
    bottom: 80px;
    max-width: calc(100vw - 48px);
  }
}

/* ============================================
   COMMENTS SECTION
   ============================================ */
.comments-area {
  margin: var(--spacing-xl) 0;
  padding: var(--spacing-lg) var(--spacing-md);
  background: var(--color-bg-primary);
  border-radius: 20px;
  border: 1px solid var(--color-border);
}

.dark-mode .comments-area {
  background: var(--color-bg-secondary);
}

.comments-title {
  font-size: 1.75rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--color-border);
}

/* Comment List */
.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.comment-list .comment {
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-lg);
  border-bottom: 1px solid var(--color-border);
}

.comment-list .comment:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.comment-body {
  display: flex;
  gap: var(--spacing-md);
}

.comment-author-avatar {
  flex-shrink: 0;
}

.comment-author-avatar img {
  border-radius: 50%;
  width: 60px;
  height: 60px;
}

.comment-content-wrap {
  flex: 1;
  min-width: 0;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-xs);
  flex-wrap: wrap;
}

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

.comment-author-name a {
  color: var(--color-text-primary);
  text-decoration: none;
}

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

.comment-date {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.comment-text {
  color: var(--color-text-primary);
  line-height: 1.7;
  margin-bottom: var(--spacing-sm);
}

.comment-text p {
  margin: 0 0 1em 0;
}

.comment-text p:last-child {
  margin-bottom: 0;
}

.comment-reply a {
  display: inline-block;
  color: var(--color-accent);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: var(--font-weight-medium);
  padding: 4px 12px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.comment-reply a:hover {
  background: var(--color-bg-secondary);
  color: var(--color-accent-hover);
}

.comment-awaiting-moderation {
  background: var(--color-bg-secondary);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-sm);
}

/* Nested Comments */
.comment-list .children {
  list-style: none;
  margin: var(--spacing-md) 0 0 var(--spacing-lg);
  padding: 0;
}

/* Comment Navigation */
.comment-navigation {
  display: flex;
  justify-content: space-between;
  margin: var(--spacing-lg) 0;
  padding: var(--spacing-md) 0;
  border-top: 1px solid var(--color-border);
}

.comment-navigation a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
}

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

/* Comment Form */
.comment-respond {
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--color-border);
}

.comment-reply-title {
  font-size: 1.5rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-md);
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.comment-form p {
  margin: 0;
}

.comment-form label {
  display: block;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-xs);
}

.comment-form .required {
  color: var(--color-accent);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  font-family: var(--font-primary);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.dark-mode .comment-form input[type="text"],
.dark-mode .comment-form input[type="email"],
.dark-mode .comment-form input[type="url"],
.dark-mode .comment-form textarea {
  background: var(--color-bg-secondary);
  border-color: rgba(255, 255, 255, 0.1);
}

.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

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

.submit-button {
  align-self: flex-start;
  padding: 12px 32px;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all 0.2s ease;
}

.submit-button:hover {
  background: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.submit-button:active {
  transform: translateY(0);
}

.no-comments {
  padding: var(--spacing-md);
  background: var(--color-bg-secondary);
  border-radius: 8px;
  color: var(--color-text-secondary);
  text-align: center;
}

/* Mobile Comments */
@media (max-width: 768px) {
  .comments-area {
    padding: var(--spacing-md);
  }

  .comments-title {
    font-size: 1.5rem;
  }

  .comment-body {
    gap: var(--spacing-sm);
  }

  .comment-author-avatar img {
    width: 40px;
    height: 40px;
  }

  .comment-list .children {
    margin-left: var(--spacing-md);
  }

  .comment-reply-title {
    font-size: 1.25rem;
  }
}

/* Widget Areas */
.widget {
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(var(--glass-blur));
  border-radius: 16px;
  border: 1px solid var(--glass-border);
}

.dark-mode .widget {
  background: rgba(29, 29, 31, 0.7);
  border-color: rgba(255, 255, 255, 0.1);
}

.widget-title {
  font-size: 1.125rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-sm);
  padding-bottom: var(--spacing-xs);
  border-bottom: 1px solid var(--color-border);
}

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

.widget li {
  padding: var(--spacing-xs) 0;
  border-bottom: 1px solid var(--color-border);
}

.widget li:last-child {
  border-bottom: none;
}

.widget a {
  color: var(--color-text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* Footer Widgets */
.footer-widget {
  margin-bottom: var(--spacing-md);
}

.footer-widget-title {
  font-size: 1rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-sm);
}

/* ============================================
   ARTICLE ACTIONS BAR & COMMENTS OVERLAY
   ============================================ */

/* Article Actions Bar (Share, Copy, Comments) */
.article-actions-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-xl);
  padding: var(--spacing-md) 0;
  border-top: 1px solid var(--color-glass-border);
  flex-wrap: wrap;
}

.article-action-button {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--color-glass-bg);
  backdrop-filter: var(--blur-strength);
  -webkit-backdrop-filter: var(--blur-strength);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--border-radius-lg);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.875rem;
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

.article-action-button:hover {
  background: var(--color-glass-bg-hover);
  border-color: var(--color-text-tertiary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.article-action-button:active {
  transform: translateY(0);
}

.article-action-button svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Copy Link Notification */
.copy-notification {
  position: fixed;
  bottom: var(--spacing-lg);
  right: var(--spacing-lg);
  padding: var(--spacing-md) var(--spacing-lg);
  /* Liquid glass styling */
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  color: var(--color-text-primary);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--border-radius-lg);
  font-size: 0.875rem;
  font-weight: var(--font-weight-semibold);
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: all var(--transition-standard);
  z-index: 10001;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12),
              0 2px 8px rgba(0, 0, 0, 0.08),
              0 1px 0 rgba(255, 255, 255, 0.9) inset;
  pointer-events: none;
}

.copy-notification.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.dark-mode .copy-notification {
  background: rgba(30, 30, 30, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  color: var(--color-text-primary);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4),
              0 2px 8px rgba(0, 0, 0, 0.3),
              0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

/* Comments Overlay Container */
.comments-sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-standard);
}

.comments-sidebar-overlay.is-open {
  pointer-events: auto;
  opacity: 1;
}

/* Backdrop */
.comments-overlay-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity var(--transition-standard);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.comments-sidebar-overlay.is-open .comments-overlay-backdrop {
  opacity: 1;
}

/* Sidebar Container - Glassmorphic liquid glass effect */
.comments-sidebar {
  position: absolute;
  top: 0;
  right: 0;
  width: 480px;
  max-width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  /* Glassmorphic background with blur */
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-left: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
  transform: translateX(100%);
  transition: transform var(--transition-standard);
  overflow: hidden;
  -webkit-transform: translateZ(0);
  isolation: isolate;
}

.dark-mode .comments-sidebar {
  background: rgba(29, 29, 31, 0.75);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.4);
}

.comments-sidebar-overlay.is-open .comments-sidebar {
  transform: translateX(0);
}

/* Mobile Drag Handle */
.comments-drag-handle {
  display: none; /* Hidden on desktop */
  padding: var(--spacing-sm) 0;
  text-align: center;
  cursor: grab;
  flex-shrink: 0;
}

.comments-drag-handle:active {
  cursor: grabbing;
}

.drag-handle-bar {
  width: 40px;
  height: 4px;
  background: var(--color-text-secondary);
  border-radius: 2px;
  margin: 0 auto;
  opacity: 0.4;
  transition: opacity var(--transition-fast);
}

.comments-drag-handle:hover .drag-handle-bar,
.comments-drag-handle:active .drag-handle-bar {
  opacity: 0.8;
}

/* Header */
.comments-sidebar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
  position: relative;
}

.comments-sidebar-title-wrapper {
  flex: 1;
  min-width: 0;
}

.comments-sidebar-title {
  font-size: 1.25rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin: 0 0 var(--spacing-xs) 0;
}

.comments-sidebar-title .count {
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-regular);
}

.comments-post-title {
  font-size: 0.875rem;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.comments-close-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius-lg);
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.comments-close-button:hover {
  background: var(--color-glass-bg-hover);
  color: var(--color-text-primary);
}

.comments-close-button svg {
  width: 20px;
  height: 20px;
}

/* Single Scrollable Content Area (Comments + Form) */
.comments-sidebar-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--spacing-md);
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
  /* Smooth scrolling on mobile */
  -webkit-overflow-scrolling: touch;
}

.comments-sidebar-content::-webkit-scrollbar {
  width: 8px;
}

.comments-sidebar-content::-webkit-scrollbar-track {
  background: transparent;
}

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

.comments-sidebar-content::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-tertiary);
}

/* Comment List */
.comment-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.comment-list > li {
  margin-bottom: var(--spacing-md);
}

/* Individual Sidebar Comment - Liquid Glass */
.sidebar-comment {
  padding: var(--spacing-md);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-radius: var(--border-radius-xl);
  border: 1px solid rgba(0, 0, 0, 0.08);
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04),
              0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.dark-mode .sidebar-comment {
  background: rgba(30, 30, 30, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3),
              0 1px 0 rgba(255, 255, 255, 0.05) inset;
}

.sidebar-comment:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08),
              0 1px 0 rgba(255, 255, 255, 0.95) inset;
  transform: translateY(-2px);
}

.dark-mode .sidebar-comment:hover {
  background: rgba(40, 40, 40, 0.7);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4),
              0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

.sidebar-comment-header {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}

.sidebar-comment-avatar img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2.5px solid var(--color-border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.sidebar-comment-meta {
  flex: 1;
  min-width: 0;
}

.sidebar-comment-author {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  font-size: 0.875rem;
  margin-bottom: 2px;
}

.sidebar-comment-author a {
  color: inherit;
  text-decoration: none;
}

.sidebar-comment-author a:hover {
  color: var(--color-accent);
}

.sidebar-comment-date {
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
  display: block;
}

.sidebar-comment-moderation {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-md);
  background: rgba(255, 193, 7, 0.1);
  border-radius: var(--border-radius-lg);
  font-size: 0.75rem;
  font-weight: var(--font-weight-medium);
  color: #ff9800;
  margin-bottom: var(--spacing-sm);
  border: 1.5px solid rgba(255, 193, 7, 0.3);
}

.sidebar-comment-moderation svg {
  width: 16px;
  height: 16px;
}

.sidebar-comment-content {
  color: var(--color-text-primary);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: var(--spacing-sm);
}

.sidebar-comment-content p:first-child {
  margin-top: 0;
}

.sidebar-comment-content p:last-child {
  margin-bottom: 0;
}

.sidebar-comment-content code {
  background: var(--color-glass-bg);
  padding: 2px 6px;
  border-radius: var(--border-radius-sm);
  font-size: 0.8125rem;
  font-family: 'Courier New', monospace;
}

.sidebar-comment-content pre {
  background: var(--color-bg-tertiary);
  padding: var(--spacing-sm);
  border-radius: var(--border-radius-sm);
  overflow-x: auto;
  border: 1px solid var(--color-border);
}

.sidebar-comment-content pre code {
  background: none;
  padding: 0;
}

.sidebar-comment-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.sidebar-comment-actions .comment-reply-link {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--border-radius-lg);
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.dark-mode .sidebar-comment-actions .comment-reply-link {
  background: rgba(40, 40, 40, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
}

.sidebar-comment-actions .comment-reply-link:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.dark-mode .sidebar-comment-actions .comment-reply-link:hover {
  background: rgba(50, 50, 50, 0.8);
  border-color: rgba(255, 255, 255, 0.2);
}

.sidebar-comment-actions .comment-reply-link svg {
  width: 14px;
  height: 14px;
}

/* Threaded Comments (Children) */
.comment-list .children {
  list-style: none;
  padding-left: var(--spacing-lg);
  margin-top: var(--spacing-md);
  border-left: 2px solid var(--color-glass-border);
}

.comment-list .children > li {
  margin-bottom: var(--spacing-md);
}

/* Comment Navigation */
.comment-navigation {
  display: flex;
  justify-content: space-between;
  padding: var(--spacing-md) 0;
  border-top: 1px solid var(--color-glass-border);
  margin-top: var(--spacing-md);
}

.comment-navigation a {
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius-md);
  transition: all var(--transition-fast);
}

.comment-navigation a:hover {
  background: var(--color-glass-bg-hover);
  color: var(--color-text-primary);
}

/* Comment Form (Inline with Comments) */
.comment-form-wrapper {
  margin-top: var(--spacing-sm);
  padding-top: var(--spacing-sm);
  border-top: 1px solid var(--color-border);
}

.comment-reply-title {
  font-size: 1rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin: 0 0 var(--spacing-md) 0;
}

.cancel-reply-link {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-left: var(--spacing-sm);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--spacing-xs);
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
}

.cancel-reply-link:hover {
  background: var(--color-glass-bg-hover);
  color: var(--color-text-primary);
}

/* Form Fields */
.comment-form-author,
.comment-form-email,
.comment-form-url {
  margin-bottom: var(--spacing-sm);
}

.comment-form-author label,
.comment-form-email label,
.comment-form-url label {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-xs);
}

.comment-form-author input,
.comment-form-email input,
.comment-form-url input {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-radius: var(--border-radius-lg);
  color: var(--color-text-primary);
  font-size: 0.875rem;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04) inset;
}

.dark-mode .comment-form-author input,
.dark-mode .comment-form-email input,
.dark-mode .comment-form-url input {
  background: rgba(30, 30, 30, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) inset;
}

.comment-form-author input:focus,
.comment-form-email input:focus,
.comment-form-url input:focus {
  outline: none;
  border-color: var(--color-accent);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15),
              0 2px 8px rgba(59, 130, 246, 0.2);
}

.dark-mode .comment-form-author input:focus,
.dark-mode .comment-form-email input:focus,
.dark-mode .comment-form-url input:focus {
  background: rgba(40, 40, 40, 0.8);
}

/* Comment Textarea with Toolbar */
.comment-form-comment {
  margin-bottom: var(--spacing-md);
}

.comment-form-toolbar {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-bottom: none;
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
  flex-wrap: wrap;
}

.dark-mode .comment-form-toolbar {
  background: rgba(30, 30, 30, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.toolbar-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  border-radius: var(--border-radius-md);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.toolbar-button:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--color-text-primary);
}

.dark-mode .toolbar-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.toolbar-button svg {
  width: 18px;
  height: 18px;
}

.markdown-hint {
  margin-left: auto;
  font-size: 0.6875rem;
  color: var(--color-text-tertiary);
  font-style: italic;
}

#comment {
  width: 100%;
  min-height: 150px;
  padding: var(--spacing-sm) var(--spacing-md);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-top: none;
  border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
  color: var(--color-text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04) inset;
}

.dark-mode #comment {
  background: rgba(30, 30, 30, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) inset;
}

#comment:focus {
  outline: none;
  border-color: var(--color-accent);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15),
              0 2px 8px rgba(59, 130, 246, 0.2);
}

.dark-mode #comment:focus {
  background: rgba(40, 40, 40, 0.8);
}

/* Comment Form Meta */
.comment-form-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--spacing-xs);
  padding: 0 var(--spacing-xs);
}

.char-count {
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
}

.preview-button {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--border-radius-lg);
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.dark-mode .preview-button {
  background: rgba(40, 40, 40, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.preview-button:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.dark-mode .preview-button:hover {
  background: rgba(50, 50, 50, 0.8);
  border-color: rgba(255, 255, 255, 0.2);
}

.preview-button svg {
  width: 14px;
  height: 14px;
}

/* Comment Preview */
.comment-preview {
  margin-top: var(--spacing-sm);
  padding: var(--spacing-md);
  background: white;
  border: 1.5px solid var(--color-border);
  border-radius: var(--border-radius-lg);
}

.dark-mode .comment-preview {
  background: var(--color-bg-secondary);
}

.preview-label {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--spacing-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.preview-content {
  color: var(--color-text-primary);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* Submit Button - Liquid Glass */
.submit-button {
  width: 100%;
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: var(--border-radius-xl);
  font-size: 0.9375rem;
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: var(--spacing-md);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25),
              0 1px 0 rgba(255, 255, 255, 0.2) inset;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.submit-button:hover {
  background: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35),
              0 1px 0 rgba(255, 255, 255, 0.3) inset;
}

.submit-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.submit-button:active {
  transform: translateY(0);
}

/* Comments Closed Notice */
.comments-closed-notice {
  padding: var(--spacing-lg);
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .comments-sidebar {
    width: 100%;
    border-left: none;
    border-top-left-radius: var(--border-radius-xl);
    border-top-right-radius: var(--border-radius-xl);
  }

  /* Show drag handle on mobile */
  .comments-drag-handle {
    display: block;
  }

  .comments-trigger-button {
    bottom: var(--spacing-md);
    right: var(--spacing-md);
    padding: var(--spacing-sm);
  }

  .comments-trigger-button .comments-count {
    font-size: 0.8125rem;
  }

  .comments-sidebar-header {
    padding: var(--spacing-sm) var(--spacing-md);
  }

  .comments-sidebar-title {
    font-size: 1.125rem;
  }

  .comments-sidebar-content {
    padding: var(--spacing-sm);
  }

  .comment-form-wrapper {
    padding: var(--spacing-sm);
    margin-top: var(--spacing-xs);
    padding-top: var(--spacing-xs);
  }

  .comment-list .children {
    padding-left: var(--spacing-sm);
    margin-top: var(--spacing-sm);
  }

  /* Compact comment spacing on mobile */
  .comment-list > li {
    margin-bottom: var(--spacing-sm);
  }

  .sidebar-comment {
    padding: var(--spacing-sm);
    border-radius: 12px;
  }

  .sidebar-comment-header {
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-xs);
  }

  .sidebar-comment-avatar img {
    width: 36px;
    height: 36px;
    border: 2px solid var(--color-border);
  }

  .sidebar-comment-author {
    font-size: 0.8125rem;
  }

  .sidebar-comment-date {
    font-size: 0.6875rem;
  }

  .sidebar-comment-content {
    font-size: 0.8125rem;
    line-height: 1.5;
    margin-bottom: var(--spacing-xs);
  }

  .sidebar-comment-actions {
    gap: var(--spacing-xs);
  }

  .sidebar-comment-actions .comment-reply-link {
    padding: 4px var(--spacing-xs);
    font-size: 0.75rem;
    border-radius: 8px;
  }

  /* Form field spacing on mobile */
  .comment-form-author,
  .comment-form-email,
  .comment-form-url {
    margin-bottom: var(--spacing-xs);
  }

  .comment-form-author input,
  .comment-form-email input,
  .comment-form-url input {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.8125rem;
    border-radius: 10px;
  }

  .comment-form-toolbar {
    padding: 4px var(--spacing-xs);
    gap: 4px;
    border-radius: 10px 10px 0 0;
  }

  .toolbar-button {
    width: 32px;
    height: 32px;
    border-radius: 6px;
  }

  .toolbar-button svg {
    width: 16px;
    height: 16px;
  }

  .markdown-hint {
    font-size: 0.625rem;
  }

  #comment {
    min-height: 120px;
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.8125rem;
    border-radius: 0 0 10px 10px;
  }

  .comment-form-meta {
    margin-top: 4px;
  }

  .char-count,
  .preview-button {
    font-size: 0.6875rem;
  }

  .preview-button {
    padding: 4px var(--spacing-xs);
    border-radius: 8px;
  }

  .preview-button svg {
    width: 12px;
    height: 12px;
  }

  .comment-preview {
    margin-top: var(--spacing-xs);
    padding: var(--spacing-sm);
    border-radius: 10px;
  }

  .submit-button {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.875rem;
    margin-top: var(--spacing-sm);
    border-radius: 12px;
  }

  .comment-reply-title {
    font-size: 0.9375rem;
    margin-bottom: var(--spacing-sm);
  }
}

/* Accessibility Settings Support */

/* Dyslexia-Friendly Font */
.a11y-dyslexia .comments-sidebar,
.a11y-dyslexia .sidebar-comment,
.a11y-dyslexia .comment-form-wrapper {
  font-family: 'Atkinson Hyperlegible', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Increased Line Height */
.a11y-line-height .sidebar-comment-content,
.a11y-line-height #comment,
.a11y-line-height .preview-content {
  line-height: 2 !important;
}

/* Increased Letter Spacing */
.a11y-letter-spacing .sidebar-comment-content,
.a11y-letter-spacing #comment,
.a11y-letter-spacing .preview-content {
  letter-spacing: 0.05em !important;
}

/* High Contrast Mode */
.a11y-contrast .comments-sidebar {
  background: var(--color-bg-primary) !important;
  border-left: 2px solid var(--color-text-primary);
}

.a11y-contrast .sidebar-comment {
  background: var(--color-bg-secondary);
  border: 2px solid var(--color-text-secondary);
}

.a11y-contrast .article-action-button {
  background: var(--color-bg-secondary);
  border: 2px solid var(--color-text-primary);
}

/* Comment Notification */
.comment-notification {
  position: fixed;
  bottom: var(--spacing-lg);
  right: var(--spacing-lg);
  padding: var(--spacing-md) var(--spacing-lg);
  background: rgba(34, 197, 94, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: white;
  border-radius: var(--border-radius-xl);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2),
              0 1px 0 rgba(255, 255, 255, 0.3) inset;
  font-weight: var(--font-weight-medium);
  font-size: 0.875rem;
  z-index: 10000;
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition-standard);
  pointer-events: none;
}

.comment-notification.show {
  opacity: 1;
  transform: translateY(0);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .comments-sidebar-overlay,
  .comments-sidebar,
  .comments-overlay-backdrop,
  .copy-notification,
  .comment-notification {
    transition: none;
  }

  .article-action-button:hover,
  .sidebar-comment:hover,
  .preview-button:hover,
  .comment-reply-link:hover {
    transform: none;
  }
}
