/* ==========================================================================
   Shared "Discover more" sidebar — used by acf/knowledgeoverview and
   acf/downloadsoverview (see shared/discover-sidebar.php). Each host block
   places .rf-discover-sidebar's host <aside> in its own grid (grid-area
   etc. — see that block's own CSS); everything below is the sidebar's own
   internal look, independent of which block hosts it.
   ========================================================================== */

.rf-discover-sidebar__inner,
[data-rf-discover-sidebar] {
	--rf-discover-radius: 16px;
	--rf-discover-border: var(--wp--preset--color--cloud, #F0EBE6);
	--rf-discover-tab-bg: #F6F3F0;
	--rf-discover-ink: var(--wp--preset--color--dark);
	/* Read by shared/discover-sidebar.js (JS-driven sticky sidebar) so the
	   offset only needs to be tuned in one place. */
	--rf-discover-sticky-offset: 6rem;
}

.rf-discover-sidebar__title {
	margin: 0 0 2rem;
	padding-bottom: 1.5rem;
	border-bottom: 1px solid var(--rf-discover-border);
	font-size: clamp(1.125rem, 2vw, 1.25rem);
	line-height: 1.4;
	font-weight: 700;
	color: var(--rf-discover-ink);
}

@media (min-width: 62em) {
	/* The host <aside> is left at the default align-self: stretch so its
	   grid cell is as tall as the block's main column — that gives
	   .rf-discover-sidebar__inner room to travel before it reaches the
	   bottom. Native CSS `position: sticky` didn't reliably stick on the
	   live site (an ancestor issue that couldn't be pinned down), so the
	   actual sticky behavior is implemented in JS instead —
	   shared/discover-sidebar.js moves .rf-discover-sidebar__inner via
	   `transform: translateY()` on scroll, computed from
	   getBoundingClientRect() so it's immune to whatever was blocking
	   native sticky. The offset (~ the site header height, so the sidebar
	   doesn't tuck under it) lives in the --rf-discover-sticky-offset
	   custom property above, which the JS reads directly — tune it there
	   only. z-index keeps it above sibling content while it's translated.
	*/
	.rf-discover-sidebar__inner {
		position: relative;
		z-index: 2;
		will-change: transform;
	}

	/* Floats above .rf-discover-sidebar__inner (into the row above)
	   instead of taking up space inside it — that's what keeps the first
	   item flush with the host block's first content item instead of
	   being pushed down by the heading. .rf-discover-sidebar__inner's
	   position: relative above makes it a valid containing block for
	   this. */
	.rf-discover-sidebar__title {
		position: absolute;
		bottom: 100%;
		left: 0;
		right: 0;
		margin: 0 0 2rem;
	}
}

.rf-discover-sidebar__item {
	display: block;
	margin-bottom: clamp(1.5rem, 3vw, 2rem);
	padding: 24px 16px 16px;
	border: 2px solid var(--rf-discover-tab-bg);
	border-radius: var(--rf-discover-radius);
	color: var(--rf-discover-ink);
	text-decoration: none;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
	background-color:#F9F7F5;
}

.rf-discover-sidebar__item:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 32px rgba(44, 57, 83, 0.12);
}

.rf-discover-sidebar__label {
	display: block;
	margin: 0 0 1rem;
	font-size: clamp(1rem, 4vw, 1.125rem);
	font-weight: 700;
	line-height: 1.4;
	color: var(--rf-discover-ink);
	font-family: Poppins;
}

/* Decorative gradient backdrop behind the image — alternates per tile via
   the --a/--b modifier (see rf_discover_sidebar_render_item() in
   discover-sidebar.php; done in PHP rather than a CSS :nth-child since the
   tiles sit alongside a <h2> sibling and can each be an <a> or a <div>,
   both of which make nth-child/nth-of-type counting unreliable here). */
.rf-discover-sidebar__media {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 200px;
	/*padding: 24px;*/
	overflow: hidden;
	border-radius: calc(var(--rf-discover-radius) - 8px);
}


.rf-discover-sidebar__img {
	position: static;
	height: auto;
	width: 100%;
}

@media (prefers-reduced-motion: reduce) {
	.rf-discover-sidebar__item {
		transition: none;
	}

	.rf-discover-sidebar__item:hover {
		transform: none;
	}
}


