/* ebookica — interfaz de tienda para Calibre-Web
   Tinta azul de estilográfica, cartulina de ficha de biblioteca y un subrayador amarillo.
   El color lo ponen las portadas; la interfaz se aparta. */

:root {
  --ink: #1b2a6b;
  --ink-deep: #111c4e;
  --ink-soft: #3a4a8f;
  --paper: #eceee9;
  --sheet: #fbfcf9;
  --graphite: #23262d;
  --muted: #5d626d;
  --rule: #d3d7cf;
  --marker: #ffd23f;
  --marker-deep: #f2b900;
  --stamp: #b4232f;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --cover-w: 148px;
  --gutter: clamp(16px, 3vw, 40px);
  --radius: 3px;
}

/* ------------------------------------------------------------------ base */
body.eb {
  background: var(--paper);
  color: var(--graphite);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}
body.eb a { color: var(--ink); }
body.eb a:hover { color: var(--ink-deep); }
body.eb :focus-visible { outline: 3px solid var(--marker-deep); outline-offset: 2px; }
.eb h1, .eb h2, .eb h3 { font-family: var(--serif); color: var(--graphite); letter-spacing: -0.01em; }
.eb-skip { position: absolute; left: -999px; top: 8px; background: var(--marker); color: var(--graphite) !important; padding: 8px 14px; z-index: 2000; }
.eb-skip:focus { left: 8px; }
.eb-muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ------------------------------------------------------------------ cabecera */
.eb-top { position: sticky; top: 0; z-index: 1000; }
.eb-top__bar {
  background: var(--ink);
  display: flex; align-items: center; gap: clamp(10px, 2vw, 28px);
  padding: 10px var(--gutter);
  min-height: 64px;
}
.eb-brand {
  font-family: var(--serif); font-weight: 750; font-size: 28px; line-height: 1;
  color: #fff !important; text-decoration: none !important; letter-spacing: -0.03em;
  font-variation-settings: "opsz" 72;
  white-space: nowrap;
}
.eb-brand span { font-style: italic; font-weight: 500; color: var(--marker); }
.eb-burger {
  display: inline-flex; align-items: center; gap: 3px; flex-direction: column; justify-content: center;
  background: none; border: 0; color: #fff; padding: 6px 4px; cursor: pointer; position: relative;
}
.eb-burger span { display: block; width: 20px; height: 2px; background: currentColor; }
.eb-burger b { font: 600 10px/1 var(--sans); margin-top: 3px; letter-spacing: 0.02em; }

.eb-search { flex: 1; display: flex; max-width: 760px; margin: 0; }
.eb-search input {
  flex: 1; min-width: 0; border: 0; border-radius: var(--radius) 0 0 var(--radius);
  padding: 0 16px; height: 44px; font: 16px var(--sans); color: var(--graphite); background: #fff;
}
.eb-search input::placeholder { color: #8a8f99; }
.eb-search button {
  border: 0; width: 54px; height: 44px; border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--marker); color: var(--graphite); cursor: pointer; display: grid; place-items: center;
  transition: background .15s;
}
.eb-search button:hover { background: var(--marker-deep); }

