/* ============================================================================
   AliothPress Theme: Stellar Origin
   
   Concept: Precision and clarity of deep space — the Alioth star
   as a point of navigation through meaning and minimalist design.
   Dark mode by default. Light mode via .light-theme class on <html>.
   
   Architecture: ONLY overrides CSS custom properties from core.css.
   Components stay untouched — themes are fully portable.
   ============================================================================ */


/* ============================================================================
   DARK THEME (default)
   ============================================================================ */

:root {
  /* --- Brand: Stellar Indigo & Violet --- */
  --ap-color-primary:        #818cf8;
  --ap-color-primary-hover:  #a5b4fc;
  --ap-color-primary-light:  rgba(129, 140, 248, 0.15);
  --ap-color-primary-subtle: rgba(129, 140, 248, 0.06);
  
  --ap-color-accent:         #c084fc;
  --ap-color-accent-hover:   #d8b4fe;
  
  /* --- Semantic --- */
  --ap-color-success:  #34d399;
  --ap-color-warning:  #fbbf24;
  --ap-color-error:    #f87171;
  --ap-color-info:     #67e8f9;
  
  /* --- Surfaces: Deep Midnight --- */
  --ap-color-bg:            #0a0b10;
  --ap-color-surface:       #11131f;
  --ap-color-surface-alt:   #181b2a;
  --ap-color-border:        rgba(255, 255, 255, 0.06);
  --ap-color-border-strong: rgba(255, 255, 255, 0.12);
  
  /* --- Text --- */
  --ap-color-text:           #cbd5e1;
  --ap-color-text-secondary: #94a3b8;
  --ap-color-text-muted:     #6e7f96;
  --ap-color-text-inverse:   #0a0b10;
  --ap-color-link:           #818cf8;
  --ap-color-link-hover:     #a5b4fc;
  
  /* --- White stays white for contrast --- */
  --ap-color-white: #ffffff;
  --ap-color-black: #0a0b10;

  /* --- Header: Glassmorphism --- */
  --ap-header-bg:         rgba(10, 11, 16, 0.85);
  --ap-header-text:       #f8fafc;
  --ap-header-link:       rgba(248, 250, 252, 0.6);
  --ap-header-link-hover: #ffffff;

  /* --- Footer: Deep abyss --- */
  --ap-footer-bg:         #07080c;
  --ap-footer-text:       #6d7e96;
  --ap-footer-link:       #94a3b8;
  --ap-footer-link-hover: #818cf8;
  --ap-footer-border:     rgba(255, 255, 255, 0.06);
  
  /* --- Typography: Modern & Breathable --- */
  --ap-font-heading: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
  --ap-font-body:    'Inter', system-ui, -apple-system, sans-serif;
  --ap-font-mono:    'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  
  /* --- Shapes: Subtle, precise --- */
  --ap-radius-sm:  2px;
  --ap-radius-md:  6px;
  --ap-radius-lg:  12px;
  --ap-radius-xl:  16px;
  
  /* --- Shadows: Glow instead of drop --- */
  --ap-shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.4);
  --ap-shadow-md:  0 4px 12px rgba(0, 0, 0, 0.5);
  --ap-shadow-lg:  0 8px 24px rgba(0, 0, 0, 0.6);
  --ap-shadow-xl:  0 16px 48px rgba(0, 0, 0, 0.7);
  --ap-shadow-glow: 0 0 20px rgba(129, 140, 248, 0.15);
}

