/* La Heredera de la Llave Prohibida. La idea: la vidriera ojival de la cubierta es una puerta cerrada con la llave dentro;
   la lectora gira la llave, la vidriera se abre hacia dentro y detrás está el libro; dentro del palacio, la luz de esos
   cristales cae al suelo con forma de arco. Colores medidos en la cubierta (datos.py). Letra de titulares: Marcellus (OFL),
   cuerpo: Alegreya de la casa. Se carga solo en esta página, después de tienda.css. Prefijo: her-. */

.ark-libro-la-heredera-de-la-llave-prohibida {
  --her-noche: #240039;
  --her-sala: #15022a;
  --her-violeta: #592883;
  --her-oro: #eec45e;
  --her-oro-2: #d09932;
  --her-lila: #e7d6ef;
  --her-gris: #d6d7d2;
  --her-tinta-clara: #efe4f6;
  --her-tinta-2: #c9b6dc;
  --her-tinta-osc: #240039;
  --her-tinta-osc-2: #4f3566;
  --her-titulo: 'Marcellus', 'Alegreya', Georgia, serif;
  --her-curva: cubic-bezier(0.77, 0, 0.175, 1);
  --her-puerta: cubic-bezier(0.32, 0.72, 0, 1);
  background: var(--her-noche);
}
.ark-libro-la-heredera-de-la-llave-prohibida :focus-visible { outline-color: var(--her-oro); }

/* ------------------------------------------------------------------ el umbral: la vidriera cerrada */
.her-umbral { position: relative; isolation: isolate; overflow: hidden; background: var(--her-noche); color: var(--her-tinta-clara);
  padding: calc(var(--cab-alto) + 10px) 0 22px; }
.her-nubes { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; max-width: none; }
.her-umbral-int { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; gap: 14px; }
.her-cab { width: 100%; }
.her-serie { font: 500 1rem/1.3 var(--sans); color: var(--her-tinta-2); margin: .15rem 0 0; }
.her-cab h1 { --fs: 2.6rem; font-family: var(--her-titulo); font-weight: 400; line-height: 1.04; letter-spacing: .01em; color: var(--her-oro); overflow-wrap: normal; text-wrap: balance; }
.her-autora { margin: .5rem 0 0; font-size: 1.0625rem; }
.her-autora .enlace { text-decoration-color: var(--her-oro); font-weight: 600; }
.her-gancho { display: none; }

.her-ventana-col { display: grid; justify-items: center; }
.her-ventana { --alto: clamp(210px, 34svh, 320px); position: relative; height: var(--alto); aspect-ratio: 100 / 180; margin: 4px 0 calc(var(--alto) * .055); }
.her-arco { position: absolute; inset: 0; perspective: 900px; background: var(--her-sala); }
.her-detras { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; }
.her-hoja { position: absolute; top: 0; bottom: 0; width: 50%; backface-visibility: hidden; will-change: transform;
  transition: transform 620ms var(--her-puerta); }
.her-hoja svg { width: 100%; height: 100%; }
.her-hoja-i { left: 0; transform-origin: 0 50%; }
.her-hoja-d { right: 0; transform-origin: 100% 50%; transition-delay: 40ms; }
.her-ventana.abierta .her-hoja { transition-duration: 1000ms; }
.her-ventana.abierta .her-hoja-i { transform: rotateY(82deg); }
.her-ventana.abierta .her-hoja-d { transform: rotateY(-82deg); }
.her-marco { position: absolute; left: -8%; top: -4.444%; width: 116%; height: 111.111%; max-width: none; pointer-events: none; }

/* El único momento de carga: los cristales se encienden de abajo arriba, como cuando entra la luz */
@keyframes her-enciende { from { opacity: .18; } to { opacity: 1; } }
.her-cristales polygon { animation: her-enciende 520ms var(--ease-out) both; animation-delay: calc(140ms + var(--i) * 26ms); }

