/**
 * Text and Image Module
 */

/* ==========================================================================
   Section wrapper
   ========================================================================== */

.text-and-image {
	padding-left: 0;
	padding-right: 0;
}

.text-and-image__header {
	max-width: 1200px;
	margin: 0 auto 20px;
	padding: 0;

	@media (min-width: 960px) {
		margin-bottom: 30px;
	}
}

/* ==========================================================================
   Two-column layout
   ========================================================================== */

.text-and-image__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0;

	@media (min-width: 960px) {
		flex-direction: row;
		align-items: center;
	}
}

.text-and-image__image {
	position: relative;
	width: 100%;
	flex: 0 0 100%;

	@media (min-width: 960px) {
		width: 50%;
		flex: 0 0 50%;
	}
}

.text-and-image__text {
	width: 100%;
	flex: 0 0 100%;

	@media (min-width: 960px) {
		width: 50%;
		flex: 0 0 50%;
	}
}

/* ==========================================================================
   Text placement — column ordering
   ========================================================================== */

/* Text on left: text first, image second */
.text-and-image--left .text-and-image__text {
	order: 0;

	@media (min-width: 960px) {
		padding-right: 30px;
		padding-left: 0;
	}
}

.text-and-image--left .text-and-image__image {
	order: 1;
}

/* Text on right (image on left): image first, text second */
.text-and-image--right .text-and-image__text {
	order: 1;

	@media (min-width: 960px) {
		padding-left: 30px;
		padding-right: 0;
	}
}

.text-and-image--right .text-and-image__image {
	order: 0;
}

/* ==========================================================================
   Image sizing
   ========================================================================== */

.text-and-image__slide {
	position: relative;
	overflow: hidden;
	border-radius: 7px;
}

.text-and-image__slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* 400px — shortest */
.text-and-image__image--size-400 .text-and-image__slide {
	height: 400px;
}

/* 550px — shorter (400 mobile, 550 desktop) */
.text-and-image__image--size-550 .text-and-image__slide {
	height: 400px;

	@media (min-width: 960px) {
		height: 550px;
	}
}

/* 650px — standard (450 mobile, 650 desktop) */
.text-and-image__image--size-650 .text-and-image__slide {
	height: 450px;

	@media (min-width: 960px) {
		height: 650px;
	}
}

/* Contained — object-fit: contain */
.text-and-image__image--contained .text-and-image__slide {
	height: auto;
	max-width: 600px;
	margin: auto;
}

.text-and-image__image--contained .text-and-image__slide img {
	object-fit: contain;
}

/* ==========================================================================
   Media label overlay
   ========================================================================== */

.text-and-image__media-label {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	z-index: 2;
	padding: 25px 35px 15px;
	color: var(--color-white);
	text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.74) 0%, rgba(0, 0, 0, 0) 100%);
}

.text-and-image__media-label--dark {
	color: var(--color-dark-gray);
	text-shadow: none;
}

.text-and-image__media-label-text {
	font-size: 14px;
	font-weight: 500;
	line-height: normal;
}

/* ==========================================================================
   Caption
   ========================================================================== */

.text-and-image__caption {
	text-align: center;
	font-size: 14px;
	font-weight: 500;
	color: var(--color-black);
	margin: 8px 0 0;
}

/* ==========================================================================
   Carousel
   ========================================================================== */

.text-and-image__carousel {
	position: relative;
	overflow: hidden;
	cursor: grab;
	user-select: none;
	border-radius: 7px;

	&:active {
		cursor: grabbing;
	}
}

.text-and-image__carousel-track {
	display: flex;
	transition: transform 0.5s ease;
}

.text-and-image__carousel .text-and-image__slide {
	flex: 0 0 100%;
	min-width: 100%;
	border-radius: 0;
}

/* ==========================================================================
   Nav arrows
   ========================================================================== */

.text-and-image__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-97%);
	z-index: 10;
	background: none;
	border: none;
	margin-top: 0;
	cursor: pointer;
	padding: 10px;
	opacity: 0.6;
	transition: opacity 0.2s ease;

	&:hover {
		opacity: 1;
		background: none;
	}

	svg {
		display: block;
	}
}

.text-and-image__nav--prev {
	left: 5px;
}

.text-and-image__nav--next {
	right: 5px;
}

/* ==========================================================================
   Dots
   ========================================================================== */

.text-and-image__dots {
	display: flex;
	justify-content: center;
	gap: 6px;
	padding: 15px 0;
	z-index: 10;
}

.text-and-image__dot {
	display: block;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	border: none;
	background: var(--color-gray);
	opacity: 0.5;
	cursor: pointer;
	padding: 0;
	transition: opacity 0.2s ease;

	&:hover {
		opacity: 0.8;
	}

	&.is-active {
		opacity: 1;
	}
}

/* ==========================================================================
   After content
   ========================================================================== */

.text-and-image__after-content {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px 0;
}
