/*! © 2026 Kerb3r0ps · www.kerb3r0ps.com */
/* Grimorio: el buscador. Reutiliza la base de las herramientas (certificaciones.css + osint.css):
   misma paleta negra/hueso, Unbounded en titulares y cifras, chips de filtro y cabecera común.
   Lo propio: un hero con el buscador grande y centrado, las sugerencias, la lista de resultados,
   el desplegable de fuente (mismo lenguaje que el de la Videoteca) y el crédito de fuentes. */

/* ── hero: todo centrado, el buscador como protagonista ── */
.gr-hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); text-align: center;
  padding-block: clamp(3rem, 9vw, 6.5rem) clamp(2.2rem, 5vw, 3.5rem); }
.gr-aura { position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(42rem 22rem at 50% -8%, color-mix(in srgb, var(--def) 16%, transparent), transparent 70%),
    radial-gradient(30rem 20rem at 12% 115%, color-mix(in srgb, var(--atk) 12%, transparent), transparent 70%),
    radial-gradient(30rem 20rem at 88% 115%, color-mix(in srgb, var(--int) 10%, transparent), transparent 70%); }
.gr-hero-in { position: relative; z-index: 1; max-width: 52rem; }
.gr-hero .eyebrow { justify-content: center; margin-bottom: 1rem; }
.gr-hero h1 { font-family: var(--display); font-weight: 700; font-size: clamp(2.2rem, 6vw, 4.1rem); line-height: 1.04; letter-spacing: -.04em; text-wrap: balance; }
.gr-sub { margin: 1.1rem auto 0; max-width: 40rem; color: var(--ash); font-size: clamp(1.03rem, 1.5vw, 1.2rem); line-height: 1.5; }

/* el buscador grande */
.gr-search { position: relative; max-width: 44rem; margin: 2.2rem auto 0; }
.gr-lupa { position: absolute; left: 1.3rem; top: 50%; transform: translateY(-50%); width: 1.45rem; height: 1.45rem; color: var(--ash); pointer-events: none; transition: color .2s; }
.gr-search:focus-within .gr-lupa { color: var(--bone); }
.gr-campo { width: 100%; max-width: none; flex: none; text-align: left; font: 400 1.2rem var(--body); color: var(--bone);
  background: var(--panel); border: 1px solid var(--line); border-radius: 1.2rem; padding: 1.15rem 3.6rem; box-shadow: 0 18px 50px -24px rgba(0, 0, 0, .9); transition: border-color .2s, box-shadow .2s; }
.gr-campo::placeholder { color: var(--ash); }
.gr-campo::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.gr-campo:focus { outline: none; border-color: var(--bone); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bone) 9%, transparent), 0 18px 50px -24px rgba(0, 0, 0, .9); }
.gr-x { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); width: 2.1rem; height: 2.1rem; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--line); background: var(--panel-2); color: var(--ash); font-size: 1.35rem; line-height: 1; cursor: pointer; transition: color .15s, border-color .15s; }
.gr-x:hover { color: var(--bone); border-color: var(--bone); }
.gr-x[hidden] { display: none; }

/* sugerencias, centradas bajo el buscador */
.gr-sugiere { display: flex; flex-wrap: wrap; gap: .45rem; justify-content: center; margin-top: 1.1rem; }
.gr-sugiere .gr-sug-et { width: 100%; color: var(--ash); font-size: .85rem; margin-bottom: .1rem; }
.gr-sug { font: 500 .88rem var(--body); cursor: pointer; padding: .36rem .85rem; border-radius: 999px; color: var(--ash);
  background: color-mix(in srgb, var(--panel) 70%, transparent); border: 1px solid var(--line); transition: color .15s, border-color .15s, background .15s; }
.gr-sug:hover { color: var(--bone); border-color: var(--ash); }

