/**
 * Daily Edits Toggle block styles.
 *
 * @package made-to-thrive-2026-base
 */

/* -------------------------------------------------------------------------
   Block wrapper
   ------------------------------------------------------------------------- */

.mtt-daily-edits-toggle {
	--mtt-det-block-bg: var(--wp--preset--color--primary, #4B5D32);
	--mtt-det-content-max: 1127px;
	--mtt-det-gap: clamp(0.75rem, 2vw, 1.5rem);
	--mtt-det-tab-width: 102px;
	align-items: center;
	background-color: var(--mtt-det-block-bg);
	box-sizing: border-box;
	color: var(--wp--preset--color--white, #FFFFFF);
	display: flex;
	flex-direction: column;
	padding: clamp(1.25rem, 3vw, 2.5rem);
	position: relative;
	width: 100%;
}

.mtt-daily-edits-toggle *,
.mtt-daily-edits-toggle *::before,
.mtt-daily-edits-toggle *::after {
	box-sizing: border-box;
}

.mtt-det__preview {
	margin: 0;
}

.mtt-det__empty {
	margin: 0;
	padding: 1rem;
	text-align: center;
}

/* -------------------------------------------------------------------------
   Header
   ------------------------------------------------------------------------- */

.mtt-det__header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    justify-content: space-between;
    margin: 19px 0 25px;
    max-width: var(--mtt-det-content-max);
    width: 100%;
}

.mtt-det__header .wp-block-heading {
	color: inherit;
	margin: 0;
}

.mtt-det__header .wp-block-button {
	margin: 0;
}

.mtt-det__header .wp-block-button__link {
	border-color: currentColor;
	color: inherit;
}

/* -------------------------------------------------------------------------
   Body layout
   ------------------------------------------------------------------------- */

.mtt-det__body {
	align-items: stretch;
	display: grid;
	gap: var(--mtt-det-gap);
	grid-template-columns: minmax(8rem, 1fr) minmax(0, 2fr);
	margin-bottom: 50px;
	max-width: var(--mtt-det-content-max);
	position: relative;
	width: 100%;
}

/* -------------------------------------------------------------------------
   Tab navigation
   ------------------------------------------------------------------------- */

.mtt-det__tabs {
	display: flex;
	flex-direction: column;
	gap: 25px;
	height: 100%;
	left: calc(50% - 50vw);
	list-style: none;
	margin: 0;
	padding: 0;
	position: absolute;
	top: 0;
	width: var(--mtt-det-tab-width);
	z-index: 1;
}

.mtt-det__tab {
	align-items: center;
	appearance: none;
	background-color: var(--mtt-det-block-bg);
	border: 0;
	box-shadow: 2px 0 6px rgba(0, 0, 0, 0.2);
	color: inherit;
	cursor: pointer;
	display: flex;
	font-family: var(--wp--preset--font-family--source-sans-3, "Source Sans 3", sans-serif);
	font-size: clamp(0.75rem, 1.5vw, 0.875rem);
	font-weight: 700;
	height: 48px;
	justify-content: center;
	letter-spacing: 0.04em;
	line-height: 1;
	min-height: 48px;
	padding: 0;
	text-align: center;
	transition: background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
	width: 102px;
}

.mtt-det__tab.is-active,
.mtt-det__tab[aria-selected="true"] {
	background-color: var(--wp--preset--color--ivory, #FFFBF8);
	box-shadow: 2px 0 8px rgba(0, 0, 0, 0.25);
	color: var(--wp--preset--color--espresso, #4C3600);
}

.mtt-det__tab:hover {
	background-color: #677b47;
	box-shadow: 2px 0 8px rgba(0, 0, 0, 0.25);
	color: var(--wp--preset--color--white, #FFFFFF);
}

.mtt-det__tab:focus-visible {
	outline: 2px solid var(--wp--preset--color--white, #FFFFFF);
	outline-offset: 2px;
}

.mtt-det__tab-label {
	display: block;
}

/* -------------------------------------------------------------------------
   Hero column
   ------------------------------------------------------------------------- */

.mtt-det__hero-col {
	align-self: stretch;
	min-height: 0;
	position: relative;
}

.mtt-det__hero {
	height: 100%;
	margin: 0;
	min-height: clamp(16rem, 40vw, 28rem);
}

.mtt-det__hero-link {
	display: block;
	height: 100%;
	text-decoration: none;
}

.mtt-det__hero-image {
	display: block;
	height: 560px;
	object-fit: cover;
	transition: filter 0.3s ease;
	width: 100%;
}

.mtt-det__hero-image:hover {
	filter: brightness(0.85);
}

/* -------------------------------------------------------------------------
   Products column
   ------------------------------------------------------------------------- */

.mtt-det__products-col {
	min-width: 0;
}

.mtt-det__panel[hidden] {
	/* Keep layout width so LTK/ShopMy widgets can measure while inactive.
	   display:none collapses width to 0 and leaves the slider showing one image. */
	display: block !important;
	height: 0 !important;
	margin: 0 !important;
	min-height: 0 !important;
	overflow: hidden !important;
	padding: 0 !important;
	pointer-events: none;
	visibility: hidden;
}

.mtt-det__panel.is-active,
.mtt-det__panel:not([hidden]) {
	height: auto !important;
	overflow: visible;
	pointer-events: auto;
	visibility: visible;
}

.mtt-det__products-card {
    background-color: #FFFBF8;
    border-radius: 0;
    color: var(--wp--preset--color--espresso, #4C3600);
    min-height: 560px;
    overflow: visible;
    padding: clamp(0.75rem, 2vw, 1.25rem);
    padding-right: clamp(2.5rem, 4vw, 3rem);
    position: relative;
}

.mtt-det__swiper {
	height: 100%;
	overflow: hidden;
	width: 100%;
}

.mtt-det__swiper--grid {
	min-height: calc(430px + clamp(0.35rem, 1vw, 0.65rem));
}

.mtt-det__swiper--grid .mtt-det__slide {
	height: auto;
}

.mtt-det__swiper--grid .mtt-det__grid-item {
	height: 100%;
}

.mtt-det__slide {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	height: auto;
}

.mtt-det__grid {
	display: grid;
	gap: clamp(0.35rem, 1vw, 0.65rem);
	grid-template-columns: repeat(4, minmax(0, 1fr));
	list-style: none;
	margin: 0;
	padding: 0;
}

.mtt-det__grid-item {
	margin: 0;
	min-width: 0;
}

.mtt-det__grid-link {
	align-items: center;
	display: flex;
	height: 215px;
	justify-content: center;
	overflow: hidden;
	text-decoration: none;
}

.mtt-det__grid-image {
	display: block;
	height: 100%;
	object-fit: contain;
	object-position: center;
	transition: transform 0.3s ease;
	width: 100%;
}

.mtt-det__grid-image:hover {
	transform: scale(1.06);
}

.mtt-det__product-links {
    border-top: 1px solid #E5E5E5;
    color: var(--wp--preset--color--espresso, #4C3600);
    font-family: var(--wp--preset--font-family--source-sans-3);
    font-size: 16px;
    line-height: 25px;
    margin: 0;
    padding-top: 20px;
    text-align: center;
}

.mtt-det__product-links a {
    color: #4C3600!important;
    font-size: 16px;
    letter-spacing: 0;
	text-decoration: none;
}

.mtt-det__product-links a:hover,
.mtt-det__product-links a:focus-visible {
	text-decoration: underline;
}

.mtt-det__product-links a:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary, #4B5D32);
	outline-offset: 2px;
}

.mtt-det__shopmy,
.mtt-det__ltk {
	min-height: 12rem;
	width: 100%;
}

.mtt-det__shopmy iframe,
.mtt-det__ltk iframe {
	max-width: 100%;
}

.mtt-det__no-products {
	font-size: 0.875rem;
	margin: 0;
	padding: 1rem 0;
	text-align: center;
}

/* -------------------------------------------------------------------------
   Next button
   ------------------------------------------------------------------------- */

.mtt-det__next {
	align-items: center;
	appearance: none;
	background: #FFFBF8;
	border: 0;
	border-radius: 50%;
	box-shadow: none;
	color: var(--wp--preset--color--espresso, #4C3600);
	cursor: pointer;
	display: flex;
	height: 61px;
	justify-content: center;
	min-height: 61px;
	min-width: 61px;
	padding: 0;
	position: absolute;
	right: -30.5px;
	top: 50%;
	transform: translateY(-50%);
	transition: transform 0.2s ease;
	width: 61px;
	z-index: 2;
}

.mtt-det__next[hidden] {
	display: none;
}

.mtt-det__next:hover,
.mtt-det__next:focus-visible {
	box-shadow: none;
	transform: translateY(-50%);
}

.mtt-det__next:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary, #4B5D32);
	outline-offset: 2px;
}

.mtt-det__next-icon {
	display: block;
	line-height: 0;
}

.mtt-det__next-icon svg {
	display: block;
	height: 11.124px;
	width: 26.749px;
}

/* -------------------------------------------------------------------------
   Editor
   ------------------------------------------------------------------------- */

.mtt-daily-edits-toggle.is-editor .mtt-det__header {
	pointer-events: auto;
}

.mtt-det-editor__selected-list {
	list-style: none;
	margin: 0 0 1rem;
	padding: 0;
}

.mtt-det-editor__selected-item {
	align-items: center;
	display: flex;
	gap: 0.5rem;
	justify-content: space-between;
	margin-bottom: 0.35rem;
}

/* -------------------------------------------------------------------------
   Reduced motion
   ------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.mtt-det__tab,
	.mtt-det__next,
	.mtt-det__hero-image,
	.mtt-det__grid-image {
		transition: none;
	}

	.mtt-det__hero-image:hover {
		filter: none;
	}

	.mtt-det__grid-image:hover {
		transform: none;
	}
}

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */

@media (max-width: 1280px) {
	.mtt-daily-edits-toggle {
		--mtt-det-content-max: 975px;
	}
	.mtt-det__swiper--grid {
		min-height: 390px;
	}

	.mtt-det__grid-link {
		height: 185px;
	}
}

@media (max-width: 1180px) {
	.mtt-det__body {
		display: block;
		max-width: 500px;
	}

	.mtt-det__hero-col {
		margin-bottom: var(--mtt-det-gap);
	}

	.mtt-det__hero-image {
		display: block;
		height: 685px;
		margin: 0 auto 40px;
		max-width: 100%;
		object-fit: cover;
		transition: filter 0.3s ease;
		width: 450px;
	}

	.mtt-det__swiper--grid {
		min-height: 185px;
	}

	.mtt-det__next {
		left: 0;
		margin: auto;
		right: 0;
		top: -28px;
		transform: none;
	}

	.mtt-det__next:hover,
	.mtt-det__next:focus-visible {
		transform: none;
	}
	.mtt-det__products-card {
		height:auto;
		padding: 20px 0;
		min-height: auto;
	}
	.mtt-det__header {
		flex-direction: column;
		text-align: center;
		gap: 30px;
	}
}

@media (max-width: 880px) {
	.mtt-daily-edits-toggle:not(.is-editor) .mtt-det__header {
		display: contents;
	}

	.mtt-daily-edits-toggle:not(.is-editor) .mtt-det__header .wp-block-heading {
		margin: 19px 0 25px;
		order: 1;
	}

	.mtt-daily-edits-toggle:not(.is-editor) .mtt-det__body {
		order: 2;
	}

	.mtt-daily-edits-toggle:not(.is-editor) .mtt-det__header .wp-block-button {
		margin-bottom: 30px;
		margin-top: 0;
		order: 3;
	}
}

@media (max-width: 680px) {
	.mtt-det__tab {
		width: 55px;
	}

	.mtt-det__hero-image {
		height: 558px;
		width: 335px;
	}
}

@media (max-width: 460px) {
	.mtt-det__tabs {
		gap: 10px;
	}

	.mtt-det__hero-image {
		height: 454px;
		width: 270px;
	}
}
