/* La identidad de la portada productiva acompaña a la biblioteca privada. */
:root {
  --blue: #153d70;
  --cream: #fbfaf7;
  --orange: #b83c2f;
  --line: #c8d3db;
  --collection: #eeeae2;
  --sans: "Avenir Next", Avenir, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-family: var(--sans);
  background: #e7eef0;
  scrollbar-color: #536f83 #e7eef0;
}
body { min-height: 100svh; display: flex; flex-direction: column; background: #e7eef0; }
main { width: 100%; flex: 1; padding-block: 56px 72px; }
h1, h2 { font-family: var(--display); letter-spacing: -.025em; text-wrap: balance; }
.test-banner { background: #102d53; letter-spacing: .04em; }
.masthead { width: 100%; max-width: none; padding: 18px max(24px, calc((100vw - 1160px) / 2)); background: var(--cream); border-color: #d2d2c6; }
.brand { gap: 12px; font-family: var(--sans); letter-spacing: normal; }
.brand-isotipo { width: auto; height: 58px; object-fit: contain; }
.brand-name { display: grid; font-size: 14px; line-height: 1.1; }
.brand-name strong { font-weight: 850; letter-spacing: .045em; text-transform: uppercase; }
.brand-name em { margin-left: 8px; color: var(--orange); font: italic 700 23px/1 var(--display); }
.masthead nav { gap: 24px; }
.masthead nav a, .masthead nav button { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; padding: 8px 0; }
.masthead nav a:hover, .masthead nav button:hover { color: var(--orange); background: transparent; text-decoration: underline; text-underline-offset: .25em; }
.login-intro h1 { font-weight: 700; }
.login-card { background: var(--cream); border: 0; border-radius: 12px; box-shadow: 0 14px 36px #153d7014; }
body:has(#app > .library-grid) { background: var(--collection); }
#app:has(> .library-grid) > h1, .library-head h1, .catalog-section > h2 { color: var(--blue); }
.library-head h1 { font-weight: 700; margin-top: 0; }
.library-head .muted, #app:has(> .library-grid) > p { color: #53616b; }
.library-head { margin-bottom: 40px; }
.library-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 42px 32px; padding-inline: 16px; }
.edition { display: flex; flex-direction: column; position: relative; min-width: 0; overflow: visible; border: 0; background: transparent; border-radius: 0; max-width: none; box-shadow: none; }
/* Los tramos contiguos forman la repisa sobre la que descansan los libros. */
.edition::before, .edition::after { content: ""; position: absolute; inset-inline: -16px; pointer-events: none; }
.edition::before { top: 328px; height: 12px; background: #bea17c; border-top: 3px solid #dfc9a9; box-shadow: 0 10px 18px #51463126; }
.edition::after { top: 340px; height: 6px; background: #987b59; }
.shelf-cover { display: flex; flex: none; justify-content: center; align-items: flex-end; height: 328px; padding-inline: 20px; text-decoration: none; }
.shelf-cover .edition-cover-image { width: auto; height: 100%; max-width: 100%; aspect-ratio: auto; object-fit: contain; background: transparent; border-radius: 2px 4px 0 0; box-shadow: -4px 0 0 #21384c, 5px 8px 16px #29333b26; }
.shelf-cover .edition-cover { width: min(230px, 100%); height: 100%; min-height: 0; border-radius: 2px 4px 0 0; box-shadow: -4px 0 0 #102d53, 5px 8px 16px #29333b26; padding: 24px; }
.shelf-cover .edition-cover strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; font-size: 30px; }
.shelf-cover:hover img, .shelf-cover:hover .edition-cover { transform: translateY(-3px); }
.edition-body { display: flex; flex: 1; flex-direction: column; gap: 12px; min-width: 0; width: 100%; max-width: 310px; margin-inline: auto; padding: 28px 20px 6px; }
.edition-title { display: flex; align-items: flex-start; font-size: 25px; line-height: 1.2; }
.edition-body h2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; width: 100%; line-height: 1.2; margin: 0; letter-spacing: -.02em; text-align: center; }
.edition-body p { margin: 0; text-align: center; }
.edition-body a { align-self: center; margin-top: auto; }
.edition-body a:hover { background: #102d53; }
.site-footer { display: grid; grid-template-columns: 142px minmax(160px, 1fr) minmax(230px, 1.3fr) auto; align-items: center; gap: 32px; padding: 36px max(24px, calc((100vw - 1160px) / 2)); background: #102d53; color: #dbe7f4; border-top: 1px solid #ffffff24; font-size: 13px; line-height: 1.7; }
.site-footer p { margin: 0; }
.site-footer a { color: #eef4fb; text-underline-offset: .22em; overflow-wrap: anywhere; }
.site-footer a:hover { color: #ffaaa0; }
.site-footer img { display: block; width: 142px; height: auto; }
.footer-support nav { display: flex; flex-wrap: wrap; gap: 0 16px; margin-top: 4px; font-size: inherit; }
.footer-support nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; }
.footer-copyright { font-size: 12px; }
/* El motor mide antes de montar las hojas; evitar centrado flex del marco vacío. */
body[data-reader-mode] { display: block; }
body[data-reader-mode] main { flex: none; }
body[data-reader-mode] .masthead { padding-block: 4px; }
body[data-reader-mode] .brand-isotipo { height: 32px; }
body[data-reader-mode] .brand-name { font-size: 10px; }
body[data-reader-mode] .brand-name em { font-size: 17px; }
body[data-reader-mode] .masthead nav a, body[data-reader-mode] .masthead nav button { min-height: 44px; }
::selection { background: var(--orange); color: var(--cream); }
a { text-underline-offset: .22em; }
@media (max-width: 1000px) {
  .site-footer { grid-template-columns: 142px 1fr; gap: 24px 40px; }
  .footer-brand { grid-row: 1 / span 3; align-self: start; }
  .footer-support, .footer-copyright { grid-column: 2; }
}
@media (max-width: 999px) {
  .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  main { padding: 34px 20px 48px; }
  .masthead { padding: 12px 20px; gap: 4px 20px; }
  .brand-isotipo { height: 46px; }
  .brand-name { font-size: 12px; }
  .brand-name em { font-size: 21px; }
  .masthead nav { width: 100%; gap: 4px 20px; font-size: 13px; }
  .library-head { margin-bottom: 28px; }
  .library-head h1 { font-size: 42px; }
  .library-grid { gap: 40px 16px; padding-inline: 8px; }
  .edition { max-width: 100%; }
  .edition::before, .edition::after { inset-inline: -8px; }
  .shelf-cover { justify-content: center; padding-inline: 12px; }
  .edition-body { max-width: 100%; padding-inline: 12px; }
  .site-footer { grid-template-columns: 1fr; gap: 20px; padding: 30px 20px; }
  .footer-brand { grid-row: auto; }
  .footer-support, .footer-copyright { grid-column: auto; }
  .footer-support nav { column-gap: 20px; }
  body[data-reader-mode] .masthead nav { width: auto; }
}
@media (max-width: 639px) {
  .library-grid { grid-template-columns: minmax(0, 1fr); }
}
