/* ej3 · Biblioteca — estilo editorial: papel, tinta y serif */
:root {
    --papel: #fbf6ec;
    --papel-2: #f3ead7;
    --tinta: #2b2118;
    --tinta-2: #6b5a48;
    --terracota: #9a3412;
    --terracota-2: #c2410c;
    --oro: #b7791f;
    --linea: #e2d5bb;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Source Sans 3', Georgia, sans-serif; color: var(--tinta); line-height: 1.6;
    background-color: var(--papel);
    background-image: radial-gradient(rgba(154,52,18,.05) 1px, transparent 1px);
    background-size: 22px 22px;
    min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--terracota); }
code { font-size: .9em; background: var(--papel-2); padding: 1px 5px; border-radius: 4px; }
.wrap { width: 100%; max-width: 1000px; margin: 0 auto; padding: 0 22px; }
.pagina { flex: 1; padding-top: 34px; padding-bottom: 50px; }
h1, h2, h3 { font-family: 'Playfair Display', Georgia, serif; font-weight: 800; letter-spacing: -.3px; }

/* cabecera tipo periódico */
.masthead { border-bottom: 3px double var(--tinta); background: rgba(251,246,236,.92); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(6px); }
.mast-in { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.sello { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--tinta); }
.sello-ico { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--terracota); color: var(--terracota); display: grid; place-items: center; font-size: 1.3rem; }
.sello b { display: block; font-family: 'Playfair Display', serif; font-size: 1.35rem; line-height: 1; }
.sello i { font-family: 'Playfair Display', serif; font-style: italic; font-size: .85rem; color: var(--tinta-2); }
.menu { display: flex; gap: 4px; }
.menu a { text-decoration: none; color: var(--tinta-2); font-weight: 600; padding: 7px 14px; border-radius: 999px; transition: background .15s, color .15s; }
.menu a:hover { color: var(--terracota); }
.menu a.on { background: var(--tinta); color: var(--papel); }

/* avisos */
.nota { background: #ecfccb; border-left: 4px solid #4d7c0f; color: #365314; padding: 12px 16px; margin-bottom: 22px; font-weight: 600; }
.nota-error { background: #fee2e2; border-left-color: var(--terracota); color: var(--terracota); }

/* portada */
.portada { text-align: center; padding: 26px 0 30px; border-bottom: 1px solid var(--linea); }
.volanta { font-size: .78rem; text-transform: uppercase; letter-spacing: 2.5px; color: var(--terracota); font-weight: 700; margin-bottom: 10px; }
.volanta a { text-decoration: none; }
.portada h1 { font-size: clamp(2.1rem, 5.5vw, 3.6rem); line-height: 1.05; }
.portada h1 em { font-style: italic; color: var(--terracota); font-weight: 600; }
.bajada { font-size: 1.12rem; color: var(--tinta-2); max-width: 560px; margin: 14px auto 22px; font-style: italic; }
.acciones { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

.boton { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 700; font-size: .95rem; text-decoration: none; cursor: pointer;
    background: var(--terracota); color: #fff8ec; border: 2px solid var(--terracota); padding: 10px 20px; border-radius: 4px;
    box-shadow: 3px 3px 0 var(--tinta); transition: transform .12s, box-shadow .12s; }
.boton:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--tinta); }
.boton:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--tinta); }
.boton-linea { background: transparent; color: var(--terracota); }

/* cifras */
.cifras { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--linea); margin-bottom: 34px; }
.cifras div { text-align: center; padding: 22px 8px; border-right: 1px solid var(--linea); }
.cifras div:last-child { border-right: 0; }
.cifras b { display: block; font-family: 'Playfair Display', serif; font-size: 2rem; color: var(--terracota); line-height: 1.1; }
.cifras span { font-size: .78rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--tinta-2); }

/* estantería */
.titulo-seccion { font-size: 1.6rem; margin-bottom: 18px; }
.estante { display: flex; align-items: flex-end; gap: 6px; padding: 0 12px; overflow-x: auto; min-height: 270px; }
.lomo { flex: 0 0 52px; font-size: .86rem; border-radius: 4px 4px 2px 2px; position: relative; text-decoration: none; color: #fdf3df;
    box-shadow: inset -6px 0 0 rgba(0,0,0,.18), inset 4px 0 0 rgba(255,255,255,.08); transition: transform .2s; }
