/*
 * Life Adve — For 0-2 Years Program: interactive tutorial page styling.
 * Developed and maintained by QD World.
 *
 * Scoped entirely under the "z2y-" prefix so nothing here can leak
 * into or collide with the shared site stylesheet (css/style.css) or
 * any other page. Reuses the site's own brand tokens (--theme-color1
 * the lime green, --theme-color2 the deep teal, --title-font /
 * --text-font) so the page reads as part of Life Adve rather than a
 * bolted-on module.
 */

.z2y-intro-text {
	max-width: 760px;
	color: var(--theme-color-gray2, #666);
	font-size: 16px;
	line-height: 1.7;
}

.z2y-chapters {
	display: flex;
	flex-direction: column;
	gap: 18px;
	margin-top: 35px;
}

.z2y-chapter {
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 6px 24px rgba(20, 68, 67, 0.08);
	background: #fff;
}

/* ---- Chapter header (the collapsible trigger bar) -------------------- */

.z2y-chapter-header {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 18px;
	padding: 10px 22px 10px 10px;
	border: none;
	cursor: pointer;
	text-align: left;
	font-family: var(--title-font);
	background: linear-gradient(100deg, var(--theme-color1, #c8f169) 0%, var(--theme-color2, #144443) 62%);
	transition: filter 0.25s ease;
}

.z2y-chapter-header:hover {
	filter: brightness(1.04);
}

.z2y-chapter-header:focus-visible {
	outline: 3px solid var(--theme-color1, #c8f169);
	outline-offset: -3px;
}

.z2y-chapter-thumb {
	flex: none;
	width: 68px;
	height: 68px;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5);
}

.z2y-chapter-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.z2y-chapter-title {
	flex: 1 1 auto;
	color: #0f2b22;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.3;
}

.z2y-chapter-state {
	flex: none;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	color: #fff;
	min-width: 54px;
}

.z2y-chapter-state-label {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.z2y-chapter-state-arrow {
	font-size: 13px;
	transition: transform 0.3s ease;
}

.z2y-chapter.is-open .z2y-chapter-state-arrow {
	transform: rotate(180deg);
}

.z2y-chapter-lock {
	flex: none;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.16);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
}

/* ---- Collapsible panel ------------------------------------------------ */

.z2y-chapter-panel {
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.4s ease;
}

.z2y-chapter.is-open .z2y-chapter-panel {
	/* JS sets an exact max-height on open for a smooth transition; this
	   is just a safe fallback if JS hasn't run yet (progressive
	   enhancement) so content is never permanently hidden. */
	max-height: none;
}

.z2y-chapter-panel-inner {
	padding: 26px 26px 32px;
}

.z2y-chapter-intro {
	font-size: 16px;
	line-height: 1.7;
	color: #333;
	font-weight: 600;
	margin-bottom: 26px;
}

/* ---- Video + audio media cards ---------------------------------------- */

.z2y-media-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 22px;
	margin-bottom: 28px;
}

.z2y-media-card {
	text-align: center;
}

.z2y-media-card-title {
	font-size: 15px;
	font-weight: 700;
	color: #0f2b22;
	margin-bottom: 12px;
}

.z2y-media-visual {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: 14px;
	overflow: hidden;
	border: none;
	padding: 0;
	cursor: pointer;
	background: #0f2b22;
}

.z2y-media-visual img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

.z2y-media-visual:hover img {
	transform: scale(1.05);
}

.z2y-media-visual::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(15, 43, 34, 0.15) 0%, rgba(15, 43, 34, 0.55) 100%);
}

