/* THE REVOLVING BOOKSHELF (@ovi 2026-10-28). Library only.
   A ring of eight real faces that recycles, so "as many sides as necessary" is true of the
   results without asking the browser to build a 244-sided prism. */
#ovi-rev { position: relative; width: 100%; }
#ovi-rev * { box-sizing: border-box; }

/* asking it for books */
.rv-ask { display: flex; gap: 7px; padding: 0 14px; margin: 6px 0 10px; position: relative; }
.rv-ask input {
  flex: 1 1 auto; min-width: 0; height: 42px; padding: 0 12px;
  font: 500 15px/1 var(--ovi-body, inherit); color: inherit;
  background: rgba(128,128,128,.12);
  border: 1px solid rgba(128,128,128,.4); border-radius: 9px;
}
.rv-ask button {
  flex: 0 0 auto; height: 42px; padding: 0 13px; cursor: pointer;
  font: 600 13px/1 var(--ovi-body, inherit); color: inherit; background: transparent;
  border: 1px solid rgba(128,128,128,.5); border-radius: 9px;
}
/* Pressed in, so it is obvious you are looking at your own shelf and not a search.
   Tinted rather than inverted: the page's text colour is a theme field and painting the
   label with the background colour guesses at a value this component does not own. */
.rv-ask button.on {
  background: rgba(128,128,128,.34); border-color: currentColor;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.35);
}
.rv-sug {
  position: absolute; left: 14px; right: 14px; top: 46px; z-index: 20;
  /* A PAIR, NEVER ONE HALF OF IT. This took its background from --ovi-bg, which the site
     does not define, so it was always #111, and its text from the page with `inherit`,
     which on a light page is dark: black on black, contrast 1.11. Robin: "the drop down is
     black text on black block." Both halves are set here so no theme can split them. */
  background: #15140f; color: #f2ecd9;
  border: 1px solid rgba(128,128,128,.45); border-radius: 9px; overflow: hidden;
  box-shadow: 0 10px 26px rgba(0,0,0,.4);
}
.rv-sug[hidden] { display: none; }
.rv-sug b { display: block; padding: 7px 11px 3px; font: 700 10.5px/1 var(--ovi-body, inherit);
  letter-spacing: .14em; text-transform: uppercase; opacity: .5; }
.rv-sug a { display: flex; justify-content: space-between; gap: 10px;
  padding: 9px 11px; color: inherit; text-decoration: none;
  font: 500 14px/1.2 var(--ovi-body, inherit);
  border-top: 1px solid rgba(128,128,128,.18); }
.rv-sug a span { opacity: .5; font-size: 12px; }

/* the shelf itself */
/* Robin: "Can u make the frame bigger the shelf is clipped when it turns."
   Two separate causes. The stage was the width of the page column, so the sides of the
   cube were cut off at a visible box edge; it now bleeds to the full window and the
   neighbouring sides run off the screen instead, which is what a real shelf does. And a
   face turning towards you comes CLOSER, so perspective makes it bigger than the stage —
   the ring is pushed back and the face padded so the near corner has somewhere to go. */
.rv-stage {
  position: relative;
  width: 100vw; margin-left: calc(50% - 50vw);
  height: 78vh; min-height: 420px;
  perspective: 1000px; overflow: hidden;
  touch-action: pan-y;        /* the page still scrolls; a horizontal drag is ours */
}
.rv-ring {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
}
/* A face is NARROWER than the stage. At full width the neighbours sit exactly off the
   edge and the thing reads as a flat carousel — you never see that it is a cube. Giving
   the face about three quarters of the stage lets the two sides next to it stay in
   frame, turned away, which is the whole illusion. Width is set from script, because the
   radius has to be computed from the same number. */
.rv-face {
  position: absolute; top: 0; height: 100%;
  display: flex; flex-direction: column; justify-content: center;
  padding: 16px 10px;
  backface-visibility: hidden;
  /* the carcass of a bookcase: two uprights and a top */
  border: 2px solid #4a361f;
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(30,22,13,.55), rgba(16,11,6,.8));
  box-shadow: inset 0 0 36px rgba(0,0,0,.55);
}
/* a shelf inside it: books standing on a plank */
.rv-row { flex: 0 0 auto; display: flex; flex-direction: column; justify-content: flex-end; }
/* Books are sized by the HEIGHT of the shelf they stand on, the way real ones are.
   Sizing by column width made each one 1.5 times the shelf tall and three rows spilled
   out of the face. The width comes from script rather than from aspect-ratio, which this
   browser does not have. */
