/* twentyonelist.com: a list pad. Cream paper with blue rules and a red margin line, navy ink, a red-pencil box for the
   title's key word; each article sheet laid on the pad. Atkinson Hyperlegible throughout, served from this site.
   An article in a series gets its series' background picture over the pad, from --series-background. */
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-hyperlegible-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-hyperlegible-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-hyperlegible-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --pad: #f7f3e6;           /* the pad's paper */
  --rule: #c9d8ec;          /* its blue rules */
  --margin: #e3a3a0;        /* its red margin line */
  --sheet: #fffefa;         /* an article's sheet */
  --ink: #1f3a68;           /* navy ink */
  --text: #1b2433;
  --muted: #55607a;
  --pencil: #c0392b;        /* red pencil */
  --on-pencil: #ffffff;
  --line: #e2e6ee;
  --body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --pad: #171c26; --rule: rgba(160, 185, 230, 0.12); --margin: rgba(227, 120, 115, 0.35); --sheet: #1f2633;
    --ink: #b9cdf0; --text: #e8ecf4; --muted: #a3adc2; --line: #2f3848;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { background: var(--pad); }
body {
  margin: 0; min-height: 100vh; color: var(--text); font: 18px/1.65 var(--body);
  background-color: var(--pad);
  /* the series' picture, then the margin line, then a rule every 32px */
  background-image:
    var(--series-background, none),
    linear-gradient(90deg, transparent 54px, var(--margin) 54px, var(--margin) 56px, transparent 56px),
    repeating-linear-gradient(transparent 0 31px, var(--rule) 31px 32px);
  background-size: 240px 240px, 100% 100%, 100% 32px;
  background-attachment: scroll, fixed, scroll;
}
main { max-width: 800px; margin: 0 auto; padding: 22px 20px 40px; display: grid; gap: 26px; }

/* the title and tagline written on the pad */
.site { display: grid; gap: 6px; color: var(--ink); }
h1 { margin: 0; font: 700 34px/1.15 var(--body); letter-spacing: 0.005em; overflow-wrap: anywhere; }
[data-page="article"] h1 { font-size: clamp(26px, 4.4vw, 34px); }
.tagline { margin: 0; font-size: 18px; line-height: 1.35; font-weight: 700; color: var(--muted); }
.byline { margin: 0; font-size: 16px; color: var(--muted); }
/* the title's key word in an angled box, in red pencil */
.hl {
  display: inline-block; color: var(--on-pencil); padding: 0 0.16em; margin-left: 0.06em;
  border-radius: 6px; background: var(--pencil); transform: rotate(-2deg);
  box-shadow: 0 3px 12px rgba(192, 57, 43, 0.25);
}
.ad a:focus-visible, .home:focus-visible { outline: 3px solid var(--pencil); outline-offset: 3px; }

/* an article: a sheet on the pad */
.article {
  background: var(--sheet); border-radius: 4px; padding: 28px 32px 32px; box-shadow: 0 2px 14px rgba(31, 58, 104, 0.12);
  display: grid; gap: 14px;
}
.article > * { margin: 0; max-width: 66ch; }
/* the opening paragraph, the answer: larger than the rest, then the banner */
.article .lead { font-size: 21px; line-height: 1.55; }
.article h2, .article h3, .article h4 { color: var(--ink); line-height: 1.2; margin-top: 12px; }
.article h2 { font-size: 28px; }
.article h3 { font-size: 22px; }
.article ul, .article ol { padding-left: 1.4em; }
.article li + li { margin-top: 6px; }
.article a { color: var(--ink); text-decoration-color: var(--pencil); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.article a:hover { color: var(--pencil); }
.article blockquote { border-left: 3px solid var(--margin); padding-left: 16px; color: var(--muted); }
.article figure img { display: block; max-width: 100%; height: auto; border-radius: 3px; }
.article .picture { max-width: none; }
.article code { font: 0.9em/1 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; background: var(--line); padding: 2px 5px; border-radius: 3px; }
.article pre { overflow-x: auto; background: var(--text); color: var(--sheet); padding: 16px; border-radius: 4px; }
.article pre code { background: none; padding: 0; line-height: 1.5; }
.article hr { border: 0; border-top: 1px solid var(--line); width: 100%; }
/* at an article's end, once its book is out: the link to it */
.article .product { font-weight: 700; border-top: 1px solid var(--line); padding-top: 14px; }

/* the banner, inside the article after its first paragraph */
.ad { display: grid; justify-items: center; gap: 6px; max-width: none; margin: 8px 0; }
/* no banner picked (none in this page's category yet): nothing shows, not even its label */
.ad[hidden] { display: none; }
.ad img { display: block; max-width: 100%; height: auto; border-radius: 3px; }
.ad small { color: var(--muted); font-size: 13px; line-height: 1.4; text-align: center; max-width: 62ch; }

/* the articles, under the page: on the home page, each series under its heading, numbered */
.more { background: var(--sheet); border-radius: 4px; padding: 24px 32px; box-shadow: 0 2px 14px rgba(31, 58, 104, 0.12); display: grid; gap: 28px; }
.more h2 { margin: 0 0 12px; font: 700 22px/1.25 var(--body); color: var(--ink); }
.more ul, .more ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
/* a card: the thumbnail beside the title and description; in a series, its number first */
.more li { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: start; }
.more li.bare { grid-template-columns: 1fr; }
.more ol li { grid-template-columns: 2.2em 220px 1fr; }
.more ol li.bare { grid-template-columns: 2.2em 1fr; }
.more .number { font: 700 22px/1.25 var(--body); color: var(--pencil); text-align: right; }
.more .thumb img { display: block; width: 100%; height: auto; border-radius: 3px; }
.more .title { font: 700 20px/1.3 var(--body); color: var(--ink); text-decoration-color: var(--pencil); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.more .title:hover { color: var(--pencil); }
.more p { margin: 6px 0 0; color: var(--muted); font-size: 16px; line-height: 1.5; }

/* on an article's page: the way back to the home page */
.home { justify-self: start; color: var(--ink); font: 700 20px/1 var(--body); text-decoration: none; padding: 6px 0; }
.home:hover { color: var(--pencil); }
footer { color: var(--muted); font-size: 14px; }
footer p { margin: 0 0 4px; }
/* the links to About, Privacy and Contact, on every page */
footer .pages { margin: 0 0 6px; }
footer .pages a { color: inherit; text-underline-offset: 3px; }

@media (max-width: 520px) {
  body { background-image: var(--series-background, none), none, repeating-linear-gradient(transparent 0 31px, var(--rule) 31px 32px); }
  main { padding-top: 14px; }
  .article, .more { padding-left: 20px; padding-right: 20px; }
  .article .lead { font-size: 19.5px; }
  .more li, .more ol li, .more ol li.bare { grid-template-columns: 1fr; gap: 10px; }
  .more ol li { grid-template-columns: 2em 1fr; }
  .more ol li .thumb { grid-column: 2; }
  .more ol li > div { grid-column: 2; }
}
