/* adrianzax.com — ¿Está en la Biblia? (/herramientas/esta-en-la-biblia). Prefijo eb-.
   Va después de sitio.css y herramientas.css (usa sus colores y los tonos cp-ok / cp-medio / cp-mal).
   Buscador centrado y limpio; mientras busca, los libros pasan como un contador;
   el veredicto entra como un sello de tinta. Todo se apaga con prefers-reduced-motion. */

.visualmente-oculto { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.eb {
  max-width: 780px; margin: 0 auto;
  padding: calc(var(--barra) + 20px) var(--margen) clamp(80px, 10vw, 140px);
  display: flex; flex-direction: column; gap: clamp(32px, 5vw, 48px);
}
.eb-migas { margin-bottom: -12px; }

/* ---------- Buscador ---------- */
.eb-busca {
  min-height: calc(100svh - var(--barra) - 150px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center;
  transition: min-height .6s var(--curva);
}
.eb-con-res .eb-busca { min-height: 0; }
.eb-marca { font: 400 clamp(54px, 13vw, 104px)/.92 var(--serif); letter-spacing: -.035em; text-wrap: balance; }
.eb-marca em { color: var(--oro); }
.eb-marca-signo { color: color-mix(in srgb, var(--oro) 70%, var(--tinta)); font-style: italic; }
.eb-sub { max-width: 34em; font-size: clamp(16.5px, 1.4vw, 19px); line-height: 1.5; color: var(--tinta-2); text-wrap: pretty; }
.eb-sub strong { color: var(--tinta); font-weight: 600; }

.eb-form { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 18px; margin-top: 6px; }
.eb-caja {
  position: relative; width: 100%; display: flex; align-items: flex-start; gap: 12px;
  padding: 15px 14px 15px 22px; border-radius: 30px;
  background: color-mix(in srgb, var(--fondo-2) 82%, transparent);
  border: 1px solid var(--linea-2);
  box-shadow: 0 1px 0 rgba(236, 238, 243, .05) inset, 0 18px 50px -24px rgba(0, 0, 0, .9);
  transition: border-color .25s, box-shadow .25s, border-radius .2s;
}
.eb-caja:hover { border-color: color-mix(in srgb, var(--tinta) 30%, transparent); }
.eb-caja:focus-within {
  border-color: color-mix(in srgb, var(--oro) 60%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--oro) 11%, transparent), 0 22px 60px -22px color-mix(in srgb, var(--oro) 30%, transparent);
}
.eb-caja:has(.eb-sugerencias:not([hidden])) { border-radius: 26px 26px 0 0; }
.eb-lupa { flex: none; margin-top: 4px; color: var(--gris); transition: color .2s; }
.eb-caja:focus-within .eb-lupa { color: var(--oro); }
.eb-caja textarea {
  flex: 1; min-width: 0; height: 30px; max-height: 220px; resize: none; overflow-y: auto; padding: 2px 0; border: 0; background: none;
  color: var(--tinta); font: 400 18px/1.45 var(--sans); color-scheme: dark; text-align: left;
}
.eb-caja textarea:focus { outline: none; }
.eb-caja textarea::placeholder { color: color-mix(in srgb, var(--gris) 85%, transparent); }
.eb-borrar {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; margin: -3px 0; border-radius: 50%;
  background: none; border: 0; color: var(--gris); cursor: pointer; transition: color .2s, background .2s;
}
.eb-borrar:hover { color: var(--tinta); background: rgba(236, 238, 243, .08); }

/* Luz dorada que recorre la caja mientras busca */
.eb-caja::after {
  content: ""; position: absolute; left: 24px; right: 24px; bottom: -1px; height: 2px; border-radius: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--oro-claro), transparent);
  background-size: 40% 100%; background-repeat: no-repeat; opacity: 0;
}
.eb-buscando .eb-caja::after { opacity: 1; animation: eb-barrido 1.1s ease-in-out infinite; }
@keyframes eb-barrido { from { background-position: -60% 0; } to { background-position: 160% 0; } }

