/* The cover box (DIRECTION §4), canonical in shared/discover: spliced into site/css/gallery.css by scripts/shared.mjs. */
/* ==== Covers never blank (sprint 3, DIRECTION §4) ==============================================
 * Every cover is a 2:3 box in its subject's dark tone with the title, a hairline and the surname drawn
 * in type; the real cover, when there is one, sits on top (site.js fades it in, and takes it away if it
 * fails, so a dead cover looks like no cover). Sized by the box: the title at 15% of its width. */
@media (prefers-color-scheme: dark) {
  .cv-box {
    outline: 1px solid var(--line);
    outline-offset: -1px;
  }
}

.cv-box {
  position: relative;
  display: block;
  overflow: hidden;
  color: #f4f4f0;
  container-type: inline-size;
}

.cv-box > .cv {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--rc);
}

.cv-box > .cv.cv-wait {
  opacity: 0;
}

.cv-none {
  position: absolute;
  inset: 0;
  display: block;
  padding: 18cqw 10cqw 0;
  text-align: left;
}

.cv-none b {
  display: -webkit-box;
  overflow: hidden;
  font: 500 15cqi / 1.12 var(--display,'Newsreader',Georgia,serif);
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

/* The title's size is a fixed scale of three steps (Juno, WS-63 N2-pre-2): L 15cqi, M 11.5cqi, S 9cqi, picked at build
   per title (cover-tone.mjs coverStep: the largest that wraps to 5 lines without splitting a word; S with hyphens when
   nothing else fits). A step that would draw under 12px hides the title instead (tone, hairline, surname), so no
   typeset title is ever under 12px: S under 133.33px wide, M under 104.35px, L under 80px. */
.cv-box .cv-none b{font-size:15cqi;-webkit-line-clamp:5}
.cv-box .cv-none b.cv-m{font-size:11.5cqi}.cv-box .cv-none b.cv-s{font-size:9cqi}.cv-box .cv-none b.cv-hy{-webkit-hyphens:auto;hyphens:auto;overflow-wrap:anywhere}
/* A cv-hy title carries soft hyphens in its long words (cover-tone.mjs softHyphens), so it breaks with a hyphen even
   with no dictionary; where the browser has one, it keeps at least 4 letters either side of a break. Anything left
   breaks anywhere rather than run off the cover. */
@supports (hyphenate-limit-chars:10 4 4){.cv-box .cv-none b.cv-hy{hyphenate-limit-chars:10 4 4}}
@container (max-width:133.34px){.cv-box .cv-none b.cv-s{visibility:hidden}}
@container (max-width:104.35px){.cv-box .cv-none b.cv-m{visibility:hidden}}
@container (max-width:79.99px){.cv-box .cv-none b{visibility:hidden}}

/* The hairline sits about 11% of the height above the bottom (16cqw of the width), the surname under it with
   room to breathe, never on the edge. */
.cv-none i {
  position: absolute;
  right: 10cqw;
  bottom: 0;
  left: 10cqw;
  overflow: hidden;
  height: 16cqw;
  padding-top: 2.5cqw;
  border-top: 1px solid rgb(244 244 240 / 0.3);
  font: 400 max(9px, 9cqw) / 1 var(--sans,'Public Sans',system-ui,-apple-system,'Segoe UI',sans-serif);
  font-style: normal;
  white-space: nowrap; /* never cut: fit.js hides a surname that doesn't fit (Juno on #367) */
}

/* Under 64px wide (list thumbnails): the title alone. */
@container (max-width: 63.98px) {
  .cv-none {
    padding: 10cqw 8cqw 0;
  }

  .cv-none i {
    display: none;
  }
}

.cvt-history {
  background: #3a3f5a;
}

.cvt-lives {
  background: #4a3c52;
}

.cvt-society {
  background: #2f4a4a;
}

.cvt-politics {
  background: #44303d;
}

.cvt-economics {
  background: #2c4a3b;
}

.cvt-business {
  background: #3a4651;
}

.cvt-nature {
  background: #34492f;
}

.cvt-science {
  background: #234059;
}

.cvt-technology {
  background: #333a44;
}

.cvt-health {
  background: #2d4c55;
}

.cvt-mind {
  background: #3e3d5e;
}

.cvt-philosophy {
  background: #2b2b38;
}

.cvt-arts {
  background: #4a3838;
}

.cvt-none {
  background: #2b2b38;
}
/* R3-93 (Juno): a small box is a typeset mini-cover, never a lone letter and never a blank slab. The old one-letter
   tile (UX-27) is retired; its <em class="cv-ini"> stays in the markup until the next full rebuild, never shown.
   96 to 133 px: every title step at 12cqi, up to 5 lines. 48 to 95 px: the title at max(8px, 14cqi), up to 4 lines,
   over the hairline where the surname sits on a big cover. Under 48 px: no type; a title-block mark (a 2 px rule
   over a 1 px rule) and the same hairline. The text is decoration: .cv-none is aria-hidden, and the row names the book.
   A home fan (.dh-fc, .dh-hc) and an opener strip (.strip) keep their own rules: their covers overlap, so a title there would be cut (Vera A on app #631).
   Long words break with a real hyphen (hyphens:auto, lang="en"); a word still too wide is clipped, never split (Juno). */
.cv-box .cv-none .cv-ini{display:none}
@container (min-width:96px) and (max-width:133.34px){.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b,.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-m,.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-s{visibility:visible;font-size:12cqi;-webkit-line-clamp:5;-webkit-hyphens:auto;hyphens:auto;overflow-wrap:normal;word-break:normal}}
@container (max-width:95.98px){.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none{padding:12cqw 10cqw 0}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none i{visibility:hidden}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b,.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-m,.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-s{visibility:visible;font-size:max(8px,14cqi);line-height:1.15;-webkit-line-clamp:4;-webkit-hyphens:auto;hyphens:auto;overflow-wrap:normal;word-break:normal}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none::after{content:'';position:absolute;left:10cqw;right:10cqw;bottom:16cqw;border-top:1px solid rgb(244 244 240/.3)}}
/* A title whose longest word would not fit a small tier's size steps down to the size it fits (cv-wN, coverFit at build and in
   cover-box.js), to the 8 px floor; only under the floor is a word clipped (Juno, R3-93 follow-up). */
@container (min-width:96px) and (max-width:133.34px){.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w11{font-size:max(8px,11cqi)}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w10{font-size:max(8px,10cqi)}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w9{font-size:max(8px,9cqi)}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w8{font-size:max(8px,8cqi)}}
@container (max-width:95.98px){.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w13{font-size:max(8px,13cqi)}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w12{font-size:max(8px,12cqi)}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w11{font-size:max(8px,11cqi)}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w10{font-size:max(8px,10cqi)}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w9{font-size:max(8px,9cqi)}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w8{font-size:max(8px,8cqi)}}
/* ...and where even the 8 px floor can't fit that word (a box under 800/N px), the title-block mark stands in for the title,
   so no word is ever clipped (Juno, R3-93 follow-up). */
@container (max-width:99.99px){.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w8{visibility:hidden}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none:has(> b.cv-w8)::before{content:'';position:absolute;left:12cqw;right:12cqw;top:16cqw;height:20cqw;border-top:max(2px,3cqw) solid rgb(244 244 240/.75);border-bottom:1px solid rgb(244 244 240/.3)}}
@container (max-width:88.88px){.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w9{visibility:hidden}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none:has(> b.cv-w9)::before{content:'';position:absolute;left:12cqw;right:12cqw;top:16cqw;height:20cqw;border-top:max(2px,3cqw) solid rgb(244 244 240/.75);border-bottom:1px solid rgb(244 244 240/.3)}}
@container (max-width:79.99px){.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w10{visibility:hidden}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none:has(> b.cv-w10)::before{content:'';position:absolute;left:12cqw;right:12cqw;top:16cqw;height:20cqw;border-top:max(2px,3cqw) solid rgb(244 244 240/.75);border-bottom:1px solid rgb(244 244 240/.3)}}
@container (max-width:72.72px){.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w11{visibility:hidden}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none:has(> b.cv-w11)::before{content:'';position:absolute;left:12cqw;right:12cqw;top:16cqw;height:20cqw;border-top:max(2px,3cqw) solid rgb(244 244 240/.75);border-bottom:1px solid rgb(244 244 240/.3)}}
@container (max-width:66.66px){.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w12{visibility:hidden}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none:has(> b.cv-w12)::before{content:'';position:absolute;left:12cqw;right:12cqw;top:16cqw;height:20cqw;border-top:max(2px,3cqw) solid rgb(244 244 240/.75);border-bottom:1px solid rgb(244 244 240/.3)}}
@container (max-width:61.53px){.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w13{visibility:hidden}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none:has(> b.cv-w13)::before{content:'';position:absolute;left:12cqw;right:12cqw;top:16cqw;height:20cqw;border-top:max(2px,3cqw) solid rgb(244 244 240/.75);border-bottom:1px solid rgb(244 244 240/.3)}}
@container (max-width:57.13px){.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w14{visibility:hidden}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none:has(> b.cv-w14)::before{content:'';position:absolute;left:12cqw;right:12cqw;top:16cqw;height:20cqw;border-top:max(2px,3cqw) solid rgb(244 244 240/.75);border-bottom:1px solid rgb(244 244 240/.3)}}
@container (max-width:53.32px){.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w15{visibility:hidden}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none:has(> b.cv-w15)::before{content:'';position:absolute;left:12cqw;right:12cqw;top:16cqw;height:20cqw;border-top:max(2px,3cqw) solid rgb(244 244 240/.75);border-bottom:1px solid rgb(244 244 240/.3)}}
@container (max-width:49.99px){.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w16{visibility:hidden}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none:has(> b.cv-w16)::before{content:'';position:absolute;left:12cqw;right:12cqw;top:16cqw;height:20cqw;border-top:max(2px,3cqw) solid rgb(244 244 240/.75);border-bottom:1px solid rgb(244 244 240/.3)}}
/* Under 64 px a typeset cover sits in a row that already names the book (the rate strip, search, Ask, shelf lists), so it
   always shows the title-block mark: text there only repeats the row, and mixing the two looks uneven (Juno, Vera B on
   #644). Fans keep their own rules; Discover's subject and genre tiles (.dh-sc) name a subject, so their covers keep the tiers. */
@container (max-width:63.98px){.cv-box:not(:is(.dh-fc, .dh-hc, .strip, .dh-sc) *) .cv-none b,.cv-box:not(:is(.dh-fc, .dh-hc, .strip, .dh-sc) *) .cv-none b.cv-m,.cv-box:not(:is(.dh-fc, .dh-hc, .strip, .dh-sc) *) .cv-none b.cv-s{visibility:hidden}.cv-box:not(:is(.dh-fc, .dh-hc, .strip, .dh-sc) *) .cv-none::before{content:'';position:absolute;left:12cqw;right:12cqw;top:16cqw;height:20cqw;border-top:max(2px,3cqw) solid rgb(244 244 240/.75);border-bottom:1px solid rgb(244 244 240/.3)}}
@container (max-width:47.98px){.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b,.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-m,.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-s{visibility:hidden}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none::before{content:'';position:absolute;left:12cqw;right:12cqw;top:16cqw;height:20cqw;border-top:max(2px,3cqw) solid rgb(244 244 240/.75);border-bottom:1px solid rgb(244 244 240/.3)}}
/* Home's fans (.dh-fc, .dh-hc): the covers overlap, so a typeset card shows the title-block mark and the hairline,
   never its title (home.css hides the text), at every size and on the front cover too: never a blank block (R3-45),
   never a clipped title (Juno, R3-93 follow-up, Vera A on app #631). */
:is(.dh-fc,.dh-hc) .cv-box:not(:has(> img)) .cv-none::before{content:'';position:absolute;left:12cqw;right:12cqw;top:16cqw;height:20cqw;border-top:max(2px,3cqw) solid rgb(244 244 240/.75);border-bottom:1px solid rgb(244 244 240/.3)}
:is(.dh-fc,.dh-hc) .cv-box:not(:has(> img)) .cv-none::after{content:'';position:absolute;left:10cqw;right:10cqw;bottom:16cqw;border-top:1px solid rgb(244 244 240/.3)}
