/* Gnosis México · buscador dentro de las conferencias
   (buscar_conferencias.html y conferencia_audio.html).
   Se carga después de lovable.css y usa sus variables.
   También incluye la sección del buscador en index.html. */

mark {
  background: rgba(231, 181, 81, 0.2);
  color: var(--fg);
  border-radius: 2px;
  box-shadow: 0 1px 0 var(--gold);
  padding: 0 1px;
}

/* ===== Encabezado del buscador ===== */
.page-hero > p.tr-lema {
  margin-top: 18px; max-width: 32em;
  font-family: var(--serif); font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.2;
  color: var(--fg);
}
.tr-lema em { font-style: italic; color: var(--gold); }
.page-hero > p.tr-lema + p { margin-top: 14px; }

/* ===== Formulario de búsqueda ===== */
.tr-search { display: flex; gap: 10px; margin-top: 28px; max-width: 680px; }
.tr-search input {
  flex: 1; min-width: 0; min-height: 50px; padding: 0 18px;
  border: 1px solid var(--line); border-radius: 4px;
  background: var(--card); color: var(--fg); font-size: 1rem;
  transition: border-color 180ms ease;
}
.tr-search input::placeholder { color: var(--muted); }
.tr-search input:focus { outline: none; border-color: var(--gold); }
.tr-search .btn { min-height: 50px; flex-shrink: 0; }
.tr-sugerencias { margin-top: 20px; align-items: center; }
.tr-sugerencias[hidden] { display: none; }
.tr-sugerencias .chip { display: inline-flex; align-items: center; }
.tr-sugerencias .filter-label { margin: 0 6px 0 0; line-height: 36px; font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.tr-aviso { margin-top: 10px; color: var(--muted); font-size: 0.92rem; max-width: 62ch; }
.tr-aviso:empty { display: none; }
@media (max-width: 560px) { .tr-search { flex-direction: column; } }

/* ===== Resultados ===== */
.tr-results { display: grid; gap: 20px; margin-top: 40px; padding-bottom: var(--section); }
.tr-result { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.tr-result-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px;
  padding: 24px 28px 20px; border-bottom: 1px solid var(--line);
}
.tr-result-head .eyebrow { font-size: 0.66rem; margin-bottom: 8px; }
.tr-result-head h2 a { transition: color 180ms ease; }
.tr-result-head .link-arrow { flex-shrink: 0; }
@media (max-width: 640px) { .tr-result-head { flex-direction: column; align-items: flex-start; gap: 14px; padding: 22px 20px 18px; } }

.tr-moments { list-style: none; margin: 0; padding: 0; }
.tr-moments li + li { border-top: 1px solid var(--line); }
.tr-moment {
  display: grid; grid-template-columns: 76px 1fr 28px; gap: 18px; align-items: baseline;
  padding: 16px 28px; color: var(--reading-ink, #D9D4C7);
  transition: background-color 200ms ease;
}
.tr-moment:focus-visible { outline-offset: -2px; }
.tr-time {
  font-size: 0.85rem; letter-spacing: 0.08em; color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.tr-snippet { line-height: 1.6; }
.tr-moment .tr-play { align-self: center; color: var(--gold); opacity: 0.55; transition: opacity 200ms ease, transform 200ms var(--ease-out); }
.tr-more { display: block; padding: 16px 28px; border-top: 1px solid var(--line); font-size: 0.72rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--gold); }
@media (hover: hover) and (pointer: fine) {
  .tr-result-head h2 a:hover { color: var(--gold); }
  .tr-moment:hover { background: var(--muted-bg); }
  .tr-moment:hover .tr-play { opacity: 1; transform: translateX(2px); }
  .tr-more:hover { background: var(--muted-bg); }
}
@media (max-width: 640px) {
  .tr-moment { grid-template-columns: 1fr 24px; gap: 4px 12px; padding: 14px 20px; }
  .tr-moment .tr-time { grid-column: 1; }
  .tr-moment .tr-snippet { grid-column: 1; }
  .tr-moment .tr-play { grid-column: 2; grid-row: 1 / span 2; }
  .tr-more { padding: 14px 20px; }
}

/* ===== Página de la conferencia ===== */
.tr-hero { padding-top: 40px; }
.tr-hero h1 { margin-top: 14px; font-size: clamp(2.4rem, 5vw, 4rem); max-width: 22ch; }
.tr-hero > p.tr-desc { margin-top: 18px; color: var(--muted); max-width: 62ch; font-size: 1.05rem; }

.tr-player {
  position: sticky; top: 65px; z-index: 20;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px 20px;
  margin-top: 36px; padding: 18px 22px;
  background: rgba(6, 28, 29, 0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: var(--r);
}
.tr-play-main {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 50px; padding: 0 24px 0 6px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--gold); color: var(--gold-ink); box-shadow: var(--glow);
  font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; white-space: nowrap;
  transition: box-shadow 200ms ease, transform 160ms var(--ease-out);
}
.tr-play-main .tr-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(2, 19, 20, 0.12); }
.tr-play-main svg { width: 18px; height: 18px; }
.tr-play-main:active { transform: scale(0.97); }
.tr-play-main.is-compact { padding: 0 5px; }
.tr-play-main.is-compact .tr-play-label { display: none; }

.tr-progress { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; min-width: 0; }
.tr-progress output { font-size: 0.82rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 4.2ch; }
.tr-progress output:first-child { color: var(--fg); text-align: right; }
.tr-seek {
  -webkit-appearance: none; appearance: none; width: 100%; height: 24px; margin: 0;
  background: transparent; cursor: pointer;
  --pct: 0%;
}
.tr-seek::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(to right, var(--gold) var(--pct), rgba(231, 181, 81, 0.2) var(--pct)); }
.tr-seek::-moz-range-track { height: 3px; border-radius: 3px; background: rgba(231, 181, 81, 0.2); }
.tr-seek::-moz-range-progress { height: 3px; border-radius: 3px; background: var(--gold); }
.tr-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5.5px; border: 0; border-radius: 50%; background: var(--gold); box-shadow: var(--glow); }
.tr-seek::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--gold); }
.tr-seek:focus-visible { outline: 1px solid var(--gold); outline-offset: 4px; }