/* cifras: una línea compacta y centrada */
.gr-cifras { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: .5rem .7rem; margin-top: 1.7rem; color: var(--ash); font-size: .95rem; }
.gr-cifras b { font-family: var(--display); font-weight: 700; color: var(--bone); font-size: 1.15rem; }
.gr-cifras > span:nth-of-type(1) b { color: var(--def); }
.gr-cifras > span:nth-of-type(3) b { color: var(--int); }
.gr-cifras > span:nth-of-type(5) b { color: var(--atk); }
.gr-sep { color: var(--line); }
.gr-academia-link { margin-top: 1rem; }
.gr-academia-link a { display: inline-flex; align-items: center; gap: .4rem; color: var(--bone); text-decoration: none; font: 600 .92rem var(--body);
  padding: .5rem 1.1rem; border: 1px solid var(--line); border-radius: 999px; transition: border-color .15s, background .15s; }
.gr-academia-link a:hover { border-color: var(--ash); background: color-mix(in srgb, var(--panel) 60%, transparent); }

/* ── filtros y resultados ── */
.gr-res { padding-block: clamp(1.6rem, 4vw, 2.4rem) 1rem; }
.gr-ramas { justify-content: center; }
.gr-ramas .chip small { font-size: .78em; opacity: .6; font-variant-numeric: tabular-nums; margin-left: .1rem; }
.gr-ramas .chip[aria-pressed="true"]:not(.todas)::after { content: "×"; margin-left: .15rem; font-size: 1.05em; line-height: 1; }
.gr-barra { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.2rem; margin-top: 1.1rem; }
.gr-barra .osint-contador { margin: 0; margin-left: auto; }

/* desplegable de fuente (mismo patrón que la Videoteca, autocontenido aquí) */
.vt-sel { display: flex; gap: .6rem; flex: 0 1 auto; min-width: 0; }
.vt-dd { position: relative; flex: 0 0 auto; width: 15rem; min-width: 0; }
.vt-dd-btn { display: flex; align-items: center; gap: .5rem; width: 100%; min-width: 0; cursor: pointer; text-align: left;
  font: 400 .95rem var(--body); color: var(--bone); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: .6rem 1rem .6rem 1.1rem; transition: border-color .15s, background .15s; }
.vt-dd-btn:hover { border-color: var(--ash); }
.vt-dd-btn[aria-expanded="true"] { border-color: var(--bone); background: var(--panel-2); }
.vt-dd-val { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.vt-dd-btn svg { flex: none; width: .65rem; height: .65rem; color: var(--ash); transition: transform .35s cubic-bezier(.16, 1, .3, 1); }
.vt-dd-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.vt-dd-list { position: absolute; z-index: 30; top: calc(100% + .45rem); left: 0; min-width: 100%; width: max-content; max-width: min(22rem, calc(100vw - 2rem));
  max-height: min(21rem, 60vh); overflow-y: auto; list-style: none; margin: 0; padding: .35rem;
  background: rgba(16, 16, 18, .96); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .9);
  animation: sn-drop .35s cubic-bezier(.16, 1, .3, 1); }
.vt-dd-list[hidden] { display: none; }
.vt-dd-list [role="option"] { position: relative; display: flex; align-items: center; gap: .6rem; padding: .62rem .9rem .62rem 1.15rem; border-radius: 11px;
  color: var(--ash); font: 500 .9rem var(--body); cursor: pointer; white-space: nowrap; outline: none; transition: background .15s, color .15s; }
.vt-dd-list [role="option"] small { margin-left: auto; color: var(--ash); font-variant-numeric: tabular-nums; opacity: .7; padding-left: 1rem; }
.vt-dd-list [role="option"]::before { content: ""; position: absolute; left: .45rem; top: .7rem; bottom: .7rem; width: 2px; border-radius: 2px; background: var(--bone); opacity: 0; transition: opacity .15s; }
.vt-dd-list [role="option"]:hover, .vt-dd-list [role="option"]:focus-visible { color: var(--bone); background: rgba(242, 240, 235, .07); }
.vt-dd-list [role="option"]:focus-visible { box-shadow: inset 0 0 0 1px rgba(242, 240, 235, .35); }
.vt-dd-list [role="option"][aria-selected="true"] { color: var(--bone); background: rgba(242, 240, 235, .06); }
.vt-dd-list [role="option"][aria-selected="true"]::before { opacity: 1; }
@keyframes sn-drop { from { opacity: 0; transform: translateY(-4px); } }

