/**
 * Kindling Carousel Block Styles
 * Auto-registered via wp_enqueue_block_style for kindling/carousel
 */

/* Neutralize alignfull when carousel is inside a flex layout */
.is-layout-flex > .wp-block-kindling-carousel.alignfull {
	max-width: 100%;
	width: auto;
	margin-inline: 0;
	flex: 1 1 0;
	min-width: 0;
}

/* Reset Splide theme padding that eats into carousel space */
.wp-block-kindling-carousel .splide {
	padding: 0;
}

/* Allow carousel track to overflow so slides extend past the viewport (testimonials only) */
.testimonials-edge-bleed .wp-block-kindling-carousel,
.testimonials-edge-bleed .wp-block-kindling-carousel .splide,
.testimonials-edge-bleed .wp-block-kindling-carousel .splide__track {
	overflow: visible;
}

/* Office carousel: clip overflow so only the active slide is visible.
   Allow visible overflow on the block & splide wrappers so side-chevron arrows can protrude;
   keep overflow hidden only on __track so slides are properly clipped. */
.office-carousel .wp-block-kindling-carousel,
.office-carousel .wp-block-kindling-carousel .splide {
	overflow: visible;
}

.office-carousel .wp-block-kindling-carousel .splide__track {
	overflow: hidden;
}

/* Office carousel: force-show pagination dots even when slide count matches visible count.
   Splide hides .splide__pagination when the carousel is not overflowing. */
.office-carousel .splide__pagination {
	display: flex !important;
	position: relative;
	bottom: auto;
	margin-top: var(--wp--preset--spacing--40);
	justify-content: center;
	gap: var(--wp--preset--spacing--20);
	padding: 0;
	list-style: none;
}

.office-carousel .splide__pagination__page {
	width: 0.625rem;
	height: 0.625rem;
	border-radius: var(--wp--custom--border--rounded-full);
	background-color: color-mix(in srgb, var(--wp--preset--color--theme-03) 30%, transparent);
	border: none;
	padding: 0;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.office-carousel .splide__pagination__page.is-active {
	background-color: var(--wp--preset--color--theme-03);
}

/* Office carousel: position navigation arrows as side chevrons.
   High-specificity selectors needed to override the built block CSS for bottom-right arrows. */
.office-carousel .wp-block-kindling-carousel .kindling-carousel-container[data-show-arrows="true"] {
	padding-bottom: 0 !important;
}

.office-carousel .wp-block-kindling-carousel .kindling-carousel-container[data-show-arrows="true"] .navigation-arrows {
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	bottom: auto;
	transform: translateY(-50%);
	pointer-events: none;
	z-index: 10;
	display: flex;
	justify-content: space-between;
	gap: 0;
}

.office-carousel .wp-block-kindling-carousel .kindling-carousel-container .navigation-arrows .splide-arrow {
	pointer-events: auto;
	position: relative;
	background: var(--wp--preset--color--theme-03) !important;
	border-radius: var(--wp--custom--border--rounded-full);
	color: var(--wp--preset--color--theme-01) !important;
	width: 2.75rem;
	height: 2.75rem;
	box-shadow: 0 2px 8px rgb(0 0 0 / 0.15);
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.office-carousel .wp-block-kindling-carousel .kindling-carousel-container .navigation-arrows .splide-arrow svg path {
	fill: var(--wp--preset--color--theme-01) !important;
}

.office-carousel .wp-block-kindling-carousel .kindling-carousel-container .navigation-arrows .splide-arrow:hover {
	background: var(--wp--preset--color--theme-02) !important;
	transform: scale(1.1) !important;
}

.office-carousel .navigation-arrows .splide-arrow--prev {
	margin-left: var(--wp--preset--spacing--60);
}

.office-carousel .navigation-arrows .splide-arrow--next {
	margin-right: var(--wp--preset--spacing--60);
}

/* Office carousel: enforce 648x399 aspect ratio on images */
.office-carousel .wp-block-kindling-carousel .wp-block-image {
	margin: 0;
}

.office-carousel .wp-block-kindling-carousel .wp-block-image img {
	width: 100%;
	height: auto;
	aspect-ratio: 648 / 399;
	object-fit: cover;
	display: block;
	border-radius: 0;
}

/* Ensure slides and inner wrappers fill their Splide-calculated width */
.wp-block-kindling-carousel .carousel-slide {
	width: 100%;
}

/* Testimonial Card - fixed height, column flex layout with name at bottom */
.wp-block-kindling-carousel .testimonial-card.wp-block-group {
	position: relative;
	width: 100% !important;
	height: 31.5625rem;
	min-height: 31.5625rem;
	padding: var(--wp--preset--spacing--80) var(--wp--custom--spacing--testimonial-inline) var(--wp--custom--spacing--testimonial-block-end) !important;
	box-sizing: border-box;
	border-radius: 0;
	flex-direction: column !important;
	flex-wrap: nowrap !important;
	align-items: stretch !important;
	justify-content: flex-start !important;
	gap: 0 !important;
	overflow: visible;
}

/* Quote icon - offset slightly outside card edge */
.wp-block-kindling-carousel .testimonial-card::before {
	content: "";
	background-image: url('../../images/icons/quotes.svg');
	background-repeat: no-repeat;
	background-size: contain;
	position: absolute;
	top: var(--wp--preset--spacing--50);
	left: -0.9375rem;
	width: 4.8125rem;
	height: 3.3125rem;
	z-index: 10;
	pointer-events: none;
}

/* Card text - clip before the absolutely-positioned name zone */
.wp-block-kindling-carousel .testimonial-card .testimonial-text {
	margin: 0 !important;
	max-height: calc(31.5625rem - var(--wp--preset--spacing--80) - var(--wp--custom--spacing--testimonial-block-end) - 2.625rem);
	overflow: hidden;
}

/* Name - pinned to bottom-right corner inside card padding */
.wp-block-kindling-carousel .testimonial-card .testimonial-name {
	position: absolute !important;
	bottom: var(--wp--custom--spacing--testimonial-block-end) !important;
	right: var(--wp--custom--spacing--testimonial-inline) !important;
	margin: 0 !important;
	text-align: right;
	font-family: var(--wp--preset--font-family--dm-sans);
	font-size: var(--wp--preset--font-size--large-plus);
	font-weight: 500;
	line-height: var(--wp--custom--line-height--snug);
	letter-spacing: var(--wp--custom--letter-spacing--extra-wide);
	text-transform: uppercase;
	color: var(--wp--preset--color--theme-03);
}

/* ==========================================================================
   Splide Arrow Touch Targets (WCAG 2.5.8 - min 44x44px)
   ========================================================================== */

.wp-block-kindling-carousel .splide__arrow {
	min-width: 2.75rem;
	min-height: 2.75rem;
}
