/* vasari.pub on the Vasari brand canon (vasari-kb design/brand-canon.md).
   Light values = vasari-art lib/design-tokens.js; dark values = the catalogued
   package `dark` surface in vasari-art lib/package-styles.js. Buttons, inputs and
   corners follow vasari-art DESIGN.md (flat, 2px). Never add a color or a font that
   is not in the canon: the canon changes first (Eric decides), then this file. */
:root {
  --brand-teal: #60B8BA;            /* fills and accents; never type on a light ground */
  --brand-teal-hover: #46A9AA;
  --brand-teal-dark: #358C8B;       /* teal type at display sizes */
  --brand-teal-text: #317C79;       /* teal type at small sizes (AA) */
  --brand-teal-tint: rgba(96, 184, 186, 0.15);
  --brand-dark: #1A1A2E;            /* ink on brand fills; the extra action */
  --brand-dark-hover: #2D2D44;
  --text: #1A1A1A;
  --text-secondary: #4D4D4D;
  --muted: #888888;                 /* decorative only: fails AA as text */
  --border: #E8E6E2;
  --bg: #FAFAF8;
  --card: #FFFFFF;
  --field: #FFFFFF;
  --error: #C0392B;
  --error-text: #C0392B;
  --success: #27AE60;
  /* Semantic status mark (the canon's admin warning amber), never type. */
  --status-amber: #F39C12;
  --link: var(--brand-teal-text);
  --focus: var(--brand-teal-dark);
  --sans: 'Montserrat', -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e10;
    --card: #141417;
    --field: #0d0d0f;
    --border: #2c2c31;
    --text: #eaeaea;
    --text-secondary: #b9b9c2;
    --muted: #83838a;
    --error-text: #c98a8a;
    /* On this ground plain brand teal is ~8.9:1, the one ground where it may be type. */
    --brand-teal-text: #60B8BA;
    --link: #60B8BA;
    --focus: #60B8BA;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.65 var(--sans);
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, .card-title, .price-big, .stats .big {
  font-family: var(--serif); font-weight: 500; letter-spacing: 0; color: var(--text);
}
h1 { font-size: clamp(2rem, 4.6vw, 3rem); line-height: 1.08; margin: 0 0 0.5em; }
h2.section { font-size: 1.6rem; line-height: 1.2; margin: 2em 0 0.8em; }
img { max-width: 100%; display: block; }

/* Header: the plain Vasari wordmark (never the Codex lockup), then "Pub" in teal (Eric, 2026-11-18). */
.top, main, .foot { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.mark { display: inline-flex; align-items: center; gap: 12px; color: var(--brand-teal-text); }
.mark:hover { text-decoration: none; }
.mark-logo { display: inline-flex; }
.mark-logo img { height: 24px; width: auto; }
.mark-logo .logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  .mark-logo .logo-light { display: none; }
  .mark-logo .logo-dark { display: block; }
}
.mark-pub { font: 500 1.2rem/1 var(--sans); letter-spacing: 0.04em; color: var(--brand-teal-text); }
.top nav { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; font: 500 0.8rem var(--sans); text-transform: uppercase; letter-spacing: 0.12em; }
.top nav a { color: var(--text); }
.top nav a:hover { color: var(--brand-teal-text); text-decoration: none; }
form.inline { display: inline; margin: 0; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--text); cursor: pointer; text-transform: inherit; letter-spacing: inherit; }
button.link:hover { color: var(--brand-teal-text); }
main { padding-top: 40px; padding-bottom: 72px; min-height: 60vh; }
body.narrow main { max-width: 620px; }
.foot { border-top: 1px solid var(--border); padding-top: 22px; padding-bottom: 44px; color: var(--text-secondary); font-size: 0.85rem; }
.foot p { margin: 0.35em 0; display: flex; gap: 18px; flex-wrap: wrap; }
.foot a { color: var(--text-secondary); }
.foot a:hover { color: var(--brand-teal-text); }
@media (max-width: 560px) { .mark-logo img { height: 20px; } .top nav { gap: 16px; } }