/* lista de resultados: filas densas con color de rama en el borde izquierdo */
.gr-lista { display: flex; flex-direction: column; gap: .55rem; margin-top: 1.4rem; }
.gr-item { display: grid; grid-template-columns: auto 1fr; gap: .2rem .9rem; align-items: start; padding: .85rem 1rem .85rem .95rem; min-width: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 7%, var(--panel)), var(--panel) 70%);
  border: 1px solid var(--line); border-left: 3px solid var(--c); border-radius: .85rem; transition: border-color .15s, transform .12s, box-shadow .15s; }
.gr-item:hover, .gr-item:focus-within { border-color: color-mix(in srgb, var(--c) 55%, var(--line)); transform: translateY(-1px); box-shadow: 0 10px 28px -16px rgba(0, 0, 0, .8); }
.gr-badge { grid-row: 1 / 3; align-self: center; display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap;
  font: 700 .66rem/1 var(--body); letter-spacing: .04em; text-transform: uppercase; color: var(--c); padding: .4rem .6rem; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--c) 45%, var(--line)); background: color-mix(in srgb, var(--c) 10%, transparent); }
.gr-badge::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--c); flex: none; }
.gr-cab { grid-column: 2; display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem .7rem; min-width: 0; }
.gr-tit { font: 600 1.04rem/1.3 var(--display); letter-spacing: -.01em; color: var(--bone); text-decoration: none; overflow-wrap: anywhere; }
.gr-tit::after { content: " ↗"; color: var(--c); font-family: var(--body); font-size: .8em; white-space: nowrap; }
.gr-tit:hover { text-decoration: underline; text-underline-offset: .2em; }
.gr-area { font-size: .76rem; color: var(--ash); font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.gr-desc { grid-column: 2; color: var(--ash); font-size: .9rem; line-height: 1.45; overflow-wrap: anywhere; }
.gr-item mark { background: color-mix(in srgb, var(--int) 30%, transparent); color: var(--bone); border-radius: 3px; padding: 0 .12em; }

.gr-vacio { padding: 2.4rem 1.5rem; text-align: center; color: var(--ash); border: 1px dashed var(--line); border-radius: 1.1rem; }
.gr-vacio b { color: var(--bone); font-family: var(--display); }
.gr-mas { display: flex; justify-content: center; margin-top: 1.4rem; }
.gr-mas[hidden] { display: none; }

/* crédito de fuentes al pie de «Cómo está hecho» */
.gr-fuentes { margin-top: 1.8rem; }
.gr-fuentes-t { font: 700 1rem var(--display); margin-bottom: .8rem; }
.gr-fuentes-lista { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: .5rem .9rem; }
.gr-fuentes-lista li { min-width: 0; }
.gr-fuentes-lista a { display: flex; align-items: baseline; gap: .5rem; color: var(--bone); text-decoration: none; font-size: .9rem; padding: .3rem 0; border-bottom: 1px solid transparent; }
.gr-fuentes-lista a:hover { border-bottom-color: var(--line); }
.gr-fuentes-lista b { font-weight: 600; white-space: nowrap; }
.gr-fuentes-lista span { color: var(--ash); font-size: .82rem; margin-left: auto; font-variant-numeric: tabular-nums; }

@media (max-width: 720px) {
  .gr-campo { font-size: 16px; padding: 1rem 3.1rem; }
  .vt-dd, .vt-sel { width: 100%; }
  .gr-barra .osint-contador { margin-left: 0; width: 100%; }
}
@media (max-width: 560px) {
  .gr-item { grid-template-columns: 1fr; gap: .35rem; }
  .gr-badge { grid-row: auto; justify-self: start; align-self: auto; }
  .gr-cab, .gr-desc { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) { .gr-item, .vt-dd-list, .gr-lupa { transition: none; animation: none; } }
@media print { .sn, .gr-search, .gr-sugiere, .gr-ramas, .gr-barra, .gr-mas { display: none !important; } }
