@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap');

:root {
  --navy: #082c59;
  --deep: #061f43;
  --blue: #115aa2;
  --bright: #277bce;
  --sky: #9ed4f6;
  --pale: #eaf4fe;
  --paper: #f6f9fd;
  --ink: #102942;
  --muted: #526a82;
  --line: #d9e7f2;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 15px/1.55 'DM Sans', Arial, sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid #efbd59; outline-offset: 3px; }
.shell { width: min(100%, 1320px); margin-inline: auto; padding-inline: clamp(20px, 4vw, 58px); }
.skip-link { position: absolute; top: -70px; left: 20px; z-index: 100; padding: 11px 16px; border-radius: 10px; color: var(--navy); background: white; font-weight: 800; }
.skip-link:focus { top: 12px; }
#catalogo, #galeria, #como-funciona, #reservas { scroll-margin-top: 130px; }

/* Quiet institutional header */
.top { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--line); background: #fff; box-shadow: 0 6px 24px #10375f08; }
.top-inner { display: flex; align-items: center; gap: clamp(14px, 2vw, 28px); min-height: 82px; }
.brand { display: inline-flex; align-items: center; gap: 13px; flex: 0 0 auto; margin-right: auto; }
.brand img { width: 86px; height: 53px; object-fit: contain; }
.brand-rule { width: 1px; height: 34px; background: #b9cede; }
.brand-copy { color: var(--navy); font: 800 14px/1.1 Manrope, Arial, sans-serif; letter-spacing: -.025em; }
.brand-copy small { display: block; margin-top: 5px; color: var(--blue); font: 700 10px/1.2 'DM Sans', Arial, sans-serif; letter-spacing: .13em; text-transform: uppercase; }
.desktop-nav { display: flex; gap: clamp(16px, 2vw, 29px); color: #405c75; font-size: 12px; font-weight: 700; white-space: nowrap; }
.desktop-nav a { position: relative; padding: 8px 0; }
.desktop-nav a::after { content: ''; position: absolute; right: 0; bottom: 4px; left: 0; height: 2px; background: var(--blue); transform: scaleX(0); transform-origin: left; transition: transform .2s; }
.desktop-nav a:hover::after { transform: scaleX(1); }
.lang { display: inline-flex; gap: 3px; padding: 3px; border-radius: 999px; background: var(--pale); }
.lang button { min-width: 36px; border: 0; border-radius: 999px; padding: 6px 8px; color: #58728b; background: transparent; font-size: 11px; font-weight: 800; }
.lang button.active { color: white; background: var(--navy); }
.header-cta { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 9px 16px; border-radius: 999px; color: white; background: var(--navy); font-size: 11px; font-weight: 800; white-space: nowrap; }
.header-cta:hover { background: var(--blue); }

/* A reading room, rather than a stock landing page */
.hero { position: relative; overflow: hidden; color: var(--navy); background: #eaf4fd; }
.hero::before { content: ''; position: absolute; top: 0; bottom: 0; left: 6%; width: 1px; background: #bcd8ed; }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr); align-items: center; gap: 36px; min-height: 590px; }
.hero-copy { position: relative; z-index: 2; padding: 75px 0 87px; }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.hero .eyebrow { display: flex; align-items: center; gap: 14px; color: var(--blue); }
.hero .eyebrow::before { content: ''; width: 34px; height: 2px; background: var(--bright); }
.hero h1 { max-width: 740px; margin: 29px 0 24px; font: 800 clamp(53px, 5.5vw, 82px)/1.04 Manrope, Arial, sans-serif; letter-spacing: -.075em; }
.hero h1 em { display: block; color: var(--blue); font: italic 400 1.14em/.97 Georgia, 'Times New Roman', serif; letter-spacing: -.065em; }
.hero p { max-width: 495px; margin: 0 0 29px; color: #4b6984; font-size: 16px; line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 11px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 47px; padding: 12px 20px; border: 1px solid transparent; border-radius: 999px; font-size: 13px; font-weight: 800; text-align: center; transition: transform .2s, background .2s, box-shadow .2s; }
.btn:hover { transform: translateY(-2px); }
.btn-white { color: #fff; background: var(--navy); box-shadow: 0 9px 18px #0b397120; }
.btn-white:hover { background: var(--blue); }
.btn-ghost { border-color: #8ab7d9; color: var(--navy); background: #ffffff70; }
.btn-ghost:hover { background: white; }
.hero-visual { position: relative; align-self: stretch; display: grid; place-items: center; padding: 52px 0; }

/* Catalogue with tactile, easy to scan filters */
.section { padding: 88px 0 104px; background: #fff; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 30px; }
.section-head .eyebrow { color: var(--blue); }
h2 { margin: 10px 0 11px; color: var(--navy); font: 400 clamp(35px, 4.2vw, 58px)/1.1 Georgia, serif; letter-spacing: -.045em; }
.section-head p { max-width: 580px; margin: 0; color: var(--muted); }
.demo-pill { flex: 0 0 auto; padding: 8px 13px; border: 1px solid #b6d7ef; border-radius: 999px; color: var(--navy); background: var(--pale); font-size: 11px; font-weight: 800; }
.catalog-layout { display: flex; flex-direction: column; gap: 0; }
.filter-panel { padding: 24px; border: 1px solid #c7dff0; border-radius: 25px; background: #eef7fe; }
.filter-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.filter-head h3 { margin: 0; color: var(--navy); font: 800 19px Manrope, Arial, sans-serif; letter-spacing: -.03em; }
.text-button { padding: 7px 12px; border: 1px solid #a7cce7; border-radius: 999px; color: var(--blue); background: white; font-size: 11px; font-weight: 800; }
.text-button:hover { border-color: var(--blue); }
#filterGroups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.filter-group { min-width: 0; margin: 0; padding: 15px 16px 16px; border: 1px solid #d4e6f3; border-radius: 17px; background: white; }
.filter-group legend { float: left; width: 100%; margin-bottom: 11px; padding: 0; color: var(--navy); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.filter-group legend + * { clear: both; }
.options { display: flex; flex-wrap: wrap; align-items: start; gap: 6px; }
.check { position: relative; display: inline-flex; cursor: pointer; }
.check input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.check span { display: inline-flex; align-items: center; min-height: 28px; padding: 5px 10px; border: 1px solid #c6daea; border-radius: 999px; color: #3f5f79; background: #f7fbfe; font-size: 11px; font-weight: 700; line-height: 1.2; transition: background .15s, color .15s, border-color .15s; }
.check:hover span { border-color: var(--blue); color: var(--navy); background: var(--pale); }
.check input:checked + span { border-color: var(--navy); color: white; background: var(--navy); }
.check input:focus-visible + span { outline: 3px solid #efbd59; outline-offset: 2px; }
.filter-hint { clear: both; margin: 10px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.catalog-layout > div { min-width: 0; }
.results-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 34px 0 16px; }
.search-wrap { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; border: 1px solid #bad2e6; border-radius: 16px; background: #fff; box-shadow: 0 9px 28px #0c477312; }
.search-wrap:focus-within { outline: 3px solid #efbd59; outline-offset: 3px; }
.search-wrap svg { flex: 0 0 auto; width: 21px; margin-left: 18px; color: var(--blue); }
.search-wrap input { width: 100%; padding: 17px 16px 17px 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 14px; }
.count { flex: 0 0 auto; color: var(--blue); font-size: 13px; font-weight: 800; white-space: nowrap; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 17px; }
.active-filters:empty { display: none; }
.active-chip { padding: 6px 11px; border: 1px solid #9cc9e7; border-radius: 999px; color: var(--navy); background: var(--pale); font-size: 11px; font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 19px; }
.card { display: flex; flex-direction: column; width: 100%; padding: 0; overflow: hidden; border: 1px solid #d8e7f2; border-radius: 21px; color: var(--ink); background: white; box-shadow: 0 13px 32px #0f4b7710; text-align: left; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-4px); box-shadow: 0 20px 36px #0f4b7724; }
.card-art { position: relative; display: flex; align-items: center; justify-content: center; min-height: 265px; padding: 25px; background: linear-gradient(145deg, #e4f1fb, #d0e5f6); }
.card-art img { width: auto; height: 215px; max-width: 90%; object-fit: contain; box-shadow: 10px 12px 15px #123c6630; }
.card-lang { position: absolute; top: 17px; left: 17px; padding: 5px 10px; border-radius: 999px; color: var(--navy); background: white; box-shadow: 0 4px 12px #0b397113; font-size: 10px; font-weight: 800; }
.card-body { display: flex; flex: 1; flex-direction: column; padding: 22px; }
.meta { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.card h3 { margin: 11px 0 5px; color: var(--navy); font: 400 26px/1.14 Georgia, serif; letter-spacing: -.04em; }
.card .author { margin: 0 0 14px; color: var(--muted); font-size: 12px; }
.card-excerpt { display: -webkit-box; overflow: hidden; margin: 0 0 20px; color: #526a82; font-size: 12px; line-height: 1.6; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.card-bottom { display: flex; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); color: #506b83; font-size: 11px; font-weight: 700; }
.card-bottom b { color: var(--blue); }
.card:only-child { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(260px, .42fr) minmax(0, .58fr); min-height: 340px; }
.card:only-child .card-art { min-height: 340px; }
.card:only-child .card-art img { height: 270px; }
.card:only-child .card-body { justify-content: center; padding: clamp(24px, 4vw, 55px); }
.card:only-child h3 { font-size: clamp(31px, 3vw, 43px); }
.card:only-child .card-excerpt { max-width: 520px; -webkit-line-clamp: 5; font-size: 14px; }
.empty { padding: 55px 30px; border: 1px dashed #aecde6; border-radius: 20px; color: var(--muted); background: var(--paper); text-align: center; }
.empty strong { display: block; margin-bottom: 5px; color: var(--navy); font: 400 26px Georgia, serif; }
.empty p { margin: 0; }

/* Reading journey on one continuous blue field */
.feature { padding: 76px 0 85px; color: white; background: var(--deep); }
.feature-inner { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: center; gap: clamp(32px, 6vw, 85px); }
.feature .eyebrow { color: var(--sky); }
.feature h2 { max-width: 470px; color: white; }
.feature p { max-width: 440px; color: #c1d9ed; }
.steps { display: grid; border-top: 1px solid #79b3df82; }
.step { display: grid; grid-template-columns: 52px 1fr; column-gap: 20px; padding: 17px 0; border-bottom: 1px solid #79b3df82; }
.step b { grid-row: span 2; color: var(--sky); font: italic 31px Georgia, serif; }
.step h3 { margin: 0 0 3px; color: white; font: 800 15px Manrope, Arial, sans-serif; }
.step p { margin: 0; font-size: 12px; }

/* Final invitation */
.reserve { position: relative; overflow: hidden; padding: 62px 0; background: #dceefa; }
.reserve::after { content: '↗'; position: absolute; right: 4%; top: -112px; color: #b4d7ee; font: 400 340px Georgia, serif; pointer-events: none; }
.reserve-inner { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.reserve .eyebrow { color: var(--blue); }
.reserve h2 { margin: 9px 0; font-size: clamp(33px, 3.3vw, 49px); }
.reserve p { max-width: 610px; margin: 0; color: #476882; }
.reserve .btn { flex: 0 0 auto; white-space: nowrap; }
.footer { padding: 28px 0; color: #c1d7e9; background: var(--deep); font-size: 11px; }
.footer-inner { display: flex; justify-content: space-between; gap: 18px; }
.footer a { text-decoration: underline; text-underline-offset: 3px; }

/* Book detail */
dialog { width: min(750px, calc(100% - 24px)); max-height: calc(100vh - 32px); padding: 0; overflow: auto; border: 0; border-radius: 24px; background: white; box-shadow: 0 30px 80px #031e4080; }
dialog::backdrop { background: #041d3ed1; }
.modal-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.modal-art { display: flex; align-items: center; justify-content: center; padding: 35px; background: #e5f2fc; }
.modal-art img { max-width: 100%; max-height: 340px; box-shadow: 10px 14px 18px #0d366d2c; }
.modal-copy { padding: 39px 36px; }
.modal-copy h2 { margin: 12px 0 4px; font-size: 39px; }
.modal-copy p { color: var(--muted); }
.modal-copy dl { display: grid; grid-template-columns: auto 1fr; gap: 7px 15px; padding: 16px 0; border-block: 1px solid var(--line); font-size: 12px; }
.modal-copy dt { font-weight: 800; }.modal-copy dd { margin: 0; }
.modal-copy h3 { margin: 19px 0 4px; color: var(--navy); font-size: 14px; }
.modal-copy .btn { color: white; background: var(--navy); }
.small-note { margin-top: 9px; font-size: 11px; }
.close { position: absolute; z-index: 2; top: 13px; right: 13px; width: 36px; height: 36px; border: 0; border-radius: 50%; color: var(--navy); background: white; font-size: 23px; line-height: 1; box-shadow: 0 3px 12px #0e426321; }

@media (max-width: 1050px) {
  .top-inner { flex-wrap: wrap; gap: 8px 20px; padding-block: 9px; }
  .desktop-nav { order: 5; width: 100%; overflow-x: auto; }
  .hero-inner { grid-template-columns: minmax(0, 1fr) minmax(290px, .65fr); }
  .hero h1 { font-size: clamp(50px, 6.3vw, 70px); }
  .float-note { right: -5%; }
  #filterGroups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .top-inner { min-height: 70px; }
  .brand img { width: 65px; height: 44px; }
  .brand-copy { font-size: 11px; }.brand-copy small { font-size: 8px; }
  .brand-rule { height: 29px; }
  .header-cta { display: none; }
  .desktop-nav { gap: 21px; padding: 2px 0; font-size: 11px; }
  .hero::before { display: none; }
  .hero-inner { display: block; min-height: 0; }
  .hero-copy { padding: 63px 0 55px; }
  .hero h1 { max-width: 620px; font-size: clamp(48px, 10vw, 77px); }
  .hero-visual { display: none; }
  .section { padding: 62px 0 74px; }
  .section-head { align-items: start; flex-direction: column; margin-bottom: 24px; }
  .filter-panel { padding: 17px; border-radius: 19px; }
  .feature { padding: 59px 0; }
  .feature-inner { grid-template-columns: 1fr; }
  .reserve-inner { align-items: start; flex-direction: column; }
  .footer-inner { flex-direction: column; gap: 9px; }
  .modal-grid { grid-template-columns: 1fr; }
  .modal-art { padding: 24px; }.modal-art img { max-height: 175px; }
  .modal-copy { padding: 27px; }.modal-copy h2 { font-size: 33px; }
}

@media (max-width: 580px) {
  #filterGroups { grid-template-columns: 1fr; }
  .filter-group { padding: 13px; }
  .results-toolbar { align-items: stretch; flex-direction: column; }
  .count { align-self: flex-end; }
  .card:only-child { display: flex; min-height: 0; }
  .card:only-child .card-art { min-height: 265px; }
  .card:only-child .card-art img { height: 215px; }
  .card:only-child .card-body { padding: 22px; }
  .card:only-child h3 { font-size: 27px; }
  .card:only-child .card-excerpt { font-size: 12px; -webkit-line-clamp: 3; }
  .reserve .btn { white-space: normal; }
}

@media (max-width: 410px) {
  .hero h1 { font-size: 47px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .card, .desktop-nav a::after, .check span { transition: none; }
  .btn:hover, .card:hover { transform: none; }
}

/* Literary quotation and hoverable book */
.hero h1 { max-width: 790px; margin-bottom: 18px; font-size: clamp(42px, 4.7vw, 70px); line-height: 1.1; }
.hero h1 em { font-size: 1.07em; }
.hero-attribution { display: flex; align-items: center; gap: 12px; margin: 0 0 23px !important; color: var(--blue) !important; font-size: 11px !important; font-weight: 800; letter-spacing: .05em; }
.hero-attribution::before { content: ''; width: 28px; height: 1px; background: var(--blue); }
.hero-attribution a { text-decoration: underline; text-underline-offset: 3px; }
.hero-attribution a:hover { color: var(--navy); }
.hero-visual { min-width: 0; padding: 36px 0 42px; }
.book-scene { position: relative; width: min(100%, 520px); min-height: 435px; }
.book-scene::before { content: ''; position: absolute; inset: 18px 7px 68px 7px; border: 1px solid #a8cce7; border-radius: 28px; background: radial-gradient(circle at 32% 28%, #fafdff 0, #cfe8f8 65%, #b5daf2); }
.book-scene::after { content: ''; position: absolute; right: 26px; top: 38px; width: 82px; height: 82px; border: 1px solid #80b5da; border-radius: 50%; opacity: .7; }
.book-body { position: absolute; z-index: 2; top: 44px; left: 51%; width: 225px; height: 305px; transform-style: preserve-3d; perspective: 1400px; filter: drop-shadow(11px 18px 12px #0c3c6a48); }
.book-back { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border: 1px solid #9bbad2; border-radius: 3px 12px 12px 3px; background: #f9fcff; box-shadow: inset -14px 0 17px #b1d1e462, 6px 6px 0 #497fb0; }
.book-back::before { content: ''; position: absolute; inset: 24px; border: 1px solid #a4c5dc; }
.book-back img { position: relative; z-index: 1; width: 75%; max-width: 165px; height: auto; object-fit: contain; }
.book-leaf, .book-cover { position: absolute; inset: 0; transform-origin: 0 50%; transform-style: preserve-3d; transition: transform .82s cubic-bezier(.2,.72,.2,1); }
.book-leaf { border-radius: 2px 10px 10px 2px; }
.leaf-one { z-index: 4; }
.leaf-two { z-index: 3; }
.leaf-three { z-index: 2; }
.book-cover { z-index: 5; transition-delay: 0s; }
.leaf-front, .leaf-back, .cover-front, .cover-inside { position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden; }
.leaf-front, .leaf-back { display: flex; flex-direction: column; padding: 24px 22px; border: 1px solid #a7c8df; border-radius: 2px 10px 10px 2px; color: var(--navy); background: #fafdff; box-shadow: inset -8px 0 12px #aacbe04d; }
.leaf-front::before, .leaf-back::before { content: ''; position: absolute; inset: 13px; border: 1px solid #b7d4e7; border-radius: 2px 5px 5px 2px; pointer-events: none; }
.page-number { position: relative; z-index: 1; color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.page-title { position: relative; z-index: 1; display: block; margin: 28px 0 11px; font: 400 28px/1.05 Georgia, serif; letter-spacing: -.04em; }
.book-body .page-text { position: relative; z-index: 1; max-width: 155px; margin: 0; color: #45647d; font-size: 11px; line-height: 1.55; }
.page-ornament { position: relative; z-index: 1; margin-top: auto; color: var(--blue); font: 22px Georgia, serif; }
.leaf-back { transform: rotateY(180deg); border-radius: 10px 2px 2px 10px; box-shadow: inset 8px 0 12px #aacbe04d; }
.leaf-two .leaf-front { background: #edf7fe; }.leaf-three .leaf-front { background: #f6fbff; }
.cover-front, .cover-inside { display: flex; flex-direction: column; border-radius: 3px 12px 12px 3px; }
.cover-front { padding: 24px 23px; border: 1px solid #0e4a84; color: white; background: linear-gradient(140deg, #1c66a7, #082c59 76%); box-shadow: inset -12px 0 16px #041d3c72, 4px 5px 0 #4b82b1; }
.cover-front::before { content: ''; position: absolute; inset: 11px; border: 1px solid #abd7f578; border-radius: 2px 5px 5px 2px; }
.cover-front::after { content: ''; position: absolute; top: 0; bottom: 0; left: 14px; border-left: 1px solid #abd7f589; }
.cover-kicker { position: relative; z-index: 1; color: #baddf4; font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.cover-title { position: relative; z-index: 1; display: block; margin: auto 0; font: 400 31px/1.06 Georgia, serif; letter-spacing: -.04em; }
.cover-mark { position: relative; z-index: 1; align-self: flex-start; display: grid; place-items: center; width: 94px; height: 51px; padding: 6px; border-radius: 8px; background: #fff; }
.cover-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.cover-inside { justify-content: center; padding: 27px 23px; border: 1px solid #a4c6df; color: var(--navy); background: #e6f4fd; transform: rotateY(180deg); }
.cover-inside::before { content: ''; position: absolute; inset: 14px; border: 1px solid #a4c6df; }
.cover-inside .page-title { margin-top: 20px; }
.cover-inside .page-text { max-width: 160px; }
.book-scene.is-open .book-cover { z-index: 0; transform: rotateY(-158deg); }
.book-cover.is-flipping, .book-leaf.is-flipping { z-index: 7 !important; }
.leaf-one.is-turned { z-index: 1; transform: rotateY(-158deg); }
.leaf-two.is-turned { z-index: 2; transform: rotateY(-158deg); }
.leaf-three.is-turned { z-index: 3; transform: rotateY(-158deg); }
.book-scene.is-resetting .book-leaf { transition: none !important; }
.book-ui { position: absolute; z-index: 3; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 8px; }
.book-ui p { margin: 0; color: #4b6984; font-size: 11px; font-weight: 700; }
.book-actions { display: flex; align-items: center; gap: 8px; }
.page-controls { display: flex; align-items: center; gap: 5px; }
.page-controls button { display: grid; place-items: center; width: 35px; height: 35px; padding: 0; border: 1px solid #a0c8e4; border-radius: 50%; color: var(--navy); background: white; font-size: 18px; }
.page-controls button:hover:not(:disabled) { border-color: var(--blue); background: #f4faff; }
.page-controls button:disabled, .page-controls button[aria-disabled="true"] { opacity: .4; cursor: default; }
.page-count { min-width: 46px; color: var(--navy); font-size: 10px; font-weight: 800; text-align: center; white-space: nowrap; }
.book-toggle { flex: 0 0 auto; min-height: 36px; padding: 7px 14px; border: 1px solid #a0c8e4; border-radius: 999px; color: var(--navy); background: #fff; font-size: 11px; font-weight: 800; }
.book-toggle:hover { border-color: var(--blue); background: #f4faff; }
.book-toggle[aria-disabled="true"] { opacity: .6; cursor: wait; }

@media (prefers-reduced-motion: no-preference) {
  .hero-copy { animation: hero-arrive .7s ease-out both; }
  .book-scene { animation: book-arrive .75s .12s ease-out both; }
  .motion-ready .reveal-item:not(.grid) { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
  .motion-ready .reveal-item:not(.grid).is-visible { opacity: 1; transform: translateY(0); }
  @keyframes hero-arrive { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes book-arrive { from { opacity: 0; transform: translateY(25px); } to { opacity: 1; transform: translateY(0); } }
}

@media (max-width: 1050px) {
  .hero h1 { font-size: clamp(39px, 5.7vw, 59px); }
  .book-body { left: 49%; width: min(195px, 46%); height: 275px; }
  .book-scene { min-height: 420px; }
  .book-scene::before { bottom: 92px; }
  .book-ui { align-items: flex-start; flex-direction: column; gap: 8px; }
  .book-ui > p:not(.sr-only) { width: 100%; }
  .book-actions { flex: 0 0 auto; }
  .cover-title { font-size: clamp(19px, 2.3vw, 28px); }
  .page-title { font-size: clamp(20px, 2.4vw, 25px); }
}

@media (max-width: 760px) {
  .hero-copy { padding-bottom: 24px; }
  .hero h1 { max-width: 650px; font-size: clamp(39px, 8vw, 59px); }
  .hero-visual { display: grid; padding: 0 0 57px; }
  .book-scene { width: min(100%, 500px); min-height: 420px; }
  .book-body { left: 50%; }
  .book-ui { align-items: flex-start; flex-direction: column; gap: 7px; }
}

@media (max-width: 420px) {
  .hero h1 { font-size: 38px; }
  .book-scene { min-height: 360px; }
  .book-scene::before { bottom: 76px; }
  .book-body { top: 35px; left: 51%; width: min(165px, 46%); height: 245px; }
  .cover-title { font-size: clamp(19px, 5.7vw, 24px); }
  .cover-front { padding: 19px; }
  .leaf-front, .leaf-back { padding: 20px 18px; }
  .page-title { margin-top: 21px; font-size: 21px; }
  .book-body .page-text { font-size: 10px; }
  .cover-inside { padding: 20px 18px; }
  .cover-mark { width: 78px; height: 43px; }
  .book-ui { gap: 5px; }
  .book-ui p { font-size: 10px; }
  .book-toggle { padding-inline: 10px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .book-cover, .book-leaf { transition: none; }
}

.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* Catálogo del inventario */
.catalog-summary { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.card-stock { margin: auto 0 12px; padding-top: 12px; color: var(--navy); font-size: 12px; font-weight: 800; }
.card-stock span { display: block; margin-top: 5px; color: var(--muted); font: 10px/1.5 ui-monospace, monospace; font-weight: 400; }
.card-bottom { margin-top: 0; flex-wrap: wrap; }
.catalog-pagination { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 32px; }
.catalog-pagination p { margin: 0; color: var(--muted); font-size: 12px; }
.catalog-pagination .btn { background: var(--navy); color: white; cursor: pointer; }
.cover-placeholder { width: 180px; min-height: 245px; padding: 25px 18px; display: flex; flex-direction: column; justify-content: center; gap: 16px; text-align: center; color: var(--navy); background: #f4f9fc; border: 1px solid #b8d4e8; box-shadow: -5px 4px 0 #c8dcec, 0 14px 26px #0b397120; }
.cover-placeholder strong { font: 700 21px/1.22 Georgia, serif; overflow-wrap: anywhere; }
.cover-placeholder span { font-size: 11px; }
.cover-placeholder small { margin-top: auto; color: var(--muted); font-size: 9px; }
.cover-rule { display: block; border-top: 2px solid #78b6de; width: 35px; margin: 0 auto; }
.modal-art .cover-placeholder { width: min(220px,100%); min-height: 310px; }
.source-link { display: inline-block; color: var(--navy); font-size: 12px; text-underline-offset: 3px; margin: 2px 0 8px; }
.card-art img { object-fit: contain; }
.modal-copy dd { overflow-wrap: anywhere; }
[hidden] { display: none !important; }

/* Allow long book titles to fit narrow screens. */
.card h3, .modal-copy h2 { overflow-wrap: anywhere; }

/* Library photo gallery */
.gallery-section { background: var(--paper); border-top: 1px solid var(--line); }
.gallery-empty { display: flex; align-items: center; gap: 34px; padding: clamp(28px, 5vw, 64px); border: 1px solid #c7dff0; border-radius: 25px; background: linear-gradient(130deg, #e5f2fc, #fff); }
.gallery-empty-icon { flex: 0 0 112px; display: grid; place-items: center; width: 112px; height: 112px; border: 1px solid #b6d7ef; border-radius: 28px; color: var(--blue); background: #fff9; }
.gallery-empty-icon svg { width: 64px; height: 64px; }
.gallery-soon { display: inline-block; color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.gallery-empty h3 { margin: 9px 0; color: var(--navy); font: 400 clamp(26px, 3vw, 36px)/1.2 Georgia, serif; }
.gallery-empty p { max-width: 550px; margin: 0; color: var(--muted); }
.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.gallery-card { min-width: 0; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 21px; background: #fff; }
.gallery-photo { position: relative; display: block; width: 100%; padding: 0; border: 0; color: var(--navy); background: var(--pale); }
.gallery-photo img { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; object-fit: cover; }
.gallery-photo:focus-visible { outline-offset: -5px; }
.gallery-expand { position: absolute; right: 14px; bottom: 14px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #fff; box-shadow: 0 4px 12px #0b397120; font-size: 21px; }
.gallery-photo:hover .gallery-expand { color: #fff; background: var(--navy); }
.gallery-card figcaption { padding: 19px 22px 23px; }
.gallery-card h3 { margin: 0; color: var(--navy); font: 400 25px/1.2 Georgia, serif; overflow-wrap: anywhere; }
.gallery-card p { margin: 8px 0 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.gallery-dialog { width: min(1000px, calc(100% - 24px)); }
.gallery-viewer { margin: 0; }
.gallery-image-stage { display: flex; align-items: center; justify-content: center; min-height: 180px; padding: 24px; background: var(--deep); }
.gallery-image-stage img { display: block; max-width: 100%; max-height: 65vh; width: auto; height: auto; object-fit: contain; }
.gallery-viewer figcaption { padding: 22px 28px 0; }
.gallery-viewer h3 { margin: 0; color: var(--navy); font: 400 28px/1.2 Georgia, serif; overflow-wrap: anywhere; }
.gallery-viewer p { margin: 9px 0 0; color: var(--muted); }
.gallery-controls { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 22px 28px; color: var(--navy); font-size: 12px; font-weight: 700; }
.gallery-controls button { width: 44px; height: 44px; border: 1px solid #a0c8e4; border-radius: 50%; color: var(--navy); background: var(--pale); font-size: 22px; }
.gallery-controls button:disabled { opacity: .4; cursor: default; }
@media (max-width: 1050px) { .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 580px) {
  .gallery-empty { align-items: flex-start; flex-direction: column; gap: 22px; border-radius: 19px; }
  .gallery-empty-icon { flex-basis: auto; width: 84px; height: 84px; border-radius: 22px; }
  .gallery-empty-icon svg { width: 50px; height: 50px; }
  .gallery-grid { grid-template-columns: 1fr; gap: 18px; }
  .gallery-image-stage { padding: 12px; }
  .gallery-viewer figcaption { padding-inline: 22px; }
}
