:root {
  --bg-page: #faf9f6;
  --bg-surface: #ffffff;
  --bg-subtle: #f2f1ec;

  --text-color: #24292f;
  --text-strong: #0d1117;
  --text-muted: #57606a;

  --border-color: #e5e5df;
  --border-subtle: #eeeee8;

  --link-color: #1a56db;
  --link-underline: #bfd5ff;
  --link-hover-color: #0c3da8;

  --accent-color: #2563eb;
  --quote-bg: #f5f4ef;
  --quote-border: #94a3b8;

  --code-bg: #f0efe9;
  --code-block-bg: #f6f5f0;
  --code-text: #8b1e2d;

  --grid-line: rgba(165, 170, 149, 0.1);
  --grid-glow: transparent;

  --container-width: 760px;
  --wide-container-width: 980px;
}

:root[data-theme="dark"] {
  --bg-page: #141618;
  --bg-surface: #1b1e22;
  --bg-subtle: #23272e;

  --text-color: #d1d5db;
  --text-strong: #f3f4f6;
  --text-muted: #9ca3af;

  --border-color: #2d333b;
  --border-subtle: #22262d;

  --link-color: #60a5fa;
  --link-underline: #1e3a8a;
  --link-hover-color: #93c5fd;

  --accent-color: #3b82f6;
  --quote-bg: #1a1d21;
  --quote-border: #475569;

  --code-bg: #1f2328;
  --code-block-bg: #181b1f;
  --code-text: #ff7b86;

  --grid-line: rgba(150, 165, 184, 0.08);
  --grid-glow: rgba(65, 85, 110, 0.14);
}

:root[data-theme="blue"] {
  --bg-page: #080f1c;
  --bg-surface: #0e1b30;
  --bg-subtle: #172a46;

  --text-color: #e3efff;
  --text-strong: #f7fbff;
  --text-muted: #aec4e2;

  --border-color: #31547d;
  --border-subtle: #203b5d;

  --link-color: #66d9ff;
  --link-underline: #287aa5;
  --link-hover-color: #b1f1ff;

  --accent-color: #27baff;
  --quote-bg: #10223a;
  --quote-border: #3ea9ef;

  --code-bg: #172a46;
  --code-block-bg: #0a1424;
  --code-text: #83dfff;

  --grid-line: rgba(88, 164, 226, 0.07);
  --grid-glow: rgba(35, 105, 168, 0.2);
}

/* Box Sizing & Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  background-color: var(--bg-page);
  color: var(--text-color);
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-page);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    radial-gradient(ellipse at 50% -20%, var(--grid-glow), transparent 60%);
  background-size: 32px 32px, 32px 32px, auto;
  margin: 0;
  padding: 0 1.5rem 4rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Page Layout Constraints */
header,
main,
footer {
  width: 100%;
  max-width: var(--container-width);
}

/* Expand container width when two-column workshop layout is present */
body:has(.workshop-layout) header,
body:has(.workshop-layout) main,
body:has(.workshop-layout) footer {
  max-width: var(--wide-container-width);
}

main {
  flex: 1;
}

/* Responsive Media & Images */
img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  margin: 1.75rem 0;
  border: 1px solid var(--border-color);
}

/* ------------------------------------------------------------------------
   Workshop Two-Column Layout (Sidebar + Content)
   ------------------------------------------------------------------------ */
.workshop-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 2.75rem;
  align-items: start;
  margin-top: 1rem;
}

.workshop-sidebar {
  position: sticky;
  top: 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-surface);
}

.workshop-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.workshop-sidebar a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.workshop-sidebar a:hover {
  color: var(--text-strong);
  background: var(--bg-subtle);
  text-decoration: none;
}

@media (max-width: 768px) {
  body {
    padding: 0 1rem 3rem;
  }

  .workshop-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .workshop-sidebar {
    position: static;
  }
}
