/* ============================================================
   Shared styles for all rendering-method comparison pages.
   Page-specific rules (chart elements, canvas layers, etc.)
   live in each page's own inline <style> block.
   ============================================================ */

@font-face {
  font-family: 'Arima';
  src: url('../lib/arima.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: sans-serif;
  background: #444465;
  color: #b8b8d8;
  padding: 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media (min-width: 600px) {
  body {
    padding: 2rem;
  }
}

.page-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 1.25rem;
  margin-bottom: 1.25rem;
}

h1 {
  margin-bottom: 0;
  font-size: 1.2rem;
  font-weight: 700;
  font-family: 'Arima', sans-serif;
  color: #f4be00;
  white-space: nowrap;
}

h1 a {
  color: #f4be00;
  text-decoration: underline;
}

h1 a:hover {
  color: #c49500;
  text-decoration: underline;
}

.page-nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.page-nav a {
  padding: 0.3rem 0.7rem;
  font-size: 0.85rem;
  border: 1.5px solid #e5ffff;
  border-radius: 4px;
  color: #e5ffff;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.page-nav a:hover {
  border-color: #f4be00;
  color: #f4be00;
}

.page-nav a.current {
  background: #f4be00;
  border-color: #f4be00;
  color: #0a0032;
  cursor: default;
  pointer-events: none;
}


.chart-container {
  background: #0a0032;
  height: 55vh;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  /* needed by pages whose chart layers are absolutely positioned */
  position: relative;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 1.25rem;
  align-items: center;
}

.controls-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.controls span {
  font-size: 0.85rem;
  color: #b8b8d8;
}

.btn {
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  border: 1.5px solid #e5ffff;
  border-radius: 4px;
  background: #2d2d52;
  color: #e5ffff;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn:hover {
  border-color: #f4be00;
  color: #f4be00;
}

.btn.active {
  background: #f4be00;
  border-color: #f4be00;
  color: #0a0032;
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---- Two-column layout on wide viewports -------------------------------- */

/* On narrow screens these are "transparent" — children flow as if the
   wrappers don't exist and the existing stacked layout is unchanged. */
.page-layout,
.left-col,
.right-col {
  display: contents;
}

@media (min-width: 1025px) {
  body {
    height: 100vh;
    overflow: hidden;
  }

  .page-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    gap: 2rem;
  }

  .left-col {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }

  /* chart fills remaining height of left column */
  .left-col .chart-container {
    flex: 1;
    height: auto;
  }

  .right-col {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
  }

  .right-col .code-panel {
    margin-top: 0;
  }
}

.code-panel {
  margin-top: 1.5rem;
  padding-bottom: 2.5rem;
}

.code-panel-explainer {
  font-size: 1rem;
  line-height: 1.6;
  color: #b8b8d8;
  margin-bottom: 1rem;
  max-width: 68ch;
}

.code-panel-label {
  font-size: 0.75rem;
  color: #8888a8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.6rem;
}

.code-panel-label code {
  font-size: 0.85em;
  text-transform: none;
  letter-spacing: 0;
  background: #2d2d52;
  color: #b8b8d8;
  border-radius: 3px;
  padding: 0.1em 0.35em;
}

.code-panel pre {
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  font-size: 0.78rem;
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre;
  font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}

/* let hljs tokens show through without adding a second background box */
.code-panel .hljs {
  background: transparent;
  padding: 0;
}

.github-link {
  font-size: 0.88rem;
  color: #8888a8;
  margin-top: 1.5rem;
}

.github-link a {
  color: #f4be00;
  text-decoration: none;
}

.github-link a:hover {
  text-decoration: underline;
}
