/* ranking-gallery.css — filtered gallery for low-N ranking pages.
   Mobile carousel + fullscreen overlay are styled by css/single-zoo.css.
   This file styles the desktop single frame + reuses the front-page arrow look. */

.ranking-gallery {
	width: 100% !important;
	max-width: none !important;
	margin: 0 0 24px;
}

/* ── Desktop single frame ─────────────────────────────── */

/* css/header.css has a stray global rule — @media(min-width:1300px) .desktop-only
   { margin-left: 474px } — meant only for the "Zoopedia" nav link in header.php's
   .nav-items, but since .desktop-only is a generic show/hide utility class, that
   margin bleeds into every other .desktop-only element too, including .rg-desktop
   here, pushing the gallery frame 474px right and leaving a big empty gap on its
   left (the parent column doesn't shrink to match). single-zoo.php's own gallery
   avoids this only because .image-gallery separately sets `margin: 30px auto`,
   which happens to override margin-left at equal specificity. This selector is
   more specific than header.css's bare .desktop-only, so it wins regardless of
   stylesheet load order — do not remove without checking css/header.css. */
.ranking-gallery .desktop-only {
	margin-left: 0;
}

.ranking-gallery .rg-frame {
	position: relative;
	width: 100% !important;
	max-width: none !important;
	aspect-ratio: 16 / 9;
	border-radius: 14px;
	overflow: hidden;
	background: #f2f2f2;
}

.ranking-gallery .rg-frame-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Front-page arrow styling (copied from css/front-page.css .fp-scroll-arrow),
   repositioned to sit inside the frame and vertically centred. */
.ranking-gallery .fp-scroll-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #fff;
	color: #222;
	border: 1.5px solid #111;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1rem;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
	z-index: 10;
	transition: box-shadow 0.15s, opacity 0.2s;
}

.ranking-gallery .fp-scroll-arrow:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.ranking-gallery .fp-scroll-left  { left: 14px; }
.ranking-gallery .fp-scroll-right { right: 14px; }

.ranking-gallery .rg-counter {
	position: absolute;
	right: 14px;
	bottom: 12px;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	font-size: 0.8rem;
	padding: 3px 10px;
	border-radius: 20px;
	z-index: 10;
}

/* ── Desktop / mobile toggle (matches single-zoo 1300px breakpoint) ── */

.ranking-gallery .desktop-only { display: block; }
.ranking-gallery .mobile-only  { display: none; }

@media (max-width: 1300px) {
	.ranking-gallery .desktop-only { display: none; }
	.ranking-gallery .mobile-only  { display: block; }
}

/* Force the mobile carousel edge-to-edge, matching single-zoo.php's bleed.
   Swiper's own bundled CSS sets ".swiper { margin-left:auto; margin-right:auto; }",
   which loads after single-zoo.css and overrides its bleed trick — so this needs
   higher specificity (+ !important) to reliably win regardless of stylesheet order. */
@media (max-width: 768px) {
	.ranking-gallery .rg-swiper {
		width: 100vw !important;
		margin-left: calc(-50vw + 50%) !important;
		border-radius: 0 !important;
	}
}