.rv-row .rv-slots { display: flex; gap: 10px;
  align-items: flex-end; justify-content: center; }
.rv-row .rv-plank { height: 9px; margin: 2px 0 7px; border-radius: 1px;
  background: linear-gradient(180deg, #7a5a39, #3a2a16);
  box-shadow: 0 3px 7px rgba(0,0,0,.5); }

/* a book, face forward, which is the whole point */
.rv-book {
  position: relative; flex: 0 0 auto;
  height: var(--rv-bh, 170px); width: var(--rv-bw, 113px);
  border-radius: 2px; overflow: hidden; cursor: pointer;
  background: #2a2520;
  box-shadow: 0 4px 10px rgba(0,0,0,.45);
  transition: transform .2s ease, box-shadow .2s ease;
}
.rv-book img { width: 100%; height: 100%; object-fit: cover; display: block;
  -webkit-user-drag: none; user-select: none; pointer-events: none; }
/* when Gutenberg has no cover, the book still has a face */
.rv-book .rv-plain {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  justify-content: center; gap: 6px; padding: 9px;
  background: linear-gradient(160deg, #4a3b28, #2b2018);
  font: 600 10.5px/1.25 var(--ovi-body, inherit); color: #e8dcc2; text-align: center;
}
.rv-book .rv-plain i { font-style: normal; font-size: 9px; opacity: .65; }
.rv-book.rv-lift { transform: translateY(-8px) scale(1.04); box-shadow: 0 14px 22px rgba(0,0,0,.6); }

/* the letter, while it spins */
.rv-letter {
  position: absolute; inset: 0; z-index: 8; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  font: 800 34vw/1 var(--ovi-heading, Georgia, serif);
  color: rgba(255,255,255,.9); text-shadow: 0 6px 30px rgba(0,0,0,.6);
  opacity: 0; transition: opacity .18s ease;
}
.rv-letter.on { opacity: .92; }

/* where you are */
.rv-foot {
  display: flex; align-items: center; gap: 10px; padding: 7px 16px 2px;
  font: 500 12px/1.2 var(--ovi-body, inherit); opacity: .72;
}
.rv-foot .rv-bar { flex: 1 1 auto; height: 3px; border-radius: 2px;
  background: rgba(128,128,128,.3); overflow: hidden; }
.rv-foot .rv-bar i { display: block; height: 100%; width: 0; background: currentColor; }

/* A BOOK TAKEN OFF THE SHELF.
   Robin: "when i select a book the pop up is clipped." It lived inside the stage, and the
   stage is overflow:hidden and shorter than the card wanted to be, so a cover plus a title
   plus three buttons could never fit. It belongs to the window, not to the shelf. */
.rv-held {
  position: fixed; inset: 0; z-index: 2147483000; display: none;
  align-items: center; justify-content: center; padding: 22px;
  background: rgba(0,0,0,.78); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
}
.rv-held.on { display: flex; }
.rv-held .rv-card {
  width: min(82vw, 320px); max-height: 92vh; overflow-y: auto;
  text-align: center; color: #fff; }
.rv-held .rv-card img, .rv-held .rv-card .rv-plain {
  display: block; width: 100%; max-height: 52vh; object-fit: contain; border-radius: 3px;
  box-shadow: 0 20px 40px rgba(0,0,0,.6); position: relative; }
.rv-held h4 { margin: 11px 0 2px; font: 700 15px/1.25 var(--ovi-heading, inherit); }
.rv-held p { margin: 0 0 12px; font: 500 12.5px/1.3 var(--ovi-body, inherit); opacity: .75; }
.rv-held .rv-acts { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.rv-held button {
  padding: 9px 14px; cursor: pointer; color: #fff; background: transparent;
  border: 1px solid rgba(255,255,255,.55); border-radius: 8px;
  font: 600 13px/1 var(--ovi-body, inherit);
}
.rv-held button.rv-go { background: #fff; color: #111; border-color: #fff; }

.rv-said { padding: 6px 16px 0; font: 500 13px/1.35 var(--ovi-body, inherit); opacity: .75; }
.rv-said[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .rv-ring, .rv-book, .rv-letter { transition: none !important; }
}

/* ovi-cube-scroll: keeping a book is press and hold, so an iPhone must not answer a long press on a cover with its save image callout or a text selection */
.rv-book, .rv-book * { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

/* ovi-libs: the strip of libraries above the search box, and an excerpt card */
.rv-libs { display: flex; gap: 7px; padding: 0 14px; margin: 8px 0 0; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.rv-libs::-webkit-scrollbar { display: none; }
.rv-libs[hidden] { display: none; }
.rv-libs button { flex: 0 0 auto; height: 34px; padding: 0 13px; cursor: pointer; font: 600 13px/1 var(--ovi-body, inherit); color: inherit; background: transparent;
  border: 1px solid rgba(128,128,128,.5); border-radius: 17px; white-space: nowrap; }
.rv-libs button span { opacity: .6; font-weight: 500; margin-left: 3px; }
.rv-libs button.on { background: rgba(128,128,128,.34); border-color: currentColor; box-shadow: inset 0 1px 3px rgba(0,0,0,.35); }
.rv-held .rv-ex { width: min(90vw, 440px); }
.rv-held .rv-ex-t { text-align: left; white-space: pre-wrap; font: 400 13.5px/1.5 var(--ovi-body, inherit); max-height: 46vh; overflow-y: auto; touch-action: pan-y;
  -webkit-overflow-scrolling: touch; padding: 12px 14px; background: rgba(255,255,255,.07); border-radius: 8px; margin: 0 0 8px; }
.rv-held .rv-ex-n { font-size: 11.5px; opacity: .6; margin: 0 0 12px; }
.rv-held a.rv-go { display: inline-block; padding: 9px 14px; background: #fff; color: #111; border: 1px solid #fff; border-radius: 8px; font: 600 13px/1 var(--ovi-body, inherit); text-decoration: none; }

/* ovi-archive-lib: the Archive's reader in a frame over the shelf */
.rv-held .rv-embed { width: min(96vw, 760px); max-height: 96vh; }
.rv-held .rv-embed iframe { display: block; width: 100%; height: 72vh; border: 0; background: #fff; border-radius: 6px; margin-bottom: 10px; }

/* ovi-film-cap: the title, printed over the foot of a film poster */
.rv-book .rv-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 6px 6px; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,.82) 55%, rgba(0,0,0,.9));
  color: #fff; font: 700 10.5px/1.2 var(--ovi-body, inherit); text-align: left; text-shadow: 0 1px 2px rgba(0,0,0,.8);
  overflow-wrap: anywhere; max-height: 100%; box-sizing: border-box;   /* ovi-title-fit: no line limit, the type size follows the title length */
}
.rv-book .rv-plain span { overflow-wrap: anywhere; }

/* ovi-subs: the sub-categories under the strip of libraries */
.rv-subs { margin: 6px 0 0; padding: 0 14px; display: flex; flex-direction: column; gap: 5px; min-width: 0; max-width: 100%; }
.rv-subs[hidden] { display: none; }
.rv-sub-row { display: flex; align-items: center; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; min-width: 0; padding: 1px 0; }
.rv-sub-row::-webkit-scrollbar { display: none; }
.rv-sub-row b { flex: 0 0 auto; font: 700 10px/1 var(--ovi-body, inherit); letter-spacing: .08em; text-transform: uppercase; opacity: .62; margin-right: 2px; }
.rv-sub-row button { flex: 0 0 auto; height: 28px; padding: 0 11px; cursor: pointer; font: 600 12px/1 var(--ovi-body, inherit); color: inherit; background: transparent;
  border: 1px solid rgba(128,128,128,.45); border-radius: 14px; white-space: nowrap; }
.rv-sub-row button span { opacity: .6; font-weight: 500; margin-left: 3px; }
.rv-sub-row button.on { background: rgba(128,128,128,.34); border-color: currentColor; box-shadow: inset 0 1px 3px rgba(0,0,0,.3); }
