.agfl-ranking-anchor {
	display: block;
	height: 0;
	scroll-margin-top: calc(5rem + var(--wp-admin--admin-bar--height, 0px));
}

.agfl-genre-footer {
	box-sizing: border-box;
	margin-block: 2rem 0;
	padding: 1.25rem;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	background: #fff;
	color: inherit;
}

.agfl-genre-footer *,
.agfl-genre-footer *::before,
.agfl-genre-footer *::after {
	box-sizing: border-box;
}

.agfl-genre-footer .agfl-popular-posts {
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
}

.agfl-genre-footer .agfl-popular-posts__title {
	margin: 0 0 0.75rem;
	padding: 0;
	border: 0;
	background: transparent;
	font-size: 1.125em;
	font-weight: 700;
	line-height: 1.5;
}

.agfl-genre-footer .agfl-popular-posts__items {
	margin: 0;
	padding: 0;
	list-style: none;
}

.agfl-genre-footer .agfl-popular-posts__item {
	margin: 0;
	padding: 0;
	border-bottom: 1px solid #e2e4e7;
	list-style: none;
}

.agfl-popular-posts__item:last-child {
	border-bottom: 0;
}

.agfl-popular-posts__link {
	display: grid;
	grid-template-columns: 120px minmax(0, 1fr);
	align-items: center;
	gap: 0.875rem;
	box-sizing: border-box;
	padding-block: 0.625rem;
	color: inherit;
	text-decoration: none;
}

.agfl-popular-posts__link:hover .agfl-popular-posts__article-title,
.agfl-popular-posts__link:focus-visible .agfl-popular-posts__article-title {
	text-decoration: underline;
}

.agfl-popular-posts__link:focus-visible {
	border-radius: 3px;
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.agfl-popular-posts__thumbnail {
	position: relative;
	display: block;
	overflow: hidden;
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: 4px;
	background: #f0f0f1;
}

.agfl-popular-posts__image {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
}

.agfl-popular-posts__rank {
	position: absolute;
	top: 5px;
	left: 5px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 26px;
	height: 26px;
	border: 2px solid rgba(255, 255, 255, 0.9);
	border-radius: 50%;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
}

.agfl-popular-posts__rank--1 {
	background: #b88900;
}

.agfl-popular-posts__rank--2 {
	background: #73777c;
}

.agfl-popular-posts__rank--3 {
	background: #985f2a;
}

.agfl-popular-posts__article-title {
	display: -webkit-box;
	overflow: hidden;
	max-height: 3.1em;
	font-weight: 600;
	line-height: 1.55;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.agfl-genre-footer .agfl-footer-links {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
}

.agfl-genre-footer .agfl-popular-posts + .agfl-footer-links {
	margin-block-start: 0.625rem;
	padding-block-start: 0.875rem;
	border-top: 1px solid #e2e4e7;
}

.agfl-popular-posts + .agfl-footer-links .agfl-footer-links__title {
	display: none;
}

.agfl-genre-footer .agfl-footer-links__title {
	margin: 0 0 1rem;
	font-size: 1.125em;
	font-weight: 700;
	line-height: 1.5;
}

.agfl-genre-footer .agfl-footer-links__items {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.agfl-footer-links__item {
	margin: 0;
	padding: 0;
}

.agfl-genre-footer .agfl-footer-links__link {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
	box-sizing: border-box;
	min-height: 100%;
	padding: 0.375rem 0;
	border: 0;
	background: transparent;
	color: #245b86;
	font-weight: 600;
	text-decoration: none;
}

.agfl-footer-links__link:hover,
.agfl-footer-links__link:focus-visible {
	border-color: currentColor;
	text-decoration: underline;
}

.agfl-footer-links__link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.agfl-footer-links__text {
	min-width: 0;
	overflow-wrap: anywhere;
}

@media (max-width: 600px) {
	.agfl-popular-posts__link {
		grid-template-columns: 96px minmax(0, 1fr);
		gap: 0.75rem;
	}

	.agfl-popular-posts__rank {
		top: 4px;
		left: 4px;
		width: 23px;
		height: 23px;
		font-size: 12px;
	}

	.agfl-genre-footer .agfl-footer-links__items {
		grid-template-columns: 1fr;
	}
}

.agfl-genre-footer [hidden] { display: none; }
.agfl-popular-posts__periods {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0.35rem;
	margin: 0 0 0.75rem;
}
.agfl-genre-footer .agfl-popular-posts__period,
.agfl-genre-footer .agfl-popular-posts__retry {
	min-width: 0;
	margin: 0;
	padding: 0.4rem 0.2rem;
	border: 1px solid rgba(0, 0, 0, 0.18);
	border-radius: 4px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 0.875rem;
	line-height: 1.4;
	cursor: pointer;
}
.agfl-genre-footer .agfl-popular-posts__period[aria-pressed="true"] {
	border-color: #333;
	background: #333;
	color: #fff;
	font-weight: 600;
}
.agfl-genre-footer .agfl-popular-posts__period:hover { border-color: #333; }
.agfl-genre-footer .agfl-popular-posts__retry { padding: 0.4rem 0.75rem; margin-bottom: 0.75rem; }
.agfl-genre-footer .agfl-popular-posts__status { margin: 0; padding: 0.75rem 0; font-size: 0.875rem; color: #666; }
.agfl-genre-footer button:focus-visible { outline: 2px solid #2779bd; outline-offset: 3px; }
