/* 
 * CSS theme for moonshadow.dev
 * Adapted from Text-Only Theme for BSSG
 * Enhanced with accessibility and compatibility improvements.
 */

/* Reduced motion support */
@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;
  }
}

/* CSS Variables for consistency */
:root {
  /* Colors */
  --color-as: #a6e3a1;
  --color-background: #11111b;
  --color-border: #313244;
  --color-code-bg: #1e1e2e;
  --color-code-fg: #fab387;
  --color-container-bg: #181825;
  --color-link-visited: #f38ba8;
  --color-link: #f38ba8;
  --color-table-alt-even: #1e1e2e;
  --color-table-alt-odd: #181825;
  --color-table-hover: #313244;
  --color-text-light: #a6adc8;
  --color-text: #cdd6f4;
  --color-th: #f38ba8;

  /* Typography */
  --font-family-mono: monospace;
  --font-family-system: monospace;
  --font-size-h1: 1.8em;
  --font-size-h2: 1.5em;
  --font-size-h3: 1.3em;
  --font-size-normal: 110%;
  --font-size-small: 95%;
  --line-height-normal: 1.6;
  --line-height-tight: 1.2;

  /* Spacing */
  --spacing-xs: 0.5em;
  --spacing-sm: 1em;
  --spacing-md: 1.5em;
  --spacing-lg: 2em;

  /* Sizing */
  --max-width: 90ch;
}

/* Light mode variables */
@media (prefers-color-scheme: light) {
  :root {
    --color-as: #40a02b;
    --color-background: #dce0e8;
    --color-border: #bcc0cc;
    --color-code-bg: #eff1f5;
    --color-code-fg: #fe640b;
    --color-container-bg: #e6e9ef;
    --color-link-visited: #1e66f5;
    --color-link: #1e66f5;
    --color-table-alt-even: #eff1f5;
    --color-table-alt-odd: #e6e9ef;
    --color-table-hover: #ccd0da;
    --color-text-light: #6c6f85;
    --color-text: #4c4f69;
    --color-th: #1e66f5;
  }
}

/* Dark mode variables */
@media (prefers-color-scheme: dark) {
  :root {
    --color-as: #a6e3a1;
    --color-background: #11111b;
    --color-border: #313244;
    --color-code-bg: #1e1e2e;
    --color-code-fg: #fab387;
    --color-container-bg: #181825;
    --color-link-visited: #f38ba8;
    --color-link: #f38ba8;
    --color-table-alt-even: #1e1e2e;
    --color-table-alt-odd: #181825;
    --color-table-hover: #313244;
    --color-text-light: #a6adc8;
    --color-text: #cdd6f4;
    --color-th: #f38ba8;
  }
}

/* Base elements with minimal styling */
body {
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-family-system);
  font-size: var(--font-size-normal);
  line-height: var(--line-height-normal);
  margin: 0 auto;
  max-width: var(--max-width);
  padding: var(--spacing-sm);
}

/* Very simple container */
.container {
  background-color: var(--color-container-bg);
  border-radius: 16px;
  border: 1px solid var(--color-border);
  margin: 0 auto;
  padding: 1em 1em 1em 1em;
}

/* Simple header without styling */
header {
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--spacing-lg);
  text-align: center;
}

.as {
  color: var(--color-as);
}

/* Simple site title */
.site-title {
  font-size: var(--font-size-h1);
  margin: 0;
}

.site-title a {
  text-decoration: none;
}

.site-title a:hover {
  text-decoration: underline;
}

/* Center the accessibility note */
.accessibility {
  text-align: center;
}

/* Navigation */
.breadcrumb {
  padding: 0 0.5rem;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: end;
}

.breadcrumb li:not(:last-child)::after {
  display: inline-block;
  margin: 0 0.25rem;
  content: "→";
}

/* Simple content area */
main {
  margin-bottom: var(--spacing-lg);
}

/* Clean typography - minimal styling */
h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: var(--line-height-tight);
  margin: var(--spacing-md) 0 var(--spacing-xs);
}

h1 {
  font-size: var(--font-size-h1);
}

h2 {
  font-size: var(--font-size-h2);
}

h3 {
  font-size: var(--font-size-h3);
}

p {
  margin: var(--spacing-sm) 0;
}

/* Simple link styling */
a {
  color: var(--color-link);
  text-decoration: none;
}

a:hover {
  color: var(--color-link);
  text-decoration: underline;
}

a:visited {
  color: var(--color-link-visited);
  text-decoration: none;
}

a:focus {
  outline-offset: 2px;
  outline: 2px solid var(--color-link);
  text-decoration: none;
}

/* Footer */
footer {
  border-top: 1px solid var(--color-border);
  color: var(--color-text-light);
  font-size: var(--font-size-small);
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-sm);
  text-align: center;
}

/* Definition lists */
dt {
  font-weight: bold;
}

dd {
  margin: 0;
  padding: 1em;
}

/* Tables */
table {
  border-radius: 16px;
  width: 100%;
}

th {
  background-color: var(--color-th);
  color: var(--color-background);
  padding-bottom: 12px;
  padding-top: 12px;
  text-align: left;
}

table,
th,
td {
  border-collapse: collapse;
  border: 1px solid var(--color-border);
  padding: 5px;
}

th,
td {
  text-align: left;
}

tr:nth-child(even) {
  background-color: var(--color-table-alt-even);
}

tr:nth-child(odd) {
  background-color: var(--color-table-alt-odd);
}

tr:hover {
  background-color: var(--color-table-hover);
}

/* Simple horizontal rule */
hr {
  border-top: 1px solid var(--color-border);
  border: 0;
  margin: var(--spacing-lg) 0;
}

/* Make device-type span elements bold */
.device-type {
  font-weight: bold;
}

blockquote {
  border-color: var(--color-border);
}

pre {
  padding: 0.5em 1rem;
  box-shadow: 0px 0px 1px 0px var(--color-border);
}

/* Bare minimum responsive adjustments */
@media (max-width: 600px) {
  body {
    padding: var(--spacing-xs);
  }

  .site-title {
    font-size: var(--font-size-h3);
  }

  h1 {
    font-size: var(--font-size-h2);
  }

  h2 {
    font-size: var(--font-size-h3);
  }

  h3 {
    font-size: var(--font-size-normal);
  }
}