/* La llave: se gira con el dedo o el ratón (de lado), con un toque o con el botón de debajo */
.her-llave { position: absolute; left: 32%; width: 36%; top: 9%; aspect-ratio: 120 / 340; perspective: 420px; cursor: grab;
  touch-action: pan-y; -webkit-tap-highlight-color: transparent; transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out); }
.her-llave svg { width: 100%; height: 100%; transform-origin: 50% 50%; transition: transform 200ms var(--ease-out); filter: drop-shadow(0 6px 10px rgba(10, 0, 25, .45)); }
.her-llave.arrastra { cursor: grabbing; }
.her-llave.arrastra svg { transition: none; will-change: transform; }
.her-ventana.girada .her-llave svg { transform: rotateY(-74deg); transition: transform 420ms var(--her-curva); }
.her-ventana.abierta .her-llave { opacity: 0; transform: scale(.94); pointer-events: none; }
@media (hover: hover) and (pointer: fine) {
  .her-ventana:not(.girada) .her-llave:hover svg { transform: rotateY(-16deg); }
}
.her-girar { min-height: 44px; padding: 0 6px; border: 0; background: none; cursor: pointer; color: var(--her-tinta-clara); font: 700 1rem/1.2 var(--sans);
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .25em; text-decoration-color: var(--her-oro); }
@media (hover: hover) and (pointer: fine) { .her-girar:hover { text-decoration-color: currentColor; } }

.her-compra-1 { width: 100%; max-width: 26rem; }
.her-compra-1 .ark-compra { --ark-compra-boton: var(--her-oro); --ark-compra-boton-tinta: var(--her-noche); --ark-compra-tinta-2: var(--her-tinta-2); }
.her-compra-1 .ark-compra-precio { justify-content: center; margin: 0; }
.her-compra-1 .ark-compra-estado { margin: .1rem 0 .7rem; }
.her-compra-1 .ark-compra-acciones { justify-content: center; }
.her-compra-1 .ark-compra-incluye { display: none; }
.her-compra-1 .ark-compra-ok { margin-top: .3rem; min-height: 1.2em; }
.her-compra-1 .enlace { display: inline-block; padding-block: .78em; font: 700 1rem/1.2 var(--sans); text-decoration-color: var(--her-oro); }
@media (max-width: 759px) {
  /* 2-oct: la vidriera manda también en el móvil (era de 159 px de ancho); el estado de publicación está en la ficha */
  .her-ventana { --alto: clamp(280px, 49svh, 450px); }
  .her-cab h1 { --fs: 2.3rem; }
  .her-compra-1 .ark-compra-estado { display: none; }
  .her-compra-1 .ark-compra-precio { margin-bottom: .6rem; }
  .her-compra-1 .ark-boton { flex: 1 1 100%; }
  .her-compra-1 .ark-compra-acciones { gap: 0 1rem; }

}

/* El marco doble de la cubierta, en grande y quieto (desde tableta) */
@media (min-width: 760px) {
  .her-umbral { padding: calc(var(--cab-alto) + 34px) 0 54px; }
  .her-umbral::before, .her-umbral::after { content: ''; position: absolute; z-index: -1; pointer-events: none; border: 1.5px solid rgba(238, 196, 94, .5); }
  .her-umbral::before { inset: calc(var(--cab-alto) + 6px) 18px 18px; }
  .her-umbral::after { inset: calc(var(--cab-alto) + 14px) 26px 26px; border-width: 1px; border-color: rgba(238, 196, 94, .32); }
  .her-cab h1 { --fs: 3.6rem; }
  .her-ventana { --alto: clamp(320px, 50svh, 520px); }
  .her-gancho { display: block; margin: 1rem auto 0; font-size: 1.25rem; font-style: italic; color: var(--her-tinta-2); max-width: 22em; }
}
/* El retablo: el título a un lado de la ventana y la compra al otro (desde 1000 px) */
@media (min-width: 1000px) {
  .her-umbral { min-height: 100svh; display: flex; align-items: center; }
  .her-umbral-int { width: 100%; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: clamp(36px, 4vw, 72px); }
  .her-cab { justify-self: stretch; text-align: right; }
  .her-cab h1 { --fs: 4.3rem; }
  .her-gancho { margin: 1.3rem 0 0 auto; }
  .her-ventana { --alto: min(64svh, 600px); }
  .her-compra-1 { justify-self: start; text-align: left; }
  .her-compra-1 .ark-compra-precio, .her-compra-1 .ark-compra-acciones { justify-content: flex-start; }
  .her-compra-1 .ark-compra-precio b { font-size: 2.1rem; }
  .her-compra-1 .ark-compra-incluye { display: block; max-width: 22rem; margin-top: 1.6rem; --ark-compra-borde: rgba(238, 196, 94, .3); }
}
@media (min-width: 1600px) {
  .her-umbral-int { max-width: 1640px; }
  .her-cab h1 { --fs: 5.2rem; }
  .her-ventana { --alto: min(70svh, 820px); }
  .her-gancho { font-size: 1.4rem; }
}

