/* css/cards.css — Tarjetas de La Guarida (1.2.0, 2026-11-23, FLU-1; 1.1.0 FAV-1; 1.0.0 RG-3)
   Un color por sección (aprobado por Pablo en RG-0b): ámbar Favoritos, violeta
   Categorías, turquesa Lanzador. Los colores fijos van en bordes, brillos y puntos,
   nunca como color de texto (en los themes claros no llegarían a 4,5:1); el texto
   sigue saliendo del theme activo. Solo CSS: app.js no cambia.
   Las variables --gh-fav/--gh-cat/--gh-lan vienen de css/header.css. */

/* ---- Paneles: una línea de color arriba ---- */
#seccionFavoritos, #seccionCategorias, #launcherPanel { position: relative; overflow: hidden; }
#seccionFavoritos::before, #seccionCategorias::before, #launcherPanel::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; opacity: .85;
}
#seccionFavoritos::before { background: linear-gradient(90deg, var(--gh-fav), transparent 70%); }
#seccionCategorias::before { background: linear-gradient(90deg, var(--gh-cat), transparent 70%); }
#launcherPanel::before { background: linear-gradient(90deg, var(--gh-lan), transparent 70%); }

/* ---- Favoritos (ámbar) ---- */
#seccionFavoritos .fav-card { padding: 16px 8px 12px; }
#seccionFavoritos .fav-card .fav-icon,
#seccionFavoritos .fav-card .fav-emoji {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 6px; border-radius: 12px;
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--border);
}
#seccionFavoritos .fav-card:hover { border-color: var(--gh-fav); box-shadow: 0 6px 20px -10px var(--gh-fav); }
#seccionFavoritos .fav-card:hover .fav-icon,
#seccionFavoritos .fav-card:hover .fav-emoji { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gh-fav) 60%, var(--border)); }
#seccionFavoritos .gn-usual__chip:hover { border-color: var(--gh-fav); }

/* ---- Íconos de Favoritos (1.1.0, FAV-1) ----
   Todos del mismo tamaño (44 px; el estilo en línea de js/data.js dice 40) y en el mismo aro
   (círculo con el theme Gato Negro, cuadrado redondeado en los demás). js/data.js pone la clase:
   - .fi-llena: nuestros sitios (mi DEV, Shiruna, Centro de mando, GitHub) y las imágenes que
     elegiste a mano: llenan el aro, sin marco doble.
   - .fi-web: favicons de la web. Están hechos para la pestaña clara del navegador, así que van
     sobre un disco claro: los cuadrados blancos dejan de flotar y ninguno oscuro se pierde. */
#seccionFavoritos .fav-card img.fav-icon { width: 44px !important; height: 44px !important; border-radius: 12px !important; }
#seccionFavoritos .fav-card img.fi-llena { padding: 0; object-fit: cover !important; }
#seccionFavoritos .fav-card img.fi-web { padding: 9px; object-fit: contain !important; background: #F4F4F7 !important; }
body[data-theme="gato"] #seccionFavoritos .fav-card img.fav-icon { border-radius: 50% !important; }

/* «Lo de siempre»: el mismo ícono, chico, en vez del emoji */
.gn-usual__ico { display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px; }
.gn-usual__ico img { width: 18px !important; height: 18px !important; border-radius: 50% !important; }
.gn-usual__ico img.fi-llena { padding: 0; object-fit: cover !important; }
.gn-usual__ico img.fi-web { padding: 2px; object-fit: contain !important; background: #F4F4F7; }

/* ---- Categorías (violeta) ---- */
#seccionCategorias .category-card { border-left: 3px solid color-mix(in srgb, var(--gh-cat) 70%, var(--border)); }
#seccionCategorias .category-card:hover { border-color: color-mix(in srgb, var(--gh-cat) 45%, var(--border)); border-left-color: var(--gh-cat); }
#seccionCategorias .category-header { padding-bottom: 6px; border-bottom: 1px solid var(--border); }
/* El título va con el color del theme; en el theme oficial, violeta claro (contraste ≥ 7:1 sobre el panel) */
body[data-theme="gato"] #seccionCategorias .category-title { color: #C9BBFF; }
#seccionCategorias .category-link:hover { border-color: color-mix(in srgb, var(--gh-cat) 55%, var(--border)); }

/* ---- Lanzador (turquesa) ---- */
#launcherPanel .launcher-section-title::before {
  content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 6px 1px 0; border-radius: 50%;
  background: var(--gh-lan); vertical-align: middle;
}
#launcherPanel .launcher-item { min-height: 42px; border-radius: 10px; }
#launcherPanel .launcher-icon {
  display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0; border-radius: 8px;
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--border);
}
#launcherPanel .launcher-item:hover { border-color: var(--gh-lan); box-shadow: 0 6px 20px -10px var(--gh-lan); }

/* ---- Botones «+ …» de cada sección ---- */
#seccionFavoritos .add-btn:hover { border-color: var(--gh-fav); }
#seccionCategorias .add-btn:hover { border-color: var(--gh-cat); }
#launcherPanel .add-btn:hover { border-color: var(--gh-lan); }

/* ---- Estados vacíos: el gato robot «en construcción» ---- */
.favorites-grid:not(:has(.fav-card))::before,
.categories-grid:not(:has(.category-card))::before {
  content: ""; grid-column: 1 / -1; justify-self: center; width: 96px; height: 96px;
  background: url("../assets/brand/gato-en-construccion-256.webp") center / contain no-repeat;
  opacity: .9;
}
.favorites-grid:not(:has(.fav-card))::after,
.categories-grid:not(:has(.category-card))::after {
  grid-column: 1 / -1; justify-self: center; margin-top: -4px; font-size: .8125rem; color: var(--gn-muted); text-align: center;
}
.favorites-grid:not(:has(.fav-card))::after { content: "Todavía no hay favoritos. Soltá un enlace acá o tocá «+ Favorito»."; order: -1; }
.categories-grid:not(:has(.category-card))::after { content: "Todavía no hay categorías. Creá una con «+ Categoría»."; order: -1; }
.favorites-grid:not(:has(.fav-card))::before,
.categories-grid:not(:has(.category-card))::before { order: -2; }

/* ---- Fluidez (1.2.0, FLU-1): mientras bajás la página ----
   js/data.js pone body.gn-scrolleando durante el scroll (y 150 ms después). Mientras tanto:
   - las tarjetas no reaccionan al mouse que pasa por encima (cada una se levantaba, brillaba
     y se repintaba al cruzarla: eso eran buena parte de los saltitos);
   - se pausan las animaciones decorativas que no paran nunca (mi pose que flota en cada panel
     y las chispas del fondo). Al quedarse quieta la página, todo sigue donde estaba.
   - el escenario del fondo queda en su propia capa (se pinta una vez). */
body.gn-scrolleando .app-main { pointer-events: none; }
body[data-theme].gn-scrolleando .gn-panel::after,
body[data-theme].gn-scrolleando .esc-chispas i { animation-play-state: paused; }
body[data-theme="gato"]::before { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  #seccionFavoritos .fav-card:hover, #launcherPanel .launcher-item:hover { transform: none; }
}