/* --- Glassmorphism for header backdrop --- */
.ap-header {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- Headings: bright white, breathing --- */
h1, h2, h3, h4, h5, h6 {
  color: #f8fafc;
  letter-spacing: -0.02em;
}

/* --- Prose code blocks: styled for dark bg --- */
.ap-prose pre {
  background: #0d0e15;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.ap-prose code {
  background: rgba(129, 140, 248, 0.1);
  color: #a5b4fc;
}

/* --- Blockquotes: indigo glow border --- */
.ap-prose blockquote {
  border-left-color: #818cf8;
  background: rgba(129, 140, 248, 0.05);
  color: #94a3b8;
}

/* --- Tables: subtle dark rows --- */
.ap-prose th {
  background: #11131f;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.ap-prose td {
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

.ap-prose tbody tr:hover {
  background: rgba(129, 140, 248, 0.04);
}

/* --- Post cards on dark: bright title --- */
.ap-post-card__title a {
  color: #f8fafc;
}

.ap-post-card__title a:hover {
  color: #818cf8;
}

.ap-post-card {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

/* --- Article title --- */
.ap-article__title {
  color: #f8fafc;
}

/* --- Language dropdown on dark --- */
.ap-lang__dropdown {
  background: #11131f;
  border-color: rgba(255, 255, 255, 0.08);
}

.ap-lang__option {
  color: #cbd5e1;
}

.ap-lang__option:hover {
  background: rgba(129, 140, 248, 0.08);
  color: #f8fafc;
}

.ap-lang__option.is-active {
  color: #818cf8;
  background: rgba(129, 140, 248, 0.12);
}

/* --- Mobile sidebar on dark --- */
.ap-sidebar {
  background: #0d0e15;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.ap-sidebar__header {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.ap-sidebar__title {
  color: #f8fafc;
}

.ap-sidebar__link {
  color: #cbd5e1;
}

.ap-sidebar__link:hover {
  background: rgba(129, 140, 248, 0.08);
  color: #818cf8;
}

.ap-sidebar__close {
  color: #94a3b8;
}

.ap-sidebar__close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
}

.ap-sidebar__lang-link {
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.1);
}

.ap-sidebar__lang-link:hover {
  border-color: #818cf8;
  color: #818cf8;
}

.ap-sidebar__lang-link.is-active {
  background: #818cf8;
  border-color: #818cf8;
  color: #ffffff;
}

/* --- Social icons on dark --- */
.ap-social-icon {
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
}

/* --- Footer nav --- */
.ap-footer__nav {
  border-top-color: rgba(255, 255, 255, 0.06);
}

/* --- Pagination on dark --- */
.ap-pagination a {
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.1);
}

.ap-pagination a:hover {
  color: #818cf8;
  border-color: #818cf8;
  background: rgba(129, 140, 248, 0.08);
}

/* --- Tags on dark --- */
.ap-tag {
  color: #a5b4fc;
  background: rgba(129, 140, 248, 0.1);
}

.ap-tag:hover {
  background: rgba(129, 140, 248, 0.18);
  color: #a5b4fc;
}

/* --- Buttons --- */
.ap-btn--primary {
  background: #818cf8;
  color: #0a0b10;
}

.ap-btn--primary:hover {
  background: #a5b4fc;
  color: #0a0b10;
}

.ap-btn--outline {
  color: #818cf8;
  border-color: rgba(129, 140, 248, 0.4);
}

.ap-btn--outline:hover {
  background: #818cf8;
  color: #0a0b10;
}

/* --- HR in prose --- */
.ap-prose hr {
  border-top-color: rgba(255, 255, 255, 0.06);
}

/* --- Focus visible: glow ring --- */
:focus-visible {
  outline: 2px solid #818cf8;
  outline-offset: 2px;
}


/* ============================================================================
   LIGHT THEME — "Stellar Daylight"
   
   Activated by adding class="light-theme" to <html>.
   Crisp, professional palette. Same indigo accents, higher contrast.
   WCAG contrast ratio ≥ 4.5:1 on all text.
   ============================================================================ */

.light-theme {
  /* --- Surfaces: cool white with faint blue undertone --- */
  --ap-color-bg:            #f8fafc;
  --ap-color-surface:       #f1f5f9;
  --ap-color-surface-alt:   #e2e8f0;
  --ap-color-border:        #e2e8f0;
  --ap-color-border-strong: #cbd5e1;
  
  /* --- Text: deep slate for readability --- */
  --ap-color-text:           #334155;
  --ap-color-text-secondary: #475569;
  --ap-color-text-muted:     #5d708c;
  --ap-color-text-inverse:   #f8fafc;
  
  /* --- Primary: slightly denser indigo for light bg --- */
  --ap-color-primary:        #585bf0;
  --ap-color-primary-hover:  #4f46e5;
  --ap-color-primary-light:  #e0e7ff;
  --ap-color-primary-subtle: #eef2ff;
  --ap-color-link:           #585bf0;
  --ap-color-link-hover:     #4f46e5;
  
  --ap-color-accent:         #7c3aed;
  --ap-color-accent-hover:   #6d28d9;
  
  /* --- Header --- */
  --ap-header-bg:         rgba(248, 250, 252, 0.9);
  --ap-header-text:       #1e293b;
  --ap-header-link:       #475569;
  --ap-header-link-hover: #1e293b;
  
  /* --- Footer --- */
  --ap-footer-bg:         #f1f5f9;
  --ap-footer-text:       #5e6d83;
  --ap-footer-link:       #5e6d83;
  --ap-footer-link-hover: #334155;
  --ap-footer-border:     #e2e8f0;
  
  /* --- Shadows: soft drop instead of glow --- */
  --ap-shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.04);
  --ap-shadow-md:  0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --ap-shadow-lg:  0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --ap-shadow-xl:  0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

