/*
 * VTAKT remediation R1
 * Responsive containment, mobile schedule and resilient local gallery.
 */

html,
body {
	max-width: 100%;
}

img,
video,
svg,
iframe {
	max-width: 100%;
}

img,
video {
	height: auto;
}

.container,
.wysiwyg,
.post_content,
.article-post,
.content-wrap {
	min-width: 0;
}

.wysiwyg,
.post_content {
	overflow-wrap: anywhere;
}

/* Direction pages: intrinsic hero images and video embeds caused 640-1140px overflow. */
.danceTypePage__hero {
	overflow: hidden;
}

.danceTypePage__img {
	display: block;
	width: 100%;
	max-width: 100%;
}

.embed-container,
.lessonsPhoto__slide {
	max-width: 100%;
	min-width: 0;
	overflow: hidden;
}

.embed-container iframe,
.lessonsPhoto__slide iframe,
.post_content iframe,
.wysiwyg iframe {
	display: block;
	width: 100% !important;
	max-width: 100% !important;
	aspect-ratio: 16 / 9;
	height: auto !important;
}

/* Schedule tables scroll inside their own region instead of widening the page. */
.bSchedule,
.bSchedule__tabContent,
.schedule-wrap,
.lSchedule__body {
	max-width: 100%;
	min-width: 0;
}

.bSchedule {
	overflow: hidden;
}

.bSchedule__tabContent {
	display: none;
}

.bSchedule__tabContent.active {
	display: block;
}

.bSchedule__table,
.schedule-wrap,
.lSchedule__body {
	overflow-x: auto !important;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-inline: contain;
	scrollbar-color: #05aaff #e8e8e8;
	scrollbar-width: thin;
}

.bSchedule__table::-webkit-scrollbar,
.schedule-wrap::-webkit-scrollbar,
.lSchedule__body::-webkit-scrollbar {
	height: 9px;
}

.bSchedule__table::-webkit-scrollbar-thumb,
.schedule-wrap::-webkit-scrollbar-thumb,
.lSchedule__body::-webkit-scrollbar-thumb {
	background: #05aaff;
	border-radius: 999px;
}

.bSchedule__table .table-schedule,
.schedule-wrap .table-schedule {
	min-width: 680px;
}

/* Stable gallery: local WordPress media is the source; Instagram is optional. */
.vtakt-gallery {
	margin: 0 auto 40px;
	max-width: 1140px;
}

.vtakt-gallery__intro {
	max-width: 760px;
	margin: 0 auto 28px;
	text-align: center;
	font-size: 18px;
	line-height: 1.55;
}

.vtakt-gallery__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 18px;
}

.vtakt-gallery__item {
	margin: 0;
	min-width: 0;
	background: #0c0c0c;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16);
}

.vtakt-gallery__link {
	display: block;
	overflow: hidden;
}

.vtakt-gallery__image {
	display: block;
	width: 100%;
	height: 280px;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.vtakt-gallery__link:hover .vtakt-gallery__image,
.vtakt-gallery__link:focus-visible .vtakt-gallery__image {
	transform: scale(1.035);
}

.vtakt-gallery__caption {
	display: block;
	padding: 12px 14px 14px;
	color: #fff;
	font-size: 15px;
	line-height: 1.4;
}

.vtakt-gallery__instagram {
	margin: 26px 0 0;
	text-align: center;
}

.vtakt-gallery__instagram a {
	display: inline-block;
	padding: 12px 20px;
	border-radius: 5px;
	background: #ffff00;
	color: #0c0c0c;
	font-weight: 700;
	text-decoration: none;
}

.vtakt-gallery__instagram a:hover,
.vtakt-gallery__instagram a:focus-visible {
	background: #05aaff;
	color: #fff;
}

@media (max-width: 900px) {
	.vtakt-gallery__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 760px) {
	html,
	body {
		overflow-x: clip;
	}

	.container {
		width: 100%;
		max-width: 100%;
	}

	.danceTypePage__img {
		left: 0 !important;
		width: 100% !important;
		max-width: 100% !important;
		transform: none !important;
	}

	.wpcf7,
	.wpcf7-form,
	.wpcf7-form-control-wrap,
	.wpcf7-form-control,
	.wpcf7 input,
	.wpcf7 select,
	.wpcf7 textarea {
		max-width: 100% !important;
	}

	.wpcf7 input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
	.wpcf7 select,
	.wpcf7 textarea {
		width: 100% !important;
	}

	.bSchedule__table::before,
	.schedule-wrap::before {
		content: "Гортайте розклад по горизонталі →";
		position: sticky;
		left: 0;
		display: block;
		width: fit-content;
		margin: 0 0 8px;
		padding: 6px 10px;
		border-radius: 4px;
		background: #ffff00;
		color: #0c0c0c;
		font-size: 13px;
		font-weight: 700;
	}

	.bSchedule__table .table-schedule th:first-child,
	.bSchedule__table .table-schedule td:first-child,
	.schedule-wrap .table-schedule th:first-child,
	.schedule-wrap .table-schedule td:first-child {
		position: sticky;
		left: 0;
		z-index: 2;
	}

	.bSchedule__table .table-schedule th:first-child,
	.schedule-wrap .table-schedule th:first-child {
		background: #000;
		z-index: 3;
	}

	.bSchedule__table .table-schedule td:first-child,
	.schedule-wrap .table-schedule td:first-child {
		background: #fff;
	}

	.bSchedule__table .table-schedule tr:nth-child(odd) td:first-child,
	.schedule-wrap .table-schedule tr:nth-child(odd) td:first-child {
		background: #e1e1e1;
	}

	.vtakt-gallery__grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.vtakt-gallery__image {
		height: auto;
		max-height: 460px;
		object-fit: cover;
	}

	.vtakt-gallery__intro {
		font-size: 16px;
	}
}
