/* NEKpress: one stylesheet, no web fonts, no scripts. */

:root {
  --paper: #faf7f0;
  --card: #fffdf8;
  --ink: #1e1b16;
  --muted: #655e53;
  --rule: #e3ddd0;
  --pill: #cfc6b4;
  --accent: #7a2618;
  --free: #1b6652;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "URW Palladio L", P052, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14120f;
    --card: #1c1a16;
    --ink: #ede7db;
    --muted: #aaa194;
    --rule: #302b25;
    --pill: #4a443b;
    --accent: #e3a086;
    --free: #7ccbb1;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.55;
}

a { color: var(--accent); text-underline-offset: 0.15em; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.wrap { max-width: 64rem; margin: 0 auto; padding: 0 1.25rem; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--paper); padding: 0.5rem 0.75rem; z-index: 2;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* header */
header.site { border-bottom: 1px solid var(--rule); }
header.site .wrap {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 0.5rem 1.5rem; padding-top: 1rem; padding-bottom: 0.9rem;
}
.brand {
  font-size: 1.45rem; font-weight: 700; letter-spacing: 0.01em;
  color: var(--ink); text-decoration: none;
}
nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; margin: 0; padding: 0; list-style: none; }
nav a {
  font-family: var(--sans); font-size: 0.9rem; color: var(--muted); text-decoration: none;
  padding-bottom: 0.15rem; border-bottom: 2px solid transparent;
}
nav a:hover { color: var(--ink); }
nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* page text */
main.wrap { padding-top: 2.25rem; padding-bottom: 3.5rem; }
h1 { font-size: clamp(1.9rem, 4vw, 2.5rem); line-height: 1.15; margin: 0 0 0.6rem; font-weight: 700; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 44rem; margin: 0 0 1.5rem; }

.group { margin-top: 2.5rem; padding-top: 1.4rem; border-top: 1px solid var(--rule); }
.group > h2 { font-size: 1.4rem; line-height: 1.25; margin: 0 0 1.1rem; font-weight: 700; }
.group > p { margin: -0.4rem 0 1rem; color: var(--muted); }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr)); gap: 1rem; }

.book {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--rule); border-radius: 6px;
  padding: 1.05rem 1.15rem 1.1rem;
}
.book .label {
  font-family: var(--sans); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 0.35rem;
}
.book .title { font-size: 1.18rem; line-height: 1.25; margin: 0; font-weight: 700; }
.book .subtitle { font-size: 0.95rem; line-height: 1.4; color: var(--muted); margin: 0.3rem 0 0; }
.book .author { font-style: italic; margin: 0.35rem 0 0; font-size: 0.95rem; }
.book .blurb { font-size: 0.97rem; margin: 0.55rem 0 0; }
.book .links { margin-top: auto; padding-top: 0.9rem; }

.links { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.links a {
  display: inline-block; font-family: var(--sans); font-size: 0.8rem; line-height: 1.2;
  padding: 0.34rem 0.7rem; border-radius: 999px; border: 1px solid var(--pill);
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.links a:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.links a.free { color: var(--free); border-color: currentColor; }
.links a.free:hover { background: var(--free); color: var(--paper); border-color: var(--free); }
.links a.code { color: var(--muted); }

/* shelves on the home page */
a.shelf {
  display: flex; flex-direction: column; gap: 0.35rem;
  background: var(--card); border: 1px solid var(--rule); border-radius: 6px;
  padding: 1.05rem 1.15rem; color: var(--ink); text-decoration: none;
}
a.shelf:hover { border-color: var(--accent); }
a.shelf .title { font-size: 1.18rem; font-weight: 700; }
a.shelf .intro { font-size: 0.95rem; color: var(--muted); line-height: 1.45; }
a.shelf .count { font-family: var(--sans); font-size: 0.8rem; color: var(--accent); margin-top: auto; padding-top: 0.35rem; }

/* the Shakespeare table */
.table-wrap { overflow-x: auto; margin-bottom: 1.25rem; }
table.plays { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.plays thead th:nth-child(1) { width: 36%; }
table.plays thead th:nth-child(2) { width: 22%; }
table.plays thead th {
  font-family: var(--sans); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); text-align: left;
  padding: 0 0.75rem 0.5rem 0; border-bottom: 1px solid var(--rule); vertical-align: bottom;
}
table.plays tbody th { text-align: left; font-weight: 600; padding: 0.6rem 0.75rem 0.6rem 0; }
table.plays td { padding: 0.5rem 0.75rem 0.5rem 0; }
table.plays tbody tr { border-bottom: 1px solid var(--rule); }
table.plays td.none { color: var(--muted); }
table.plays .links { gap: 0.3rem; }

/* free list */
.free-list { margin: 0; padding-left: 1.1rem; }
.free-list li { margin: 0.35rem 0; }
.free-list .note { color: var(--muted); font-size: 0.92rem; }

/* footer */
footer.site { border-top: 1px solid var(--rule); font-family: var(--sans); font-size: 0.85rem; color: var(--muted); }
footer.site .wrap { padding-top: 1.25rem; padding-bottom: 2rem; }
footer.site p { margin: 0.6rem 0 0; }
.contact { display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; margin: 0; padding: 0; list-style: none; }
.disclaimer { font-size: 0.8rem; }

@media (max-width: 34rem) {
  body { font-size: 1rem; }
  table.plays thead th:nth-child(1) { width: 34%; }
  table.plays thead th:nth-child(2) { width: 30%; }
}
