/* ── Page ── */

.ap-page .wnmu-body {
	padding-top: 32px;
	padding-bottom: 72px;
}

/* ── Accordion (details/summary) ── */

.ap-accordion {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	overflow: hidden;
	margin-bottom: 28px;
	box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.ap-accordion__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 22px;
	cursor: pointer;
	font-size: 1rem;
	font-weight: 600;
	color: #1a1a2e;
	list-style: none;
	user-select: none;
	transition: background 0.18s;
}

.ap-accordion__toggle::-webkit-details-marker { display: none; }
.ap-accordion__toggle::marker { display: none; }

.ap-accordion__toggle:hover {
	background: #f8f9fb;
}

.ap-accordion__toggle:focus-visible {
	outline: 2px solid #42196F;
	outline-offset: -2px;
}

.ap-accordion__icon {
	flex-shrink: 0;
	color: #888;
	transition: transform 0.25s ease;
}

.ap-accordion[open] .ap-accordion__icon {
	transform: rotate(180deg);
}

.ap-accordion__body {
	padding: 24px;
	border-top: 1px solid #e2e8f0;
	background: #fafbfc;
}

/* ── Search ── */

.ap-search-wrap {
	position: relative;
	margin-bottom: 40px;
}

.ap-search-icon {
	position: absolute;
	left: 18px;
	top: 50%;
	transform: translateY(-50%);
	color: #a0a4b0;
	pointer-events: none;
}

.ap-search {
	width: 100%;
	padding: 14px 160px 14px 50px;
	font-family: inherit;
	font-size: 1rem;
	color: #1a1a2e;
	border: 2px solid #dde1ea;
	border-radius: 50px;
	background: #fff;
	outline: none;
	box-shadow: 0 1px 4px rgba(0,0,0,0.05);
	transition: border-color 0.15s, box-shadow 0.15s;
	-webkit-appearance: none;
}

.ap-search::placeholder {
	color: #9a9eab;
}

.ap-search:focus {
	border-color: #42196F;
	box-shadow: 0 0 0 4px rgba(66, 25, 111, 0.09);
}

.ap-search-count {
	position: absolute;
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 0.77rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: #42196F;
	background: rgba(66, 25, 111, 0.09);
	padding: 4px 13px;
	border-radius: 20px;
	white-space: nowrap;
}

/* ── Section ── */

.ap-section {
	margin-bottom: 44px;
}

.ap-section[hidden] {
	display: none !important;
}

.ap-section__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 22px;
	background: var(--ap-color);
	border-radius: 10px;
	margin-bottom: 14px;
}

/* .ap-page prefix outranks the theme's `.int-page h2` sizing rules */
.ap-page .ap-section__title {
	font-size: 1.125rem;
	line-height: 1.3;
	font-weight: 600;
	font-family: inherit;
	color: #fff;
	margin: 0;
	letter-spacing: 0.01em;
}

.ap-section__count {
	font-size: 0.75rem;
	font-weight: 700;
	color: #fff;
	background: rgba(255, 255, 255, 0.18);
	padding: 3px 12px;
	border-radius: 20px;
	min-width: 2ch;
	text-align: center;
}

/* ── Grid ── */

.ap-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
	list-style: none;
	padding: 0;
	margin: 0;
}

/* ── Card ── */

.ap-card {
	display: flex;
}

.ap-card[hidden] {
	display: none !important;
}

.ap-card__link {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	width: 100%;
	padding: 15px 18px 13px;
	background: #fff;
	border: 1px solid #e4e7ef;
	border-left: 4px solid var(--ap-color);
	border-radius: 10px;
	text-decoration: none;
	gap: 8px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.04);
	transition: box-shadow 0.16s, transform 0.16s, border-color 0.16s;
}

.ap-card__link:hover {
	border-color: color-mix(in srgb, var(--ap-color) 40%, #e4e7ef);
	border-left-color: var(--ap-color);
	box-shadow: 0 5px 16px rgba(0,0,0,0.09);
	transform: translateY(-2px);
}

.ap-card__link:focus-visible {
	outline: 2px solid var(--ap-color);
	outline-offset: 2px;
}

.ap-card__name {
	display: block;
	color: #1a1a2e;
	font-size: 0.9375rem;
	line-height: 1.45;
	font-weight: 500;
	transition: color 0.16s;
}

.ap-card__link:hover .ap-card__name {
	color: var(--ap-color);
}

/* URL-less programs render as a non-link card: same look, no hover affordance */
.ap-card__link--static:hover {
	border-color: #e4e7ef;
	border-left-color: var(--ap-color);
	box-shadow: 0 1px 3px rgba(0,0,0,0.04);
	transform: none;
}

.ap-card__link--static:hover .ap-card__name {
	color: #1a1a2e;
}

.ap-card__type {
	display: block;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: #8a8f9a;
}

/* ── No results ── */

.ap-no-results {
	text-align: center;
	color: #777e8b;
	padding: 60px 0;
	font-size: 1rem;
}

.ap-no-results[hidden] {
	display: none !important;
}

/* ── Reduced motion ── */

@media (prefers-reduced-motion: reduce) {
	.ap-card__link,
	.ap-card__name,
	.ap-accordion__icon {
		transition: none;
	}
	.ap-card__link:hover {
		transform: none;
	}
}

/* ── Responsive ── */

@media (max-width: 1024px) {
	.ap-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	.ap-grid {
		grid-template-columns: 1fr;
	}
	.ap-page .ap-section__title {
		font-size: 1rem;
	}
	.ap-search {
		padding-left: 46px;
		padding-right: 16px;
		border-radius: 10px;
	}
	.ap-search-count {
		display: none;
	}
}
