/* Making Modules Widget — hardcoded styles matching Figma */

/* Keep Elementor flex parents from expanding past the viewport (needed for tab scroll). */
.elementor-widget-making_modules_widget,
.elementor-widget-making_modules_widget > .elementor-widget-container {
	min-width: 0;
	max-width: 100%;
}

.making-modules-widget {
	--mmw-text: #161616;
	--mmw-border: #A8A8A8;
	--mmw-tab-bar: #F7F7F7;
	--mmw-hex-idle: #E0E0E0;
	--mmw-radius-image: 12px;
	--mmw-radius-panel: 12px;
	--mmw-radius-tab: 12px;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	color: var(--mmw-text);
}

.making-modules-widget__images {
	display: grid;
	margin-bottom: 32px;
	overflow: hidden;
}

.making-modules-widget__image-pair {
	grid-area: 1 / 1;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
	width: 100%;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateX(0);
	transition:
		opacity 0.4s ease,
		transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
		visibility 0.4s ease;
}

.making-modules-widget__image-pair.is-active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateX(0);
	z-index: 1;
}

.making-modules-widget__image-pair.is-from-right,
.making-modules-widget__panel.is-from-right {
	opacity: 0;
	visibility: visible;
	transform: translateX(40px);
	transition: none;
}

.making-modules-widget__image-pair.is-from-left,
.making-modules-widget__panel.is-from-left {
	opacity: 0;
	visibility: visible;
	transform: translateX(-40px);
	transition: none;
}

.making-modules-widget__image-pair.is-leave-to-left,
.making-modules-widget__panel.is-leave-to-left {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateX(-40px);
	z-index: 0;
}

.making-modules-widget__image-pair.is-leave-to-right,
.making-modules-widget__panel.is-leave-to-right {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateX(40px);
	z-index: 0;
}

.making-modules-widget__image {
	position: relative;
	overflow: hidden;
	border-radius: var(--mmw-radius-image);
	background: #f0f0f0;
	aspect-ratio: 16 / 10;
	border: 1px solid var(--mmw-border);
}

.making-modules-widget__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Tab bar */
.making-modules-widget__tabs-fade {
	position: relative;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin-bottom: 32px;
}

.making-modules-widget__tabs-scroller {
	width: 100%;
	max-width: 100%;
	min-width: 0;
}

.making-modules-widget__tabs {
	display: flex;
	flex-wrap: nowrap;
	align-items: stretch;
	gap: 0;
	width: 100%;
	padding: 0;
	background: var(--mmw-tab-bar);
	border-radius: var(--mmw-radius-tab) var(--mmw-radius-tab) 0 0;
}

/* Include `button` so this beats Elementor kit global button styles */
.making-modules-widget button.making-modules-widget__tab {
	appearance: none;
	-webkit-appearance: none;
	display: flex;
	flex: 1 1 0;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-width: 96px;
	margin: 0;
	padding: 16px 12px 14px;
	border: 0;
	border-style: none;
	border-width: 0;
	border-color: transparent;
	border-radius: var(--mmw-radius-tab) var(--mmw-radius-tab);
	background: transparent;
	background-color: transparent;
	box-shadow: none;
	color: var(--mmw-text);
	cursor: pointer;
	font: inherit;
	font-family: inherit;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	letter-spacing: inherit;
	text-align: center;
	text-decoration: none;
	transition: background-color 0.15s ease;
}

.making-modules-widget button.making-modules-widget__tab:hover,
.making-modules-widget button.making-modules-widget__tab:focus,
.making-modules-widget button.making-modules-widget__tab:active {
	background: transparent;
	background-color: transparent;
	box-shadow: none;
	border: 0;
	color: var(--mmw-text);
}

.making-modules-widget button.making-modules-widget__tab.is-active,
.making-modules-widget button.making-modules-widget__tab.is-active:hover,
.making-modules-widget button.making-modules-widget__tab.is-active:focus {
	background: #fff;
	background-color: #fff;
	box-shadow: none;
	border: 1px solid var(--mmw-border);
}

.making-modules-widget button.making-modules-widget__tab:focus-visible {
	outline: 2px solid #000;
	outline-offset: -2px;
	z-index: 1;
}

/* Hexagon icon badge: solid face + soft glow behind on active */
.making-modules-widget__hex {
	--mmw-hex-color: var(--mmw-hex-idle);
	--mmw-hex-clip: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
	position: relative;
	display: grid;
	place-items: center;
	width: 70px;
	height: 82px;
	flex-shrink: 0;
}

.making-modules-widget button.making-modules-widget__tab:not(.is-active) .making-modules-widget__hex {
	--mmw-hex-color: var(--mmw-hex-idle);
}

.making-modules-widget__hex-bg {
	position: absolute;
	inset: 0;
	width: 70px;
	height: 82px;
	background: var(--mmw-hex-color);
	opacity: 0.2;
	clip-path: var(--mmw-hex-clip);
	transform: scale(0);
	pointer-events: none;
	z-index: 0;
}

.making-modules-widget button.making-modules-widget__tab.is-active .making-modules-widget__hex-bg {
	transform: scale(1);
}

