/* Biblioteca de recursos gratis. Se carga después de legal.css (tokens, header, pie y botones). */
:root { --claude: #D97757; }

.rec { padding: 56px var(--gutter) 96px; }
@media (min-width: 720px) { .rec { padding-top: 72px; } }

.rec h1 { margin: 14px 0 0; font-size: clamp(34px, 6vw, 52px); line-height: 1.06; font-weight: 500; letter-spacing: -0.03em; text-wrap: balance; }
.rec .lead { margin: 20px 0 0; max-width: 40rem; font-size: 18px; color: var(--muted); text-wrap: pretty; }
.rec .updated { margin: 16px 0 0; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; color: var(--dim); }

/* Volver a la biblioteca */
.back {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; margin-bottom: 28px;
  color: var(--muted); text-decoration: none; font-size: 15px;
  transition: color .2s;
}
.back:hover { color: var(--text); }

/* Página de un recurso */
.resource { max-width: 46rem; }
.resource .detail { margin: 14px 0 0; color: var(--muted); }
.get { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 32px; }
.get .btn-primary { padding: 15px 26px; font-size: 16px; }
.video {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  color: var(--muted); text-decoration: none; font-size: 15px; transition: color .2s;
}
.video svg { width: 16px; height: 16px; color: var(--claude); }
.video:hover { color: var(--text); }

.text-box { width: 100%; }
.resource-text {
  margin: 0 0 14px; padding: 20px;
  max-height: 420px; overflow: auto;
  border: 1px solid var(--border); border-radius: 16px;
  background: var(--bg-raised);
  font-family: var(--mono); font-size: 14px; line-height: 1.65; color: var(--text);
  white-space: pre-wrap; word-break: break-word;
}

.help {
  margin-top: 40px; padding: 22px 24px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 20px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: radial-gradient(120% 80% at 0% 0%, rgba(255, 255, 255, 0.04), transparent 60%), var(--bg-raised);
}
.help p { margin: 0; color: var(--text); }
.help .btn { padding: 11px 18px; font-size: 14px; }

/* Tarjetas (biblioteca y "Más recursos") */
.grid { display: grid; gap: 14px; margin-top: 40px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.card {
  display: flex; flex-direction: column;
  padding: 24px; min-height: 100%;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: radial-gradient(120% 80% at 0% 0%, rgba(255, 255, 255, 0.04), transparent 60%), var(--bg-raised);
  text-decoration: none;
  transition: border-color .2s, transform .2s, background-color .2s;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.card .label { color: var(--claude); letter-spacing: 0.18em; }
.card h3 { margin: 14px 0 0; font-size: 20px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.3; }
.card p { margin: 10px 0 0; color: var(--muted); font-size: 15px; flex: 1; }
.card .go { margin-top: 18px; font-size: 14px; color: var(--text); }

.more { margin-top: 80px; padding-top: 48px; border-top: 1px solid var(--border); }
.more h2 { margin: 0; font-size: 24px; font-weight: 500; letter-spacing: -0.02em; }
.more .grid { margin-top: 24px; }

/* Lluvia de meteoritos de la biblioteca (js/recursos.js) */
.meteors { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; height: 100lvh; z-index: 0; pointer-events: none; } /* alto estable con la barra del celular */
/* Globo de puntos asomado en la esquina de arriba a la izquierda (tamaño lo pone js/recursos.js) */
.globe { position: fixed; left: 0; top: 0; z-index: 0; pointer-events: none; }
.top, .rec, footer { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) { .meteors { display: none; } }

/* Buscador, filtros y lista de la biblioteca */
.finder { margin-top: 40px; }
.search {
  display: flex; align-items: center; gap: 12px;
  padding: 0 18px; min-height: 54px;
  border: 1px solid var(--border-strong); border-radius: 16px;
  background: rgba(11, 11, 13, 0.85);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.search svg { width: 20px; height: 20px; color: var(--dim); flex: none; }
.search input { flex: 1; min-width: 0; height: 52px; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; }
.search input::placeholder { color: var(--dim); }
.search:focus-within { border-color: rgba(255, 255, 255, 0.3); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  min-height: 38px; padding: 0 16px;
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: rgba(11, 11, 13, 0.7); color: var(--muted);
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
  transition: color .2s, background-color .2s, border-color .2s;
}
.chip:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.28); }
.chip.is-on { background: var(--text); border-color: var(--text); color: var(--bg); }
.count { margin: 22px 0 0; font-size: 14px; color: var(--dim); }

.list { margin-top: 14px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: rgba(11, 11, 13, 0.82); }
.card.row {
  flex-direction: row; align-items: flex-start; gap: 16px;
  min-height: 0; padding: 22px 20px; border: 0; border-radius: 0;
  border-top: 1px solid var(--border); background: transparent;
}
.card.row:first-child { border-top: 0; }
.card.row:hover { transform: none; background: rgba(255, 255, 255, 0.025); }
.row[hidden] { display: none; }
.row-icon {
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; border: 1px solid var(--border-strong); border-radius: 12px; color: var(--muted);
}
.row-icon svg { width: 20px; height: 20px; }
.row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.row-title h2 { margin: 0; font-size: 18px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.35; }
.badge {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px;
  border: 1px solid var(--border-strong); border-radius: 999px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.nivel-principiante { color: #3ddc97; border-color: rgba(61, 220, 151, 0.4); background: rgba(61, 220, 151, 0.08); }
.nivel-intermedio { color: #E8956F; border-color: rgba(232, 149, 111, 0.45); background: rgba(232, 149, 111, 0.08); }
.nivel-avanzado { color: #A78BFA; border-color: rgba(167, 139, 250, 0.45); background: rgba(167, 139, 250, 0.08); }
.row-desc {
  margin-top: 8px; color: var(--muted); font-size: 15px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
@media (min-width: 900px) { .row-desc { -webkit-line-clamp: 1; } }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tags span { padding: 3px 10px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: 13px; color: var(--muted); }
.row-go { width: 20px; height: 20px; flex: none; margin-top: 12px; color: var(--dim); }
.card.row:hover .row-go { color: var(--text); }
.empty { margin: 18px 0 0; color: var(--muted); }
@media (max-width: 520px) { .row-icon { display: none; } .card.row { padding: 18px 16px; } }
