/* Example 24: Combining Tokens — Day/Night Theme Styles
 *
 * The body class is set at build time to either theme-light or theme-dark
 * based on the time of day when SSI was run.
 */

/* Theme: light (AM builds) */
.theme-light {
  --bg: #ffffff;
  --bg-alt: #f5f5f5;
  --text: #1a1a1a;
  --text-muted: #555555;
  --accent: #d97706;
  --accent-fg: #ffffff;
  --border: #e0e0e0;
  --hero-bg: #fffbeb;
  --hero-border: #fcd34d;
  --card-bg: #ffffff;
}

/* Theme: dark (PM builds) */
.theme-dark {
  --bg: #1a1a1a;
  --bg-alt: #252525;
  --text: #f0f0f0;
  --text-muted: #aaaaaa;
  --accent: #818cf8;
  --accent-fg: #1a1a1a;
  --border: #333333;
  --hero-bg: #1e1b4b;
  --hero-border: #4338ca;
  --card-bg: #252525;
}

/* Base */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  transition: background 0.3s, color 0.3s;
}

/* Theme indicator — shows which theme was selected at build time */
.theme-indicator {
  padding: 0.4rem 1rem;
  border-radius: 4px;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 0.85rem;
  font-weight: bold;
}

.theme-light .theme-indicator::before {
  content: "Day Mode";
}

.theme-dark .theme-indicator::before {
  content: "Night Mode";
}

/* Header */
header {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav a {
  color: var(--accent);
  margin-right: 1.5rem;
  text-decoration: none;
}

nav a:hover {
  text-decoration: underline;
}

/* Main content */
main {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem;
}

h1 {
  color: var(--text);
  margin-top: 0;
}

h2 {
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}

section {
  margin-bottom: 2.5rem;
}

.intro {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* Hero blocks */
.hero {
  border-radius: 8px;
  padding: 2rem;
  margin: 1rem 0;
  background: var(--hero-bg);
  border: 2px solid var(--hero-border);
}

.hero h2 {
  border: none;
  margin-top: 0;
}

.hero-time {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Daily tip widget */
.daily-tip {
  background: var(--bg-alt);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 1.5rem;
  margin: 1rem 0;
}

.daily-tip h3 {
  margin-top: 0;
  color: var(--accent);
}

/* Cards */
.card {
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1rem 0;
  border: 1px solid var(--border);
  background: var(--card-bg);
}

.card h3 {
  margin-top: 0;
}

/* Greeting */
.greeting {
  font-size: 1.2rem;
  font-weight: bold;
  padding: 1rem 1.5rem;
  background: var(--bg-alt);
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* Build info */
footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 1rem 2rem;
  margin-top: 2rem;
}

.build-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.build-info code {
  background: var(--border);
  border-radius: 3px;
  padding: 0 0.3rem;
  font-size: 0.8rem;
}

/* Navigation between examples */
.examples-nav {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 1.5rem;
}

.examples-nav a {
  color: var(--accent);
  text-decoration: none;
}

.examples-nav a:hover {
  text-decoration: underline;
}

/* Code blocks (config display on index page) */
pre {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.5;
}

pre code {
  display: block;
  text-indent: 2ch;
}

.code-example {
  margin: 1rem 0;
}

/* Step-by-step trace block on crazy-town page */
.step-trace {
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}

.step-trace h3 {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.step-trace ol {
  margin: 0;
  padding-left: 1.5rem;
}

.step-trace li {
  margin: 0.5rem 0;
  line-height: 1.5;
}
