/**
 * Patient Slider Block Styles
 *
 * @package made-to-thrive-2026-base
 * @since 1.0.0
 */

/* Screen reader text for accessibility */
.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	position: absolute !important;
	height: 1px;
	width: 1px;
	overflow: hidden;
	word-wrap: normal !important;
}

/* Preview Image - ensure it displays in editor */
.wp-block-cwp-patient-slider figure,
.block-editor-block-list__block figure,
[data-type="cwp/patient-slider"] figure {
	margin: 0 !important;
	padding: 0 !important;
	width: 100% !important;
	display: block !important;
	line-height: 0 !important;
	background: transparent !important;
}

.wp-block-cwp-patient-slider figure img,
.block-editor-block-list__block figure img,
[data-type="cwp/patient-slider"] figure img {
	width: 100% !important;
	height: auto !important;
	display: block !important;
	max-width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	background: transparent !important;
}

/* Ensure block wrapper doesn't interfere with preview */
[data-type="cwp/patient-slider"]:not(.has-child-selected) figure {
	min-height: auto !important;
	height: auto !important;
}

/* Editor-specific: prevent white box from slider styles */
.block-editor-block-preview [data-type="cwp/patient-slider"] .patient-slider,
.block-editor-block-preview [data-type="cwp/patient-slider"] .patient-slider-container {
	min-height: auto !important;
	height: auto !important;
}

/* Patient Slider Container */
.patient-slider {
	width: 100%;
	padding: 100px 0 100px 8%;
}

.patient-slider-container {
	max-width: 100%;
	margin: 0 auto;
	width: 100%;
	display: grid;
	grid-template-columns: 286px 1fr;
	gap: 7%;
}

/* Content Section (Left) */
.patient-slider-content {
	min-width: 0;
	max-width: 286px;
	display: table;
	padding-bottom: 30px;
}
.patient-slider-content .in {
	display: table-cell;
	vertical-align: middle;
}

/* Title */
.patient-slider-title {
	margin: 0 0 20px;
	padding: 0;
	font-size: 46px;
	line-height: 54px;
	font-weight: 100;
}

/* Title with font size override - use CSS custom property from block wrapper */
.patient-slider[style*="--patient-slider-font-size"] .patient-slider-title,
.patient-slider.has-extra-small-font-size .patient-slider-title,
.patient-slider.has-small-font-size .patient-slider-title,
.patient-slider.has-medium-font-size .patient-slider-title,
.patient-slider.has-large-font-size .patient-slider-title,
.patient-slider.has-x-large-font-size .patient-slider-title,
.patient-slider.has-xx-large-font-size .patient-slider-title,
.patient-slider.has-56px-font-size .patient-slider-title,
.patient-slider.has-24px-font-size .patient-slider-title {
	font-size: var(--patient-slider-font-size, 2rem);
}

/* Copy */
.patient-slider-copy {
	margin: 0 0 2rem 0;
	padding: 0;
	font-size: 1rem;
	line-height: 1.6;
}

/* Copy with font size override - use CSS custom property from block wrapper */
.patient-slider[style*="--patient-slider-font-size"] .patient-slider-copy,
.patient-slider.has-extra-small-font-size .patient-slider-copy,
.patient-slider.has-small-font-size .patient-slider-copy,
.patient-slider.has-medium-font-size .patient-slider-copy,
.patient-slider.has-large-font-size .patient-slider-copy,
.patient-slider.has-x-large-font-size .patient-slider-copy,
.patient-slider.has-xx-large-font-size .patient-slider-copy,
.patient-slider.has-56px-font-size .patient-slider-copy,
.patient-slider.has-24px-font-size .patient-slider-copy {
	font-size: var(--patient-slider-font-size, 1rem);
}

.patient-slider-copy p {
	margin: 0 0 20px;
	font-size: 17px;
	line-height: 27px;
}

.patient-slider-copy p:last-child {
	margin-bottom: 0;
}

