/* Theme system using CSS variables */
:root {
  /* Dark theme colors (default) */
  --background: #1d2021;
  --foreground: #ebdbb2;
  --accent: #8ec07c;
  --radius: 0;
  --font-size: 1rem;
  --line-height: 1.54em;
  --font-family: "LINESeedTW", "Fira Code", "JetBrains Mono", Monaco, Consolas, "Ubuntu Mono", monospace;
}

/* Light theme colors */
[data-theme="light"] {
  --background: #ffffff;
  --foreground: #000000;
  --accent: #000000;
}

/* Desktop language selector dropdown width adjustment */
.menu--desktop.menu--language-selector .menu__dropdown {
  width: max-content;
  white-space: nowrap;
}

.menu--desktop.menu--language-selector .menu__dropdown > li a {
  white-space: nowrap;
  padding: 5px 10px;
}

/* Mobile language selector styles */
.menu--mobile-language {
  display: none;
}

@media (max-width: 684px) {
  .menu--mobile-language {
    display: flex;
  }
  
  .menu--mobile-language .menu__trigger {
    display: block;
    color: var(--accent);
    border: 2px solid;
    margin-left: 10px;
    height: 100%;
    padding: 3px 8px;
    margin-bottom: 0 !important;
    position: relative;
    cursor: pointer;
  }
  
  .menu--mobile-language .menu__dropdown {
    left: auto;
    right: 0;
    width: max-content;
    white-space: nowrap;
  }
  
  .menu--mobile-language .menu__dropdown > li a {
    white-space: nowrap;
    padding: 5px 10px;
  }
  
  /* Hide desktop language selector on mobile */
  .menu--desktop.menu--language-selector {
    display: none;
  }
}

/* Theme switcher styles */
.theme-switcher {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
  cursor: pointer;
  padding: 3px 8px;
  margin-left: 5px;
  margin-right: 5px;
  font-size: 16px;
  line-height: 1;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  min-width: 32px;
  height: 32px;
}

.theme-switcher:hover {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
}

.theme-switcher:focus {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

.theme-switcher__icon {
  display: inline-block;
  transition: opacity 0.2s ease;
}

.theme-switcher__icon--light {
  display: none;
}

.theme-switcher[data-theme="dark"] .theme-switcher__icon--dark {
  display: none;
}

.theme-switcher[data-theme="dark"] .theme-switcher__icon--light {
  display: inline-block;
}

@media (max-width: 684px) {
  .theme-switcher {
    margin-left: 10px;
    margin-right: 0;
  }
}

/* Code and pre tag font-family override */
code, kbd, pre {
  font-family: "Fira Code", "LINESeedTW", "JetBrains Mono", Monaco, Consolas, "Ubuntu Mono", monospace !important;
}