/* Physical details for the Learning Studio collection. Load after site.css.
 * Decoration is confined to bookshelf view: all resource buttons and their
 * existing hover/focus/touch behaviour remain owned by library.js/library.css.
 */
.learning-library .lib-book-detail { display: none; pointer-events: none; }

.learning-library[data-library-view="shelf"] {
  --lib-row-height: 282px;
  --lib-row-gap: 34px;
  --lib-row-step: 316px;
  --lib-case-wood: #d4b590;
  --lib-case-dark: #8b684e;
  --lib-case-paper: #ead8bd;
}

/* One framed case, with continuous uprights and a recessed back behind each
 * group. Repeating plank bands follow the actual grid row, including its gap.
 */
.learning-library[data-library-view="shelf"] .lib-shelves {
  position: relative;
  padding: 33px 33px 16px;
  border: 1px solid #b08b68;
  border-top: 12px solid #d3af87;
  border-bottom: 13px solid #bc956f;
  border-radius: 20px 20px 17px 17px;
  background:
    repeating-linear-gradient(91deg, transparent 0 5px, #8a654709 5px 6px, transparent 6px 11px, #fff5d512 11px 12px, transparent 12px 29px),
    linear-gradient(90deg, #c9a780, #e0c3a0 5%, #ead8bd 21%, #ead8bd 79%, #dfc29e 95%, #c5a17a);
  box-shadow:
    inset 0 2px 0 #fff1d8aa,
    inset 0 -2px 0 #8a65472b,
    0 18px 30px -26px #5f3d36b3,
    0 3px 5px #68432a13;
  overflow: visible;
}
.learning-library[data-library-view="shelf"] .lib-shelves::before,
.learning-library[data-library-view="shelf"] .lib-shelves::after {
  content: '';
  position: absolute;
  top: 5px;
  bottom: 5px;
  width: 15px;
  border: 1px solid #ad866028;
  border-radius: 5px;
  background:
    repeating-linear-gradient(89deg, transparent 0 3px, #7a573915 3px 4px, transparent 4px 7px),
    linear-gradient(90deg, #b58d66, #e2c39a 29%, #d5b18b 68%, #b48a62);
  pointer-events: none;
}
.learning-library[data-library-view="shelf"] .lib-shelves::before {
  left: 7px;
  box-shadow: 3px 1px 4px #7451392b, inset 1px 0 0 #ffe5bd9c;
}
.learning-library[data-library-view="shelf"] .lib-shelves::after {
  right: 7px;
  box-shadow: -3px 1px 4px #7451392b, inset -1px 0 0 #ffe5bd9c;
}
.learning-library[data-library-view="shelf"] .lib-shelf-group {
  position: relative;
  margin-block: 33px 38px;
}
.learning-library[data-library-view="shelf"] .lib-shelf-group:first-child { margin-top: 0; }
.learning-library[data-library-view="shelf"] .lib-shelf-group:last-child { margin-bottom: 0; }
.learning-library[data-library-view="shelf"] .lib-shelf-heading {
  gap: 20px;
  margin-bottom: 25px;
  padding-inline: 4px;
}
.learning-library[data-library-view="shelf"] .lib-shelf-title {
  font-size: clamp(26px, 2.7vw, 34px);
  color: #513748;
  text-shadow: 0 1px 0 #fff4de99;
}
.learning-library[data-library-view="shelf"] .lib-shelf-count { color: #6c504c; }
.learning-library[data-library-view="shelf"] .lib-books {
  position: relative;
  grid-auto-rows: var(--lib-row-height);
  row-gap: var(--lib-row-gap);
  border-inline: 1px solid #a4816238;
  border-radius: 3px;
  background-color: #e0c9aa;
  background-image:
    /* Lit top edge, thick fascia and the fine dark underside of each plank. */
    repeating-linear-gradient(180deg,
      transparent 0 calc(var(--lib-row-height) - 21px),
      #efd9b8 calc(var(--lib-row-height) - 21px) calc(var(--lib-row-height) - 16px),
      #dcc099 calc(var(--lib-row-height) - 16px) calc(var(--lib-row-height) - 13px),
      #b7906b calc(var(--lib-row-height) - 13px) calc(var(--lib-row-height) - 12px),
      #d4ad81 calc(var(--lib-row-height) - 12px) calc(var(--lib-row-height) - 3px),
      #bd936a calc(var(--lib-row-height) - 3px) calc(var(--lib-row-height) - 1px),
      #896447 calc(var(--lib-row-height) - 1px) var(--lib-row-height),
      transparent var(--lib-row-height) var(--lib-row-step)),
    /* Horizontal cabinet grain. Fine enough to remain a quiet material cue. */
    repeating-linear-gradient(180deg,
      transparent 0 3px, #8d6a4810 3px 4px, transparent 4px 9px,
      #fff1d713 9px 10px, transparent 10px 17px),
    /* Vertical back-board seams, with gentle irregularity in their spacing. */
    repeating-linear-gradient(90deg,
      transparent 0 89px, #a8896924 89px 90px, #f4e4c526 90px 92px,
      transparent 92px 197px, #a889691c 197px 198px, transparent 198px 278px),
    linear-gradient(90deg, #79563c20, transparent 6%, transparent 94%, #79563c20),
    repeating-linear-gradient(180deg,
      #74523b23 0, transparent 33px,
      transparent calc(var(--lib-row-height) - 39px),
      #8a65471b calc(var(--lib-row-height) - 21px),
      transparent var(--lib-row-height), #8767470f calc(var(--lib-row-height) + 1px),
      #e6d1b2 var(--lib-row-step));
  box-shadow: inset 3px 0 6px #79563c12, inset -3px 0 6px #79563c12;
}
.learning-library[data-library-view="shelf"] .lib-book-slot { height: var(--lib-row-height); }
/* Continuous shelves belong to the case, not to each individual book slot. */
.learning-library[data-library-view="shelf"] .lib-book-slot::before,
.learning-library[data-library-view="shelf"] .lib-book-slot::after { display: none; }

/* Slightly rounded binding, a visible cover board and an ivory page block.
 * The titles keep their original high-contrast ink and original font size.
 */
.learning-library[data-library-view="shelf"] .lib-book {
  --lib-foil: #d8b779;
  border-radius: 5px 6px 6px 5px;
}
.learning-library[data-library-view="shelf"] .lib-book[data-tone="1"],
.learning-library[data-library-view="shelf"] .lib-book[data-tone="2"],
.learning-library[data-library-view="shelf"] .lib-book[data-tone="3"],
.learning-library[data-library-view="shelf"] .lib-book[data-tone="4"],
.learning-library[data-library-view="shelf"] .lib-book[data-tone="5"] { --lib-foil: #92704a; }
.learning-library[data-library-view="shelf"] .lib-book-detail { display: block; }
.learning-library[data-library-view="shelf"] .lib-book-cover-edge {
  position: absolute;
  top: 1px;
  bottom: 1px;
  right: -7px;
  width: 9px;
  border: 1px solid #482e4938;
  border-radius: 1px 4px 4px 1px;
  background: linear-gradient(90deg, #482e494a, #fff7e32b 76%, #482e4938), var(--lib-spine);
  transform: skewY(-7deg);
  transform-origin: left center;
  z-index: -2;
}
.learning-library[data-library-view="shelf"] .lib-book-pageblock {
  position: absolute;
  top: 6px;
  bottom: 6px;
  right: -4px;
  width: 6px;
  border: 1px solid #b5a084;
  border-left: 0;
  border-radius: 0 2px 2px 0;
  background:
    repeating-linear-gradient(180deg, #f4e8d0 0 1px, #c9b99b 1px 1.5px, #f7ecd7 1.5px 3px),
    #ecdfc6;
  box-shadow: inset -2px 0 2px #91744a24;
  transform: skewY(-7deg);
  transform-origin: left center;
  z-index: -1;
}
.learning-library[data-library-view="shelf"] .lib-book-spine {
  padding: 23px 11px 30px;
  gap: 12px;
  border: 1px solid #482e493d;
  background-color: var(--lib-spine);
  background-image:
    /* Original, CSS-only woven cloth and soft cover curvature. */
    repeating-linear-gradient(0deg, #fffaf00c 0 .65px, transparent .65px 3px),
    repeating-linear-gradient(90deg, #38223d0b 0 .65px, transparent .65px 3px),
    linear-gradient(90deg, #39233d2e 0, #fff2d724 8%, transparent 17%, transparent 77%, #3d25452e 94%, #fff4db1c);
  box-shadow:
    inset 1px 0 1px #fff2d744,
    inset -3px 0 3px #3f284c38,
    inset 0 1px 0 #fff2dc44,
    inset 0 -2px 1px #3d254526,
    5px 3px 4px #4f382d25;
  z-index: 1;
}
.learning-library[data-library-view="shelf"] .lib-book[data-binding="paper"] .lib-book-spine {
  background-image:
    repeating-linear-gradient(113deg, transparent 0 2px, #583a470a 2px 2.5px, transparent 2.5px 5px),
    linear-gradient(90deg, #482e4926, #fff6e729 8%, transparent 17%, transparent 81%, #482e492b 96%);
}
.learning-library[data-library-view="shelf"] .lib-book-spine::before {
  top: 5px;
  bottom: 5px;
  left: 5px;
  width: 3px;
  border: 0;
  border-left: 1px solid #38223d;
  border-right: 1px solid #fff5de;
  opacity: .2;
}
.learning-library[data-library-view="shelf"] .lib-book-spine::after {
  inset: 1px;
  border: 0;
  border-radius: inherit;
  opacity: .52;
  background:
    radial-gradient(ellipse at 1px 0, #fff0d655, transparent 8px),
    radial-gradient(ellipse at 100% 100%, #fff0d645, transparent 8px);
  pointer-events: none;
}
.learning-library[data-library-view="shelf"] .lib-book-title {
  flex: 1 1 auto;
  height: auto;
  max-height: none;
  position: relative;
  z-index: 1;
}
.learning-library[data-library-view="shelf"] .lib-book-number {
  position: relative;
  color: var(--lib-spine-ink);
  opacity: .88;
  z-index: 1;
}
.learning-library[data-library-view="shelf"] .lib-book-band {
  position: absolute;
  left: 8px;
  right: 6px;
  height: 5px;
  border-top: 1px solid var(--lib-foil);
  border-bottom: 1px solid var(--lib-foil);
  background: linear-gradient(180deg, #fff8dd2b, transparent 50%, #38223d1c);
  box-shadow: 0 -1px 0 #38223d0f, 0 1px 0 #fff6e31c;
}
.learning-library[data-library-view="shelf"] .lib-book-band-head { top: 9px; }
.learning-library[data-library-view="shelf"] .lib-book-band-tail { bottom: 9px; }
.learning-library[data-library-view="shelf"] .lib-book-emblem {
  position: absolute;
  left: 50%;
  bottom: 19px;
  width: 16px;
  height: 12px;
  color: var(--lib-foil);
  transform: translateX(-50%);
  opacity: .9;
}
.learning-library[data-library-view="shelf"] .lib-book-emblem::before,
.learning-library[data-library-view="shelf"] .lib-book-emblem::after {
  content: '';
  position: absolute;
  pointer-events: none;
}
/* Tiny decorative motifs, never fabricated author names or publication marks. */
.learning-library[data-library-view="shelf"] .lib-book[data-emblem="pages"] .lib-book-emblem::before {
  inset: 1px 8px 1px 0;
  border: 1px solid currentColor;
  border-radius: 2px 0 0 1px;
  transform: skewY(11deg);
}
.learning-library[data-library-view="shelf"] .lib-book[data-emblem="pages"] .lib-book-emblem::after {
  inset: 1px 0 1px 8px;
  border: 1px solid currentColor;
  border-radius: 0 2px 1px 0;
  transform: skewY(-11deg);
}
.learning-library[data-library-view="shelf"] .lib-book[data-emblem="code"] .lib-book-emblem::before {
  width: 7px;
  height: 7px;
  left: 0;
  top: 2px;
  border-left: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
}
.learning-library[data-library-view="shelf"] .lib-book[data-emblem="code"] .lib-book-emblem::after {
  width: 7px;
  height: 7px;
  right: 0;
  top: 2px;
  border-right: 1px solid currentColor;
  border-top: 1px solid currentColor;
  transform: rotate(45deg);
}
.learning-library[data-library-view="shelf"] .lib-book[data-emblem="network"] .lib-book-emblem {
  background:
    radial-gradient(circle at 2px 9px, currentColor 0 1.4px, transparent 1.7px),
    radial-gradient(circle at 8px 2px, currentColor 0 1.4px, transparent 1.7px),
    radial-gradient(circle at 14px 9px, currentColor 0 1.4px, transparent 1.7px);
}
.learning-library[data-library-view="shelf"] .lib-book[data-emblem="network"] .lib-book-emblem::before {
  width: 10px;
  height: 1px;
  left: 0;
  top: 6px;
  background: currentColor;
  transform: rotate(-49deg);
}
.learning-library[data-library-view="shelf"] .lib-book[data-emblem="network"] .lib-book-emblem::after {
  width: 10px;
  height: 1px;
  right: 0;
  top: 6px;
  background: currentColor;
  transform: rotate(49deg);
}
.learning-library[data-library-view="shelf"] .lib-book[data-emblem="seal"] .lib-book-emblem::before {
  width: 9px;
  height: 9px;
  top: 1px;
  left: 3px;
  border: 1px solid currentColor;
  transform: rotate(45deg);
}
.learning-library[data-library-view="shelf"] .lib-book[data-emblem="seal"] .lib-book-emblem::after {
  width: 3px;
  height: 3px;
  top: 4px;
  left: 6px;
  background: currentColor;
  border-radius: 50%;
}

/* Titles can rise out of the case. Neither the frame nor its back clips the
 * existing, viewport-positioned full-title disclosure or keyboard outline.
 */
.learning-library[data-library-view="shelf"] .lib-book-peek { z-index: 8; }
.learning-library[data-library-view="shelf"] .lib-book:focus-visible { outline-color: #68406e; }

/* Compact/touch layouts already have a selection panel. Keep its complete
 * title readable there instead of duplicating it over neighbouring shelves.
 * Let long titles, metadata and text zoom grow the panel around its control.
 */
.learning-library[data-library-view="shelf"][data-coarse-input="true"] .lib-selection {
  height: auto;
  min-height: 154px;
}
.learning-library[data-library-view="shelf"][data-coarse-input="true"] .lib-selection-title {
  display: block;
  max-height: none;
  overflow: visible;
  -webkit-line-clamp: unset;
}
.learning-library[data-library-view="shelf"][data-coarse-input="true"] .lib-selection-meta {
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
}
.learning-library[data-library-view="shelf"][data-coarse-input="true"] .lib-book .lib-book-peek {
  display: none;
}
@media (max-width: 650px) {
  .learning-library[data-library-view="shelf"][data-coarse-input="true"] .lib-selection { min-height: 190px; }
}

@media (max-width: 540px) {
  .learning-library[data-library-view="shelf"] {
    --lib-row-height: 272px;
    --lib-row-gap: 30px;
    --lib-row-step: 302px;
  }
  .learning-library[data-library-view="shelf"] .lib-shelves {
    padding: 22px 16px 13px;
    border-top-width: 10px;
    border-bottom-width: 11px;
    border-radius: 17px;
  }
  .learning-library[data-library-view="shelf"] .lib-shelves::before,
  .learning-library[data-library-view="shelf"] .lib-shelves::after { width: 8px; }
  .learning-library[data-library-view="shelf"] .lib-shelves::before { left: 3px; }
  .learning-library[data-library-view="shelf"] .lib-shelves::after { right: 3px; }
  .learning-library[data-library-view="shelf"] .lib-shelf-heading { gap: 12px; padding-inline: 2px; margin-bottom: 24px; }
  .learning-library[data-library-view="shelf"] .lib-shelf-title { font-size: 28px; }
  .learning-library[data-library-view="shelf"] .lib-shelf-count { font-size: 14px; }
  .learning-library[data-library-view="shelf"] .lib-book-spine { padding-inline: 8px; }
  .learning-library[data-library-view="shelf"][data-coarse-input="true"] .lib-selection { min-height: 220px; }
}

/* A separate gold binding family identifies the publication/manuscript
 * records. Status remains readable in the full-title disclosure, selection
 * panel and reading list; a gold cover does not imply a published outcome.
 * Five shades and static foil flecks give material depth without flashing.
 */
.learning-library[data-library-view="shelf"] .lib-shelf-group[data-publication-shelf="true"] .lib-shelf-title {
  text-decoration: underline;
  text-decoration-color: #a47e405c;
  text-decoration-thickness: 1px;
  text-underline-offset: .25em;
}
.learning-library[data-library-view="shelf"] .lib-book[data-publication="true"] {
  --lib-spine: #d8bd7b;
  --lib-spine-ink: #392736;
  --lib-foil: #795523;
}
.learning-library[data-library-view="shelf"] .lib-book[data-publication="true"][data-gold-tone="1"] { --lib-spine: #bc9454; }
.learning-library[data-library-view="shelf"] .lib-book[data-publication="true"][data-gold-tone="2"] { --lib-spine: #ead59b; }
.learning-library[data-library-view="shelf"] .lib-book[data-publication="true"][data-gold-tone="3"] { --lib-spine: #c6aa69; }
.learning-library[data-library-view="shelf"] .lib-book[data-publication="true"][data-gold-tone="4"] { --lib-spine: #ddc492; }
.learning-library[data-library-view="shelf"] .lib-book[data-publication="true"] .lib-book-spine {
  border-color: #7955239e;
  background-image:
    repeating-linear-gradient(0deg, #fff9df12 0 .7px, transparent .7px 3px),
    repeating-linear-gradient(90deg, #6445170a 0 .6px, transparent .6px 3px),
    linear-gradient(90deg, #67491f35, #fff3cc55 9%, transparent 22%, transparent 73%, #72532035 94%, #fff4d646);
  box-shadow:
    inset 1px 0 1px #fff2bc99,
    inset -3px 0 3px #70501e52,
    inset 0 1px 0 #fff6dbaa,
    inset 0 -2px 1px #7c592e44,
    5px 3px 4px #4f382d25;
}
.learning-library[data-library-view="shelf"] .lib-book[data-publication="true"] .lib-book-band {
  z-index: 2;
  border-color: #805c2b;
  background: linear-gradient(180deg, #fff7d5ad, #b28b4355 48%, #73501b70);
}
.learning-library[data-library-view="shelf"] .lib-book[data-publication="true"] .lib-book-emblem { z-index: 2; color: #725023; }
.learning-library[data-library-view="shelf"] .lib-book[data-publication="true"] .lib-book-foil {
  position: absolute;
  inset: 5px 4px;
  z-index: 0;
  border: 1px solid #fff3cb52;
  border-radius: 2px;
  opacity: .47;
  background-image:
    radial-gradient(ellipse at 13% 24%, #fff9dcd9 0 .55px, transparent .9px),
    radial-gradient(ellipse at 79% 62%, #fff9dcd1 0 .6px, transparent 1px),
    radial-gradient(ellipse at 34% 83%, #79562450 0 .5px, transparent 1px),
    linear-gradient(116deg, transparent 20%, #fff8db00 34%, #fff8db70 47%, #fff8db00 60%, transparent 77%);
  background-size: 13px 23px, 19px 29px, 23px 17px, 240% 100%;
  background-position: 0 0, 4px 8px, 2px 1px, 90% 0;
  transition: opacity .28s ease, background-position .45s ease;
}
.learning-library[data-library-view="shelf"] .lib-book[data-publication="true"]:is(:hover, :focus-visible, [data-selected="true"]) .lib-book-foil {
  opacity: .7;
  background-position: 0 0, 4px 8px, 2px 1px, 12% 0;
}

@media (prefers-reduced-motion: reduce) {
  .learning-library[data-library-view="shelf"] .lib-book-detail { animation: none; transition: none; }
}
@media (forced-colors: active) {
  .learning-library[data-library-view="shelf"] .lib-book-detail,
  .learning-library[data-library-view="shelf"] .lib-shelves::before,
  .learning-library[data-library-view="shelf"] .lib-shelves::after { display: none; }
  .learning-library[data-library-view="shelf"] .lib-shelves,
  .learning-library[data-library-view="shelf"] .lib-books { border: 1px solid CanvasText; background: Canvas; }
  .learning-library[data-library-view="shelf"] .lib-book-spine { border-color: ButtonText; }
  .learning-library[data-library-view="shelf"] .lib-book[data-publication="true"] .lib-book-spine { background: ButtonFace; color: ButtonText; box-shadow: none; border-color: ButtonText; }
}