.intro { max-width: 680px; margin-bottom: 8px; }
.intro p { color: var(--text-secondary); font-size: 1.05rem; }
.empty, .note, .crumb { color: var(--text-secondary); }
.note { font-size: 0.875rem; }
.crumb { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; }
.crumb a { color: var(--text-secondary); }
.flash, .warn-box { padding: 12px 16px; border-radius: 2px; background: var(--card); border: 1px solid var(--border); color: var(--text); }
.flash { border-left: 3px solid var(--success); }
.warn-box { border-left: 3px solid var(--status-amber); }
.error { color: var(--error-text); font-weight: 500; }

/* The store shelf is an index: thumbnails may be cropped (Artwork presentation). */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 32px 22px; }
.card { display: flex; flex-direction: column; gap: 4px; color: var(--text); }
.card:hover { text-decoration: none; }
.cover { display: block; aspect-ratio: 3 / 4; background: var(--border); border-radius: 2px; overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
/* Covers fade in once loaded (the head script adds .in); the grey cover box shows meanwhile. */
html.js img.fade { opacity: 0; transition: opacity .45s ease; }
html.js img.fade.in { opacity: 1; }
@media (prefers-reduced-motion: reduce) { html.js img.fade { transition: none; } }
.card:hover .card-title { color: var(--brand-teal-dark); }
.card-title { font-size: 1.3rem; line-height: 1.2; margin: 8px 0 0; }
.card-meta { color: var(--text-secondary); font-size: 0.85rem; margin: 0; }
.card-price { font-size: 0.85rem; font-weight: 600; }

/* A title shown on its own is whole and unaltered: the frame is a mount, never a mask. */
.mount { width: fit-content; max-width: 100%; padding: 10px; background: var(--card); border: 1px solid var(--border); border-radius: 2px; }
.mount img { border-radius: 0; max-width: 100%; height: auto; }
.title { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 44px; align-items: start; }
.by { margin-top: -0.3em; color: var(--text-secondary); }
.by a { color: var(--brand-teal-text); }
.facts { font-weight: 600; font-size: 0.9rem; }
.desc { max-width: 62ch; }
.action { margin-top: 28px; }
.price-big { font-size: 2rem; margin: 0; }
@media (max-width: 720px) {
  .title { grid-template-columns: 1fr; gap: 24px; }
  .title-cover .mount { max-width: 170px; }   /* the Read button stays on the first screen of a phone */
}

/* Buttons: DESIGN.md. Primary = teal with brand-dark ink; ghost = 1px text border. */
.btn { display: inline-block; font: 600 0.8rem/1 var(--sans); text-transform: uppercase; letter-spacing: 0.14em; padding: 14px 22px; border-radius: 2px; border: 1px solid var(--text); background: transparent; color: var(--text); text-decoration: none; cursor: pointer; transition: background-color .2s, border-color .2s, color .2s; }
.btn:hover { text-decoration: none; background: var(--brand-teal-tint); }
.btn.primary { background: var(--brand-teal); border-color: var(--brand-teal); color: var(--brand-dark); }
.btn.primary:hover { background: var(--brand-teal-hover); border-color: var(--brand-teal-hover); }
.btn.small { padding: 10px 16px; font-size: 0.72rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

.stack { display: flex; flex-direction: column; gap: 16px; margin: 20px 0; }
label { display: flex; flex-direction: column; gap: 6px; font: 600 0.75rem var(--sans); text-transform: uppercase; letter-spacing: 0.12em; color: var(--text); }
label.check { flex-direction: row; align-items: center; gap: 10px; font: 500 0.95rem var(--sans); text-transform: none; letter-spacing: 0; }
fieldset.choice { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
fieldset.choice legend { padding: 0; margin-bottom: 4px; font: 600 0.75rem var(--sans); text-transform: uppercase; letter-spacing: 0.12em; color: var(--text); }
fieldset.choice label.check { align-items: flex-start; }
fieldset.choice .hint { display: block; font-weight: 400; font-size: 0.88rem; }
input, textarea { font: 400 1rem var(--sans); text-transform: none; letter-spacing: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 0; background: var(--field); color: var(--text); width: 100%; }
input:focus, textarea:focus { outline: none; border-color: var(--text); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--brand-teal); }
input[type="file"] { padding: 10px; }
.btn:focus-visible, a:focus-visible, button.link:focus-visible, summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.stack .btn { align-self: flex-start; }

.shelf { list-style: none; padding: 0; margin: 0; display: grid; gap: 22px; }
.shelf-item { display: grid; grid-template-columns: 96px 1fr; gap: 18px; align-items: start; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.shelf-item.new .card-title { color: var(--brand-teal-dark); }
.shelf-item .btn { margin-top: 10px; }
.cover.small { width: 96px; }
.cover.tiny { width: 64px; height: auto; }

.checkout-head { display: flex; gap: 16px; align-items: center; margin-bottom: 20px; }
.license { background: var(--card); border: 1px solid var(--border); border-radius: 2px; padding: 4px 20px; margin-bottom: 20px; }
#checkout { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
#pay { width: 100%; max-width: 420px; }

.row-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.row-head h1 { margin: 0; }
table.list { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.list th, table.list td { text-align: left; padding: 13px 8px; border-bottom: 1px solid var(--border); }
table.list th { color: var(--text-secondary); font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; }
table.list a { color: var(--text); font-weight: 500; }
table.list a:hover { color: var(--brand-teal-text); }
.num { text-align: right !important; }
/* Status: the label stays text-colored; the color is the dot beside it. */
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; padding: 4px 10px; border-radius: 2px; border: 1px solid var(--border); color: var(--text); white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.s-on_sale::before { background: var(--success); }
.s-converting::before, .s-paused::before { background: var(--status-amber); }
.s-failed { color: var(--error-text); }
.s-failed::before { background: var(--error); }
.title-edit { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 32px; align-items: start; margin-top: 18px; }
@media (max-width: 720px) { .title-edit { grid-template-columns: 1fr; } .title-edit .mount { max-width: 200px; } }
.share { border-top: 1px solid var(--border); padding-top: 14px; overflow-wrap: anywhere; }
.replace { margin-top: 22px; }
.replace summary { cursor: pointer; font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 16px 0 22px; }
.stats div { background: var(--card); border: 1px solid var(--border); border-radius: 2px; padding: 16px; display: flex; flex-direction: column; }
.stats .big { font-size: 2.1rem; line-height: 1.1; }
.stats span:last-child { color: var(--text-secondary); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; }
ul.plain { padding-left: 18px; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- store home */
/* Pictures are accents beside the copy (canon: real public-domain works, whole, in a
   mount, credited). The publishers band is --brand-dark with white type at alpha, which
   is the canon's rule for copy on a dark ground. */
body.home { overflow-x: clip; }
body.home main { padding-top: 0; }
.eyebrow { font: 600 0.72rem/1.4 var(--sans); text-transform: uppercase; letter-spacing: 0.22em; color: var(--brand-teal-text); margin: 0 0 14px; }
.lead { font-size: 1.12rem; line-height: 1.6; color: var(--text-secondary); max-width: 34em; margin: 0 0 28px; }
.ctas { display: flex; gap: 12px; flex-wrap: wrap; margin: 0; }

.work { margin: 0; padding: 10px; background: var(--card); border: 1px solid var(--border); border-radius: 2px; width: fit-content; max-width: 100%; }
.work img { display: block; width: 100%; height: auto; border-radius: 0; }
.work.land { width: 340px; }
.work.port { width: 230px; }
.work.hero-work { width: 400px; }
.work figcaption { font-size: 0.75rem; line-height: 1.45; color: var(--text-secondary); margin-top: 9px; }
.work figcaption b { font-weight: 600; color: var(--text); }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 56px; align-items: center; padding: 64px 0 72px; border-bottom: 1px solid var(--border); }
.hero h1 { font-size: clamp(2.4rem, 5.4vw, 3.9rem); line-height: 1.04; margin-bottom: 22px; max-width: 13em; }

.shelf-section { padding: 8px 0 24px; }
.shelf-section h2.section { margin-top: 1.6em; }

.readers { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 56px; align-items: center; padding: 64px 0; border-top: 1px solid var(--border); margin-top: 48px; }
.readers h2, .band h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); line-height: 1.1; margin: 0 0 26px; max-width: 16em; }
.points { display: grid; gap: 20px; margin: 0; }
.points div { border-left: 2px solid var(--brand-teal); padding-left: 16px; }
.points dt { font-weight: 600; margin-bottom: 3px; }
.points dd { margin: 0; color: var(--text-secondary); max-width: 34em; }

.band { background: var(--brand-dark); color: #FFFFFF; margin: 24px calc(50% - 50vw) -72px; padding: 72px 16px; }
.band-inner { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 56px; align-items: center; }
.band .eyebrow { color: var(--brand-teal); }      /* plain teal is legible type on brand dark */
.band h2 { color: #FFFFFF; }
.band .points dd, .band-plan { color: rgba(255, 255, 255, 0.82); }
.band-plan { margin: 26px 0 22px; }
.band .work { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.16); }
.band .work figcaption { color: rgba(255, 255, 255, 0.70); }
.band .work figcaption b { color: #FFFFFF; }
.band a:focus-visible, .band .btn:focus-visible { outline-color: var(--brand-teal); }

@media (max-width: 760px) {
  .hero, .readers, .band-inner { grid-template-columns: 1fr; gap: 32px; }
  .hero { padding: 40px 0 48px; }
  .work.hero-work { width: 300px; }
  .work.land { width: 280px; }
  .work.port { width: 180px; }
  .readers .work { order: 2; }
  .band { padding: 56px 16px; }
}

/* Read: the short wait while a text book is set for this screen (lib/views.js reading) */
.reading { padding-top: 12vh; }
.reading-status { color: var(--text-secondary); }
.reading-links a { margin-right: 1.25rem; }

/* Text size (lib/views.js textSize) */
.sizes { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 0.75rem; }
.size-opt { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 0.4rem;
  min-height: 96px; padding: 0.75rem 0.5rem; border: 1px solid var(--border); border-radius: 2px; background: var(--card); text-decoration: none; color: var(--text); }
.size-opt:hover { text-decoration: none; border-color: var(--brand-teal); }
.size-opt.current { border-color: var(--focus); box-shadow: inset 0 0 0 1px var(--focus); }
.size-sample { font-family: var(--serif); line-height: 1; }
.size-label { font-size: 0.8rem; color: var(--text-secondary); }
.size-16 { font-size: 16px; } .size-18 { font-size: 18px; } .size-21 { font-size: 21px; } .size-24 { font-size: 24px; }
.sizes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.inline-claim { margin: 0 0 8px; }

/* Publishing a text book (lib/views.js publishNew, bookOutline, bookChapter) */
.chapters { padding-left: 1.4rem; }
.chapters li { margin: 0.35rem 0; }
.chapters .card-meta { display: block; }
.blocks { list-style: none; padding: 0; margin: 1rem 0 1.5rem; }
.blk { border-top: 1px solid var(--border); padding: 0.75rem 0; }
.blk-ctl { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; }
.blk-ctl select { font: 400 0.9rem var(--sans); padding: 8px 10px; min-width: 11rem; border: 1px solid var(--border); border-radius: 0; background: var(--field); color: var(--text); }
.blk-ctl select:focus { outline: none; border-color: var(--text); }
.blk-text { margin: 0.4rem 0 0; color: var(--text-secondary); font-family: var(--serif); font-size: 1.05rem; line-height: 1.5; overflow-wrap: anywhere; }
.blk-h1 .blk-text { font-weight: 600; color: var(--text); }
.blk-h2 .blk-text { font-weight: 500; color: var(--text); }
.check.small { font-size: 0.85rem; }
.pager a { margin-right: 1.25rem; }