.eb-account { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.eb-account__btn {
  color: #fff !important; font-weight: 600; font-size: 14px; cursor: pointer; margin: 0;
  border: 1px solid rgba(255,255,255,.35); border-radius: var(--radius); padding: 7px 12px; white-space: nowrap;
}
.eb-account__btn:hover { border-color: #fff; }
.eb-account__btn input[type=file] { display: none; }
.eb-upload { margin: 0; }
.eb-account__who { color: #fff !important; text-decoration: none !important; display: flex; flex-direction: column; line-height: 1.15; }
.eb-account__who small { font-size: 12px; opacity: .8; }
.eb-account__who strong { font-size: 14px; }
.eb-account .dropdown-menu { font-family: var(--sans); border-radius: var(--radius); border-color: var(--rule); }

.eb-genres { background: var(--ink-deep); }
.eb-genres ul {
  display: flex; gap: 2px; list-style: none; margin: 0; padding: 0 calc(var(--gutter) - 10px);
  overflow-x: auto; scrollbar-width: none;
}
.eb-genres ul::-webkit-scrollbar { display: none; }
.eb-genres a {
  display: block; color: #dfe4ff !important; text-decoration: none !important; white-space: nowrap;
  padding: 9px 10px; font-size: 14px; font-weight: 500; border-bottom: 3px solid transparent;
}
.eb-genres a:hover { color: #fff !important; border-bottom-color: rgba(255,210,63,.5); }
.eb-genres a[aria-current] { color: #fff !important; border-bottom-color: var(--marker); }
.eb-genres__all { font-weight: 700 !important; }

/* ------------------------------------------------------------------ cajón */
.eb-drawer[hidden] { display: none; }
.eb-drawer { position: fixed; inset: 0; z-index: 1500; }
.eb-drawer__scrim { position: absolute; inset: 0; background: rgba(17, 28, 78, .55); animation: eb-fade .2s ease-out; }
.eb-drawer__panel {
  position: absolute; left: 0; top: 0; bottom: 0; width: min(360px, 88vw); background: var(--sheet);
  display: flex; flex-direction: column; box-shadow: 8px 0 40px rgba(0,0,0,.25);
  animation: eb-slide .25s cubic-bezier(.2,.8,.2,1);
}
.eb-drawer__head { background: var(--ink); color: #fff; display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; font-weight: 700; font-size: 18px; }
.eb-drawer__head button { background: none; border: 0; color: #fff; font-size: 30px; line-height: 1; cursor: pointer; }
.eb-drawer__body { overflow-y: auto; padding: 8px 0 32px; }
.eb-drawer__body h3 { font-size: 18px; margin: 20px 20px 6px; }
.eb-drawer__body ul { list-style: none; margin: 0; padding: 0; }
.eb-drawer__body a { display: flex; justify-content: space-between; padding: 8px 20px; color: var(--graphite) !important; text-decoration: none !important; }
.eb-drawer__body a:hover, .eb-drawer__body .active a { background: #e3e7f6; }
.eb-drawer__body small { color: var(--muted); font-variant-numeric: tabular-nums; }
@keyframes eb-fade { from { opacity: 0; } }
@keyframes eb-slide { from { transform: translateX(-100%); } }

/* ------------------------------------------------------------------ estructura */
.eb-main { padding: 0 var(--gutter) 56px; max-width: 1680px; margin: 0 auto; min-height: 60vh; }
.eb-flash { padding: 0 var(--gutter); max-width: 1680px; margin: 0 auto; }
.eb-flash .alert { margin: 16px 0 0; border-radius: var(--radius); }
.eb-foot {
  background: var(--ink-deep); color: #c7cdf0; display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 28px var(--gutter);
}
.eb-foot p { margin: 0; }
.eb-foot__top { margin-left: auto; color: #fff !important; }
.eb-brand--small { font-size: 22px; }

/* ------------------------------------------------------------------ portadas */
.eb-cover {
  position: relative; display: block; aspect-ratio: 2 / 3; overflow: hidden;
  border-radius: 1px 3px 3px 1px; background: #d9dcd4;
  box-shadow: 0 1px 1px rgba(20,25,45,.12), 0 6px 14px -6px rgba(20,25,45,.35);
}
.eb-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* lomo: un brillo y una sombra en el borde izquierdo, como un libro de verdad */
.eb-cover::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(0,0,0,.28) 0, rgba(255,255,255,.22) 3px, rgba(0,0,0,.06) 7px, transparent 12px);
}
.eb-cover__fallback { display: none; }
.eb-cover.is-missing { background: var(--ink); }
.eb-cover.is-missing .eb-cover__fallback {
  display: flex; align-items: center; justify-content: center; text-align: center; height: 100%;
  padding: 14px; color: #fff; font: 600 15px/1.25 var(--serif);
}

/* ------------------------------------------------------------------ portada: mesa de novedades */
.eb-hero {
  display: grid; grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.4fr); align-items: center;
  gap: clamp(20px, 4vw, 64px); padding: clamp(28px, 5vw, 64px) 0 clamp(24px, 4vw, 40px);
  border-bottom: 1px solid var(--rule);
}
.eb-hero h1 {
  font-size: clamp(34px, 4.6vw, 64px); line-height: 1.02; margin: 0 0 16px; font-weight: 700;
  font-variation-settings: "opsz" 72; max-width: 12ch;
}
.eb-hero p { font-size: 18px; color: var(--muted); max-width: 38ch; margin: 0 0 24px; }
.eb-fan { list-style: none; margin: 0; padding: 0; position: relative; height: clamp(230px, 26vw, 360px); }
.eb-fan li {
  position: absolute; bottom: 0; left: 50%; width: clamp(120px, 13vw, 190px);
  --spread: calc((var(--i) - (var(--n) - 1) / 2));
  transform: translateX(calc(-50% + var(--spread) * 62%)) rotate(calc(var(--spread) * 5deg)) translateY(calc(var(--spread) * var(--spread) * 6px));
  transform-origin: 50% 120%;
  z-index: calc(10 - var(--i));
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
  animation: eb-deal .9s cubic-bezier(.2,.8,.2,1) both;
  animation-delay: calc(var(--i) * 70ms + 120ms);
}
.eb-fan li:hover { transform: translateX(calc(-50% + var(--spread) * 62%)) rotate(calc(var(--spread) * 5deg)) translateY(-14px); z-index: 20; }
.eb-fan .eb-cover { box-shadow: 0 2px 2px rgba(20,25,45,.15), 0 22px 30px -14px rgba(20,25,45,.55); }
@keyframes eb-deal {
  from { transform: translateX(-50%) rotate(0) translateY(40px); opacity: 0; }
}

/* ------------------------------------------------------------------ estanterías */
.eb-shelves { padding-top: 8px; }
.eb-shelf { padding: 28px 0 8px; border-bottom: 1px solid var(--rule); }
.eb-shelf:last-child { border-bottom: 0; }
.eb-shelf__head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 14px; }
.eb-shelf__head h2 { font-size: clamp(21px, 2vw, 26px); margin: 0; font-weight: 650; }
.eb-shelf--lead .eb-shelf__head h2 { font-size: clamp(24px, 2.4vw, 30px); }
.eb-shelf__more { font-size: 14px; font-weight: 600; white-space: nowrap; }
.eb-shelf__rail { position: relative; }
.eb-shelf__list {
  list-style: none; margin: 0; padding: 4px 2px 18px; display: grid; grid-auto-flow: column;
  grid-auto-columns: var(--cover-w); gap: 22px; overflow-x: auto; scroll-snap-type: x proximity;
  scrollbar-width: thin; scrollbar-color: #b9beb4 transparent; overscroll-behavior-x: contain;
}
.eb-shelf__list > li { scroll-snap-align: start; }
.eb-rail-btn {
  position: absolute; top: calc(var(--cover-w) * 0.75 - 26px); z-index: 3; width: 44px; height: 64px;
  border: 1px solid var(--rule); background: rgba(251,252,249,.94); color: var(--graphite);
  font-size: 34px; line-height: 1; cursor: pointer; border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(20,25,45,.15);
}
.eb-rail-btn--prev { left: -8px; }
.eb-rail-btn--next { right: -8px; }
.eb-rail-btn:hover { background: #fff; border-color: var(--ink-soft); }
@media (hover: none) { .eb-rail-btn { display: none; } }

/* ------------------------------------------------------------------ tarjeta de libro */
.eb-card { min-width: 0; position: relative; }
.eb-card__link { display: block; position: relative; text-decoration: none !important; }
.eb-card__link .eb-cover { transition: transform .2s ease, box-shadow .2s ease; }
.eb-card__link:hover .eb-cover { transform: translateY(-4px); box-shadow: 0 2px 2px rgba(20,25,45,.15), 0 16px 22px -10px rgba(20,25,45,.5); }
.eb-card__title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 10px; font: 600 15px/1.3 var(--serif); color: var(--graphite) !important;
}
.eb-card__author, .eb-card__series { display: block; font-size: 13.5px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eb-card__author a { color: var(--muted) !important; }
.eb-card__author a:hover { color: var(--ink) !important; }
.eb-card__series { color: var(--ink-soft) !important; font-style: italic; font-family: var(--serif); }
.eb-card__badge {
  position: absolute; right: 6px; bottom: 6px; min-width: 26px; height: 26px; padding: 0 6px;
  border-radius: 13px; background: var(--marker); color: var(--graphite); font: 700 12.5px/26px var(--sans);
  text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.eb-card__read {
  position: absolute; left: 6px; top: 6px; background: var(--ink); color: #fff; font: 600 11.5px/1 var(--sans);
  padding: 5px 7px; border-radius: 2px; transform: rotate(-4deg);
}
.eb-card.is-current .eb-cover { outline: 3px solid var(--marker); outline-offset: 3px; }

/* ------------------------------------------------------------------ autores parecidos */
.eb-shelf--authors .eb-shelf__list { grid-auto-columns: 168px; }
.eb-author a { display: block; text-decoration: none !important; color: var(--graphite) !important; }
.eb-author__stack { position: relative; display: block; height: 170px; }
.eb-author__stack img {
  position: absolute; bottom: 8px; width: 92px; aspect-ratio: 2/3; object-fit: cover;
  box-shadow: 0 6px 14px -6px rgba(20,25,45,.45); border-radius: 1px 3px 3px 1px;
}
.eb-author__stack img:nth-child(1) { left: 6px; transform: rotate(-7deg); }
.eb-author__stack img:nth-child(2) { left: 38px; transform: rotate(-1deg); }
.eb-author__stack img:nth-child(3) { left: 70px; transform: rotate(6deg); }
.eb-author__mono {
  position: absolute; right: 4px; top: 4px; width: 58px; height: 58px; border-radius: 50%;
  background: hsl(var(--h) 45% 38%); color: #fff; display: grid; place-items: center;
  font: 700 21px/1 var(--serif); border: 3px solid var(--paper); z-index: 2;
}
.eb-author__name { display: block; font: 600 15px/1.3 var(--serif); margin-top: 4px; }
.eb-author__count { display: block; font-size: 13px; color: var(--muted); }
.eb-author a:hover .eb-author__name { color: var(--ink); text-decoration: underline; }

/* ------------------------------------------------------------------ índice de géneros */
.eb-genre-index { padding: 36px 0 8px; }
.eb-genre-index h2 { font-size: 26px; margin: 0 0 16px; }
.eb-genre-index ul { list-style: none; padding: 0; margin: 0; columns: 4 220px; column-gap: 32px; }
.eb-genre-index li { break-inside: avoid; }
.eb-genre-index a { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dotted var(--rule); color: var(--graphite) !important; text-decoration: none !important; }
.eb-genre-index a:hover span { color: var(--ink); text-decoration: underline; }
.eb-genre-index small { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ listados */
.eb-listing__head { padding: 28px 0 18px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; border-bottom: 1px solid var(--rule); margin-bottom: 26px; }
.eb-listing__head h1 { font-size: clamp(28px, 3vw, 40px); margin: 0; font-weight: 700; }
.eb-listing__count { color: var(--muted); margin: 0; }
.eb-sort { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; width: 100%; font-size: 14px; }
.eb-sort span { color: var(--muted); margin-right: 4px; }
.eb-sort a { padding: 5px 11px; border: 1px solid var(--rule); border-radius: 20px; color: var(--graphite) !important; text-decoration: none !important; background: var(--sheet); }
.eb-sort a:hover { border-color: var(--ink-soft); }
.eb-sort a.active { background: var(--ink); border-color: var(--ink); color: #fff !important; }
.eb-grid {
  list-style: none; margin: 0; padding: 0; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--cover-w), 1fr)); gap: 34px 26px;
}
.eb-empty { font-size: 18px; color: var(--muted); padding: 40px 0; }
.eb-pages { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 40px 0 0; }
.eb-pages a, .eb-pages span { min-width: 40px; padding: 8px 12px; text-align: center; border-radius: var(--radius); border: 1px solid var(--rule); background: var(--sheet); color: var(--graphite) !important; text-decoration: none !important; }
.eb-pages a:hover { border-color: var(--ink-soft); }
.eb-pages span[aria-current] { background: var(--ink); color: #fff !important; border-color: var(--ink); }
.eb-pages .gap { border: 0; background: none; }

/* ------------------------------------------------------------------ ficha de libro */
.eb-crumbs { padding: 18px 0 6px; font-size: 13.5px; }
.eb-crumbs a { color: var(--muted) !important; }
.eb-crumbs a + a::before { content: "›"; margin: 0 8px; color: #9aa0a8; display: inline-block; }
.eb-product__grid {
  display: grid; grid-template-columns: minmax(220px, 320px) minmax(0, 1fr) 300px;
  gap: clamp(20px, 3vw, 48px); align-items: start; padding: 16px 0 36px; border-bottom: 1px solid var(--rule);
}
.eb-product__cover { margin: 0; position: sticky; top: 130px; }
.eb-cover--hero { box-shadow: 0 2px 2px rgba(20,25,45,.15), 0 30px 40px -22px rgba(20,25,45,.65); }
.eb-product__info h1 {
  font-size: clamp(30px, 3.2vw, 46px); line-height: 1.08; margin: 0 0 10px; font-weight: 700;
  font-variation-settings: "opsz" 60; text-wrap: balance;
}
.eb-product__by { font-size: 18px; margin: 0 0 6px; color: var(--muted); }
.eb-product__by a { font-weight: 600; }
.eb-product__series { margin: 0 0 10px; font-family: var(--serif); font-style: italic; color: var(--muted); }
.eb-stars { color: #c7c9c2; font-size: 20px; letter-spacing: 2px; margin: 0 0 8px; }
.eb-stars .on { color: var(--marker-deep); }
.eb-chips { list-style: none; padding: 0; margin: 14px 0 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.eb-chips a {
  display: inline-block; padding: 5px 12px; border-radius: 20px; background: #dfe3f3; color: var(--ink-deep) !important;
  font-size: 14px; font-weight: 600; text-decoration: none !important;
}
.eb-chips a:hover { background: var(--ink); color: #fff !important; }
.eb-blurb { font-family: var(--serif); font-size: 17.5px; line-height: 1.7; max-width: 68ch; }
.eb-blurb__text p { margin: 0 0 1em; }
.eb-blurb.is-clamped .eb-blurb__text { max-height: 13.6em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.eb-blurb__more { background: none; border: 0; padding: 4px 0; color: var(--ink); font: 700 15px var(--sans); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.eb-facts { margin-top: 28px; max-width: 68ch; }
.eb-facts h2 { font-size: 21px; margin: 0 0 10px; }
.eb-facts dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 22px; margin: 0; font-size: 15px; }
.eb-facts dt { font-weight: 600; color: var(--muted); }
.eb-facts dd { margin: 0; }
.eb-elsewhere { margin-top: 14px; font-size: 14.5px; color: var(--muted); }

.eb-buybox {
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; padding: 20px;
  display: flex; flex-direction: column; gap: 10px; position: sticky; top: 130px;
}
.eb-buybox__alt { font-size: 14px; color: var(--muted); margin: -2px 0 6px; }
.eb-buybox__toggles { border-top: 1px solid var(--rule); margin-top: 6px; padding-top: 12px; display: grid; gap: 6px; }
.eb-buybox__toggles form { margin: 0; }
.eb-check { display: flex; gap: 10px; align-items: center; font-weight: 500; margin: 0; cursor: pointer; }
.eb-check input { width: 18px; height: 18px; accent-color: var(--ink); margin: 0; }
.eb-buybox__shelves { display: grid; gap: 8px; }
.eb-buybox__inshelves { display: flex; flex-wrap: wrap; gap: 6px; }
.eb-buybox__edit { font-size: 14px; font-weight: 600; margin-top: 4px; }
.eb-buybox .dropdown-menu { width: 100%; }

/* ------------------------------------------------------------------ botones */
.eb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 24px; border: 1px solid var(--ink); background: var(--sheet);
  color: var(--ink) !important; font: 650 15px/1.2 var(--sans); text-decoration: none !important; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.eb-btn:hover { background: #e3e7f6; }
.eb-btn--primary { background: var(--marker); border-color: var(--marker-deep); color: var(--graphite) !important; }
.eb-btn--primary:hover { background: var(--marker-deep); }
.eb-btn--primary small { font-weight: 500; opacity: .75; }
.eb-btn--ghost { border-color: var(--rule); color: var(--graphite) !important; }
.eb-btn--block { width: 100%; }

/* ------------------------------------------------------------------ otras páginas de Calibre-Web */
body.eb .discover h2, body.eb .container-fluid h2 { font-family: var(--serif); }
body.eb .btn-primary { background: var(--ink); border-color: var(--ink); }
body.eb .btn-primary:hover, body.eb .btn-primary:focus { background: var(--ink-deep); border-color: var(--ink-deep); }
body.eb .book .cover img { box-shadow: 0 6px 14px -6px rgba(20,25,45,.35); }
body.eb .modal-content { border-radius: 6px; }
body.eb .well, body.eb .panel { border-radius: 6px; }
body.eb table.table { background: var(--sheet); }
body.eb .book.session { margin-bottom: 26px; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .eb-product__grid { grid-template-columns: minmax(200px, 280px) minmax(0, 1fr); }
  .eb-buybox { grid-column: 1 / -1; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .eb-buybox > * { flex: 1 1 220px; }
  .eb-buybox__toggles { border-top: 0; margin: 0; padding: 0; }
}
@media (max-width: 760px) {
  :root { --cover-w: 116px; }
  .eb-top { position: static; }
  .eb-top__bar { flex-wrap: wrap; row-gap: 10px; }
  .eb-search { order: 5; flex-basis: 100%; max-width: none; }
  .eb-account__btn.btn-file { display: none; }
  .eb-hero { grid-template-columns: 1fr; text-align: left; }
  .eb-fan { height: 220px; }
  .eb-fan li { width: 120px; }
  .eb-product__grid { grid-template-columns: 1fr; }
  .eb-product__cover { position: static; width: min(240px, 62vw); margin: 0 auto; }
  .eb-buybox { flex-direction: column; align-items: stretch; }
  .eb-buybox > * { flex: none; }
  .eb-grid { gap: 26px 16px; }
  .eb-shelf__list { gap: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .eb *, .eb *::before, .eb *::after { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------------------------ búsqueda y autor */
.eb-listing__actions { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.eb-listing__actions .eb-btn { padding: 7px 14px; font-size: 14px; }
.eb-author-head { align-items: flex-start; flex-wrap: wrap; }
.eb-author-head > div:first-of-type { flex: 1 1 420px; }
.eb-author-head__photo { width: 120px; aspect-ratio: 3/4; object-fit: cover; border-radius: 4px; box-shadow: 0 10px 20px -10px rgba(20,25,45,.5); }
.eb-author-head__bio { font-family: var(--serif); font-size: 16.5px; line-height: 1.65; max-width: 70ch; margin-top: 10px; }
.eb-other { padding-top: 36px; }
.eb-other h2 { font-size: 22px; }
.eb-other ul { columns: 3 240px; padding-left: 18px; }

/* ------------------------------------------------------------------ red de seguridad para páginas antiguas de Calibre-Web
   (estanterías, listados que no tienen plantilla propia): portadas a tamaño de tarjeta */
.eb-main .row.display-flex {
  display: grid !important; grid-template-columns: repeat(auto-fill, minmax(var(--cover-w), 1fr));
  gap: 34px 26px; margin: 0 0 24px;
}
.eb-main .row.display-flex::before, .eb-main .row.display-flex::after { display: none; }
.eb-main .row.display-flex > .book { width: auto; float: none; padding: 0; margin: 0; min-width: 0; }
.eb-main .book .cover { position: relative; height: auto; aspect-ratio: 2 / 3; overflow: hidden; margin: 0;
  border-radius: 1px 3px 3px 1px; background: #d9dcd4; box-shadow: 0 1px 1px rgba(20,25,45,.12), 0 6px 14px -6px rgba(20,25,45,.35); }
.eb-main .book .cover a, .eb-main .book .cover .img { display: block; width: 100%; height: 100%; position: static; }
.eb-main .book .cover img { width: 100% !important; height: 100% !important; max-width: none; object-fit: cover; position: static !important; box-shadow: none; }
.eb-main .book .meta { padding: 0; }
.eb-main .book .meta .title { font: 600 15px/1.3 var(--serif); color: var(--graphite); margin: 10px 0 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.eb-main .book .meta .author, .eb-main .book .meta .series { font-size: 13.5px; color: var(--muted); margin: 0; }
.eb-main .book .meta .author a { color: var(--muted); }
.eb-main .discover > h2, .eb-main > h2, .eb-main > .discover h2:first-child { font-size: clamp(26px, 2.6vw, 36px); margin: 28px 0 16px; }
.eb-main .filterheader:not(.eb-sort) { margin: 0 0 22px; float: none; }
.eb-main .filterheader:not(.eb-sort) .btn { border-radius: 18px; margin: 0 4px 4px 0; }

/* pie siempre abajo aunque haya poco contenido */
body.eb { display: flex; flex-direction: column; min-height: 100vh; }
body.eb > .eb-main { flex: 1 0 auto; width: 100%; }

/* Calibre-Web maqueta sus rejillas antiguas con Isotope (posiciones absolutas).
   Lo anulamos para que manden las columnas de la rejilla; el filtro por letra sigue funcionando. */
.eb-main .row.display-flex { height: auto !important; }
.eb-main .row.display-flex > .book { position: static !important; left: auto !important; top: auto !important; transform: none !important; opacity: 1; }
.eb-main .book .badge { position: absolute; right: 6px; bottom: 6px; top: auto; left: auto; background: var(--marker); color: var(--graphite); font: 700 12.5px/20px var(--sans); border-radius: 12px; min-width: 26px; z-index: 2; }
.eb-main .filterheader .btn-group.character { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.eb-main .filterheader .btn-group.character .btn { margin: 0; border-radius: 14px !important; min-width: 30px; padding: 4px 8px; }
.eb-main > h1, .eb-main h1.series, .eb-main h1.author, .eb-main h1.category, .eb-main h1.publisher, .eb-main h1.language { font-size: clamp(28px, 3vw, 40px); margin: 28px 0 16px; font-weight: 700; }

/* Contenedor que esperan los estilos originales de Calibre-Web (páginas no rediseñadas:
   editar metadatos, administración, perfil…). En las páginas nuevas no añade nada visible. */
.eb-main > .eb-page { padding: 0; }
.eb-main > .eb-page > .row-fluid::after { content: ""; display: table; clear: both; }
.eb-main #detailcover { max-width: 100%; height: auto; }

/* ------------------------------------------------------------------ peticiones */
.eb-ask { margin: 40px 0 8px; padding: 24px; border: 1px dashed var(--ink-soft); border-radius: 6px; background: var(--sheet); max-width: 980px; }
.eb-ask--open { border-style: solid; border-color: var(--ink); box-shadow: 0 18px 30px -24px rgba(20,25,45,.6); }
.eb-ask h2 { font-size: 24px; margin: 0 0 6px; }
.eb-ask p { color: var(--muted); margin: 0 0 16px; }
.eb-ask__form { display: grid; grid-template-columns: 2fr 1.4fr; gap: 12px 16px; align-items: end; }
.eb-ask__form label { display: grid; gap: 4px; font-weight: 600; font-size: 14px; margin: 0; }
.eb-ask__form label small { font-weight: 400; color: var(--muted); }
.eb-ask__form input { height: 42px; border: 1px solid var(--rule); border-radius: var(--radius); padding: 0 12px; font: 16px var(--sans); background: #fff; }
.eb-ask__form input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(255,210,63,.6); }
.eb-ask__note { grid-column: 1 / 2; }
.eb-ask__form .eb-btn { justify-self: start; }
.eb-reqs { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; max-width: 980px; }
.eb-req { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 18px; background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; }
.eb-req strong { font-family: var(--serif); font-size: 18px; }
.eb-req small { display: block; color: var(--muted); margin-top: 2px; }
.eb-req__author { color: var(--muted); }
.eb-req--done { border-left: 4px solid var(--marker-deep); }
.eb-pill { display: inline-block; padding: 5px 12px; border-radius: 20px; background: #e1e3dd; font-size: 14px; font-weight: 600; white-space: nowrap; }
.eb-pill--wait { background: #dfe3f3; color: var(--ink-deep); }
.eb-pill--ok { background: var(--marker); }
.eb-foot__privacy { flex-basis: 100%; order: 5; font-size: 13px; opacity: .75; }

/* ------------------------------------------------------------------ panel de actividad */
.eb-admin section { margin: 8px 0 32px; }
.eb-admin h2 { font-size: 22px; margin: 0 0 12px; }
.eb-admin .eb-listing__count a { margin: 0 2px; }
.eb-admin .eb-listing__count a[aria-current] { font-weight: 700; text-decoration: underline; }
.eb-warn { width: 100%; background: #fff4cc; border: 1px solid var(--marker-deep); padding: 8px 12px; border-radius: 4px; margin: 6px 0 0; }
.eb-table { width: 100%; border-collapse: collapse; background: var(--sheet); border: 1px solid var(--rule); font-size: 14.5px; }
.eb-table th { text-align: left; font-weight: 600; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--rule); background: #f1f3ee; }
.eb-table td { padding: 8px 12px; border-bottom: 1px solid #e6e9e2; vertical-align: top; }
.eb-table--compact td { padding: 6px 10px; }
.eb-table td:first-child { white-space: nowrap; }
.eb-table tr.is-miss td { background: #fff7d6; }
.eb-inline { display: flex; gap: 6px; flex-wrap: wrap; margin: 0; }
.eb-inline input { height: 34px; border: 1px solid var(--rule); border-radius: var(--radius); padding: 0 8px; }
.eb-inline .eb-btn { padding: 6px 12px; font-size: 13.5px; }
.eb-admin__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 1100px) { .eb-admin__cols { grid-template-columns: 1fr; } .eb-table { display: block; overflow-x: auto; } }
@media (max-width: 760px) { .eb-ask__form { grid-template-columns: 1fr; } .eb-req { flex-direction: column; align-items: flex-start; } }

/* ------------------------------------------------------------------ ficha de autor */
.eb-slot--loading { min-height: 48px; background: linear-gradient(90deg, transparent, rgba(27,42,107,.06), transparent) 0 0 / 200% 100%; animation: eb-shimmer 1.2s linear infinite; border-radius: 4px; }
@keyframes eb-shimmer { to { background-position: -200% 0; } }
.eb-authorcard { padding: 28px 0 8px; }
.eb-authorcard__kicker { color: var(--muted); font-size: 14px; margin: 0; }
.eb-authorcard__name { font-size: clamp(32px, 3.6vw, 48px); margin: 2px 0 6px; font-weight: 700; }
.eb-authorcard__name a { color: var(--graphite) !important; text-decoration: none !important; }
.eb-authorcard__name a:hover { color: var(--ink) !important; }
.eb-bio { display: flex; gap: 22px; align-items: flex-start; margin-top: 14px; max-width: 900px; }
.eb-bio__photo { width: 128px; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; border-radius: 4px; flex: none;
  box-shadow: 0 12px 24px -12px rgba(20,25,45,.55); filter: saturate(.9); }
.eb-bio__text { font-family: var(--serif); font-size: 16.5px; line-height: 1.65; }
.eb-bio__text p { margin: 0 0 8px; max-width: 68ch; }
.eb-bio__desc { font-family: var(--sans) !important; font-size: 14.5px; color: var(--muted); font-weight: 600; }
.eb-bio__text a { font-family: var(--sans); font-size: 14px; font-weight: 600; }

/* obras que no están: portada apagada y un botón para pedirla */
.eb-shelf--missing { border-top: 1px solid var(--rule); margin-top: 28px; }
.eb-shelf__hint { color: var(--muted); margin: -6px 0 14px; }
.eb-card--missing { position: relative; }
.eb-card--missing .eb-cover { filter: grayscale(1) contrast(.9); opacity: .55; transition: filter .25s, opacity .25s; }
.eb-card--missing:hover .eb-cover, .eb-card--missing:focus-within .eb-cover { filter: none; opacity: 1; }
.eb-card--missing .eb-cover.is-missing { background: #8b91a6; }
.eb-card--missing .eb-card__title { cursor: default; }
.eb-ask-one { position: absolute; left: 0; right: 0; top: calc(var(--cover-w) * 1.5 - 46px); display: flex; justify-content: center; margin: 0; z-index: 2; }
.eb-ask-one__btn { border: 0; border-radius: 18px; padding: 7px 16px; background: var(--marker); color: var(--graphite);
  font: 700 14px var(--sans); cursor: pointer; box-shadow: 0 4px 12px rgba(20,25,45,.3); }
.eb-ask-one__btn:hover { background: var(--marker-deep); }
.eb-ask-one.is-done .eb-ask-one__btn { background: var(--ink); color: #fff; }
.eb-ask-one.is-error .eb-ask-one__btn { background: var(--stamp); color: #fff; }
@media (max-width: 760px) { .eb-bio { flex-direction: column; } .eb-bio__photo { width: 110px; } }

/* tomo que falta en una saga */
.eb-cover--gap { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: repeating-linear-gradient(135deg, #e4e6e0 0 10px, #dcdfd8 10px 20px); box-shadow: inset 0 0 0 2px #c8ccc3; }
.eb-cover--gap::after { display: none; }
.eb-gap__n { font: 700 46px/1 var(--serif); color: #9aa0a8; }
.eb-gap__txt { font-size: 12.5px; color: var(--muted); text-align: center; padding: 0 10px; }
.eb-card--gap { position: relative; }
.eb-card--gap .eb-card__title { color: var(--muted) !important; font-style: italic; }
.eb-admin details summary { cursor: pointer; font-weight: 600; color: var(--ink); margin-bottom: 10px; }

/* ------------------------------------------------------------------ móvil: ajustes tras revisión
   - el abanico de novedades no debe ensanchar la página
   - en la ficha, el botón de descarga va justo después del título (no tras la sinopsis) */
.eb-hero { overflow: hidden; }
@media (max-width: 760px) {
  .eb-fan li { --spread-k: 44%; transform: translateX(calc(-50% + var(--spread) * 44%)) rotate(calc(var(--spread) * 4deg)) translateY(calc(var(--spread) * var(--spread) * 4px)); }
  .eb-product__grid { display: flex; flex-direction: column; gap: 0; }
  .eb-product__info { display: contents; }
  .eb-product__cover { order: 1; width: min(190px, 52vw); margin: 0 auto 18px; }
  .eb-product__info > h1 { order: 2; font-size: 28px; }
  .eb-product__by { order: 3; }
  .eb-product__series { order: 4; }
  .eb-stars { order: 5; }
  .eb-chips { order: 6; margin: 8px 0 14px; }
  .eb-buybox { order: 7; margin-bottom: 22px; align-self: stretch; }
  .eb-product__info > h1, .eb-product__by, .eb-chips, .eb-blurb, .eb-facts { align-self: stretch; }
  .eb-blurb, .eb-product__info > .eb-muted { order: 8; font-size: 16.5px; }
  .eb-facts { order: 9; }
  .eb-shelf__head h2 { font-size: 20px; }
}