.z2y-play-btn {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: var(--theme-color2, #144443);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	z-index: 1;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
	transition: transform 0.25s ease, background 0.25s ease;
}

.z2y-media-visual:hover .z2y-play-btn {
	transform: translate(-50%, -50%) scale(1.08);
}

.z2y-media-visual.is-playing .z2y-play-btn {
	background: var(--theme-color1, #c8f169);
}

/* Local video plays inline inside this same thumbnail frame — no
   popup/lightbox. Once the <video> is inserted, the thumbnail image,
   dark overlay and play button all step aside for its own native
   controls. */
.z2y-media-visual video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	background: #000;
}

.z2y-media-visual.is-video-active::after {
	display: none;
}

.z2y-media-visual.is-video-active .z2y-play-btn {
	display: none;
}

.z2y-media-visual.is-video-active:hover img {
	transform: none;
}

.z2y-audio-card-status {
	margin-top: 8px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--theme-color2, #144443);
	min-height: 16px;
}

/* ---- Questionnaire card ------------------------------------------------ */

.z2y-quiz-card,
.z2y-result-card {
	border-radius: 14px;
	overflow: hidden;
	border: 1px solid #e7ece9;
	margin-bottom: 22px;
}

.z2y-quiz-card-head {
	background: var(--theme-color2, #144443);
	color: #fff;
	padding: 16px 24px;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.z2y-quiz-card-body {
	padding: 24px;
}

.z2y-quiz-section + .z2y-quiz-section {
	margin-top: 26px;
}

.z2y-quiz-section-title {
	color: #b3261e;
	font-size: 15px;
	font-weight: 700;
	margin-bottom: 14px;
}

.z2y-quiz-question {
	margin-bottom: 18px;
}

.z2y-quiz-question-text {
	font-size: 15px;
	color: #1c1c1c;
	margin-bottom: 10px;
	line-height: 1.5;
}

.z2y-quiz-options {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.z2y-quiz-option {
	position: relative;
}

.z2y-quiz-option input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.z2y-quiz-option span {
	display: inline-flex;
	align-items: center;
	padding: 10px 16px;
	border-radius: 8px;
	background: #eef3f0;
	color: #1c1c1c;
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
	border: 2px solid transparent;
	transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.z2y-quiz-option input:hover + span {
	background: #e2ece5;
}

.z2y-quiz-option input:focus-visible + span {
	outline: 3px solid var(--theme-color2, #144443);
	outline-offset: 2px;
}

.z2y-quiz-option input:checked + span {
	background: var(--theme-color1, #c8f169);
	border-color: var(--theme-color2, #144443);
	color: #0f2b22;
	transform: translateY(-1px);
}

.z2y-quiz-error {
	color: #b3261e;
	font-size: 13.5px;
	font-weight: 700;
	margin-top: 4px;
	display: none;
}

.z2y-quiz-question.has-error .z2y-quiz-error {
	display: block;
}

.z2y-quiz-question.has-error .z2y-quiz-option span {
	border-color: #f0b3ae;
}

.z2y-quiz-submit-row {
	margin-top: 10px;
	text-align: center;
}

.z2y-quiz-submit-btn {
	display: inline-block;
	padding: 14px 46px;
	background: var(--theme-color2, #144443);
	color: #fff;
	border: none;
	border-radius: 30px;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 0.25s ease, transform 0.15s ease;
}

.z2y-quiz-submit-btn:hover {
	background: #0f3433;
	transform: translateY(-1px);
}

/* ---- Results card ------------------------------------------------------ */

.z2y-result-card-head {
	background: linear-gradient(100deg, #6f9d1f 0%, #3f6d16 100%);
	color: #fff;
	padding: 16px 24px;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.z2y-result-card-body {
	padding: 24px;
	min-height: 60px;
}

.z2y-result-placeholder {
	color: #6b7a72;
	font-size: 14.5px;
	font-style: italic;
	margin: 0;
}

.z2y-result-content {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.z2y-result-score {
	font-size: 14px;
	font-weight: 700;
	color: var(--theme-color2, #144443);
}

.z2y-result-title {
	font-size: 19px;
	font-weight: 800;
	color: #0f2b22;
	margin-top: 4px;
}

.z2y-result-desc {
	font-size: 14.5px;
	color: #333;
	line-height: 1.6;
}

.z2y-result-actions-title {
	font-size: 13.5px;
	font-weight: 700;
	color: #0f2b22;
	margin-top: 12px;
}

.z2y-result-actions-list {
	margin: 6px 0 0;
	padding-left: 20px;
	color: #333;
	font-size: 14px;
	line-height: 1.8;
}

.z2y-result-cta-btn {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 16px;
	padding: 12px 26px;
	background: var(--theme-color2, #144443);
	color: #fff;
	border: none;
	border-radius: 30px;
	font-size: 13.5px;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.25s ease, transform 0.15s ease;
}

.z2y-result-cta-btn:hover {
	background: #0f3433;
	color: #fff;
	transform: translateY(-1px);
}

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

@media only screen and (max-width: 767px) {
	.z2y-chapter-header {
		gap: 12px;
		padding: 8px 14px 8px 8px;
	}
	.z2y-chapter-thumb {
		width: 52px;
		height: 52px;
	}
	.z2y-chapter-title {
		font-size: 15px;
	}
	.z2y-chapter-state-label {
		display: none;
	}
	.z2y-chapter-lock {
		width: 32px;
		height: 32px;
		font-size: 12px;
	}
	.z2y-chapter-panel-inner {
		padding: 20px 16px 26px;
	}
	.z2y-media-grid {
		grid-template-columns: 1fr;
	}
	.z2y-quiz-card-body {
		padding: 18px;
	}
	.z2y-quiz-options {
		gap: 8px;
	}
	.z2y-quiz-option span {
		padding: 9px 13px;
		font-size: 13px;
	}
}