.eb-sugerencias {
  position: absolute; z-index: 5; left: -1px; right: -1px; top: 100%; margin: 0; padding: 6px 0 10px; list-style: none; text-align: left;
  background: color-mix(in srgb, var(--fondo-2) 97%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid color-mix(in srgb, var(--oro) 60%, transparent); border-top-color: var(--linea);
  border-radius: 0 0 26px 26px; box-shadow: 0 30px 50px -20px rgba(0, 0, 0, .9);
}
.eb-sugerencias li {
  display: flex; align-items: center; gap: 14px; min-height: 46px; padding: 8px 22px; cursor: pointer;
  color: var(--tinta-2); font-size: 16.5px; line-height: 1.35;
}
.eb-sugerencias li svg { flex: none; color: var(--gris); }
.eb-sugerencias li:hover, .eb-sugerencias li[aria-selected="true"] { background: rgba(236, 238, 243, .06); color: var(--tinta); }

.eb-botones { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.eb-boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 0 22px; border-radius: 999px;
  background: color-mix(in srgb, var(--fondo-3) 80%, transparent); border: 1px solid var(--linea);
  color: var(--tinta); font: 500 15.5px/1 var(--sans); cursor: pointer; white-space: nowrap;
  transition: border-color .2s, background .2s, color .2s, transform .25s var(--curva);
}
.eb-boton:hover { border-color: var(--linea-2); background: var(--fondo-3); }
.eb-boton:active { transform: scale(.97); }
.eb-boton-oro { background: var(--oro); border-color: var(--oro); color: #0A0C12; font-weight: 600; }
.eb-boton-oro:hover { background: var(--oro-claro); border-color: var(--oro-claro); }
.eb-boton:focus-visible, .eb-chip:focus-visible, .eb-otra:focus-visible { outline: 2px solid var(--oro-claro); outline-offset: 3px; }

.eb-prueba { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; font-size: 14px; color: var(--gris); }
.eb-prueba > span { margin-right: 2px; }
.eb-chip {
  min-height: 36px; padding: 0 14px; border-radius: 999px; background: none; cursor: pointer;
  border: 1px solid var(--linea); color: var(--tinta-2); font: 400 14px/1.2 var(--sans);
  transition: border-color .2s, color .2s;
}
.eb-chip:hover { border-color: color-mix(in srgb, var(--oro) 55%, transparent); color: var(--oro-claro); }
.eb-nota { max-width: 32em; }
.eb-con-res .eb-sub, .eb-con-res .eb-prueba, .eb-con-res .eb-nota,
.eb-buscando .eb-sub, .eb-buscando .eb-prueba, .eb-buscando .eb-nota { display: none; }
.eb-buscando .eb-busca { min-height: 0; }

/* ---------- Buscando ---------- */
.eb-cargando { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 8px 0 24px; text-align: center; }
.eb-libros {
  height: 1.2em; overflow: hidden; font: italic 400 clamp(34px, 7vw, 52px)/1.2 var(--serif); color: var(--oro);
}
.eb-libros span { display: block; }
.eb-barra { width: min(260px, 70%); height: 2px; border-radius: 2px; background: var(--linea); overflow: hidden; }
.eb-barra i { display: block; height: 100%; background: linear-gradient(90deg, var(--oro), var(--oro-claro)); transform: scaleX(0); transform-origin: left; }
.eb-corre .eb-barra i { animation: eb-llena var(--dur, 2600ms) cubic-bezier(.3, .1, .2, 1) forwards; }
@keyframes eb-llena { to { transform: scaleX(1); } }
.eb-mensaje { min-height: 3em; max-width: 26em; font-size: 17px; line-height: 1.5; color: var(--tinta-2); text-wrap: balance; }
.eb-msg-entra { animation: eb-msg .45s var(--curva) both; }
@keyframes eb-msg { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } }

/* ---------- Resultado ---------- */
.eb-res { display: flex; flex-direction: column; gap: 26px; scroll-margin-top: calc(var(--barra) + 12px); }
.eb-res:focus { outline: none; }
.eb-tarjeta {
  position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 18px;
  padding: clamp(24px, 4vw, 40px) clamp(20px, 4vw, 40px); border-radius: 24px;
  background: var(--cristal); border: 1px solid var(--linea);
  box-shadow: inset 0 1px 0 rgba(236, 238, 243, .06), 0 40px 80px -40px rgba(0, 0, 0, .8);
}
.eb-tarjeta::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(70% 60% at 100% 0%, color-mix(in srgb, var(--tono) 14%, transparent), transparent 70%);
}
.eb-frase { font: 400 clamp(34px, 7vw, 58px)/1.04 var(--serif); letter-spacing: -.015em; text-wrap: balance; overflow-wrap: anywhere; }
.eb-sello-caja { position: relative; }
.eb-sello {
  position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 11px 20px; border-radius: 999px;
  font: 600 13.5px/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--tono);
  border: 2px solid var(--tono); background: color-mix(in srgb, var(--tono) 11%, transparent);
  transform: rotate(-2deg);
}
.eb-sello::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--tono); flex: none; }
.eb-sello::after { content: ""; position: absolute; inset: -2px; border-radius: inherit; border: 2px solid var(--tono); opacity: 0; pointer-events: none; }
.eb-coincide { font-size: 15px; color: var(--gris); }
.eb-explica { font-size: clamp(17.5px, 1.5vw, 19.5px); line-height: 1.6; color: var(--tinta); max-width: 38em; text-wrap: pretty; }
.eb-origen { font-size: 15px; line-height: 1.5; color: var(--gris); }
.eb-origen span { display: block; margin-bottom: 2px; font: 600 11px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--oro); }

.eb-versos-cab { display: flex; justify-content: space-between; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.eb-version { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--linea); background: color-mix(in srgb, var(--fondo-2) 70%, transparent); }
.eb-version button {
  min-height: 36px; padding: 0 14px; border-radius: 999px; border: 0; background: none; cursor: pointer;
  color: var(--gris); font: 500 13.5px/1 var(--sans); transition: color .2s, background .2s;
}
.eb-version button[aria-pressed="true"] { background: var(--fondo-3); color: var(--tinta); box-shadow: inset 0 0 0 1px var(--linea-2); }
.eb-version button:focus-visible { outline: 2px solid var(--oro-claro); outline-offset: 1px; }

