/* F5-02 Biblioteca / The exact approved Hablemos room photograph, used as a
   closer editorial view. Six genuine covers stand on the same round table.
   No edits to the approved Hablemos photograph, CSS or scene. */
#libros.rve-library{
  position:relative;isolation:isolate;overflow:hidden;
  background:#e9e3da;color:#26231f;padding:0!important;scroll-margin-top:0;
}
#libros.rve-library::before{display:none}
#libros .rve-library-layout{
  position:relative;display:block;width:100%;max-width:none;
  min-height:760px;height:100%;margin:0;
}
/* One image-coordinate stage for both the photograph and all six books. */
#libros .rve-library-desk{
  position:absolute;inset:0;z-index:1;width:100%;height:100%;min-width:0;
  aspect-ratio:auto;overflow:hidden;isolation:isolate;
}
#libros .rve-library-plane{
  /* Crops the LEFT side of the Hablemos photograph so the real bookcase,
     round table and the blue chair on the RIGHT remain visible. */
  position:absolute;left:clamp(-335px,-19.5vw,-240px);top:50%;
  width:clamp(1180px,87vw,1480px);height:auto;aspect-ratio:1672/941;
  transform:translateY(-50%);isolation:isolate;
}
#libros .rve-library-table{
  position:absolute;inset:0;z-index:0;display:block;width:100%;height:100%;
  object-fit:contain;object-position:center;pointer-events:none;user-select:none;
  filter:none;
  -webkit-mask-image:linear-gradient(90deg,transparent 0%,#000 11%,#000 88%,transparent 100%);
  mask-image:linear-gradient(90deg,transparent 0%,#000 11%,#000 88%,transparent 100%);
}
/* Soft feather only where editorial copy begins, with the scene undisturbed. */
#libros.rve-library::after{
  content:'';position:absolute;inset:0;z-index:2;pointer-events:none;
  /* The image has no hard border: Hablemos-style feather on four sides. */
  background:
    linear-gradient(180deg,#e9e3da 0%,rgba(233,227,218,.23) 12%,transparent 22%,transparent 76%,rgba(233,227,218,.32) 90%,#e9e3da 100%),
    linear-gradient(90deg,rgba(233,227,218,.92) 0%,rgba(233,227,218,.18) 6%,transparent 13%,transparent 52%,rgba(233,227,218,.15) 61%,rgba(233,227,218,.79) 70%,#e9e3da 77%);
}
/* F5-02 Biblioteca: six actual cover textures rendered on physical volumes.
   One shared tabletop camera, window light, A-frame stands and contact shadows.
   All geometry is baked into a transparent WEBP. CSS only aligns the image and
   the six keyboard-accessible selection hotspots with the approved photograph. */
#libros .rve-library-books-render{
  position:absolute;inset:0;z-index:1;display:block;width:100%;height:100%;
  object-fit:contain;object-position:center;pointer-events:none;user-select:none;
}
#libros .rve-book-rests,#libros .rve-lib-desk-item,#libros .rve-lib-label{display:none!important}
#libros .rve-book-ensemble{
  position:absolute;z-index:4;left:var(--hit-x);top:var(--hit-y);
  width:var(--hit-w);height:var(--hit-h);pointer-events:none;
}
#libros .rve-lib-book{
  position:absolute;inset:0;display:block;width:100%;height:100%;padding:0;
  appearance:none;border:0;background:transparent;cursor:pointer;pointer-events:auto;
  touch-action:manipulation;-webkit-tap-highlight-color:transparent;
  /* The photographic object is an image; never transform these click targets. */
  transform:none!important;filter:none!important;transition:none;
}
#libros .rve-lib-cover{
  position:absolute;left:0;top:0;width:1px;height:1px;overflow:hidden;
  clip-path:inset(50%);white-space:nowrap;
}
#libros .rve-lib-book:hover{outline:2px solid rgba(162,109,67,.55);outline-offset:3px}
#libros .rve-lib-book:focus-visible{outline:3px solid #9a5e34;outline-offset:4px}
#libros .rve-lib-book[aria-pressed='true']::after{
  content:'';position:absolute;left:14%;right:14%;bottom:-6px;height:3px;
  border-radius:50%;background:rgba(147,88,51,.55);
  box-shadow:0 0 7px rgba(147,88,51,.25);pointer-events:none;
}
#libros .rve-book-ensemble--cimbalo{
  --hit-x:28.85766%;--hit-y:36.91817%;
  --hit-w:6.94976%;--hit-h:18.03294%;
}
#libros .rve-book-ensemble--rey{
  --hit-x:35.41089%;--hit-y:39.63443%;
  --hit-w:7.25658%;--hit-h:18.73751%;
}
#libros .rve-book-ensemble--hija{
  --hit-x:42.04067%;--hit-y:40.56429%;
  --hit-w:7.43780%;--hit-h:19.19341%;
}
#libros .rve-book-ensemble--animales{
  --hit-x:49.70215%;--hit-y:41.10308%;
  --hit-w:7.26854%;--hit-h:18.75239%;
}
#libros .rve-book-ensemble--hotel{
  --hit-x:56.73026%;--hit-y:39.95855%;
  --hit-w:7.11842%;--hit-h:18.08714%;
}
#libros .rve-book-ensemble--horror{
  --hit-x:63.81100%;--hit-y:37.24336%;
  --hit-w:6.86423%;--hit-h:17.80659%;
}
/* Reading system / consistent with the existing Onest+Bricolage Grotesque editorial type. */
#libros .rve-library-copy{
  position:absolute;z-index:4;right:clamp(36px,5.5vw,100px);top:50%;
  transform:translateY(-50%);width:min(32vw,465px);max-width:465px;
  min-width:0;color:#26231f;
}
#libros .rve-library-copy .eyebrow{color:#5d493a}
#libros .rve-library-copy h2{font-size:clamp(3.2rem,5vw,5.75rem);line-height:.96;letter-spacing:-.055em;margin:.15em 0 .17em}
#libros .rve-library-intro{font-size:clamp(1rem,1.15vw,1.12rem);max-width:40ch;color:#4f4943;line-height:1.53;margin:0 0 27px}
#libros .rve-library-categories{display:flex;flex-wrap:wrap;gap:5px 12px;max-width:44ch;margin:-12px 0 27px;font:600 10px/1.5 Onest,Arial,sans-serif;text-transform:uppercase;letter-spacing:.075em;color:#6e655a}
#libros .rve-library-categories span:not(:last-child)::after{content:'·';margin-left:12px;color:#aa9b88}
#libros .rve-library-selected{border-top:1px solid rgba(42,38,31,.25);padding-top:22px;min-height:0}
#libros .rve-library-kind{display:block;font-family:Onest,Arial,sans-serif;font-size:.78rem;letter-spacing:.1em;text-transform:uppercase;margin-bottom:9px;opacity:.72}
#libros .rve-library-selected h3{font-size:clamp(2rem,3vw,3.18rem);line-height:1.06;letter-spacing:-.043em;margin:0 0 17px}
#libros .rve-library-selected p{font-size:clamp(.94rem,1.1vw,1.06rem);line-height:1.56;max-width:42ch;margin:0 0 20px}
#libros .rve-library-selected .cta{display:inline-flex}
#libros .rve-library-hint{font-size:.79rem;opacity:.64;margin-top:16px}
#libros .rve-library-hint a{color:#473321;text-decoration:underline;text-underline-offset:3px}
#libros .rve-library-hint a:focus-visible{outline:2px solid currentColor;outline-offset:3px}
/* Preserve the existing short, natural desktop rest; never trap scrolling. */
.chapter-shell-library{position:relative}
@media(min-width:950px) and (min-height:760px){
 .chapter-shell-library{height:calc(100svh + clamp(94px,16svh,160px))}
 .chapter-shell-library>#libros.rve-library{
   position:sticky!important;top:0!important;height:100svh!important;
   min-height:0!important;max-height:none!important;overflow:hidden!important;
 }
 .chapter-shell-library .rve-library-layout{height:100svh;min-height:0}
}
@media(min-width:1200px) and (max-width:1599px){
 #libros .rve-library-plane{left:clamp(-335px,-19.5vw,-240px)}
 #libros .rve-library-copy{right:clamp(28px,4.2vw,68px);width:min(31vw,435px)}
 #libros.rve-library::after{background:
  linear-gradient(180deg,#e9e3da 0%,rgba(233,227,218,.24) 12%,transparent 23%,transparent 76%,rgba(233,227,218,.32) 90%,#e9e3da 100%),
  linear-gradient(90deg,rgba(233,227,218,.90) 0%,rgba(233,227,218,.16) 7%,transparent 15%,transparent 50%,rgba(233,227,218,.14) 59%,rgba(233,227,218,.82) 69%,#e9e3da 77%)}
}
@media(min-width:1200px) and (max-width:1399px){
 #libros .rve-library-copy{right:32px;width:min(29vw,395px)}
}
/* Smaller screens get a closer crop of the same photo, then a full-width reading
   column. No new images, UI gimmicks, or unclickable miniature cover grid. */
@media(max-width:1199px), (max-height:759px){
 .chapter-shell-library{height:auto!important}
 .chapter-shell-library>#libros.rve-library{position:relative!important;top:auto!important;height:auto!important;min-height:0!important;max-height:none!important}
 #libros .rve-library-layout{display:flex;flex-direction:column;min-height:0;height:auto}
 #libros .rve-library-desk{position:relative;inset:auto;flex:0 0 auto;width:100%;height:clamp(475px,67vw,660px)}
 #libros .rve-library-plane{top:50%;left:-10%;width:auto;height:100%;aspect-ratio:1672/941;transform:translateY(-50%)}
 #libros.rve-library::after{display:none}
 #libros .rve-library-desk::after{
   content:'';position:absolute;inset:0;z-index:15;pointer-events:none;
   background:linear-gradient(180deg,rgba(233,227,218,.35) 0%,transparent 12%,transparent 78%,rgba(233,227,218,.40) 91%,#e9e3da 100%),linear-gradient(90deg,rgba(233,227,218,.7) 0%,transparent 11%,transparent 90%,rgba(233,227,218,.45) 100%);
 }
 #libros .rve-library-copy{position:relative;inset:auto;right:auto;top:auto;transform:none;width:calc(100% - 56px);max-width:760px;margin:-8px auto 0;padding:0 0 62px}
 #libros .rve-library-selected{min-height:0}
 #libros .rve-library-copy h2{font-size:clamp(3.6rem,9vw,5.8rem)}
}
@media(max-width:580px){
 #libros .rve-library-desk{height:clamp(450px,125vw,560px)}
 #libros .rve-library-plane{left:50%;transform:translate(-50%,-50%)}
 #libros .rve-library-copy{width:calc(100% - 40px);max-width:520px;padding-bottom:55px}
 #libros .rve-library-copy h2{font-size:clamp(3.1rem,13vw,4.2rem)}
 #libros .rve-library-intro{font-size:1rem}
 #libros .rve-library-selected p{font-size:1rem}
 #libros .rve-library-categories{margin-bottom:20px}
 #libros .rve-library-hint{margin-top:16px}
}
@media(prefers-reduced-motion:reduce){
 #libros .rve-lib-book,#libros .rve-lib-cover{transition:none!important}
}

/* NAV-B2-03: at 320px the two outer covers stay fully visible and tappable. */
@media(max-width:360px){#libros .rve-library-plane{height:90%}}
/* NAV-B2-04: interactive hotspots are shown only after the controller initializes. */
#libros.rve-library:not(.rve-library-ready) .rve-book-ensemble{display:none}
#libros .rve-library-hint-interactive{display:none}
#libros.rve-library-ready .rve-library-hint-interactive{display:inline}
#libros.rve-library-ready .rve-library-hint-static{display:none}
