/**
 * Responsive Grid & Carousel – widget styles.
 *
 * Specificity strategy
 * --------------------
 * - Structural / layout rules use normal specificity (.rgc-widget .x) so
 *   theme resets cannot break the layout.
 * - Cosmetic defaults that Elementor style controls can override are wrapped
 *   in :where(.rgc-widget) so the Elementor-generated rules ({{WRAPPER}} .x)
 *   always win, regardless of stylesheet order.
 * - Configurable values are CSS custom properties set by Elementor
 *   `selectors`, which also emits them per breakpoint.
 *
 * Every selector is scoped under .rgc-widget.
 */

/* ==========================================================================
   Root
   ========================================================================== */

.rgc-widget {
	--rgc-card-transition: 300ms;
	--rgc-img-transition: 500ms;
	position: relative;
	min-width: 0;
	box-sizing: border-box;
}

.rgc-widget *,
.rgc-widget *::before,
.rgc-widget *::after {
	box-sizing: border-box;
}

.rgc-widget .rgc-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.rgc-widget.rgc-empty {
	padding: 24px;
	text-align: center;
	opacity: 0.7;
}

/* ==========================================================================
   Grid layout
   ========================================================================== */

.rgc-widget.rgc-grid {
	display: grid;
	grid-template-columns: repeat(var(--rgc-cols, 3), minmax(0, 1fr));
	column-gap: var(--rgc-col-gap, 24px);
	row-gap: var(--rgc-row-gap, 24px);
	align-items: var(--rgc-grid-align, stretch);
}

/* ==========================================================================
   Custom Layout items (each holds an Elementor container)
   ========================================================================== */

.rgc-widget .rgc-item {
	display: flex;
	flex-direction: column;
	min-width: 0;
	transition:
		background-color var(--rgc-card-transition) ease,
		box-shadow var(--rgc-card-transition) ease,
		border-color var(--rgc-card-transition) ease;
}

.rgc-widget .rgc-item > .elementor-element {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
}

/* Editor-only holder for item containers while another source is active. */
.rgc-widget > .rgc-nested-holder,
.rgc-widget.rgc-holder-only {
	display: none;
}

/* ==========================================================================
   Card
   ========================================================================== */

.rgc-widget .rgc-card {
	position: relative;
	display: flex;
	flex-direction: var(--rgc-card-dir, column);
	min-width: 0;
	margin: 0;
	overflow: hidden;
	transition:
		transform var(--rgc-card-transition) ease,
		box-shadow var(--rgc-card-transition) ease,
		background-color var(--rgc-card-transition) ease,
		border-color var(--rgc-card-transition) ease;
}

:where(.rgc-widget) .rgc-card {
	background-color: #fff;
}

/* --- Image --------------------------------------------------------------- */

.rgc-widget .rgc-image {
	position: relative;
	flex: 0 0 var(--rgc-img-basis, auto);
	max-width: 100%;
	aspect-ratio: var(--rgc-img-ratio, auto);
	height: var(--rgc-img-h, auto);
	margin: 0;
	overflow: hidden;
}

.rgc-widget .rgc-card--no-image {
	--rgc-img-basis: auto;
}

.rgc-widget .rgc-image-link {
	display: block;
	height: 100%;
}

.rgc-widget .rgc-image img {
	display: block;
	width: 100%;
	max-width: none;
	height: 100%;
	margin: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	object-fit: var(--rgc-img-fit, cover);
	object-position: var(--rgc-img-pos, center center);
	transition:
		transform var(--rgc-img-transition) ease,
		filter var(--rgc-img-transition) ease;
}

.rgc-widget .rgc-image::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	transition:
		opacity var(--rgc-img-transition) ease,
		background-color var(--rgc-img-transition) ease;
}

/* Image hover effects */
.rgc-widget.rgc-img-hover-zoom-in .rgc-card:hover .rgc-image img {
	transform: scale(1.08);
}

.rgc-widget.rgc-img-hover-zoom-out .rgc-image img {
	transform: scale(1.08);
}

.rgc-widget.rgc-img-hover-zoom-out .rgc-card:hover .rgc-image img {
	transform: scale(1);
}

.rgc-widget.rgc-img-hover-grayscale .rgc-image img {
	filter: grayscale(1);
}

.rgc-widget.rgc-img-hover-grayscale .rgc-card:hover .rgc-image img {
	filter: grayscale(0);
}

.rgc-widget.rgc-img-hover-brighten .rgc-card:hover .rgc-image img {
	filter: brightness(1.12);
}