.eb-versos { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; }
.eb-verso {
  --tono: var(--oro);
  position: relative; display: flex; flex-direction: column; gap: 12px;
  padding: 22px 20px 16px 24px; border-radius: 18px; border: 1px solid var(--linea); background: var(--cristal);
}
.eb-verso.cp-ok { --tono: var(--cp-ok); } .eb-verso.cp-medio { --tono: var(--cp-medio); }
.eb-verso.cp-mal { --tono: var(--cp-mal); } .eb-verso.cp-neutro { --tono: var(--gris); }
.eb-verso::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; border-radius: 0 3px 3px 0; background: var(--tono); }
.eb-verso-cab { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 12px; flex-wrap: wrap; }
.eb-ref { margin: 0; font: 400 clamp(25px, 5vw, 32px)/1.05 var(--serif); color: var(--tinta); }
.eb-etq { font: 600 11px/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--tono); }
.eb-verso blockquote { margin: 0; font: italic 400 clamp(21px, 3.4vw, 25px)/1.42 var(--serif); color: var(--tinta-2); overflow-wrap: anywhere; }
.eb-verso blockquote sup { margin-right: 2px; font: 600 11px/1 var(--sans); font-style: normal; color: var(--oro); vertical-align: 6px; }
.eb-verso-pie { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0 18px; font-size: 14px; color: var(--gris); }
.eb-oir { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; color: var(--tinta-2); transition: color .2s; }
.eb-oir svg { color: var(--oro); }
.eb-oir:hover { color: var(--oro-claro); }

.eb-citas { display: flex; flex-direction: column; gap: 14px; }

.eb-compartir { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 16px 28px; align-items: start; }
.eb-compartir .hz-rotulo { grid-column: 1 / -1; }
.eb-imagen { margin: 0; }
.eb-imagen canvas {
  display: block; width: 100%; height: auto; aspect-ratio: 1080 / 1350; border-radius: 14px;
  border: 1px solid var(--linea-2); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .9);
}
.eb-acciones { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.eb-otra {
  align-self: center; display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 999px;
  background: none; border: 1px solid var(--linea-2); color: var(--tinta); font: 500 15.5px/1 var(--sans); cursor: pointer;
  transition: border-color .2s, color .2s;
}
.eb-otra:hover { border-color: var(--oro); color: var(--oro-claro); }

/* Entrada del resultado: tarjeta, sello de tinta con onda, explicación y versículos uno a uno */
.eb-entra .eb-tarjeta { animation: eb-sube .6s var(--curva) both; }
.eb-entra .eb-frase { animation: eb-tinta .7s var(--curva) .1s both; }
.eb-entra .eb-sello { animation: eb-sello .55s cubic-bezier(.2, 1.6, .4, 1) .45s both; }
.eb-entra .eb-sello::after { animation: eb-onda .9s ease-out .7s both; }
.eb-entra .eb-coincide, .eb-entra .eb-explica, .eb-entra .eb-origen { animation: eb-sube .6s var(--curva) .8s both; }
.eb-entra .eb-versos-cab { animation: eb-sube .5s var(--curva) 1s both; }
.eb-entra .eb-verso { animation: eb-sube .6s var(--curva) both; animation-delay: calc(1.1s + var(--i, 0) * .14s); }
.eb-entra .eb-verso blockquote { animation: eb-tinta .9s var(--curva) both; animation-delay: calc(1.25s + var(--i, 0) * .14s); }
.eb-entra .eb-citas, .eb-entra .eb-compartir, .eb-entra .eb-otra { animation: eb-sube .6s var(--curva) 1.5s both; }
@keyframes eb-sube { from { opacity: 0; transform: translateY(18px); } }
@keyframes eb-tinta { from { opacity: 0; filter: blur(8px); transform: translateY(6px); } }
@keyframes eb-sello {
  0% { opacity: 0; transform: scale(2.2) rotate(-14deg); }
  60% { opacity: 1; transform: scale(.94) rotate(-1deg); }
  100% { opacity: 1; transform: scale(1) rotate(-2deg); }
}
@keyframes eb-onda { from { opacity: .7; transform: scale(1); } to { opacity: 0; transform: scale(1.35, 1.8); } }

@media (max-width: 600px) {
  .eb-busca { min-height: calc(100svh - var(--barra) - 230px); gap: 18px; }
  .eb-caja { padding: 13px 10px 13px 18px; }
  .eb-caja textarea { font-size: 17px; }
  .eb-botones { width: 100%; }
  .eb-botones .eb-boton { flex: 1 1 0; padding: 0 12px; }
  .eb-compartir { grid-template-columns: 1fr; }
  .eb-imagen { max-width: 340px; width: 100%; justify-self: center; }
}
@media (prefers-reduced-motion: reduce) {
  .eb-busca { transition: none; }
  .eb-entra *, .eb-entra *::after, .eb-msg-entra, .eb-buscando .eb-caja::after, .eb-corre .eb-barra i { animation: none !important; }
  .eb-corre .eb-barra i { transform: scaleX(1); }
}