.lomo::before, .lomo::after { content: ''; position: absolute; left: 6px; right: 8px; height: 3px; background: var(--oro); opacity: .8; }
.lomo::before { top: 14px; } .lomo::after { bottom: 14px; }
.lomo span { position: absolute; inset: 26px 0; writing-mode: vertical-rl; transform: rotate(180deg); display: flex; align-items: center; justify-content: center;
    font-family: 'Playfair Display', serif; font-weight: 600; font-size: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lomo:hover { transform: translateY(-12px) rotate(-2deg); }
.tabla-madera { height: 16px; border-radius: 3px; background: linear-gradient(#8b5a2b, #6b4220); box-shadow: 0 8px 14px -6px rgba(60,30,10,.6); }
.pie-estante { margin-top: 12px; font-size: .88rem; font-style: italic; color: var(--tinta-2); text-align: center; }

/* encabezado de listado */
.encabezado { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; padding-bottom: 16px; margin-bottom: 26px; border-bottom: 1px solid var(--tinta); }
.encabezado h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); line-height: 1.1; }

/* fichas de libro */
.fichas { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.ficha { background: #fffdf8; border: 1px solid var(--linea); padding: 22px 22px 16px; position: relative; box-shadow: 0 1px 0 var(--linea), 0 12px 24px -18px rgba(43,33,24,.5); }
.ficha::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--terracota); }
.ficha-anio { position: absolute; top: 14px; right: 16px; font-family: 'Playfair Display', serif; font-style: italic; color: var(--oro); font-weight: 600; }
.ficha h3 { font-size: 1.28rem; line-height: 1.2; padding-right: 50px; }
.ficha-autor { font-style: italic; color: var(--tinta-2); margin: 4px 0 14px; }
.ficha dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border-top: 1px dashed var(--linea); padding-top: 12px; }
.ficha dt { font-size: .7rem; text-transform: uppercase; letter-spacing: 1.4px; color: var(--tinta-2); }
.ficha dd { font-weight: 700; }
.ficha-acciones, .indice-acc { display: flex; gap: 16px; margin-top: 14px; font-weight: 700; font-size: .9rem; }
.ficha-acciones a, .indice-acc a { text-decoration: none; border-bottom: 1px solid currentColor; }
.peligro { color: #b91c1c; }

/* índice de autores */
.indice { list-style: none; }
.indice li { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 18px; padding: 16px 4px; border-bottom: 1px solid var(--linea); }
.inicial { width: 52px; height: 52px; display: grid; place-items: center; font-family: 'Playfair Display', serif; font-size: 1.3rem; font-weight: 800; color: var(--papel); background: var(--tinta); border-radius: 50%; }
.indice-txt strong { display: block; font-family: 'Playfair Display', serif; font-size: 1.2rem; }
.indice-txt small { color: var(--tinta-2); }
.cuenta { font-style: italic; color: var(--oro); font-weight: 600; white-space: nowrap; }
.indice-acc { margin-top: 0; }

/* formulario */
.formulario { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; max-width: 760px; background: #fffdf8; border: 1px solid var(--linea); padding: 28px; box-shadow: 0 12px 30px -20px rgba(43,33,24,.5); }
.formulario label { display: flex; flex-direction: column; gap: 6px; }
.formulario .ancho { grid-column: 1 / -1; }
.formulario span { font-size: .74rem; text-transform: uppercase; letter-spacing: 1.6px; font-weight: 700; color: var(--tinta-2); }
.formulario input { font: inherit; font-size: 1.05rem; color: var(--tinta); background: transparent; border: 0; border-bottom: 2px solid var(--linea); padding: 8px 2px; outline: none; transition: border-color .15s; }
.formulario input:focus { border-bottom-color: var(--terracota); }
.form-pie { grid-column: 1 / -1; display: flex; justify-content: flex-end; align-items: center; gap: 20px; margin-top: 6px; }
.form-pie a { font-weight: 700; text-decoration: none; }
.vacio { font-style: italic; color: var(--tinta-2); text-align: center; padding: 40px 0; font-size: 1.1rem; }

/* pie */
.colofon { border-top: 3px double var(--tinta); padding: 18px 0; font-size: .85rem; color: var(--tinta-2); }
.colofon-in { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.colofon a { font-weight: 700; text-decoration: none; }

@media (max-width: 640px) {
    .cifras { grid-template-columns: 1fr 1fr; }
    .cifras div:nth-child(2) { border-right: 0; }
    .cifras div:nth-child(-n+2) { border-bottom: 1px solid var(--linea); }
    .indice li { grid-template-columns: auto 1fr; }
    .cuenta, .indice-acc { grid-column: 2; }
    .formulario { grid-template-columns: 1fr; padding: 20px; }
    .menu a { padding: 6px 10px; }
    .encabezado .boton { width: 100%; justify-content: center; }
}
