/* Shared style for the RayCrafter docs, matching the look of the software: sheets of warm paper
   with sepia ink, serif lettering and round "medallion" markers. */

/* The colours of the same names in raycrafter/palette.py. */
:root {
  color-scheme: light;  /* the software is light whatever the system setting, and so are the docs */
  --window: #eee0c2; --bar: #e7d5b0; --panel: #f4e8d0; --paper: #fbf4e4;
  --border: #c9b28a; --border-soft: #dccaa5; --canvas-border: #c3ab80;
  --text: #3b2f22; --text-secondary: #66553f;
  --accent: #4a6f86; --accent-dark: #35546a; --accent-tint: #e6dfc6; --warn: #b8521c; --warn-tint: #f3d9c8;
  --medallion: #f6ebd3; --medallion-chosen: #b3c2c2; --medallion-ring: #9a7f55;
  --serif: "EB Garamond", Baskerville, "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --shadow: 0 1px 2px rgba(59, 47, 34, 0.10), 0 6px 18px rgba(59, 47, 34, 0.08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--window); }
body { margin: 0; color: var(--text); font: 17.5px/1.58 var(--serif); }
::selection { background: var(--accent); color: var(--paper); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* The banner runs the full width of the window, like the software's context bar. */
header { max-width: 1160px; margin: 0 auto 24px; padding: 22px 16px 20px; background: var(--bar);
  box-shadow: 0 0 0 100vmax var(--bar), 0 1px 0 100vmax var(--border); clip-path: inset(0 -100vmax -1px); }
header .brand { display: flex; align-items: center; gap: 12px; }
/* The catalogue-lens medallion of the software's tool palette (raycrafter/gui/tool_icons.py). */
header .brand::before { content: ""; flex: none; width: 52px; height: 52px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Ccircle cx='24' cy='24' r='22.5' fill='%23f6ebd3' stroke='%239a7f55' stroke-width='1.1'/%3E%3Ccircle cx='24' cy='24' r='20.3' fill='none' stroke='%239a7f55' stroke-opacity='.43' stroke-width='.5'/%3E%3Cpath d='M9 24H39' stroke='%233b2f22' stroke-opacity='.47' stroke-width='.8' stroke-dasharray='4.8 2.4 .8 2.4'/%3E%3Cpath d='M24 9Q40 24 24 39Q8 24 24 9Z' fill='%2347718f' fill-opacity='.47' stroke='%233b2f22' stroke-width='1.7' stroke-linejoin='round'/%3E%3Cpath d='M24 9Q31 24 24 39' fill='none' stroke='%233b2f22' stroke-width='.9'/%3E%3C/svg%3E") center / contain no-repeat; }
header .brand b { font-size: 32px; font-weight: 600; line-height: 1.1; }
header .brand span { font-style: italic; font-size: 22px; color: var(--text-secondary); }
header .brand span::before { content: "·"; font-style: normal; margin-right: 10px; }
header p { color: var(--text-secondary); max-width: 70ch; margin: 8px 0 0; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; display: grid; grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px; }

/* The contents list, laid out like the tool palette: the current page sits on a framed tab. */
nav { position: sticky; top: 16px; align-self: start; max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--bar); border: 1px solid var(--border); border-radius: 8px; padding: 12px 8px; font-size: 16px;
  line-height: 1.35; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
nav b { display: block; font-size: 15px; font-weight: 400; font-style: italic; color: var(--text-secondary);
  padding: 0 10px; margin: 0 0 6px; }
nav b ~ b { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }
nav a { display: block; color: var(--text); text-decoration: none; padding: 5px 9px; border: 1px solid transparent;
  border-radius: 8px; }
nav a:hover { background: var(--panel); }
nav a.here { background: var(--panel); border-color: var(--border); font-weight: 600; }
nav .sub { margin: 3px 0 6px 12px; border-left: 1px solid var(--border); padding-left: 3px; }
nav .sub a { font-size: 14.5px; color: var(--text-secondary); padding: 2px 8px; }
nav .sub a:hover { color: var(--text); }

/* Groups in the contents list open and close. The arrow in the heading shows which. */
nav details { margin: 3px 0 4px 6px; }
nav details > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px;
  padding: 4px 9px; border: 1px solid transparent; border-radius: 8px; font-size: 15px; font-style: italic;
  color: var(--text-secondary); }
nav details > summary::-webkit-details-marker { display: none; }
nav details > summary::before { content: "\25B8"; flex: none; width: 10px; font-size: 11px; font-style: normal;
  color: var(--medallion-ring); }
nav details[open] > summary::before { content: "\25BE"; }
nav details > summary:hover { background: var(--panel); color: var(--text); }
nav details > summary:focus-visible { outline-offset: -2px; }
nav details > .sub { margin: 2px 0 4px 10px; }
nav details details { margin: 2px 0 2px 0; }
nav details details > summary { font-size: 14.5px; }

/* The page itself: one sheet of paper. */
main { min-width: 0; background: var(--paper); border: 1px solid var(--border); border-radius: 8px;
  padding: 18px 36px 48px; box-shadow: var(--shadow); }
a { color: var(--accent-dark); text-decoration-thickness: 1px; text-underline-offset: 2px;
  text-decoration-color: var(--medallion-ring); }
a:hover { text-decoration-color: currentColor; }
h2, h3 { font-weight: 600; line-height: 1.25; }
/* Section headings are ruled off, like the titles of the software's panels. */
h2 { font-size: 28px; margin: 46px 0 14px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
h3 { font-size: 20px; margin: 28px 0 4px; }
/* Text runs the full width of the sheet, the same as the pictures, so the two line up. */
li::marker { color: var(--medallion-ring); }
.lead { color: var(--text-secondary); font-size: 19.5px; }

/* Pictures are framed like the software's plot canvases, on a mount. */
figure { margin: 20px 0 24px; }
figure a { display: block; }
figure img { display: block; width: 100%; height: auto; padding: 5px; background: var(--panel);
  border: 1px solid var(--canvas-border); border-radius: 8px; box-shadow: var(--shadow); }
figure.small img { max-width: 490px; }
figcaption { font-size: 15.5px; font-style: italic; color: var(--text-secondary); margin-top: 8px; }

/* Numbered steps, each number in a medallion. */
.steps { counter-reset: s; padding: 0; list-style: none; }
.steps > li { counter-increment: s; position: relative; padding-left: 42px; margin: 14px 0; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: -1px; width: 30px; height: 30px;
  border-radius: 50%; background: var(--medallion); border: 1px solid var(--medallion-ring);
  box-shadow: inset 0 0 0 2px var(--medallion), inset 0 0 0 3px rgba(154, 127, 85, 0.43);
  font-size: 15px; font-weight: 600; line-height: 1; display: grid; place-items: center; }

code { font: 0.8em var(--mono); background: var(--panel); border: 1px solid var(--border-soft); padding: 1px 4px;
  border-radius: 4px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
pre {background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; overflow-x: auto;
  max-width: 100%; }
pre code { background: none; border: none; padding: 0; font-size: 13px; line-height: 1.5; }
pre.ipython code { white-space: pre-wrap; overflow-wrap: anywhere; }
pre.ipython .in { color: #3d6529; font-weight: 650; }
pre.ipython .out { color: #a33126; font-weight: 650; }
/* Keys are small raised caps. */
kbd { display: inline-block; font: 0.76em/1.5 var(--mono); background: var(--medallion);
  border: 1px solid var(--medallion-ring); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; }

.note { background: var(--accent-tint); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: 8px; padding: 12px 16px; margin: 18px 0; }
.note p { margin: 4px 0; }
.note.warn { background: var(--warn-tint); border-left-color: var(--warn); }
.note code { background: var(--paper); }
.problems { padding-left: 20px; }
.problems li { margin: 12px 0; }

.table { overflow-x: auto; }
table { border-collapse: collapse; font-size: 16px; line-height: 1.45; width: 100%; }
th, td { text-align: left; vertical-align: top; padding: 6px 10px; border-bottom: 1px solid var(--border-soft); }
th { padding-top: 18px; font-weight: 600; color: var(--text-secondary); border-bottom-color: var(--border); }

footer { max-width: 1160px; margin: 0 auto; padding: 22px 16px 40px; color: var(--text-secondary); font-size: 15px;
  font-style: italic; text-align: center; }
footer a { display: inline-block; vertical-align: middle; margin-left: 4px; color: inherit; }
footer svg { display: block; width: 22px; height: 22px; fill: currentColor; }

@media (max-width: 800px) {
  header { margin-bottom: 14px; }
  header .brand { gap: 9px; }
  header .brand::before { width: 42px; height: 42px; }
  header .brand b { font-size: 27px; }
  header .brand span { font-size: 18px; }
  header .brand span::before { margin-right: 7px; }
  .wrap { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 0 10px; }
  nav { position: static; max-height: none; }
  main { padding: 8px 16px 32px; }
}
@media print {
  html, header { background: none; box-shadow: none; }
  nav { display: none; }
  .wrap { display: block; }
  main { border: none; box-shadow: none; padding: 0; background: none; }
}
