:root {
  /* Color Palette - Blue/Gold Theme */
  --primary-red: #35576c;
  --secondary-red: #284b69;
  --bg: #f5f7fa;
  --surface: rgba(255, 255, 255, 0.95); /* High opacity for readability over BG */
  --card: rgba(255, 255, 255, 0.95);
  --text: #1f2937;
  --text-heading: #171a3c;
  --muted: #5b6b7a;
  --border: #d8e0e6;
  
  --accent: #e3c06d;
  --accent-hover: #fad492;
  --accent-light: rgba(250, 212, 146, 0.25);

  /* Shadows & Radius */
  --radius: 4px; /* Sharper radius for academic feel */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  /* Typography */
  --font-heading: 'Merriweather', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'SF Mono', 'Menlo', monospace;

  /* Chat Colors */
  --chat-bg-user: #35576c;
  --chat-text-user: #ffffff;
  --chat-bg-ai: #f1f5f9;
  --chat-text-ai: #333333;
}

:root[data-theme='dark'] {
  --bg: #141826;
  --surface: rgba(21, 26, 44, 0.95);
  --card: rgba(23, 28, 48, 0.95);
  --text: #e6edf5;
  --text-heading: #fad492;
  --muted: #b6c0cc;
  --border: rgba(250, 212, 146, 0.2);
  
  --accent: #fad492;
  --accent-hover: #e3c06d;
  --accent-light: rgba(250, 212, 146, 0.2);
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);

  --chat-bg-user: #284b69;
  --chat-text-user: #ffffff;
  --chat-bg-ai: rgba(23, 28, 48, 0.95);
  --chat-text-ai: #e6edf5;
}

/* Base Reset & Typography */
* { box-sizing: border-box; margin: 0; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Dynamic Background Container */
#site-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.85; /* User requested 85% opacity */
}

/* White overlay on top of background image to ensure readability */
#site-background::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.15); /* Light overlay for readability */
}

:root[data-theme='dark'] #site-background::after {
  background: rgba(0, 0, 0, 0.25);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-heading);
  font-weight: 700;
  line-height: 1.3;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-hover);
}

/* Layout */
.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-body {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: grid;
  grid-template-columns: minmax(0, 3fr) 300px;
  gap: 3rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #192d50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 3px solid var(--accent);
  box-shadow: var(--shadow-sm);
}

.site-nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.5rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}

.brand-logo {
  height: 50px;
  width: auto;
  border-radius: 4px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-weight: 700;
  font-size: 1.2rem;
  color: #ffffff;
  line-height: 1.2;
}

:root[data-theme='dark'] .brand-title {
  color: #ffffff;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
  height: 100%;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.nav-links a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

:root[data-theme='dark'] .nav-links a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Mobile Toggle */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-nav-toggle .bar {
  display: block;
  width: 24px;
  height: 2px;
  background: rgba(255, 255, 255, 0.85);
  margin: 5px 0;
  transition: 0.3s;
}

/* Sidebar */
.site-sidebar {
  position: sticky;
  top: 6rem; /* Header height + gap */
  height: fit-content;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.profile-card {
  text-align: center;
}

.avatar-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 2.5rem;
  font-weight: 700;
  border: 2px solid var(--primary-red);
}

.profile-info h3 {
  margin-bottom: 0.25rem;
  font-size: 1.25rem;
}

.profile-info .role {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.profile-info .affiliation {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin: 1rem 0;
}

.tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
}

.btn-primary-outline {
  display: block;
  width: 100%;
  padding: 0.6rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
  background: transparent;
}

.btn-primary-outline:hover {
  background: var(--accent);
  color: white;
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-list li {
  margin-bottom: 0.5rem;
}

.nav-list a {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.nav-list a:hover {
  color: var(--accent);
  transform: translateX(4px);
  display: inline-block;
}

/* Search */
.search-wrapper {
  position: relative;
}

#search-input {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}

#search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
}

#results-container {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#results-container li {
  list-style: none;
}

#results-container a {
  display: block;
  font-size: 0.9rem;
  padding: 0.5rem;
  background: var(--bg);
  border-radius: 4px;
}

#results-container a:hover {
  background: var(--accent-light);
}

