/**
 * infinite-scroll.css — Estilos do Infinite Scroll SEO-first
 *
 * Princípios:
 *   - Esconde paginate_links() SOMENTE quando JS ativa (body.has-fa-inf).
 *     Sem JS, paginação clássica continua visível e funcional.
 *   - Skeleton anti-CLS: container do sentinel reserva espaço fixo.
 *   - Botão "Carregar mais" fica visível com JS como fallback de teclado;
 *     escondido visualmente até observer detectar interação manual.
 *
 * @package 55acompanhantes
 * @since   5.7.5
 */

/* ═══════════════════════════════════════════════════════════════
   1. Esconde paginação clássica quando JS+IO ativos
   ═══════════════════════════════════════════════════════════════ */

.has-fa-inf .arch-pag,
.has-fa-inf .av-pag {
	display: none;
}

/* ═══════════════════════════════════════════════════════════════
   2. Wrap do sentinel
   ═══════════════════════════════════════════════════════════════ */

.fa-inf-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 24px 16px 40px;
	min-height: 120px;
	position: relative;
}

/* ═══════════════════════════════════════════════════════════════
   3. Skeleton — espaço reservado para evitar CLS
   ═══════════════════════════════════════════════════════════════ */

.fa-inf-skel {
	width: 100%;
	max-width: 320px;
	height: 8px;
	border-radius: 4px;
	background: linear-gradient(90deg, #f1f1f1 0%, #e5e5e5 50%, #f1f1f1 100%);
	background-size: 200% 100%;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.fa-inf-wrap.is-loading .fa-inf-skel {
	opacity: 1;
	animation: fa-inf-shimmer 1.2s ease-in-out infinite;
}

@keyframes fa-inf-shimmer {
	0%   { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════════════════════════════
   4. Live region — acessibilidade
   ═══════════════════════════════════════════════════════════════ */

.fa-inf-live {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ═══════════════════════════════════════════════════════════════
   5. Botão "Carregar mais" — fallback acessível
   ═══════════════════════════════════════════════════════════════ */

.fa-inf-more {
	appearance: none;
	-webkit-appearance: none;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	color: #1a1a2e;
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 999px;
	padding: 10px 24px;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.fa-inf-more:hover,
.fa-inf-more:focus {
	background: #f8f8f8;
	border-color: #ccc;
	outline: none;
}

.fa-inf-more:focus-visible {
	outline: 2px solid #e25352;
	outline-offset: 2px;
}

.fa-inf-more:active {
	transform: scale(0.98);
}

.fa-inf-wrap.is-loading .fa-inf-more {
	opacity: 0.5;
	pointer-events: none;
}

.fa-inf-wrap.is-done .fa-inf-more {
	display: none;
}

/* ═══════════════════════════════════════════════════════════════
   6. Estado de erro
   ═══════════════════════════════════════════════════════════════ */

.fa-inf-wrap.has-error::before {
	content: "Erro ao carregar. Tente novamente.";
	display: block;
	color: #c92a2a;
	font-size: 13px;
	margin-bottom: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   7. Link fallback (noscript)
   ═══════════════════════════════════════════════════════════════ */

.fa-inf-next-noscript {
	font-size: 14px;
	color: #1a1a2e;
	text-decoration: underline;
}
