/* Root variables for light mode (default) */
:root {
  --q-primary: #fff;
  --q-secondary: #E77500;
  --q-font-family-base: 'Arial', sans-serif;
  --q-heading-font-family: 'Georgia', serif;
  --q-text-color: #222222;
  --q-background-color: #fff;
  --q-accent: #222;
  --q-accent-light: #fff4e6;
  --q-border-radius: 8px;

  --background: #333;
  --highlight: #39AC4C;
}

/* Dark mode variables */
@media (prefers-color-scheme: dark) {
  :root {
    --q-primary: #121212;
    --q-secondary: #FF7F00;
    --q-font-family-base: 'Arial', sans-serif;
    --q-heading-font-family: 'Georgia', serif;
    --q-text-color: #fff;
    --q-background-color: #121212;
    --q-accent: #b3b3b3;
    --q-accent-light: #333;

    --background: #121212;
    --highlight: #FF7F00;
  }
}

/* General body styles */
body {
  font-family: var(--q-font-family-base);
  color: var(--q-text-color);
  background-color: var(--q-background-color);
  margin: 0;
  padding: 0;
  transition: background-color 0.3s, color 0.3s;
}

/* Theme Switcher */
.theme-switch {
  --background: var(--q-background-color);
  --text: var(--q-text-color);
  width: 70px;
  height: 30px;
  background: var(--highlight);
  border-radius: 50px;
  position: relative;
  margin: 1rem;

  .switch {
    background: var(--background);
    width: 24px;
    height: 24px;
    border-radius: 100%;
    position: absolute;
    top: 3px;
    left: 4px;
    transition: 0.5s all ease;
  }
}

.light-theme {
  --background: #FFF;
  --text: #000;
  background: var(--background);
  
  .theme-switch {
    background: var(--text);
    
    .switch {
      transform: translateX(37px);
    }
  }
}

/* Navbar */
.navbar {
  background-color: var(--q-secondary);
  color: #fff;
  padding: 1rem 2rem;
  border-bottom: 3px solid var(--q-primary);
}

.navbar a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  margin-right: 1.5rem;
  transition: color 0.2s;
}

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

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--q-heading-font-family);
  color: var(--q-secondary);
  margin-top: 1.5em;
}

/* Links (default) */
a {
  color: var(--q-secondary);
  text-decoration: underline;
  transition: color 0.2s;
  text-underline-offset: 3px;
}

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

/* Fix for grey links in Quarto about section */
div.quarto-about-trestles .about-entity .about-link {
  color: var(--q-secondary) !important;
  text-decoration: none;
  border: solid 1px;
}

div.quarto-about-trestles .about-entity .about-link:hover {
  color: var(--q-accent) !important;
  text-decoration: underline;
}

div.quarto-about-marquee .about-link {
  color: var(--q-secondary) !important;
  text-decoration: none;
  border: solid 1px;
}

div.quarto-post a {
  color: var(--q-text-color) !important;
  text-decoration: none;
}

/* Buttons */
.button, button, input[type="submit"] {
  background-color: var(--q-secondary);
  color: #fff;
  border: none;
  border-radius: var(--q-border-radius);
  padding: 0.6em 1.2em;
  font-family: var(--q-font-family-base);
  font-size: 1em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.button:hover, button:hover, input[type="submit"]:hover {
  background-color: var(--q-primary);
  color: var(--q-secondary);
  border: 1px solid var(--q-secondary);
}

/* Card styles */
.card {
  background: var(--q-accent-light);
  border: 1px solid #eaeaea;
  border-radius: var(--q-border-radius);
  box-shadow: 0 2px 8px rgba(231, 117, 0, 0.08);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

/* Accent highlight */
.accent {
  background: var(--q-accent);
  color: var(--q-secondary);
  padding: 0.2em 0.6em;
  border-radius: var(--q-border-radius);
  font-weight: bold;
}

/* Table styles */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 1em;
}

th, td {
  border: 1px solid #ddd;
  padding: 0.75em;
  text-align: left;
}

th {
  background-color: var(--q-secondary);
  color: #fff;
  font-family: var(--q-heading-font-family);
}

tr:nth-child(even) {
  background-color: #f5f5f5;
}

/* Code blocks and inline code */
pre, code {
  background-color: #000 !important;
  color: #fff !important;
  font-family: 'Fira Mono', 'Consolas', 'Menlo', 'Monaco', monospace;
  border-radius: 6px;
  padding: 0.5em 0.75em;
  font-size: 1em;
}

pre {
  overflow-x: auto;
  margin: 1em 0;
}

code {
  padding: 0.15em 0.4em;
  font-size: 0.98em;
  border-radius: 4px;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .navbar {
    padding: 1rem;
  }
  .card {
    padding: 1rem;
  }
  th, td {
    padding: 0.5em;
  }
}