/* ------------------------------------------------------------------ dentro: la luz de la vidriera cae al suelo */
.her-dentro { position: relative; isolation: isolate; background: var(--her-sala); color: var(--her-tinta-clara); padding: clamp(4.5rem, 10vw, 9rem) 0 clamp(5rem, 11vw, 10rem); overflow: hidden; }
.her-luz { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
.her-dentro-int { max-width: 46rem; }
.her-entrada { font: 400 clamp(1.7rem, 3.4vw, 2.6rem)/1.18 var(--her-titulo); color: var(--her-oro); margin: 0 0 clamp(2.5rem, 6vw, 4rem); text-wrap: balance; }
.her-dentro h2 { font: 700 1.0625rem/1.2 var(--sans); letter-spacing: .02em; color: var(--her-tinta-2); margin-bottom: 1rem; }
.her-prosa { font-size: clamp(1.1875rem, 1.6vw, 1.3125rem); line-height: 1.62; max-width: 36em; }
.her-prosa p { margin-bottom: 1em; }
.her-prosa p:first-child::first-letter { float: left; font: 400 4.1em/.82 var(--her-titulo); color: var(--her-oro); padding: .06em .08em 0 0; }
.her-cierre { margin: clamp(3rem, 7vw, 5rem) 0 0; padding-top: 1.6rem; border-top: 1.5px solid rgba(238, 196, 94, .55);
  font: 400 clamp(1.45rem, 2.6vw, 2.05rem)/1.28 var(--her-titulo); color: var(--her-oro); max-width: 24em; text-wrap: balance; }

/* ------------------------------------------------------------------ las tres líneas de la cubierta */
.her-lema { background: var(--her-violeta); color: #cfbde0; padding: clamp(4rem, 10vw, 8.5rem) 0; }
.her-lema-l { margin: 0; text-align: center; font-family: var(--her-titulo); text-transform: uppercase; line-height: 1.06; letter-spacing: .015em;
  font-size: min(4.6rem, calc(100cqi / var(--em, 6))); }
.her-linea { position: relative; display: block; padding: .18em 0; }
.her-linea > span { display: block; }
.her-oro { position: absolute; inset: .18em 0 auto; padding-left: inherit; color: var(--her-oro); opacity: 0; transition: opacity 650ms var(--ease-out); }
.her-linea.on .her-oro { opacity: 1; }
@media (max-width: 759px) { .her-lema-l { font-size: min(2.3rem, calc(100cqi / var(--em, 6))); } }

/* ------------------------------------------------------------------ el universo y los personajes */
.her-mundo { background: var(--her-lila); color: var(--her-tinta-osc); padding: clamp(4rem, 8vw, 7rem) 0; }
.her-mundo-rejilla { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem clamp(2.5rem, 7vw, 7rem); }
.her-mundo h2, .her-edicion h2, .her-autora-sec h2, .her-otros h2 { font: 400 clamp(2rem, 3.6vw, 2.9rem)/1.06 var(--her-titulo); letter-spacing: .01em; }
.her-sub { font-size: 1.25rem; font-style: italic; margin: .6rem 0 1.6rem; color: var(--her-tinta-osc-2); }
.her-lista li { padding: 1.15rem 0 1.25rem; border-top: 1.5px solid rgba(36, 0, 57, .32); }
.her-lista li:last-child { border-bottom: 1px solid rgba(36, 0, 57, .2); }
.her-lista h3 { font: 700 1.3rem/1.2 var(--serif); margin-bottom: .3rem; }
.her-rol { font: 500 1rem/1.3 var(--sans); color: var(--her-tinta-osc-2); margin: 0 0 .35rem; }
.her-lista p { font-size: 1.125rem; }
@media (max-width: 859px) { .her-mundo-rejilla { grid-template-columns: 1fr; } }
/* 2-oct: piezas de la vidriera en el lila: un destello de la cubierta en cada entrada del universo, un cristal suelto
   de capitular de cada personaje y, en el móvil, la llave grande sola entre los dos bloques, que gira con el scroll */
.her-lista h3 { display: flex; align-items: center; gap: .6rem; }
.her-destello { flex: none; width: 18px; height: 18px; fill: var(--her-violeta); }
.her-cristal { flex: none; width: auto; height: 34px; max-width: 30px; }
.her-llave-suelta { display: none; }
@media (max-width: 859px) {
  .her-llave-suelta { display: block; position: relative; height: 170px; margin: -.6rem 0 -.4rem; overflow: hidden; }
  .her-llave-giro { position: absolute; left: 50%; top: 50%; width: 120px; height: 340px; margin: -170px 0 0 -60px; transform: rotate(-90deg); filter: drop-shadow(0 8px 10px rgba(36, 0, 57, .28)); }
  .her-llave-giro svg { width: 100%; height: auto; }
}
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) and (max-width: 859px) {
    .her-llave-giro { animation: her-gira linear both; animation-timeline: view(); animation-range: entry 0% exit 100%; }
  }
}
@keyframes her-gira { from { transform: rotate(-112deg); } to { transform: rotate(-68deg); } }