/* --- Light theme overrides for elements that use hardcoded colors --- */

.light-theme .ap-header {
  border-bottom-color: #e2e8f0;
}

.light-theme h1,
.light-theme h2,
.light-theme h3,
.light-theme h4,
.light-theme h5,
.light-theme h6 {
  color: #1e293b;
}

.light-theme .ap-article__title {
  color: #1e293b;
}

.light-theme .ap-post-card__title a {
  color: #1e293b;
}

.light-theme .ap-post-card__title a:hover {
  color: #6366f1;
}

.light-theme .ap-post-card {
  border-bottom-color: #e2e8f0;
}

.light-theme .ap-prose pre {
  background: #1e293b;
  border-color: #334155;
}

.light-theme .ap-prose code {
  background: #eef2ff;
  color: #6366f1;
}

.light-theme .ap-prose blockquote {
  border-left-color: #6366f1;
  background: #eef2ff;
  color: #475569;
}

.light-theme .ap-prose th {
  background: #f1f5f9;
  border-bottom-color: #e2e8f0;
}

.light-theme .ap-prose td {
  border-bottom-color: #e2e8f0;
}

.light-theme .ap-prose tbody tr:hover {
  background: #f8fafc;
}

.light-theme .ap-prose hr {
  border-top-color: #e2e8f0;
}

.light-theme .ap-lang__trigger {
  color: #475569;
  border-color: #e2e8f0;
}

.light-theme .ap-lang__trigger:hover {
  color: #1e293b;
  border-color: #cbd5e1;
  background: rgba(0, 0, 0, 0.03);
}

.light-theme .ap-lang__dropdown {
  background: #ffffff;
  border-color: #e2e8f0;
}

.light-theme .ap-lang__option {
  color: #475569;
}

.light-theme .ap-lang__option:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.light-theme .ap-lang__option.is-active {
  color: #6366f1;
  background: #eef2ff;
}

.light-theme .ap-sidebar {
  background: #ffffff;
  border-left-color: #e2e8f0;
}

.light-theme .ap-sidebar__header {
  border-bottom-color: #e2e8f0;
}

.light-theme .ap-sidebar__title {
  color: #1e293b;
}

.light-theme .ap-sidebar__link {
  color: #334155;
}

.light-theme .ap-sidebar__link:hover {
  background: #f1f5f9;
  color: #6366f1;
}

.light-theme .ap-sidebar__close {
  color: #94a3b8;
}

.light-theme .ap-sidebar__close:hover {
  background: #f1f5f9;
  color: #334155;
}

.light-theme .ap-sidebar__lang-link {
  color: #475569;
  border-color: #e2e8f0;
}

.light-theme .ap-sidebar__lang-link:hover {
  border-color: #6366f1;
  color: #6366f1;
}

.light-theme .ap-sidebar__lang-link.is-active {
  background: #6366f1;
  border-color: #6366f1;
  color: #ffffff;
}

.light-theme .ap-social-icon {
  background: #f1f5f9;
  color: #64748b;
}

.light-theme .ap-footer__nav {
  border-top-color: #e2e8f0;
}

.light-theme .ap-pagination a {
  color: #475569;
  border-color: #e2e8f0;
}

.light-theme .ap-pagination a:hover {
  color: #6366f1;
  border-color: #6366f1;
  background: #eef2ff;
}

.light-theme .ap-tag {
  color: #6366f1;
  background: #eef2ff;
}

.light-theme .ap-tag:hover {
  background: #e0e7ff;
  color: #6366f1;
}

.light-theme .ap-btn--primary {
  background: #6366f1;
  color: #ffffff;
}

.light-theme .ap-btn--primary:hover {
  background: #4f46e5;
  color: #ffffff;
}

.light-theme .ap-btn--outline {
  color: #6366f1;
  border-color: #6366f1;
}

.light-theme .ap-btn--outline:hover {
  background: #6366f1;
  color: #ffffff;
}

.light-theme .ap-hamburger__line {
  background: #334155;
}

.light-theme .ap-hamburger:hover {
  background: rgba(0, 0, 0, 0.05);
}

.light-theme :focus-visible {
  outline-color: #6366f1;
}
