/* =========================================================================
   MK Archive — /manga/ y archivos de género estilo Utoon
   Consume los tokens --mc-* de la Fase 1.
   ========================================================================= */

.mk-archive {
	--fg:     var(--mc-text, #fff);
	--muted:  var(--mc-text-muted, #9a9a9a);
	--bg:     var(--mc-bg, #0a0a0a);
	--card:   var(--mc-card-bg, #161616);
	--line:   rgba(var(--mc-border-rgb, 42, 42, 42), .65);
	--accent: var(--mc-primary, #7c3aed);
	color: var(--fg);
	max-width: 1280px;
	margin: 0 auto;
	padding: 8px 0 40px;
}

.arc-head { margin: 18px 4px; }
.arc-title { font-size: clamp(22px, 3.4vw, 30px); font-weight: 840; letter-spacing: -.02em; margin: 0; }
.arc-desc { color: var(--muted); margin: 8px 0 0; font-size: 14px; line-height: 1.6; }

/* ----------------------------------------------------------------------- */
/*  Barra de filtros                                                        */
/* ----------------------------------------------------------------------- */
.filters {
	background: rgba(var(--mc-surface-rgb, 22, 22, 22), .5);
	border: 1px solid var(--line);
	border-radius: 16px;
	margin-bottom: 18px;
}
.filters__in { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.frow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.flabel { font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); flex: 0 0 auto; }
.flabel--inline { margin-left: 6px; }

.seg { display: inline-flex; gap: 4px; background: rgba(var(--mc-text-rgb, 255, 255, 255), .05); padding: 4px; border-radius: 11px; }
.seg a {
	padding: 7px 13px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 700;
	color: var(--muted);
	text-decoration: none;
	white-space: nowrap;
	transition: background .15s, color .15s;
}
.seg a:hover { color: var(--fg); }
.seg a.on { background: var(--accent); color: var(--mc-on-primary, #fff); }

/* Chips de género con scroll horizontal + flechas + degradados */
.chipscroll { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; }
.chips {
	flex: 1;
	display: flex;
	gap: 7px;
	overflow-x: auto;
	scroll-behavior: smooth;
	scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
	flex: 0 0 auto;
	background: rgba(var(--mc-text-rgb, 255, 255, 255), .06);
	border: 1px solid var(--line);
	border-radius: 18px;
	padding: 6px 13px;
	font-size: 12.5px;
	font-weight: 650;
	color: var(--fg);
	text-decoration: none;
	white-space: nowrap;
	transition: background .15s, border-color .15s;
}
.chip:hover { background: rgba(var(--mc-primary-rgb, 124, 58, 237), .16); border-color: rgba(var(--mc-primary-rgb, 124, 58, 237), .5); }
.chip.on { background: var(--accent); border-color: transparent; color: var(--mc-on-primary, #fff); }

.chiparrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 4;
	width: 30px; height: 30px;
	border-radius: 50%;
	border: 1px solid var(--line);
	background: var(--card);
	color: var(--fg);
	display: grid;
	place-items: center;
	cursor: pointer;
	font-size: 20px;
	line-height: 1;
	box-shadow: 0 4px 16px rgba(0, 0, 0, .4);
	transition: opacity .18s, color .15s, border-color .15s;
}
.chiparrow--l { left: -2px; }
.chiparrow--r { right: -2px; }
.chiparrow:hover { border-color: rgba(var(--mc-primary-rgb, 124, 58, 237), .55); color: var(--accent); }
.chiparrow[hidden] { display: none; }
.chipscroll::before, .chipscroll::after {
	content: "";
	position: absolute;
	top: 0; bottom: 0;
	width: 38px;
	pointer-events: none;
	z-index: 3;
	opacity: 0;
	transition: opacity .2s;
}
.chipscroll::before { left: 0; background: linear-gradient(to right, var(--bg), transparent); }
.chipscroll::after { right: 0; background: linear-gradient(to left, var(--bg), transparent); }
.chipscroll.can-l::before { opacity: 1; }
.chipscroll.can-r::after { opacity: 1; }

/* ----------------------------------------------------------------------- */
/*  Resultados                                                              */
/* ----------------------------------------------------------------------- */
.resbar { display: flex; align-items: center; justify-content: space-between; margin: 4px 4px 14px; }
.resbar .cnt { color: var(--muted); font-size: 13.5px; }
.resbar .cnt b { color: var(--fg); font-weight: 800; }

/* ----------------------------------------------------------------------- */
/*  Rejilla de tarjetas                                                     */
/* ----------------------------------------------------------------------- */
.agrid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 16px 14px;
}
@media (max-width: 600px) { .agrid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 14px 10px; } }

.acard { display: block; text-decoration: none; color: var(--fg); }
.ac-img {
	position: relative;
	aspect-ratio: 2 / 3;
	border-radius: 12px;
	overflow: hidden;
	background: var(--card);
	border: 1px solid var(--line);
}
.ac-img img, .ac-cover {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .35s ease;
}
.acard:hover .ac-img img { transform: scale(1.06); }
.ac-noimg { display: grid; place-items: center; width: 100%; height: 100%; padding: 12px; text-align: center; color: var(--muted); font-weight: 700; font-size: 13px; }

/* Badge de rating (arriba izq.) */
.ac-rate {
	position: absolute;
	top: 7px; left: 7px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 3px;
	background: rgba(0, 0, 0, .62);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	color: var(--mc-warning, #f59e0b);
	font-size: 11.5px;
	font-weight: 800;
	padding: 3px 7px;
	border-radius: 999px;
}

/* Estado (arriba der.) */
.ac-status {
	position: absolute;
	top: 7px; right: 7px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: rgba(0, 0, 0, .62);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	color: #fff;
	font-size: 10.5px;
	font-weight: 750;
	padding: 3px 8px;
	border-radius: 999px;
}
.ac-status .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--mc-success, #22c55e); }
.ac-status.st-end .dot { background: var(--mc-info, #3b82f6); }
.ac-status.st-canceled .dot { background: var(--mc-danger, #ef4444); }
.ac-status.st-on-hold .dot { background: var(--mc-warning, #f59e0b); }
.ac-status.st-upcoming .dot { background: var(--mc-accent, #c084fc); }

/* Último capítulo (abajo, sobre degradado) */
.ac-ch {
	position: absolute;
	left: 0; right: 0; bottom: 0;
	z-index: 2;
	padding: 18px 9px 8px;
	font-size: 11.5px;
	font-weight: 700;
	color: #fff;
	background: linear-gradient(to top, rgba(0, 0, 0, .85), transparent);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ac-t {
	margin-top: 8px;
	font-size: 13.5px;
	font-weight: 700;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ----------------------------------------------------------------------- */
/*  Paginación nativa de Madara, restilizada con tokens                     */
/* ----------------------------------------------------------------------- */
.mk-archive .wp-pagenavi,
.mk-archive .pagination,
.mk-archive .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin-top: 26px;
}
.mk-archive .wp-pagenavi a,
.mk-archive .wp-pagenavi span,
.mk-archive .page-numbers {
	min-width: 38px;
	height: 38px;
	padding: 0 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 10px;
	border: 1px solid var(--line);
	background: var(--card);
	color: var(--fg);
	font-weight: 700;
	text-decoration: none;
}
.mk-archive .wp-pagenavi .current,
.mk-archive .page-numbers.current {
	background: var(--accent);
	border-color: transparent;
	color: var(--mc-on-primary, #fff);
}

@media (prefers-reduced-motion: reduce) {
	.ac-img img, .chip, .seg a { transition: none; }
}
