/* catalog.knittedbooks.com (Domains spec §2, FR-12; plan Step 4.2, Quinn Q-DP-14).
   The palette and type tokens are copied from knittedbooks.com/src/app.css (:root), with the knit
   edge, so a visitor moving between the two sites sees one brand. Light only, as knittedbooks.com
   is: no dark tokens are designed for the catalog in this release. Self-hosted fonts only
   (/fonts/fonts.css, copied from knittedbooks.com/public/fonts with their licences). The CSP is
   style-src 'self', so every style is here: the pages carry no style= attribute and no <style>. */

:root {
  --indigo: #1d2350;
  --indigo-deep: #141838;
  --indigo-soft: #2c3470;
  --madder: #a3302b;
  --saffron: #e3a53b;
  --linen: #f3ead8;
  --paper: #faf5ea;
  --cream: #fffaf0;
  --ink: #27223a;
  --ink-soft: #534b63;
  --rule: #d9ccb2;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1180px;

  /* The knit edge: app.css draws it as an SVG data: URL, which this site's CSP (img-src 'self') does
     not allow, so here it is two rows of V stitches in plain CSS gradients, madder over saffron. */
  --knit-row-1: repeating-linear-gradient(60deg, var(--madder) 0 3px, transparent 3px 7px), repeating-linear-gradient(-60deg, var(--madder) 0 3px, transparent 3px 7px);
  --knit-row-2: repeating-linear-gradient(60deg, var(--saffron) 0 3px, transparent 3px 7px), repeating-linear-gradient(-60deg, var(--saffron) 0 3px, transparent 3px 7px);

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 1.0625rem; line-height: 1.6; overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: var(--madder); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
h1, h2 { font-family: var(--serif); font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
p { margin: 0 0 1em; }

/* header and footer, on indigo as knittedbooks.com's */
header.site { background: var(--indigo); color: var(--cream); }
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 20px; padding-bottom: 20px; }
.brand { color: var(--cream); text-decoration: none; display: inline-flex; align-items: baseline; gap: 10px; }
.brand b { font-family: var(--serif); font-size: 1.45rem; font-weight: 600; }
.brand b span { font-weight: 400; font-style: italic; color: #d9cfe8; }
.brand small { font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--saffron); }
header nav { display: flex; flex-wrap: wrap; gap: 8px 24px; font-weight: 600; }
header nav a { color: #e6def0; text-decoration: none; }
header nav a:hover { color: var(--saffron); }
.band {
  height: 12px; border-top: 1px solid var(--indigo-deep); border-bottom: 1px solid var(--indigo-deep);
  background: var(--knit-row-1), var(--knit-row-2), var(--indigo-deep);
  background-size: 100% 50%, 100% 50%, auto; background-position: top, bottom, 0 0; background-repeat: repeat-x;
}
footer.site { background: var(--indigo-deep); color: #d9d0e6; padding: 32px 0 40px; font-size: .98rem; }
footer.site a { color: var(--cream); }

main { padding-top: clamp(40px, 6vw, 72px); padding-bottom: clamp(48px, 7vw, 96px); }
.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 40rem; margin-top: 1rem; }

/* the grid of titles: a list of links */
.grid { list-style: none; margin: clamp(28px, 4vw, 48px) 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: clamp(18px, 2.4vw, 32px); }
.card a { display: block; color: inherit; text-decoration: none; }
.card h2 { font-size: 1.25rem; margin-top: 14px; }
.card a:hover h2 { color: var(--madder); }
.cover {
  width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px 12px 12px 4px; background: var(--linen);
  box-shadow: 0 22px 34px -18px rgba(20, 24, 56, .6), 0 2px 4px rgba(20, 24, 56, .2);
}
.by { color: var(--ink-soft); margin: .25rem 0 .5rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: #f6dfae; color: #5e3d05; }
.tag.paid { background: #f3d0c9; color: #7a1f1a; }
.note { font-size: .92rem; color: var(--ink-soft); margin-top: .6rem; }

/* a title page */
.title { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
.title h1 { margin-top: .4rem; }
.title h2 { font-size: 1.5rem; margin: 2rem 0 1rem; }
.description { font-size: 1.15rem; margin-top: 1rem; }
dl { margin: 1.5rem 0 0; display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.2rem; }
dt { font-weight: 700; }
dd { margin: 0; }
dd ul { margin: 0; padding-left: 1.1rem; }

/* store badges, as knittedbooks.com's (text links styled here, no images) */
#get { margin-top: clamp(32px, 5vw, 64px); }
#get h2 { font-size: 1.6rem; margin-bottom: 1rem; }
.badges { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.badge {
  display: inline-flex; flex-direction: column; justify-content: center; padding: 9px 15px 10px; border-radius: 12px;
  border: 1.5px solid var(--indigo-soft); background: var(--indigo); color: var(--cream); line-height: 1.2; text-decoration: none;
}
a.badge:hover { background: var(--indigo-deep); }
.badge small { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: #cfc6de; }
.badge strong { font-family: var(--serif); font-size: 1.08rem; font-weight: 600; }
.badge em { font-style: normal; font-size: .85rem; color: var(--saffron); font-weight: 600; }

@media (max-width: 760px) {
  .title { grid-template-columns: 1fr; }
  .title .cover { max-width: 260px; }
  .badges li { flex: 1 1 100%; }
  .badge { width: 100%; }
  dl { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