/* Main Content Components */
.hero-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem;
  text-align: center;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.hero-lead {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.hero-cta,
.hero-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.hero-cta {
  background: var(--accent);
  color: white;
}

.hero-cta:hover {
  background: var(--accent-hover);
  color: white;
  transform: translateY(-2px);
}

.hero-ghost {
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
}

.hero-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hero-statistics {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  color: var(--muted);
  display: block;
  margin-bottom: 0.5rem;
}

.stat-value {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.content-section {
  margin-bottom: 3rem;
  background: var(--card);
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.section-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.card-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.link-pill {
  font-size: 0.8rem;
  padding: 0.3rem 0.8rem;
  border-radius: 99px;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 500;
  border: 1px solid transparent;
}

.link-pill:hover {
  background: var(--accent);
  color: white;
}

.list-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.list-item:last-child {
  border-bottom: none;
}

.list-item-main {
  flex: 1;
  padding-right: 1rem;
}

.contact-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.section-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

/* Blog Post */
.post-header {
  margin-bottom: 2rem;
  text-align: center;
}

.post-header h1 {
  font-size: 2.25rem;
  margin: 0.5rem 0;
}

.post-body {
  font-size: 1.1rem;
  line-height: 1.8;
}

.post-body img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 1.5rem 0;
}

.post-divider {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: 3rem 0;
}

.post-navigation {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.nav-arrow {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.nav-arrow:hover {
  border-color: var(--accent);
  background: var(--bg);
}

.nav-arrow .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 1px;
  margin-bottom: 0.3rem;
}

.nav-arrow .title {
  font-weight: 600;
}

/* Footer */
.site-footer {
  background: #192d50;
  color: white;
  padding: 3rem 1.5rem;
  text-align: center;
  font-size: 0.9rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: underline;
}

.site-footer a:hover {
  color: white;
}

/* Code Blocks (Keep MacOS style but refined) */
pre[class*="language-"] {
  background: #1e293b !important;
  border-radius: var(--radius);
  margin: 1.5rem 0;
}

/* Mobile Responsive */
@media (max-width: 900px) {
  .site-body {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .site-sidebar {
    order: -1;
    position: relative;
    top: 0;
  }

  .mobile-nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #192d50;
    flex-direction: column;
    padding: 1rem;
    border-bottom: 3px solid var(--accent);
    box-shadow: var(--shadow-lg);
  }

  .nav-links.active {
    display: flex;
  }
  
  .nav-links a {
    width: 100%;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }
  
  .nav-actions {
    margin-top: 1rem;
    width: 100%;
    justify-content: flex-start;
  }
}

/* ==========================================================================
   Search Modal (Command Palette)
   ========================================================================== */
.search-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.search-modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.search-modal-content {
  width: 100%;
  max-width: 600px;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  overflow: hidden;
  transform: translateY(-10px);
  transition: transform 0.2s;
}

.search-modal-backdrop.open .search-modal-content {
  transform: translateY(0);
}

.search-modal-header {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  gap: 0.75rem;
}

.search-icon {
  font-size: 1.2rem;
  opacity: 0.5;
}

#modal-search-input {
  flex: 1;
  border: none;
  font-size: 1.1rem;
  color: var(--text-heading);
  background: transparent;
  outline: none;
}

.search-shortcut-hint {
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
}

.search-results-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 400px;
  overflow-y: auto;
}

.search-results-list li {
  border-bottom: 1px solid var(--border);
}

.search-results-list li:last-child {
  border-bottom: none;
}

.search-results-list a {
  display: block;
  padding: 1rem;
  color: var(--text);
  text-decoration: none;
}

.search-results-list a:hover,
.search-results-list a.selected {
  background: var(--bg);
  color: var(--accent);
}

/* ==========================================================================
   AI Chat Widget
   ========================================================================== */
.chat-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary-red);
  color: white;
  border: none;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: transform 0.2s, background 0.2s;
}

.chat-fab:hover {
  transform: scale(1.1);
  background: var(--secondary-red);
}

.chat-widget {
  position: fixed;
  bottom: 6rem;
  right: 2rem;
  width: 380px;
  height: 600px;
  max-height: 80vh;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 101;
  overflow: hidden;
  transition: opacity 0.2s, transform 0.2s;
  opacity: 1;
  transform: translateY(0);
}

.chat-widget.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.chat-header {
  padding: 1rem;
  background: #192d50;
  color: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

:root[data-theme='dark'] .chat-header {
  background: #192d50;
  color: #ffffff;
  border-bottom: 1px solid rgba(250, 212, 146, 0.25);
}

.chat-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: inherit;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.5);
}

.chat-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-action-btn,
.chat-close-btn {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: inherit;
  opacity: 0.8;
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 4px;
  transition: opacity 0.2s;
}

.chat-action-btn:hover,
.chat-close-btn:hover {
  opacity: 1;
  background: rgba(255,255,255,0.1);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--bg);
}

