/*
 * Popular Posts list (Maya 3.15): a lead item with a large number, then
 * numbered circles. Numbers come from CSS counters. Tokens fall back to the
 * JNews values if the theme omits a preset. Mobile-first, no media queries.
 */
.dnews-popular__list {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: dnews-popular;
}

.dnews-popular__item {
	position: relative;
	margin: 0 0 var(--wp--preset--spacing--space-5, 20px);
	counter-increment: dnews-popular;
}

.dnews-popular__title {
	margin: 0 0 var(--wp--preset--spacing--space-1, 4px);
	font-size: var(--wp--preset--font-size--small, 14px);
	font-weight: var(--wp--custom--type--card-title--weight, 700);
	line-height: var(--wp--custom--type--small--line-height, 1.5);
	letter-spacing: var(--wp--custom--type--small--tracking, 0);
	word-spacing: var(--wp--custom--type--card-title--word-spacing, 0.06em);
}

.dnews-popular__title a {
	color: inherit;
	text-decoration: none;
}

.dnews-popular__title a:hover,
.dnews-popular__title a:focus-visible {
	color: var(--wp--preset--color--accent-text, #cc3a27);
}

/* Numbered circle for items 2 and up. */
.dnews-popular__item:not(.dnews-popular__item--lead) {
	min-height: 44px;
	padding-inline-start: var(--wp--preset--spacing--space-9, 48px);
}

.dnews-popular__item:not(.dnews-popular__item--lead)::before {
	position: absolute;
	inset-block-start: 0;
	inset-inline-start: 0;
	display: grid;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--wp--preset--color--rank-bg, #14141b);
	color: var(--wp--preset--color--badge, #ffcf40);
	content: counter(dnews-popular);
	font-size: var(--wp--preset--font-size--h-4, 18px);
	font-family: var(--wp--preset--font-family--heading, inherit);
	font-weight: var(--wp--custom--type--heading--weight, 700);
	place-items: center;
	transition: background-color var(--wp--custom--motion--base, 200ms) var(--wp--custom--motion--ease, ease-out), color var(--wp--custom--motion--base, 200ms) var(--wp--custom--motion--ease, ease-out);
}

.dnews-popular__item:not(.dnews-popular__item--lead):hover::before {
	background: var(--wp--preset--color--button-hover-bg, #cc3a27);
	color: var(--wp--preset--color--button-hover-text, #fff);
}

/* Lead item: full-width image, bigger title, large number at the right. */
.dnews-popular__item--lead {
	padding-block-end: var(--wp--preset--spacing--space-4, 16px);
	border-block-end: 3px solid var(--wp--preset--color--line, #eee);
}

.dnews-popular__thumb {
	display: block;
	overflow: hidden;
	border-radius: var(--wp--custom--radius--image, 6px);
}

.dnews-popular__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: var(--wp--custom--ratio--card, 16 / 9);
	object-fit: cover;
}

.dnews-popular__item--lead .dnews-popular__title {
	margin: var(--wp--preset--spacing--space-4, 16px) var(--wp--preset--spacing--space-10, 64px) var(--wp--preset--spacing--space-1, 4px) 0;
	font-size: var(--wp--preset--font-size--h-4, 18px);
	line-height: var(--wp--custom--type--card-title--line-height, 1.25);
	letter-spacing: var(--wp--custom--type--base--tracking, 0);
	word-spacing: var(--wp--custom--type--card-title--word-spacing, 0.06em);
}

.dnews-popular__item--lead::after {
	position: absolute;
	inset-block-end: var(--wp--preset--spacing--space-4, 16px);
	inset-inline-end: 0;
	padding-inline-start: var(--wp--preset--spacing--space-3, 12px);
	border-inline-start: 1px solid var(--wp--preset--color--line, #eee);
	color: var(--wp--preset--color--rank-decor, #d7d7d7);
	content: counter(dnews-popular);

	/* Decorative rank numeral: 36px has no type role, intentionally literal. */
	font-size: 36px;
	font-family: var(--wp--preset--font-family--heading, inherit);
	font-weight: var(--wp--custom--type--heading--weight, 700);
	line-height: 1;
}
