:root {
  color-scheme: dark;
  --fondo: #151413;
  --superficie: #1d1b19;
  --borde: #37322b;
  --tinta: #f4efe7;
  --suave: #c0b7ad;
  --oro: #dcc091;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: Manrope, system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--fondo); color: var(--tinta); font: 1rem/1.6 var(--sans); }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
:where(a, button, input, select):focus-visible { outline: 2px solid var(--oro); outline-offset: 3px; }
img { display: block; max-width: 100%; }
svg { width: 1.1rem; height: 1.1rem; flex: none; }
[hidden] { display: none !important; }
.contenedor { width: min(calc(100% - 4rem), 1080px); margin-inline: auto; }
.solo-lector, .salto:not(:focus) { clip-path: inset(50%); position: absolute; width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
.salto:focus { position: fixed; z-index: 4; margin: .5rem; padding: .7rem 1rem; background: var(--superficie); }
h1, h2, h3, p { margin: 0; }

.cabecera { border-bottom: 1px solid var(--borde); }
.cabecera-interior { min-height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.marca { display: flex; align-items: center; gap: .65rem; color: var(--suave); font-size: .875rem; line-height: 1.2; }
.marca strong { display: block; color: var(--tinta); font-size: .94rem; font-weight: 700; }
.cabecera-enlace { display: inline-flex; align-items: center; min-height: 44px; color: var(--oro); font-size: .875rem; font-weight: 700; text-decoration: none; }
.cabecera-enlace:hover, .lector-retorno:hover { text-decoration: underline; }

.hero { position: relative; isolation: isolate; min-height: 330px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1.7rem; border-bottom: 1px solid #6c54363f; }
.hero::before { content: ''; position: absolute; z-index: -1; inset: 0; background: radial-gradient(ellipse at 82% 55%, #98704724, transparent 45%); pointer-events: none; }
.hero-texto { padding-block: 2.7rem; }
.identificador { display: flex; gap: .7rem; align-items: center; color: var(--oro); font-size: .875rem; font-weight: 700; letter-spacing: .095em; text-transform: uppercase; }
.identificador span { width: 18px; height: 1px; background: currentColor; flex: none; }
.hero h1 { margin: .32rem 0 .63rem; font: 400 clamp(3.65rem, 6.5vw, 6rem)/.97 var(--serif); letter-spacing: -.026em; text-wrap: balance; }
.introduccion { max-width: 440px; color: var(--suave); }
.hero-exhibicion { position: relative; display: grid; place-items: center; padding: 1.45rem clamp(2rem, 6vw, 5rem); }
.hero-exhibicion::before { content: ''; position: absolute; inset: 12% 8%; z-index: -1; border: 1px solid #c4a16b38; border-radius: 50%; transform: rotate(-14deg); }
.hero-portada { position: relative; width: clamp(155px, 19vw, 224px); border: 1px solid #b08d5f; padding: 3px; background: #241c15; overflow: hidden; border-radius: .18rem; box-shadow: 0 14px 40px #0009, 0 0 25px #aa744635; transform: rotate(3deg); animation: elevar .65s ease-out both; }
.hero-portada img { width: 100%; height: auto; }
.hero-portada::after, .comunidad-boton::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, #fff6dd50 49%, transparent 64%); transform: translateX(-115%); pointer-events: none; animation: destello 1.8s .35s ease-out both; }
@keyframes elevar { from { opacity: 0; transform: translateY(8px) rotate(1deg); } to { opacity: 1; transform: translateY(0) rotate(3deg); } }
@keyframes destello { 0% { transform: translateX(-115%); } 100% { transform: translateX(115%); } }

.comunidad { padding: 1rem 1.2rem; margin-top: 1.45rem; border: 1px solid #82643d; background: linear-gradient(110deg, #2c2117, #211b15 55%, #2e2318); box-shadow: inset 0 1px #f4d29a2b, 0 7px 27px #0004; display: flex; justify-content: space-between; align-items: center; gap: 1rem; scroll-margin-top: 1rem; }
.comunidad-intro { display: flex; align-items: center; gap: .8rem; }
.comunidad-icono { color: var(--oro); background: #30271c; border: 1px solid #584733; width: 42px; height: 42px; display: grid; place-items: center; flex: none; }
.comunidad-icono svg { height: 22px; width: 22px; }
.comunidad h2 { font-size: 1rem; font-weight: 700; }
.comunidad p { color: var(--suave); font-size: .92rem; margin-top: .12rem; }
.comunidad > .boton { flex-shrink: 0; }
.comunidad .comunidad-boton { position: relative; isolation: isolate; overflow: hidden; min-height: 48px; padding-inline: 1.05rem; background: linear-gradient(110deg, #d6af76, #f2d495 57%, #e6c188); border-color: #f3d69f; box-shadow: 0 0 16px #d7aa6c42, inset 0 1px #fff4cf; }
.comunidad .comunidad-boton:hover { background: #f6daa4; box-shadow: 0 0 22px #e5b97a66; }
.comunidad-boton::after { animation-delay: .85s; }

.materiales { padding-block: 2.2rem 3rem; scroll-margin-top: 1rem; }
.materiales-cabecera { display: flex; justify-content: space-between; align-items: end; gap: .9rem 1.8rem; }
.materiales h2 { font: 400 clamp(2.5rem, 5vw, 3.5rem)/1.05 var(--serif); letter-spacing: -.02em; }
.resumen { color: var(--suave); margin-top: .25rem; font-size: .875rem; }
.busqueda { background: var(--superficie); display: flex; align-items: center; gap: .65rem; border: 1px solid var(--borde); border-radius: .25rem; padding-inline: .8rem; min-height: 46px; width: min(100%, 290px); color: var(--suave); }
.busqueda input { min-width: 0; width: 100%; padding: .55rem 0; background: transparent; outline: none; border: 0; color: var(--tinta); }
.busqueda input::placeholder { color: var(--suave); opacity: 1; }
.busqueda:focus-within { border-color: var(--oro); }
.filtros { display: flex; flex-wrap: wrap; gap: .45rem; margin: 1.12rem 0; }
.filtros button { color: var(--suave); background: transparent; border: 1px solid var(--borde); border-radius: .25rem; min-height: 44px; padding: .45rem .72rem; font-size: .875rem; font-weight: 600; }
.filtros button:hover { border-color: var(--oro); color: var(--tinta); }
.filtros button[aria-pressed="true"] { color: var(--oro); background: #2e261d; border-color: #6d563a; }

.lista { display: grid; gap: .55rem; }
.tarjeta { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; align-items: center; gap: 1.15rem; padding: .85rem 1rem; background: var(--superficie); border: 1px solid var(--borde); border-radius: .3rem; }
.tarjeta.destacada { border-color: #846844; background: linear-gradient(110deg, #2b2118, var(--superficie) 75%); }
.portada { display: grid; place-items: center; align-self: center; width: 62px; min-height: 86px; color: var(--oro); border: 1px solid #5e5040; text-decoration: none; }
.portada img { width: 100%; height: auto; }
.portada:hover { border-color: var(--oro); }
.portada-pendiente { min-height: 62px; background: #221e1a; border-color: var(--borde); color: var(--suave); }
.recurso { min-width: 0; }
.metadatos { color: var(--oro); font-size: .875rem; font-weight: 700; }
.pendiente .metadatos { color: var(--suave); }
.tarjeta h3 { margin: .08rem 0 .13rem; font-size: 1.03rem; font-weight: 700; line-height: 1.35; }
.recurso p { color: var(--suave); font-size: .91rem; }
.recurso .datos-pdf { margin-top: .35rem; color: #b0a498; font-size: .8125rem; }
.datos-pdf span { padding-inline: .12rem; }
.acciones { display: flex; gap: .48rem; }
.boton { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; text-decoration: none; min-height: 44px; padding: .48rem .82rem; border: 1px solid #625549; border-radius: .25rem; background: transparent; color: var(--tinta); font-size: .875rem; font-weight: 700; line-height: 1.28; }
.boton:hover { background: #2f2922; border-color: var(--oro); }
.primario { color: #241b12; background: var(--oro); border-color: var(--oro); }
.primario:hover { background: #ead2ac; }
.boton:disabled { opacity: .42; cursor: default; }
.sin-resultados { padding: 1.5rem; text-align: center; background: var(--superficie); border: 1px solid var(--borde); }
.sin-resultados p { color: var(--suave); margin: .25rem 0 .85rem; }

.lector { max-width: 820px; padding-block: 1rem 2rem; }
.lector-retorno { display: inline-flex; min-height: 44px; align-items: center; color: var(--oro); text-decoration: none; font-size: .875rem; font-weight: 700; }
.lector-cabecera { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.lector h1 { font: 400 clamp(2.5rem, 6vw, 4rem)/1.05 var(--serif); }
.lector-cabecera .boton { flex: none; }
.visor-pagina { display: grid; place-items: center; min-height: 8rem; border: 1px solid var(--borde); background: var(--superficie); }
.visor-pagina img { width: 100%; height: auto; scroll-margin-top: 70px; }
.visor-pagina p { padding: 1rem; }
.visor-controles { position: sticky; top: 0; z-index: 2; display: flex; justify-content: center; align-items: center; gap: .5rem; padding: .55rem .35rem; background: var(--fondo); border-block: 1px solid var(--borde); }
.visor-controles select { min-height: 44px; padding: .35rem .5rem; background: var(--superficie); border: 1px solid #625549; border-radius: .25rem; font-size: 1rem; }

.pie { border-top: 1px solid var(--borde); padding-block: 1.35rem; }
.pie-interior { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .35rem 1rem; font-size: .875rem; color: var(--suave); }
.pie-interior strong { color: var(--oro); }
.pie-interior a { color: var(--tinta); text-underline-offset: .22em; }
.pie-interior a:hover { color: var(--oro); }

@media (max-width: 700px) {
  .contenedor { width: calc(100% - 2rem); }
  .cabecera-interior { min-height: 61px; }
  .hero { min-height: 0; gap: .6rem; overflow: clip; }
  .hero-texto { padding-block: 1.45rem; }
  .hero h1 { text-wrap: initial; font-size: clamp(2.7rem, 9.1vw, 4.3rem); }
  .introduccion { font-size: .94rem; }
  .hero-exhibicion { padding: 1rem .35rem 1rem 0; }
  .hero-exhibicion::before { inset: -2% -15%; }
  .hero-portada { width: clamp(85px, 27vw, 149px); padding: 2px; }
  .identificador { gap: .42rem; letter-spacing: .045em; flex-wrap: wrap; }
  .identificador span { width: 10px; }
  .comunidad { align-items: stretch; flex-direction: column; padding: .8rem; margin-top: .9rem; gap: .65rem; }
  .materiales { padding-top: 1.4rem; }
  .materiales-cabecera { flex-direction: column; align-items: stretch; }
  .busqueda { width: 100%; }
  .filtros { flex-wrap: nowrap; overflow-x: auto; padding: 3px 3px .35rem; margin: .65rem -3px .55rem; scrollbar-width: thin; scrollbar-color: #6d563a transparent; }
  .filtros button { flex: 0 0 auto; white-space: nowrap; }
  .tarjeta { grid-template-columns: 55px minmax(0, 1fr); gap: .7rem .8rem; padding: .8rem; }
  .portada { width: 55px; min-height: 75px; }
  .portada-pendiente { min-height: 55px; }
  .acciones { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lector-cabecera { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-portada, .hero-portada::after, .comunidad-boton::after { animation: none; }
}