/* Button */
.patient-slider-button {
	display: inline-flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.875rem 30px;
	background-color: var(--button-bg-color, #013D36);
	color: #ffffff!important;
	text-decoration: none;
	border-radius: 30px;
	font-size: 14px;
	font-weight: 100;
	transition: background-color 0.3s ease, transform 0.2s ease, outline 0.2s ease;
	border: none;
	cursor: pointer;
	white-space: nowrap;
	text-transform: uppercase;
	letter-spacing: 0.1rem;
	height: 57px;
}

/* Button with font size override - use CSS custom property from block wrapper */
.patient-slider[style*="--patient-slider-font-size"] .patient-slider-button,
.patient-slider.has-extra-small-font-size .patient-slider-button,
.patient-slider.has-small-font-size .patient-slider-button,
.patient-slider.has-medium-font-size .patient-slider-button,
.patient-slider.has-large-font-size .patient-slider-button,
.patient-slider.has-x-large-font-size .patient-slider-button,
.patient-slider.has-xx-large-font-size .patient-slider-button,
.patient-slider.has-56px-font-size .patient-slider-button,
.patient-slider.has-24px-font-size .patient-slider-button {
	font-size: var(--patient-slider-font-size, 1rem);
}

.patient-slider-button:hover,
.patient-slider-button:focus {
	background:#6B7861;
}

.patient-slider-button:active {
	transform: translateY(0);
}

.patient-slider-button:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 3px;
}

/* Button Icon Wrapper */
.patient-slider-button-icon-wrapper {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

/* Button Icon */
.patient-slider-button-icon {
	width: 1.25rem;
	height: 1.25rem;
	object-fit: contain;
	display: inline-block;
}

.patient-slider-button-icon.fa-regular,
.patient-slider-button-icon.fa-solid {
	font-size: 1.25rem;
	line-height: 1;
	width: auto;
	height: auto;
}

/* Button Text */
.patient-slider-button-text {
	white-space: nowrap;
}

/* Slider Section (Right) */
.patient-slider .patient-slider-container .patient-slider-slider,
.patient-slider-slider {
	flex: 1 1 auto !important;
	min-width: 0 !important;
	max-width: 100%;
	width: 100% !important;
	display: block !important;
	position: relative !important;
}

/* Swiper Container */
.patient-slider-swiper {
	width: 100%;
	position: relative;
	padding-bottom: 50px!important;
}

/* Swiper Wrapper */
.patient-slider-swiper .swiper-wrapper {
	display: flex;
	align-items: stretch;
}

/* Swiper Slide */
.patient-slider-swiper .swiper-slide {
	position: relative;
	width: 100%;
	aspect-ratio: 3 / 5;
}

/* Safari fallback for aspect-ratio using padding-bottom technique */
@supports not (aspect-ratio: 3 / 5) {
	.patient-slider-swiper .swiper-slide {
		height: 0;
		padding-bottom: 166.67%; /* 5/3 = 1.6667 = 166.67% */
		display: block;
	}
	
	.patient-slider-swiper .swiper-slide .patient-slider-slide {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		display: flex;
		align-items: stretch;
	}
}

/* Modern browsers with aspect-ratio support */
@supports (aspect-ratio: 3 / 5) {
	.patient-slider-swiper .swiper-slide {
		display: flex;
		align-items: stretch;
	}
}

/* Image */
.patient-slider-image {
	width: 100%;
	height: 100%;
	display: block;
	border-radius: 12px;
	overflow: hidden;
	position: absolute;
	top: 0;
	left: 0;
	transition: opacity 0.5s ease, visibility 0.5s ease;
	z-index: 1;
}

.patient-slider-image.hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.patient-slider-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
}

/* Video */
.patient-slider-video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
	border-radius: 12px;
	position: absolute;
	top: 0;
	left: 0;
	cursor: pointer;
	z-index: 2;
	transition: opacity 0.5s ease, visibility 0.5s ease;
	background-color: #000000;
}

.patient-slider-video.hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.patient-slider-slide {
	position: relative;
	width: 100%;
	height: 100%;
}

/* Ensure slide has proper aspect ratio - fallback for when aspect-ratio is on swiper-slide */
@supports not (aspect-ratio: 3 / 5) {
	.patient-slider-slide {
		min-height: 400px;
	}
}

/* Custom cursor on slider hover */
.patient-slider-slider {
	cursor: none;
}

