/* Plain "paper" design: one sheet on a desk, in the old site's Droid Sans. */
:root {
  --desk: #e8e4da;      /* page background around the sheet */
  --paper: #fffdf7;
  --ink: #2a2a28;
  --muted: #625e57;      /* 6.3:1 on the paper */
  --rule: #d9d3c5;
  --accent: #1f4e8c;    /* links: dark ink blue */
  --bar: #2f6fcf;       /* the old site's blue, a little deeper */
  --code-bg: #f5f1e8;
  --note-bg: #fbf3d6;
  --note-rule: #d8c27c;
}

html { background: var(--desk); }
body {
  max-width: 60rem; margin: 2.5rem auto; padding: 2.5rem 3.5rem 1.5rem;
  background: var(--paper); color: var(--ink);
  font: 400 14px/1.7 "Droid Sans", Arial, sans-serif;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 6px 24px rgba(0, 0, 0, .07);
}
a { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(31, 78, 140, .35); text-underline-offset: .18em; }
a:hover { text-decoration-color: currentColor; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--bar); outline-offset: 2px; border-radius: 2px; }
img { max-width: 100%; }

/* letterhead: the old Sněhurka server photo runs across the top of the sheet and fades into the paper on the left;
   the blue bar under it is a nod to the old design */
header {
  margin: -2.5rem -3.5rem 0; padding: 2.4rem 3.5rem 1.6rem;
  background:
    linear-gradient(to right, var(--paper) 48%, rgba(255, 253, 247, .6) 70%, rgba(255, 253, 247, .1)),
    url(../wp-content/uploads/2012/07/snehurka2x4.png) right center / cover no-repeat;
  border-bottom: 5px solid var(--bar);
}
header .site-title { font-size: 2.4rem; font-weight: 700; line-height: 1.1; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
header p { margin: .35rem 0 0; color: var(--muted); font-size: 1.05rem; }

nav { margin: 0; border-bottom: 1px solid var(--rule); }
nav ul { margin: 0 0 0 -.7em; padding: 0; list-style: none; display: flex; flex-wrap: wrap; }
nav li { position: relative; }
/* a thin vertical rule between groups of menu items (group_start in _data/menu.yml) */
nav li.group-start { display: flex; align-items: center; }
nav li.group-start::before { content: ""; align-self: stretch; margin: .6em .5em .6em .3em; border-left: 1px solid var(--muted); }
nav a { display: block; padding: .55em .7em; color: var(--muted); text-decoration: none; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }
nav a:hover { color: var(--ink); }
nav li ul { display: none; position: absolute; left: 0; top: 100%; z-index: 1; width: 16em; flex-direction: column; margin: 0; background: var(--paper); border: 1px solid var(--rule); }
nav li:hover > ul, nav li:focus-within > ul { display: flex; }

main { padding: 1.5rem 0 2rem; }
h1 { font-size: 1.9rem; line-height: 1.25; font-weight: 700; margin: .3em 0 .6em; }
h2, h3, h4 { font-weight: 700; line-height: 1.3; margin: 2em 0 .5em; }
h2 { font-size: 1.35rem; padding-bottom: .2em; border-bottom: 1px solid var(--rule); }
h3 { font-size: 1.1rem; } h4 { font-size: 1rem; }
.meta { color: var(--muted); font-size: .85rem; margin-top: -.4em; }
.archived, .note { background: var(--note-bg); border: 1px dashed var(--note-rule); padding: .6em 1em; font-size: .92rem; }
.note > :first-child { margin-top: 0; } .note > :last-child { margin-bottom: 0; }

/* where a command runs: {: .on-pc}, {: .on-chimera} or {: .on-r3d3} after a code block puts a small tab on it */
.on-pc, .on-chimera, .on-r3d3 { margin: 1em 0; }
.on-pc::before, .on-chimera::before, .on-r3d3::before {
  display: inline-block; padding: .1em .7em; border-radius: 3px 3px 0 0;
  font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink);
}
.on-pc::before { content: "On your computer"; background: #e6dfcf; }
.on-chimera::before { content: "On Chimera"; background: #d6e2f3; }
.on-r3d3::before { content: "On r3d3"; background: #dcead3; }
.on-pc pre, .on-chimera pre, .on-r3d3 pre { margin-top: 0; }
.on-pc pre { border-left-color: #c9bd9f; } .on-chimera pre { border-left-color: #9fb8de; } .on-r3d3 pre { border-left-color: #a9c79a; }

/* table of contents: "* TOC" + "{:toc}" in a page */
#markdown-toc { display: inline-block; margin: .5em 0 1em; padding: .5em 1.2em .5em 2em; background: var(--code-bg); font-size: .92rem; }
#markdown-toc ul { margin: 0; padding-left: 1.2em; }

/* home page starting points: {: .start} after a list */
ul.start { list-style: none; padding: 0; margin: 1.2em 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr)); gap: .8rem; }
ul.start li { border: 1px solid var(--rule); border-top: 3px solid var(--bar); background: #fff; padding: .7em 1em; }
ul.start li strong { display: block; font-size: 1.05rem; margin-bottom: .2em; }

pre, code { font-family: "Droid Sans Mono", ui-monospace, monospace; font-size: .86em; }
code { background: var(--code-bg); padding: .05em .3em; border-radius: 2px; }
pre { overflow: auto; padding: .8em 1em; background: var(--code-bg); border-left: 3px solid var(--rule); line-height: 1.45; }
pre code { background: none; padding: 0; font-size: 1em; }
div.highlight { position: relative; }
button.copy {
  position: absolute; top: .4em; right: .4em; padding: .1em .6em;
  font: inherit; font-size: .75rem; color: var(--muted); background: var(--paper);
  border: 1px solid var(--rule); border-radius: 3px; cursor: pointer; opacity: .75;
}
div.highlight:hover button.copy, button.copy:focus { opacity: 1; color: var(--ink); }
@media print { button.copy { display: none; } }

table { border-collapse: collapse; display: block; overflow-x: auto; margin: 1em 0; font-size: .95rem; }
th, td { padding: .35em .9em .35em 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
th { font-weight: 700; border-bottom: 2px solid var(--ink); }

footer { border-top: 1px solid var(--rule); color: var(--muted); font-size: .85rem; padding-top: .8rem; }

/* cheat sheet: sections in two columns */
.cheat { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(24rem, 100%), 1fr)); gap: 0 2rem; }
.cheat h3 { margin-top: 1em; }
.cheat pre { font-size: .8em; }
.cheat table { font-size: .9rem; margin: .5em 0; }

/* on a phone the sheet fills the screen */
@media (max-width: 48rem) {
  body { margin: 0; padding: 1.5rem 1rem 1rem; box-shadow: none; }
  /* the photo becomes a strip above the title instead of sitting behind it */
  header {
    margin: -1.5rem -1rem 0; padding: calc(72px + 1rem) 1rem 1.2rem;
    background: url(../wp-content/uploads/2012/07/snehurka2x4.png) right top / auto 72px no-repeat;
  }
  header .site-title { font-size: 2rem; }
  h1 { font-size: 1.6rem; }
  nav li ul, nav li:hover > ul, nav li:focus-within > ul { display: contents; }
}

/* printing: just the content, black on white */
@media print {
  @page { size: A4; margin: 12mm; }
  html, body { background: #fff; }
  body { max-width: none; margin: 0; padding: 0; box-shadow: none; font-size: 9.5pt; line-height: 1.4; }
  header { margin: 0 0 .5em; padding: 0 0 .3em; background: none; border-bottom: 2px solid #000; }
  h2 { border-bottom-color: #999; }
  header .site-title { font-size: 14pt; }
  header p, nav, footer, #markdown-toc, .no-print, button.copy { display: none; }
  main { padding: 0; }
  h1 { font-size: 15pt; margin: .2em 0 .4em; }
  h2, h3 { break-after: avoid; }
  pre, table, .cheat section { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  .cheat { grid-template-columns: 1fr 1fr; gap: 0 6mm; }
  .cheat h3 { margin: .6em 0 .2em; font-size: 10.5pt; }
  .cheat pre { padding: .3em .5em; margin: 0; }
  .on-pc::before, .on-chimera::before, .on-r3d3::before { font-size: 6.5pt; padding: 0 .5em; }
}
