/**
 * Posts Horizontal Slider V2 block styles.
 *
 * @package made-to-thrive-2026-base
 */

.mtt-posts-horizontal-slider-v2 {
	width: 100%;
}

.mtt-phsv2__inner {
	width: 100%;
	max-width: 95%;
    margin: 50px auto 70px;
}

/* -------------------------------------------------------------------------
   Header — left title + top-right button (stack on mobile)
   ------------------------------------------------------------------------- */

.mtt-phsv2__header {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: flex-start;
	gap: 1rem;
	margin-bottom: clamp(1.25rem, 3vw, 2rem);
	padding: clamp(0.5rem, 2vw, 1rem) 0;
	text-align: left;
}

.mtt-phsv2__header > .wp-block-heading {
	margin: 0;
	width: 100%;
	text-align: center;
}

.mtt-phsv2__header > .wp-block-button {
	align-self: center;
	position: static;
	margin: 0;
}

.mtt-phsv2__header .wp-block-button__link {
	background: transparent;
	color: inherit;
	font-family: var(--wp--preset--font-family--source-sans-3, "Source Sans 3", sans-serif);
}

.mtt-phsv2__header .wp-block-button__link:hover,
.mtt-phsv2__header .wp-block-button__link:focus-visible {
	background: currentColor;
	color: var(--wp--preset--color--white, #fff);
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

@media (min-width: 769px) {
	.mtt-phsv2__header {
		min-height: 4rem;
		padding-right: 0;
	}

	.mtt-phsv2__header > .wp-block-button {
		align-self: auto;
		position: absolute;
		top: 50%;
		right: 0;
		transform: translateY(-50%);
	}
}

@media (max-width: 768px) {
	.mtt-phsv2__inner {
		padding-bottom: 3.5rem;
		position: relative;
	}

	.mtt-phsv2__header {
		position: static;
	}

	.mtt-phsv2__header > .wp-block-button {
		bottom: -35px;
		left: 50%;
		position: absolute;
		right: auto;
		top: auto;
		transform: translateX(-50%);
	}
}

/* -------------------------------------------------------------------------
   Empty state
   ------------------------------------------------------------------------- */

.mtt-phsv2__empty {
	margin: 0;
	font-family: var(--wp--preset--font-family--source-sans-3, "Source Sans 3", sans-serif);
	font-size: 0.875rem;
}

/* -------------------------------------------------------------------------
   Editor — horizontal flex row (no Swiper in dashboard)
   ------------------------------------------------------------------------- */

.mtt-posts-horizontal-slider-v2.is-editor .mtt-phsv2__editor-track {
	display: flex;
	flex-wrap: nowrap;
	gap: 0.75rem;
	overflow-x: auto;
	padding-bottom: 0.5rem;
	scrollbar-width: thin;
}

.mtt-posts-horizontal-slider-v2.is-editor .mtt-phsv2__editor-slide {
	flex: 0 0 calc(100% / 5);
	min-width: 5rem;
}

.mtt-posts-horizontal-slider-v2.seven-slides.is-editor .mtt-phsv2__editor-slide {
	flex: 0 0 calc(100% / 7);
}

.mtt-posts-horizontal-slider-v2.is-editor .mtt-phsv2__editor-note {
	margin: 0 0 1rem;
	font-size: 0.8125rem;
	color: #757575;
}

.mtt-posts-horizontal-slider-v2.is-editor .mtt-phsv2__editor-slide-image-wrap {
	display: block;
	width: 100%;
	overflow: hidden;
	border: 1px solid currentColor;
	box-sizing: border-box;
}

.mtt-posts-horizontal-slider-v2.is-editor .mtt-phsv2__editor-slide-image {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 8 / 11;
	object-fit: cover;
	object-position: center;
	border: none;
}

.mtt-posts-horizontal-slider-v2.is-editor .mtt-phsv2__editor-slide-image--empty {
	display: block;
	width: 100%;
	aspect-ratio: 8 / 11;
	height: auto;
	background: rgba(0, 0, 0, 0.08);
}

.mtt-phsv2__preview {
	margin: 0;
}

.mtt-phsv2__preview img {
	display: block;
	width: 100%;
	height: auto;
}

/* -------------------------------------------------------------------------
   Frontend Swiper
   ------------------------------------------------------------------------- */

.mtt-phsv2__slider-wrap {
	width: 100%;
}

.mtt-phsv2__swiper {
	width: 100%;
	overflow: hidden;
	height: auto !important;
}

.mtt-phsv2__swiper:not(.swiper-initialized) .swiper-wrapper {
	display: flex;
	flex-wrap: nowrap;
	gap: 1rem;
}

.mtt-phsv2__swiper:not(.swiper-initialized) .swiper-slide {
	flex: 0 0 calc(100% / 5);
	min-width: 0;
}

.mtt-posts-horizontal-slider-v2.seven-slides .mtt-phsv2__swiper:not(.swiper-initialized) .swiper-slide {
	flex: 0 0 calc(100% / 7);
}

.mtt-phsv2__swiper .swiper-wrapper {
	align-items: flex-start;
}

.mtt-phsv2__swiper .swiper-slide {
	height: auto !important;
}

.mtt-phsv2__slide {
	height: auto;
}

.mtt-phsv2__card-link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.mtt-phsv2__card-link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 4px;
}

.mtt-phsv2__card-image-wrap {
	display: block;
	margin: 0;
	width: 100%;
	overflow: hidden;
	border: none;
	box-sizing: border-box;
}

.mtt-phsv2__card-image-wrap .mtt-phsv2__card-image,
.mtt-phsv2__card-image-wrap img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 8 / 11;
	object-fit: cover;
	object-position: center;
	margin: 0;
	padding: 0;
	border: 0;
	box-sizing: border-box;
	transition: transform 0.2s ease;
}