.patient-slider-custom-cursor {
	position: absolute;
	width: 54px;
	height: 54px;
	pointer-events: none;
	z-index: 100;
	transform: translate(-50%, -50%);
	background-image: url('../../assets/images/arrow-right.png');
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	opacity: 0;
	transition: opacity 0.15s ease;
}

.patient-slider-custom-cursor.is-visible {
	opacity: 1;
}

/* Sound toggle button */
.patient-slider-video-toggle {
	position: absolute;
	left: 0.85rem;
	right: 0.85rem;
	bottom: 0.85rem;
	z-index: 3;
	border: 0;
	border-radius: 999px;
	padding: 0.55rem 0.85rem;
	font-size: 0.9rem;
	line-height: 1.1;
	cursor: pointer;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	backdrop-filter: blur(6px);
	display: none;
}

.patient-slider-video-toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.swiper-slide-active .patient-slider-video-toggle {
	display: block;
}

.patient-slide-is-unmuted .patient-slider-video-toggle {
	background: rgba(0, 0, 0, 0.7);
}

/* Pagination */
.patient-slider-pagination {
	bottom: 0!important;
}

.patient-slider-pagination .swiper-pagination-bullet {
	width: 4px;
	height: 4px;
	background-color: #013D36;
	opacity: 1;
	transition: opacity 0.3s ease, background-color 0.3s ease, transform 0.2s ease;
	cursor: pointer;
}

.patient-slider-pagination .swiper-pagination-bullet-active {
	opacity: 1;
	background-color: #013D36;
	width: 7px;
	height: 7px;
	margin-bottom: -1px!important;
}

.patient-slider-pagination .swiper-pagination-bullet:hover,
.patient-slider-pagination .swiper-pagination-bullet:focus {
	opacity: 0.8;
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 1024px) {
	.patient-slider-container {
		gap: 2rem;
	}

	.patient-slider-title {
	}
}

@media (max-width: 768px) {
	.patient-slider {
		padding: 1.5rem 0 1.5rem 1.5rem;
	}

	.patient-slider-container {
		flex-direction: column-reverse;
		gap: 2rem;
		display: flex;
	}

	.patient-slider-content {
		width: 100%;
		max-width: 100%;
	}

	.patient-slider-slider {
		width: 100% !important;
		max-width: 100% !important;
		flex: 1 1 100% !important;
	}

	.patient-slider-slide {
		min-height: 300px;
	}

	.patient-slider-title {
	}

	.patient-slider-copy {
		margin-bottom: 1.5rem;
		font-size: 0.9375rem;
	}

	.patient-slider-button {
		width: 100%;
		justify-content: center;
	}
}

@media (max-width: 500px) {
	.patient-slider {
		padding: 1rem;
	}

	.patient-slider-container {
		gap: 1.5rem;
	}

	.patient-slider-title {
		font-size: 30px;
		line-height: 38px;
	}

	.patient-slider-copy {
		font-size: 17px;
		margin-bottom: 1rem;
	}

	.patient-slider-button {
		font-size: 0.9375rem;
		width: auto;
		margin-top: 20px;
	}

	.patient-slider-pagination {
		margin-top: 1rem;
	}
	.patient-slider-content {
		padding:0 30px 40px;
	}
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
	.patient-slider-button {
		transition: none;
	}

	.patient-slider-pagination .swiper-pagination-bullet {
		transition: none;
	}

	.patient-slider-image,
	.patient-slider-video {
		transition: none;
	}
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
	.patient-slider-button {
		border: 2px solid currentColor;
	}

	.patient-slider-pagination .swiper-pagination-bullet {
		border: 2px solid currentColor;
	}

	.patient-slider-pagination .swiper-pagination-bullet-active {
		border-width: 3px;
	}
}

/* Print Styles */
@media print {
	.patient-slider {
		background-color: #f5f5f5;
		padding: 1rem;
	}

	.patient-slider-container {
		flex-direction: column;
	}

	.patient-slider-button {
		background-color: #000000;
		color: #ffffff;
		border: 1px solid #000000;
		page-break-inside: avoid;
	}

	.patient-slider-pagination {
		display: none;
	}

	.patient-slider-swiper .swiper-slide {
		page-break-inside: avoid;
		margin-bottom: 1rem;
	}
}