.tr-tools { display: flex; align-items: center; gap: 6px; }
.tr-tool {
  display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--gold);
  font-size: 0.7rem; letter-spacing: 0.12em; cursor: pointer; font-variant-numeric: tabular-nums;
  transition: border-color 180ms ease, background-color 180ms ease;
}
.tr-tool svg { width: 18px; height: 18px; }
.tr-tool:active { transform: scale(0.96); }
@media (hover: hover) and (pointer: fine) {
  .tr-play-main:hover { box-shadow: 0 0 56px -6px rgba(231, 181, 81, 0.6); }
  .tr-tool:hover { border-color: var(--line-strong); background: rgba(231, 181, 81, 0.08); }
}
.tr-estado { grid-column: 1 / -1; font-size: 0.8rem; color: var(--muted); }
.tr-estado:empty { display: none; }
@media (max-width: 760px) {
  .tr-player { grid-template-columns: auto 1fr; gap: 10px 12px; padding: 12px 14px; }
  .tr-progress { grid-column: 1 / -1; grid-row: 2; gap: 10px; }
  .tr-tools { justify-content: flex-end; gap: 4px; }
  .tr-tool { min-width: 36px; height: 36px; padding: 0 8px; }
  .tr-play-main { min-height: 44px; padding-right: 16px; gap: 8px; letter-spacing: 0.14em; }
  .tr-play-main .tr-icon { width: 34px; height: 34px; }
  .tr-hide-sm { display: none; }
}

/* Transcripción */
.tr-transcript { margin-top: 28px; padding-bottom: var(--section); }
.tr-transcript-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px;
  padding-bottom: 18px; border-bottom: 1px solid var(--line);
}
.tr-transcript-head h2 { font-size: clamp(1.5rem, 2vw, 1.875rem); }
.tr-find { display: flex; align-items: center; gap: 8px; flex: 1; max-width: 520px; min-width: 260px; }
.tr-find[hidden] { display: none; }
.tr-find input {
  flex: 1; min-width: 0; height: 42px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 4px; background: var(--card); color: var(--fg); font-size: 0.92rem;
}
.tr-find input:focus { outline: none; border-color: var(--gold); }
.tr-find input::placeholder { color: var(--muted); }
.tr-find output { font-size: 0.75rem; letter-spacing: 0.1em; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 6ch; text-align: center; }

