/* =============================================================================
   ComicSwap Web · Agenda cómic (/app/#agenda)
   Usa las variables y el acabado de comic-theme.css (oscuro suave).
   ============================================================================= */

.ag-buscador { margin-bottom: 20px; }
.ag-buscador input { margin-top: 0; }
.ag-buscador input::-webkit-search-cancel-button { cursor: pointer; }

.ag-filtros { display: grid; gap: 14px; margin: 0 0 22px; }
.ag-fila { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.ag-chip {
  font-family: var(--titulo);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.2;
  padding: 8px 12px;
  background: var(--surface2);
  color: #e2e2ea;
  border: 2px solid var(--line);
  border-radius: 0;
  cursor: pointer;
  transition: border-color 0.1s ease, background 0.1s ease;
}
.ag-chip small { font-family: var(--texto); font-size: 0.72rem; letter-spacing: 0; opacity: 0.6; margin-left: 3px; }
.ag-chip:hover { border-color: var(--amarillo); }
.ag-chip[aria-pressed='true'] {
  background: var(--amarillo);
  color: #111;
  border-color: var(--sombra);
  box-shadow: 2px 2px 0 var(--sombra);
}
.ag-chip[aria-pressed='true'] small { opacity: 0.75; }
.ag-chip-adultos { border-color: rgba(215, 21, 21, 0.55); }
.ag-chip-adultos[aria-pressed='true'] { background: var(--rojo); color: #fff; }
.ag-aviso-adultos { margin: -8px 0 14px; padding: 8px 12px; border-left: 3px solid var(--rojo); background: var(--surface2); font-size: 0.86rem; color: #d8d8e0; }
.ag-aviso-adultos[hidden] { display: none; }

.ag-selects { display: flex; flex-wrap: wrap; gap: 12px; }
.ag-selects label {
  margin: 0;
  font-family: var(--titulo);
  font-weight: 400;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.ag-selects select {
  display: block;
  width: auto;
  min-width: 190px;
  max-width: 280px;
  margin-top: 5px;
  padding: 9px 12px;
  font-family: var(--texto);
  font-size: 0.92rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  cursor: pointer;
}

.ag-contador { margin: 0 0 6px; font-size: 0.86rem; color: var(--muted); }
.ag-limpiar {
  padding: 0;
  border: 0;
  background: none;
  color: var(--amarillo);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.ag-grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
.ag-semana,
.ag-separador { grid-column: 1 / -1; }
.ag-semana {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 22px 0 2px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--line);
  font-family: var(--letras);
  font-weight: 400;
  font-size: 1.6rem;
  line-height: 1;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--amarillo);
}
.ag-semana:first-child { margin-top: 6px; }
.ag-semana small {
  font-family: var(--titulo);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.ag-separador {
  margin: 34px 0 0;
  padding: 8px 12px;
  background: var(--surface2);
  border-left: 3px solid var(--rojo);
  font-family: var(--titulo);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #d8d8e0;
}

.ag-card { cursor: pointer; }
.ag-card:focus-visible { outline: 3px solid var(--amarillo); outline-offset: 2px; }
.ag-card .comic-info p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ag-card .comic-info h3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ag-sin-portada { padding: 12px; text-align: center; }
.ag-sin-portada span { font-size: 1.15rem !important; line-height: 1.05; word-break: break-word; text-transform: uppercase; }
.ag-badge-fecha { background: #0b0b0e !important; color: var(--amarillo) !important; }
.ag-badge-proxima { background: var(--amarillo) !important; color: #111 !important; }
.ag-badge-precio { background: #fff !important; color: #111 !important; }

.ag-mas { display: flex; justify-content: center; margin-top: 28px; }
.ag-mas:empty { display: none; }
.ag-fuente { margin: 26px 0 0; font-size: 0.78rem; color: var(--muted); }

/* ---------- Ficha ---------- */
dialog.ag-ficha { width: min(860px, calc(100% - 28px)); max-height: calc(100vh - 40px); padding: 30px; overflow: auto; }
.ag-ficha-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
.ag-ficha-portada img { display: block; }
.ag-ficha-portada .comic-cover { display: grid; }
.ag-ficha-portada img,
.ag-ficha-portada .comic-cover {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border: 2px solid var(--line);
  box-shadow: 3px 3px 0 var(--sombra);
}
.ag-ficha-txt .eyebrow { margin-bottom: 4px; }
.ag-ficha-txt h2 {
  margin: 8px 0 4px;
  font-family: var(--letras);
  font-weight: 400;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
}
.ag-subtitulo { margin: 0 0 6px; color: var(--muted); font-weight: 600; }
.ag-datos { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 16px; margin: 18px 0 16px; font-size: 0.92rem; }
.ag-datos dt { color: var(--muted); font-weight: 600; }
.ag-datos dd { margin: 0; overflow-wrap: anywhere; }
.ag-ficha-generos { margin: 0 0 16px; }
.ag-sinopsis { padding-top: 14px; border-top: 2px solid var(--line); line-height: 1.6; color: #dcdce4; }
.ag-sinopsis p { margin: 0 0 10px; }

@media (max-width: 720px) {
  .ag-fila-generos { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
  .ag-fila-generos .ag-chip { flex: 0 0 auto; }
  .ag-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .ag-selects select { width: 100%; min-width: 0; max-width: none; }
  .ag-semana { font-size: 1.35rem; }
  dialog.ag-ficha { padding: 26px 18px 20px; }
  .ag-ficha-grid { grid-template-columns: 1fr; gap: 18px; }
  .ag-ficha-portada { width: min(210px, 70%); }
}