.rgc-widget.rgc-img-hover-blur .rgc-card:hover .rgc-image img {
	filter: blur(3px);
}

/* --- Content ------------------------------------------------------------- */

.rgc-widget .rgc-content {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	align-items: var(--rgc-content-items, stretch);
	min-width: 0;
}

:where(.rgc-widget) .rgc-content {
	padding: 20px 20px 24px;
}

.rgc-widget .rgc-title {
	overflow-wrap: anywhere;
}

:where(.rgc-widget) .rgc-title {
	margin: 0 0 8px;
	font-size: 1.25em;
	line-height: 1.3;
}

.rgc-widget .rgc-title a,
.rgc-widget .rgc-title a:hover,
.rgc-widget .rgc-title a:focus {
	color: inherit;
	text-decoration: none;
	box-shadow: none;
}

:where(.rgc-widget) .rgc-description {
	margin: 0 0 16px;
}

.rgc-widget .rgc-description > :last-child {
	margin-bottom: 0;
}

.rgc-widget .rgc-button-wrap {
	max-width: 100%;
}

.rgc-widget .rgc-button {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	color: var(--rgc-btn-color, #fff);
	text-decoration: none;
	cursor: pointer;
	transition:
		color 0.25s ease,
		background-color 0.25s ease,
		border-color 0.25s ease,
		box-shadow 0.25s ease,
		transform 0.25s ease;
}

.rgc-widget .rgc-button:hover,
.rgc-widget .rgc-button:focus-visible {
	color: var(--rgc-btn-color-hover, var(--rgc-btn-color, #fff));
	text-decoration: none;
}

:where(.rgc-widget) a.rgc-button,
:where(.rgc-widget) span.rgc-button {
	padding: 10px 18px;
	border: 0 solid transparent;
	border-radius: 4px;
	background-color: #111;
	font-size: 0.875em;
	font-weight: 600;
	line-height: 1.2;
}

:where(.rgc-widget) a.rgc-button:hover,
:where(.rgc-widget) a.rgc-button:focus-visible {
	background-color: #333;
}

/* --- Badge --------------------------------------------------------------- */

.rgc-widget .rgc-badge {
	z-index: 2;
	max-width: calc(100% - 2 * var(--rgc-badge-offset, 12px));
}

:where(.rgc-widget) .rgc-badge {
	display: inline-block;
	padding: 0.35em 0.75em;
	border-radius: 999px;
	background-color: #111;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
}

.rgc-widget .rgc-badge--overlay {
	position: absolute;
	margin: 0;
}

.rgc-widget.rgc-badge-pos-top-left .rgc-badge--overlay {
	top: var(--rgc-badge-offset, 12px);
	left: var(--rgc-badge-offset, 12px);
}

.rgc-widget.rgc-badge-pos-top-right .rgc-badge--overlay {
	top: var(--rgc-badge-offset, 12px);
	right: var(--rgc-badge-offset, 12px);
}

.rgc-widget.rgc-badge-pos-bottom-left .rgc-badge--overlay {
	bottom: var(--rgc-badge-offset, 12px);
	left: var(--rgc-badge-offset, 12px);
}

.rgc-widget.rgc-badge-pos-bottom-right .rgc-badge--overlay {
	right: var(--rgc-badge-offset, 12px);
	bottom: var(--rgc-badge-offset, 12px);
}

.rgc-widget .rgc-badge--inline {
	align-self: var(--rgc-content-items, flex-start);
}

:where(.rgc-widget) .rgc-badge--inline {
	margin-bottom: 10px;
}

/* --- Whole-card link (stretched link pattern) ---------------------------- */

.rgc-widget.rgc-card-clickable .rgc-title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.rgc-widget.rgc-card-clickable .rgc-button,
.rgc-widget.rgc-card-clickable .rgc-description a {
	position: relative;
	z-index: 2;
}

/* --- Focus --------------------------------------------------------------- */

.rgc-widget a:focus-visible,
.rgc-widget button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.rgc-widget.rgc-card-clickable .rgc-title a:focus-visible {
	outline: 0;
}

.rgc-widget.rgc-card-clickable .rgc-card:focus-within {
	outline: 2px solid currentColor;
	outline-offset: -2px;
}

/* ==========================================================================
   Carousel layout
   ========================================================================== */

.rgc-widget.rgc-carousel {
	--rgc-spv: 3;
	--rgc-gap: 24px;
}

.rgc-carousel .rgc-stage {
	position: relative;
}

/*
 * The viewport is where the overflow offset happens. JS writes the bleed in
 * pixels to --rgc-ol / --rgc-or. Negative margins pull the viewport out to
 * the viewport edge; matching padding keeps the track (and therefore every
 * slide's percentage width) the same size as the content container, so slide
 * widths and spacing never change. overflow is clipped at the padding box,
 * so slides remain visible across the whole bleed area.
 */
.rgc-carousel .rgc-viewport {
	position: relative;
	margin-left: calc(-1 * var(--rgc-ol, 0px));
	margin-right: calc(-1 * var(--rgc-or, 0px));
	padding-left: var(--rgc-ol, 0px);
	padding-right: var(--rgc-or, 0px);
	/* Old browsers: hidden. Modern: clip horizontally only, so card shadows,
	   hover lifts and grow animations are not cut off at the top/bottom. */
	overflow: hidden;
	overflow-x: clip;
	overflow-y: visible;
	touch-action: pan-y pinch-zoom;
}

.rgc-carousel .rgc-viewport:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -2px;
}

.rgc-carousel .rgc-track {
	display: var(--rgc-track-display, flex);
	/* Only used on devices whose Layout Type is Grid (see layout_type). */
	grid-template-columns: repeat(var(--rgc-cols, 3), minmax(0, 1fr));
	column-gap: var(--rgc-track-col-gap, var(--rgc-gap, 24px));
	row-gap: var(--rgc-track-row-gap, 0px);
	align-items: var(--rgc-track-align, var(--rgc-slide-align, stretch));
	margin: 0;
	padding: 0;
	transform: translate3d(0, 0, 0);
}

.rgc-carousel.rgc-is-ready:not(.rgc-is-grid) .rgc-track {
	will-change: transform;
}

/* Device in Grid mode: no transform, no clipping, no carousel UI. */
.rgc-carousel.rgc-is-grid .rgc-track {
	transform: none;
}

.rgc-carousel.rgc-is-grid .rgc-viewport {
	overflow: visible;
}

.rgc-carousel .rgc-slide {
	display: flex;
	flex: 0 0 calc((100% - (var(--rgc-spv, 3) - 1) * var(--rgc-gap, 24px)) / var(--rgc-spv, 3));
	min-width: 0;
	margin: 0;
}

.rgc-carousel .rgc-slide > .rgc-card {
	flex: 1 1 auto;
	width: 100%;
}

.rgc-carousel.rgc-can-drag .rgc-viewport {
	cursor: grab;
}

.rgc-carousel.rgc-is-dragging .rgc-viewport {
	cursor: grabbing;
	user-select: none;
}

.rgc-carousel.rgc-is-dragging .rgc-slide {
	pointer-events: none;
}

.rgc-carousel .rgc-slide img {
	-webkit-user-drag: none;
	user-select: none;
}

/* --- Arrows -------------------------------------------------------------- */

.rgc-carousel .rgc-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: var(--rgc-arrow-size, 44px);
	height: var(--rgc-arrow-size, 44px);
	min-height: 0;
	margin: 0;
	padding: 0;
	font-size: var(--rgc-arrow-icon, 18px);
	line-height: 1;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
	transition:
		color 0.2s ease,
		background-color 0.2s ease,
		border-color 0.2s ease,
		box-shadow 0.2s ease,
		opacity 0.2s ease;
}

:where(.rgc-widget) button.rgc-arrow {
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 50%;
	background-color: #fff;
	color: #111;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

:where(.rgc-widget) button.rgc-arrow:hover,
:where(.rgc-widget) button.rgc-arrow:focus-visible {
	background-color: #111;
	color: #fff;
}

.rgc-carousel .rgc-arrow svg,
.rgc-carousel .rgc-arrow i {
	display: block;
	width: 1em;
	height: 1em;
	font-size: inherit;
	fill: currentColor;
}

.rgc-carousel .rgc-arrow i::before {
	display: block;
}

.rgc-carousel .rgc-arrow[aria-disabled="true"] {
	cursor: default;
	opacity: 0.35;
}

.rtl .rgc-carousel .rgc-arrow-svg,
[dir="rtl"] .rgc-carousel .rgc-arrow-svg {
	transform: scaleX(-1);
}

/* Side arrows: positioned over the stage (= the content container), so they
   always stay inside the normal content area even when the slides bleed. */
.rgc-carousel .rgc-arrows--sides .rgc-arrow {
	position: absolute;
	top: calc(var(--rgc-arrow-top, 50%) + var(--rgc-arrow-y, 0px));
	z-index: 3;
	transform: translateY(var(--rgc-arrow-ty, -50%));
}

.rgc-carousel .rgc-arrows--inside .rgc-arrow--prev {
	inset-inline-start: var(--rgc-arrow-x, 12px);
}

.rgc-carousel .rgc-arrows--inside .rgc-arrow--next {
	inset-inline-end: var(--rgc-arrow-x, 12px);
}

.rgc-carousel .rgc-arrows--outside .rgc-arrow--prev {
	inset-inline-end: calc(100% + var(--rgc-arrow-x, 12px));
}

.rgc-carousel .rgc-arrows--outside .rgc-arrow--next {
	inset-inline-start: calc(100% + var(--rgc-arrow-x, 12px));
}

/* Grouped arrows (above / below the slides). */
.rgc-carousel .rgc-arrows--sides {
	display: var(--rgc-nav-display, block);
}

.rgc-carousel .rgc-arrows--grouped {
	display: var(--rgc-nav-display, flex);
	gap: var(--rgc-arrows-gap, 8px);
	justify-content: flex-end;
}

.rgc-carousel .rgc-arrows--top {
	margin-bottom: var(--rgc-nav-space, 16px);
}

.rgc-carousel .rgc-arrows--bottom {
	margin-top: var(--rgc-nav-space, 16px);
}

/* --- Footer: pagination + autoplay toggle --------------------------------- */

.rgc-carousel .rgc-footer {
	display: var(--rgc-nav-display, flex);
	align-items: center;
	gap: 12px;
	margin-top: var(--rgc-pag-space, 20px);
}

.rgc-carousel .rgc-pagination {
	display: flex;
	flex: 1 1 auto;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: var(--rgc-dot-gap, 8px);
	min-height: max(var(--rgc-dot, 10px), 1.2em);
}

.rgc-carousel .rgc-pagination .rgc-dot {
	position: relative;
	display: block;
	flex: none;
	width: var(--rgc-dot, 10px);
	height: var(--rgc-dot, 10px);
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: var(--rgc-dot-radius, 999px);
	background: var(--rgc-dot-color, rgba(0, 0, 0, 0.25));
	box-shadow: none;
	cursor: pointer;
	transition:
		width 0.3s ease,
		background-color 0.3s ease;
}

/* Larger, invisible hit area for touch. */
.rgc-carousel .rgc-pagination .rgc-dot::before {
	content: "";
	position: absolute;
	inset: -6px;
}

.rgc-carousel .rgc-pagination .rgc-dot:hover {
	background: var(--rgc-dot-active, #111);
	opacity: 0.6;
}

.rgc-carousel .rgc-pagination .rgc-dot[aria-current="true"] {
	width: var(--rgc-dot-active-w, var(--rgc-dot, 10px));
	background: var(--rgc-dot-active, #111);
	opacity: 1;
}

.rgc-carousel .rgc-pagination .rgc-dot:focus-visible {
	outline: 2px solid var(--rgc-dot-active, #111);
	outline-offset: 3px;
}

.rgc-carousel .rgc-fraction {
	font-variant-numeric: tabular-nums;
}

.rgc-carousel .rgc-footer .rgc-autoplay-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 32px;
	height: 32px;
	min-height: 0;
	margin: 0 0 0 auto;
	padding: 0;
	border: 1px solid currentColor;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	cursor: pointer;
	opacity: 0.75;
}

.rgc-carousel .rgc-footer .rgc-autoplay-toggle:hover,
.rgc-carousel .rgc-footer .rgc-autoplay-toggle:focus-visible {
	background: transparent;
	color: inherit;
	opacity: 1;
}

.rgc-carousel .rgc-autoplay-toggle svg {
	width: 14px;
	height: 14px;
}

.rgc-carousel .rgc-autoplay-toggle .rgc-icon-play,
.rgc-carousel.rgc-is-paused .rgc-autoplay-toggle .rgc-icon-pause {
	display: none;
}

.rgc-carousel.rgc-is-paused .rgc-autoplay-toggle .rgc-icon-play {
	display: block;
}

/* Nothing to scroll: hide navigation entirely. */
.rgc-carousel.rgc-is-static .rgc-arrows,
.rgc-carousel.rgc-is-static .rgc-footer {
	display: none;
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	.rgc-widget .rgc-card,
	.rgc-widget .rgc-image img,
	.rgc-widget .rgc-image::after,
	.rgc-widget .rgc-button,
	.rgc-carousel .rgc-arrow,
	.rgc-carousel .rgc-pagination .rgc-dot {
		transition: none;
	}

	.rgc-widget.rgc-img-hover-zoom-in .rgc-card:hover .rgc-image img,
	.rgc-widget.rgc-img-hover-zoom-out .rgc-image img {
		transform: none;
	}
}