.tr-lines { list-style: none; margin: 0; padding: 0; }
.tr-line {
  display: grid; grid-template-columns: 76px 1fr; gap: 18px; width: 100%;
  padding: 12px 16px 12px 14px; margin: 0;
  border: 0; border-left: 2px solid transparent; background: transparent;
  text-align: left; cursor: pointer; color: var(--muted);
  font-size: 1.05rem; line-height: 1.75;
  scroll-margin-top: 240px;
  transition: color 200ms ease, background-color 200ms ease, border-color 200ms ease;
}
.tr-line .tr-time { padding-top: 0.25em; font-size: 0.82rem; opacity: 0.75; }
.tr-line.is-match { color: var(--reading-ink, #D9D4C7); }
.tr-line.is-match .tr-time { opacity: 1; }
.tr-line.is-match-active { background: rgba(231, 181, 81, 0.06); }
.tr-line.is-current { color: var(--fg); border-left-color: var(--gold); background: var(--card); }
.tr-line.is-current .tr-time { opacity: 1; }
@media (hover: hover) and (pointer: fine) { .tr-line:hover { color: var(--fg); background: var(--card); } }
@media (max-width: 640px) {
  .tr-line { grid-template-columns: 1fr; gap: 2px; padding: 12px 12px 12px 12px; font-size: 1rem; }
  .tr-find { min-width: 100%; }
}

/* ===== Inicio: sección del buscador de conferencias ===== */
.buscador-home { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.buscador-home h2 { margin-top: 16px; max-width: 18ch; }
.buscador-home .link-arrow { margin-top: 24px; }
.buscador-stats { margin-top: 20px; font-size: 0.72rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--gold); }
.buscador-stats[hidden] { display: none; }
@media (max-width: 960px) { .buscador-home { grid-template-columns: 1fr; gap: 48px; } }

.buscador-demo {
  margin: 0; padding: 28px;
  background: linear-gradient(135deg, var(--card), var(--bg));
  border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--glow);
}
.buscador-demo-q {
  display: flex; align-items: center; gap: 12px;
  min-height: 48px; padding: 10px 16px; line-height: 1.4;
  border: 1px solid var(--line-strong); border-radius: 4px; background: var(--bg);
  color: var(--fg); font-size: 0.95rem;
}
.buscador-demo-q svg { flex-shrink: 0; color: var(--gold); }
.buscador-demo-head { margin-top: 24px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.buscador-demo-head .eyebrow { font-size: 0.64rem; }
.buscador-demo-title { margin-top: 6px; font-family: var(--serif); font-size: 1.6rem; line-height: 1.2; color: var(--fg); }
.buscador-demo-row { display: grid; grid-template-columns: 52px 1fr; gap: 14px; padding: 16px 0; color: #D9D4C7; line-height: 1.65; border-bottom: 1px solid var(--line); }
.buscador-demo-time { padding-top: 2px; font-size: 0.85rem; color: var(--gold); font-variant-numeric: tabular-nums; }
.buscador-demo mark { background: rgba(231, 181, 81, 0.2); color: var(--fg); border-radius: 2px; box-shadow: 0 1px 0 var(--gold); padding: 0 1px; }
.buscador-demo-player { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.buscador-demo-play { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; background: var(--gold); color: var(--gold-ink); }
.buscador-demo-label { font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); white-space: nowrap; }
.buscador-demo-bar { position: relative; flex: 1; height: 3px; border-radius: 3px; background: rgba(231, 181, 81, 0.2); }
.buscador-demo-bar span { position: absolute; inset: 0 auto 0 0; width: 12%; border-radius: 3px; background: var(--gold); }
.buscador-demo figcaption { margin-top: 18px; font-size: 0.8rem; color: var(--muted); }
@media (max-width: 520px) {
  .buscador-demo { padding: 20px; }
  .buscador-demo-row { grid-template-columns: 1fr; gap: 4px; }
}