/* Bounce glow to final size when tab becomes active (triggered via .is-bouncing from JS) */
@keyframes mmw-hex-bounce {
	0% {
		transform: scale(0.55);
	}

	55% {
		transform: scale(1.12);
	}

	78% {
		transform: scale(0.96);
	}

	100% {
		transform: scale(1);
	}
}

.making-modules-widget__hex-bg.is-bouncing {
	animation: mmw-hex-bounce 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.making-modules-widget__hex-face {
	position: relative;
	z-index: 1;
	display: grid;
	place-items: center;
	width: 47px;
	height: 55px;
	background: var(--mmw-hex-color);
	clip-path: var(--mmw-hex-clip);
	transform: scale(1);
	transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.making-modules-widget button.making-modules-widget__tab:not(.is-active):hover .making-modules-widget__hex-face,
.making-modules-widget button.making-modules-widget__tab:not(.is-active):focus-visible .making-modules-widget__hex-face {
	transform: scale(1.08);
}

@media (prefers-reduced-motion: reduce) {
	.making-modules-widget button.making-modules-widget__tab:not(.is-active) .making-modules-widget__hex-face {
		transition: none;
	}

	.making-modules-widget button.making-modules-widget__tab:not(.is-active):hover .making-modules-widget__hex-face,
	.making-modules-widget button.making-modules-widget__tab:not(.is-active):focus-visible .making-modules-widget__hex-face {
		transform: none;
	}

	.making-modules-widget__hex-bg.is-bouncing {
		animation: none;
	}

	.making-modules-widget__hex-icon,
	.making-modules-widget__hex-icon i,
	.making-modules-widget__hex-icon svg,
	.making-modules-widget__hex-icon svg * {
		transition: none;
	}

	.making-modules-widget__image-pair,
	.making-modules-widget__panel {
		transition: none;
		transform: none;
	}

	.making-modules-widget__image-pair.is-from-right,
	.making-modules-widget__image-pair.is-from-left,
	.making-modules-widget__image-pair.is-leave-to-left,
	.making-modules-widget__image-pair.is-leave-to-right,
	.making-modules-widget__panel.is-from-right,
	.making-modules-widget__panel.is-from-left,
	.making-modules-widget__panel.is-leave-to-left,
	.making-modules-widget__panel.is-leave-to-right {
		transform: none;
		transition: none;
	}
}

.making-modules-widget__hex-icon {
	display: grid;
	place-items: center;
	width: 22px;
	height: 22px;
	color: #262626;
	line-height: 0;
	transition: color 0.3s ease;
}

.making-modules-widget button.making-modules-widget__tab.is-active .making-modules-widget__hex-icon {
	color: #fff;
}

.making-modules-widget button.making-modules-widget__tab.is-active.keep-icon-dark .making-modules-widget__hex-icon {
	color: #000;
}

.making-modules-widget__hex-icon i,
.making-modules-widget__hex-icon svg {
	display: block;
	width: 22px;
	height: 22px;
	font-size: 18px;
	color: inherit;
	transition: color 0.3s ease, fill 0.3s ease, stroke 0.3s ease;
}

/*
 * Recolor only existing fills/strokes.
 * Do not invent stroke on fill-only paths — that doubles the outline weight.
 */
.making-modules-widget__hex-icon svg [fill]:not([fill='none']) {
	fill: currentColor !important;
	transition: fill 0.3s ease;
}

.making-modules-widget__hex-icon svg [stroke]:not([stroke='none']) {
	stroke: currentColor !important;
	transition: stroke 0.3s ease;
}

.making-modules-widget__tab-label {
	color: rgba(22, 22, 22, 0.85);
	text-align: center;
	font-family: "Source Code Pro", monospace;
	font-size: clamp(18px, calc(1.5rem + ((1vw - 4.8px) * 0.6061)), 22px)
	font-style: normal;
	font-weight: 600;
	line-height: 120%;
	letter-spacing: 0;
	white-space: nowrap;
	transition: color 0.3s ease;
}

.making-modules-widget button.making-modules-widget__tab.is-active .making-modules-widget__tab-label {
	color: #161616;
}

/* Content panel */
.making-modules-widget__panels {
	display: grid;
	width: 100%;
	overflow: hidden;
}

.making-modules-widget__panel {
	grid-area: 1 / 1;
	display: grid;
	grid-template-columns: minmax(180px, 250px) 1fr;
	gap: 40px;
	align-items: stretch;
	padding: 48px;
	background: #fff;
	border-top: 0;
	border-radius: 24px;
	border: 1px solid var(--mmw-border);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateX(0);
	transition:
		opacity 0.4s ease,
		transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
		visibility 0.4s ease;
}

.making-modules-widget__panel.is-active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateX(0);
	z-index: 1;
}

.making-modules-widget__topic {
	display: flex;
	align-items: center;
	justify-content: center;
	align-self: center;
	min-width: 0;
}

.making-modules-widget__topic-icon {
	display: block;
	width: 100%;
	max-width: 250px;
	height: auto;
	min-height:250px;
}

.making-modules-widget__content {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
	min-width: 0;
	min-height: 100%;
}

.making-modules-widget__copy {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 24px;
}

.making-modules-widget__heading {
	margin: 0;
	font-family: "Source Sans Pro", var(--h2-font-family, sans-serif);
	font-size: 32px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.04em;
	color: var(--mmw-text);
}

.making-modules-widget__text {
	margin: 0;
	font-family: Sora;
	font-size: 18px;
	font-style: normal;
	font-weight: 400;
	line-height: 150%;
	letter-spacing: 0.25px;
	color: var(--mmw-text);
}

.making-modules-widget__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.making-modules-widget__tag {
	display: inline-flex;
	align-items: center;
	padding: 8px 14px;
	border: 1px solid var(--mmw-border);
	border-radius: 999px;
	background: #fff;
	font-family: "Sora", var(--text-font-family, sans-serif);
	font-size: 14px;
	font-weight: 400;
	line-height: 1.3;
	color: var(--mmw-text);
	white-space: nowrap;
}

/* Tablet */
@media screen and (max-width: 1024px) {
	.making-modules-widget__image-pair {
		gap: 16px;
	}

	.making-modules-widget__panel {
		grid-template-columns: minmax(140px, 200px) 1fr;
		gap: 28px;
		padding: 28px 32px;
	}

	.making-modules-widget__heading {
		font-size: 26px;
	}

	.making-modules-widget__text {
		font-size: 16px;
	}

	.making-modules-widget button.making-modules-widget__tab {
		min-width: 88px;
		padding: 14px 8px 12px;
		gap: 6px;
	}
}

/* Mobile */
@media screen and (max-width: 767px) {
	.making-modules-widget__images {
		margin-bottom: 16px;
	}

	.making-modules-widget__image-pair {
		grid-template-columns: 1fr 1fr;
		gap: 12px;
	}

	.making-modules-widget__image {
		aspect-ratio: 16 / 11;
	}

	.making-modules-widget__tabs-fade {
		margin-bottom: 16px;
	}

	.making-modules-widget__tabs-fade::before,
	.making-modules-widget__tabs-fade::after {
		content: '';
		position: absolute;
		top: 0;
		bottom: 0;
		width: 40px;
		pointer-events: none;
		z-index: 2;
		opacity: 0;
		transition: opacity 0.25s ease;
		background: var(--mmw-tab-bar);
	}

	.making-modules-widget__tabs-fade::before {
		left: 0;
		border-radius: 12px 0 0 0;
		-webkit-mask-image: linear-gradient(to right, var(--mmw-tab-bar) 0%, transparent 100%);
		mask-image: linear-gradient(to right, var(--mmw-tab-bar) 0%, transparent 100%);
	}

	.making-modules-widget__tabs-fade::after {
		right: 0;
		border-radius: 0 12px 0 0;
		-webkit-mask-image: linear-gradient(to left, var(--mmw-tab-bar) 0%, transparent 100%);
		mask-image: linear-gradient(to left, var(--mmw-tab-bar) 0%, transparent 100%);
	}

	.making-modules-widget__tabs-fade.has-left-fade::before,
	.making-modules-widget__tabs-fade.has-right-fade::after {
		opacity: 1;
	}

	.making-modules-widget__tabs-scroller {
		overflow-x: auto;
		overflow-y: hidden;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior-x: contain;
		scrollbar-width: none;
		-ms-overflow-style: none;
		cursor: grab;
	}

	.making-modules-widget__tabs-scroller::-webkit-scrollbar {
		display: none;
		height: 0;
	}

	.making-modules-widget__tabs-scroller.is-dragging {
		cursor: grabbing;
		scroll-behavior: auto;
		user-select: none;
	}

	.making-modules-widget__tabs {
		padding: 0 4px;
		border-radius: 12px;
		width: max-content;
		min-width: 100%;
		box-sizing: border-box;
	}

	.making-modules-widget button.making-modules-widget__tab {
		flex: 0 0 auto;
		flex-shrink: 0;
		min-width: 130px;
		padding: 12px 6px 10px;
	}

	.making-modules-widget__hex {
		width: 58px;
		height: 68px;
	}

	.making-modules-widget__hex-bg {
		width: 58px;
		height: 68px;
	}

	.making-modules-widget__hex-face {
		width: 40px;
		height: 47px;
	}

	.making-modules-widget__hex-icon,
	.making-modules-widget__hex-icon i,
	.making-modules-widget__hex-icon svg {
		width: 18px;
		height: 18px;
		font-size: 14px;
	}

	.making-modules-widget__panel {
		grid-template-columns: 1fr;
		gap: 0px;
		padding: 24px 20px;
		border-radius: 12px;
	}

	.making-modules-widget__topic-icon {
		max-width: 200px !important;
		margin: 0 auto;
	}

	.making-modules-widget__heading {
		font-size: 22px;
	}

	.making-modules-widget__text {
		font-size: 15px;
	}

	.making-modules-widget__tag {
		font-size: 13px;
		padding: 7px 12px;
		white-space: normal;
	}
}