.message {
  display: flex;
  max-width: 85%;
}

.message.user-message {
  align-self: flex-end;
  justify-content: flex-end;
}

.message.ai-message {
  align-self: flex-start;
  justify-content: flex-start;
}

.message-content {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
}

.user-message .message-content {
  background: var(--chat-bg-user);
  color: var(--chat-text-user);
  border-bottom-right-radius: 2px;
}

.ai-message .message-content {
  background: white;
  color: #333;
  border-bottom-left-radius: 2px;
  border: 1px solid var(--border);
}

:root[data-theme='dark'] .ai-message .message-content {
  background: var(--chat-bg-ai);
  color: var(--chat-text-ai);
}

.chat-input-area {
  padding: 1rem;
  border-top: none;
  display: flex;
  gap: 0.5rem;
  background: var(--surface);
}

#chat-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.6rem 1rem;
  background: var(--bg);
  color: var(--text);
  resize: none;
  font-family: inherit;
  outline: none;
}

#chat-input:focus {
  border-color: var(--accent);
}

.chat-send-btn {
  background: var(--primary-red);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background 0.2s;
}

.chat-send-btn:hover {
  background: var(--secondary-red);
}

/* Expanded Mode */
.chat-widget.expanded {
  width: 33vw;
  height: 80vh;
  min-width: 400px;
  max-width: 800px;
}

@media (max-width: 768px) {
  .chat-widget.expanded {
    width: 90vw;
    min-width: unset;
  }
}

/* Footer & Privacy Notice */
.chat-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.chat-privacy-notice {
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
  padding: 0 1rem 0.8rem;
  opacity: 0.8;
}

/* Settings Panel */
.chat-settings-panel {
  position: absolute;
  top: 60px; /* Below header */
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  backdrop-filter: blur(8px);
  z-index: 10;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s;
  overflow-y: auto;
}

.chat-settings-panel.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  width: 100%;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.auth-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
  color: var(--accent);
}

.auth-desc {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.auth-tabs {
  display: flex;
  background: var(--border);
  padding: 0.25rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.auth-panel {
  display: none;
  margin-bottom: 1.5rem;
}

.auth-panel.active {
  display: block;
}

.auth-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
}

.auth-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
}

.auth-note {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.5rem;
  text-align: left;
}

.auth-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  padding: 0.5rem 1rem;
}

.btn-text:hover {
  color: var(--text);
}

.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

/* Navbar Search */
.nav-search-wrapper {
  position: relative;
  margin-right: 1rem;
}

#nav-search-input {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  padding: 0.4rem 0.8rem;
  color: white;
  font-size: 0.9rem;
  width: 200px;
  transition: all 0.2s;
}

#nav-search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

#nav-search-input:focus {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--accent);
  outline: none;
  width: 240px;
}

.nav-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 0.5rem;
  padding: 0;
  list-style: none;
  box-shadow: var(--shadow-lg);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  display: none; /* Hidden by default */
}

/* SimpleJekyllSearch adds children li's */
.nav-search-results li {
  border-bottom: 1px solid var(--border);
}

.nav-search-results li:last-child {
  border-bottom: none;
}

.nav-search-results a {
  display: block;
  padding: 0.8rem;
  color: var(--text);
  font-size: 0.9rem;
  text-decoration: none;
  text-transform: none; /* Override nav link uppercase */
}

.nav-search-results a:hover {
  background: var(--bg);
  color: var(--accent);
}

.nav-search-results .search-category {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 0.2rem;
}

/* Theme Toggle Updates */
.theme-toggle {
  background: transparent; /* Same as nav */
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2rem;
}

.theme-toggle span {
  transition: all 0.3s;
}

/* Default (Light Theme Active) - Sun matches text, Moon faded */
:root[data-theme='light'] .theme-toggle .icon-sun {
  color: var(--accent); /* Highlighted */
  opacity: 1;
}

:root[data-theme='light'] .theme-toggle .icon-moon {
  color: white;
  opacity: 0.3; /* Faded */
}

/* Dark Theme Active - Moon matches text, Sun faded */
:root[data-theme='dark'] .theme-toggle .icon-moon {
  color: var(--accent); /* Highlighted */
  opacity: 1;
}

:root[data-theme='dark'] .theme-toggle .icon-sun {
  color: white;
  opacity: 0.3; /* Faded */
}

/* Make sure the toggle button itself doesn't have background */
.nav-actions .theme-toggle {
    background: transparent;
}
