/* ===========================================================================
 * AAPS Guides page (4406) — sort dropdown & numbered pagination.
 * The sort box / grid are styled in Elementor; this file adds the interactive
 * chrome (sort menu, numbered pagination) + hides the widget's native pager.
 * Mirrors aaps-blogs.css. See assets/js/aaps-guides.js.
 * ======================================================================== */

/* The custom AJAX pagination replaces the widget's native load-more / pagination. */
#aapsFilterGuides .e-load-more-anchor,
#aapsFilterGuides .elementor-button-wrapper.e-load-more-anchor,
#aapsFilterGuides .e-load-more-spinner,
#aapsFilterGuides nav.elementor-pagination { display: none !important; }

/* ── grid loading state ─────────────────────────────────────────────────── */
#aapsFilterGuides .elementor-loop-container { transition: opacity .15s ease; }
#aapsFilterGuides.aaps-guides-loading .elementor-loop-container {
	opacity: .45;
	pointer-events: none;
}

.aaps-guides-empty {
	grid-column: 1 / -1;
	margin: 0;
	padding: 56px 16px;
	text-align: center;
	color: #535862;
	font-size: 16px;
}

/* ── sort dropdown ──────────────────────────────────────────────────────── */
#aapsFilterSort.aaps-sort-ready { position: relative; cursor: pointer; }
#aapsFilterSort.aaps-sort-ready:focus-visible { outline: 2px solid #104C94; outline-offset: 2px; }
#aapsFilterSort img { transition: transform .2s ease; }
#aapsFilterSort.is-open img { transform: rotate(180deg); }

#aapsFilterSort .aaps-sort-menu {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	left: auto;
	min-width: 210px;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: #fff;
	border: 1px solid #E9EAEB;
	border-radius: 12px;
	box-shadow: 0 12px 32px rgba(10, 13, 18, .12);
	z-index: 60;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
}
#aapsFilterSort.is-open .aaps-sort-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}
.aaps-sort-opt {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 12px;
	border-radius: 8px;
	font-size: 14px;
	line-height: 1.3;
	color: #414651;
	white-space: nowrap;
}
.aaps-sort-opt:hover { background: #F5F5F5; }
.aaps-sort-opt.is-active { color: #181D27; font-weight: 600; }
.aaps-sort-opt.is-active::after {
	content: "";
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	background: #104C94;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M16.67 5 7.5 14.17 3.33 10' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
	        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M16.67 5 7.5 14.17 3.33 10' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ── numbered pagination (Untitled-UI style, matching the design) ───────── */
.aaps-guides-pagination {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
	margin-top: 48px;
	padding-top: 20px;
	border-top: 1px solid #E9EAEB;
}
.aaps-guides-pagination[hidden] { display: none; }

.aaps-pg-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
	padding: 8px 6px;
	background: none;
	border: 0;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	color: #535862;
	font-family: inherit;
}
.aaps-pg-btn svg { display: block; flex: 0 0 auto; }
.aaps-pg-btn:hover:not([disabled]) { color: #181D27; }
.aaps-pg-btn[disabled] { opacity: .4; cursor: default; }

.aaps-pg-list {
	display: flex;
	align-items: center;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.aaps-pg-list li { display: flex; }
.aaps-pg-num {
	min-width: 40px;
	height: 40px;
	padding: 0 6px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: 0;
	border-radius: 8px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	color: #717680;
	font-family: inherit;
}
.aaps-pg-num:hover { background: #FAFAFA; color: #181D27; }
.aaps-pg-num.is-active { background: #FAFAFA; color: #252B37; font-weight: 600; }
.aaps-pg-dots {
	min-width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #717680;
	font-size: 14px;
}

@media (max-width: 767px) {
	.aaps-guides-pagination { gap: 8px; }
	.aaps-pg-btn span { display: none; }     /* arrows only on small screens */
	.aaps-pg-num { min-width: 36px; height: 36px; }
}