.mtt-phsv2__card-image--placeholder {
	display: block;
	width: 100%;
	aspect-ratio: 8 / 11;
	height: auto;
	background: rgba(255, 255, 255, 0.12);
}

.mtt-phsv2__card-link:hover .mtt-phsv2__card-image-wrap .mtt-phsv2__card-image,
.mtt-phsv2__card-link:hover .mtt-phsv2__card-image-wrap img,
.mtt-phsv2__card-link:focus-visible .mtt-phsv2__card-image-wrap .mtt-phsv2__card-image,
.mtt-phsv2__card-link:focus-visible .mtt-phsv2__card-image-wrap img {
	transform: scale(1.02);
}

/* -------------------------------------------------------------------------
   Custom scrollbar
   ------------------------------------------------------------------------- */

.mtt-posts-horizontal-slider-v2 .mtt-phsv2__scrollbar,
.mtt-posts-horizontal-slider-v2 .swiper-horizontal > .swiper-scrollbar,
.mtt-posts-horizontal-slider-v2 .swiper-scrollbar.swiper-scrollbar-horizontal {
	position: relative;
	left: 0;
	right: auto;
	bottom: auto;
	width: 100%;
	max-width: 352px;
	margin: 66px auto 0;
	height: 1px;
	background: currentColor;
	border-radius: 0;
}

.mtt-phsv2__scrollbar.swiper-scrollbar {
	opacity: 1 !important;
}

.mtt-phsv2__scrollbar .swiper-scrollbar-drag {
	top: -12px;
	height: 24px;
	width: 24px !important;
	margin-top: -0.4375rem;
	background-color: #fffbf8;
	border: 1px solid currentColor;
	border-radius: 50%;
	cursor: grab;
	box-sizing: border-box;
}

.mtt-phsv2__scrollbar .swiper-scrollbar-drag::after {
	content: "";
	position: absolute;
	top: calc(100% + 11px);
	left: 50%;
	transform: translateX(-50%);
	width: 19.965px;
	height: 7.748px;
	background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2219.965%22%20height%3D%227.748%22%20viewBox%3D%220%200%2019.965%207.748%22%3E%3Cg%20id%3D%22Group_88%22%20data-name%3D%22Group%2088%22%20transform%3D%22translate%28-531.742%20-1272.126%29%22%3E%3Cg%20id%3D%22arrow-right-svgrepo-com_1_%22%20data-name%3D%22arrow-right-svgrepo-com%20%281%29%22%20transform%3D%22translate%28521.399%201248.48%29%22%3E%3Cpath%20id%3D%22Path_317%22%20data-name%3D%22Path%20317%22%20d%3D%22M44%2C31.04l3.52-3.52L44%2C24%22%20transform%3D%22translate%28-17.919%29%22%20fill%3D%22none%22%20stroke%3D%22%234d3700%22%20stroke-width%3D%221%22%2F%3E%3Cline%20id%3D%22Line_21%22%20data-name%3D%22Line%2021%22%20x1%3D%2217.276%22%20transform%3D%22translate%2812%2027.585%29%22%20fill%3D%22none%22%20stroke%3D%22%234d3700%22%20stroke-width%3D%221%22%2F%3E%3C%2Fg%3E%3Cg%20id%3D%22arrow-right-svgrepo-com_1_2%22%20data-name%3D%22arrow-right-svgrepo-com%20%281%29%22%20transform%3D%22translate%28562.051%201303.52%29%20rotate%28180%29%22%3E%3Cpath%20id%3D%22Path_317-2%22%20data-name%3D%22Path%20317%22%20d%3D%22M44%2C31.04l3.52-3.52L44%2C24%22%20transform%3D%22translate%28-17.919%29%22%20fill%3D%22none%22%20stroke%3D%22%234d3700%22%20stroke-width%3D%221%22%2F%3E%3Cline%20id%3D%22Line_21-2%22%20data-name%3D%22Line%2021%22%20x1%3D%2217.276%22%20transform%3D%22translate%2812%2027.585%29%22%20fill%3D%22none%22%20stroke%3D%22%234d3700%22%20stroke-width%3D%221%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	pointer-events: none;
}

.mtt-phsv2__scrollbar .swiper-scrollbar-drag:active {
	cursor: grabbing;
}

/* -------------------------------------------------------------------------
   Editor — post picker
   ------------------------------------------------------------------------- */

.mtt-phsv2__selected-list {
	margin: 0.75rem 0 0;
	padding: 0;
	list-style: none;
}

.mtt-phsv2__selected-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.375rem 0;
	border-bottom: 1px solid #e0e0e0;
}

.mtt-phsv2__selected-item > span {
	flex: 1;
	min-width: 0;
}

.mtt-phsv2__selected-actions {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	gap: 0.125rem;
}

.mtt-phsv2__selected-item:last-child {
	border-bottom: none;
}

@media (prefers-reduced-motion: reduce) {
	.mtt-phsv2__card-image-wrap .mtt-phsv2__card-image,
	.mtt-phsv2__card-image-wrap img {
		transition: none;
	}
}