/* ------------------------------------------------------------------ la edición: el objeto y su compra */
.her-edicion { background: var(--her-gris); color: var(--her-tinta-osc); padding: clamp(1rem, 3vw, 2.5rem) 0 clamp(4rem, 8vw, 7rem); }
.her-mockup { margin: 0 auto; max-width: 1000px; }
.her-mockup img { width: 100%; }
.her-mockup figcaption { font: 500 .95rem/1.4 var(--sans); color: #4c4a52; padding: .4rem var(--margen) 0; text-align: center; }
.her-edicion-rejilla { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 3rem clamp(2.5rem, 7vw, 6rem); margin-top: clamp(2.5rem, 5vw, 4rem); align-items: start; }
.her-titulo-2 { font: 400 clamp(1.9rem, 3.2vw, 2.6rem)/1.08 var(--her-titulo); margin: 0 0 1.2rem; }
.her-compra-2 .ark-compra { --ark-compra-boton: var(--her-noche); --ark-compra-boton-tinta: var(--her-oro); --ark-compra-borde: rgba(36, 0, 57, .4); --ark-compra-tinta-2: #3f3a48; }
.her-compra-2 .ark-compra-incluye li { border-top-color: rgba(36, 0, 57, .22); }
.her-ficha { margin: 1.2rem 0 0; font-size: 1.0625rem; }
.her-ficha div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1rem; padding: .6rem 0; border-top: 1px solid rgba(36, 0, 57, .25); }
.her-ficha dt { font: 700 1rem/1.5 var(--sans); }
.her-ficha dd { margin: 0; }
@media (max-width: 859px) { .her-edicion-rejilla { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ la autora */
.her-autora-sec { background: var(--her-lila); color: var(--her-tinta-osc); padding: clamp(4rem, 8vw, 6.5rem) 0; }
.her-autora-rejilla { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 1.5rem clamp(2rem, 5vw, 4.5rem); align-items: start; }
.her-retrato { width: 260px; aspect-ratio: 1; object-fit: cover; object-position: var(--foco, 50% 30%); }
.her-bio { margin: 1rem 0 .4rem; max-width: 36em; font-size: 1.1875rem; }
.her-autora-sec .enlace { text-decoration-color: var(--her-noche); }
@media (max-width: 759px) { .her-autora-rejilla { grid-template-columns: 120px minmax(0, 1fr); } .her-retrato { width: 120px; } .her-autora-rejilla > div { grid-column: 1 / -1; } }

/* ------------------------------------------------------------------ los otros tres libros */
.her-otros { background: var(--her-noche); color: var(--her-tinta-clara); padding: clamp(3.5rem, 7vw, 6rem) 0; }
.her-otros h2 { color: var(--her-oro); }
.her-otros-lista { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 3vw, 2.5rem); margin-top: 2rem; }
.her-otros-lista a { display: block; text-decoration: none; }
.her-otros-lista img { width: 100%; max-width: 180px; height: auto; aspect-ratio: 492 / 747; object-fit: cover; box-shadow: 0 16px 30px -16px rgba(0, 0, 0, .8); }
.her-otros-lista b { display: block; margin-top: .9rem; font-size: 1.15rem; line-height: 1.2; }
.her-otros-quien { margin: .2rem 0 0; font: 500 .95rem/1.3 var(--sans); color: var(--her-tinta-2); }
.her-otros-lista .her-otros-quien .enlace { display: inline; padding-block: .95em; font-weight: 500; color: var(--her-tinta-clara); text-decoration-color: var(--her-oro); }
@media (hover: hover) and (pointer: fine) { .her-otros-lista a:hover b { text-decoration: underline; text-decoration-color: var(--her-oro); text-decoration-thickness: 2px; text-underline-offset: .2em; } }
@media (max-width: 460px) { .her-otros-lista b { font-size: 1rem; } .her-otros-quien { font-size: .875rem; } }

/* ------------------------------------------------------------------ 5-oct-2026, cambios de la clienta (agente 2)
   El sello bajo la sinopsis, en Marcellus y en el oro de la llave; la ficha con sus enlaces en la noche del libro; el
   nombre de la autora, enlazado a su página; la cubierta completa, cuando llegue, bajo la ficha. Las tres líneas de la
   cubierta («La corona exige poder.») van centradas: escalonadas se leían descentradas. */
.her-sello { margin: 1.6rem 0 0; font: 400 clamp(1.15rem, 1.6vw, 1.35rem)/1.2 var(--her-titulo); text-transform: uppercase; letter-spacing: .08em; }
.her-sello .enlace { display: inline-block; padding-block: .6em; font-weight: 400; color: var(--her-oro); text-decoration-thickness: 1.5px; text-underline-offset: .3em; text-decoration-color: rgba(238, 196, 94, .55); }
@media (hover: hover) and (pointer: fine) { .her-sello .enlace:hover { text-decoration-color: currentColor; } }
.her-ficha .enlace { display: inline-block; padding-block: .62em; margin-block: -.62em; text-decoration-color: var(--her-noche); }
.her-nombre-enlace { padding-block: .14em; color: inherit; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .16em; text-decoration-color: var(--her-oro-2); }
@media (hover: hover) and (pointer: fine) { .her-nombre-enlace:hover { text-decoration-color: currentColor; } }
.her-entera { margin: clamp(3rem, 7vw, 5rem) 0 0; }
.her-entera img { display: block; width: 100%; height: auto; box-shadow: 0 24px 48px -26px rgba(21, 2, 42, .55); }
.her-entera figcaption { margin-top: .8rem; font: 500 .95rem/1.4 var(--sans); color: #4c4a52; }

/* ------------------------------------------------------------------ movimiento reducido: todo quieto y visible */
@media (prefers-reduced-motion: reduce) {
  .her-cristales polygon { animation: none; opacity: 1; }
  .her-oro { opacity: 1; transition: none; }
  .her-hoja, .her-llave, .her-llave svg { transition: none; }
}
