/* Homepage, part 2: results carousel, gallery band, form band, knowledge cards, news. */

/* Results: caption left, before/after right */
.cases__track { gap: 0; }
.case { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 600px; gap: 30px; align-items: center; }
.case__text { padding-right: 20px; }
.case__quote { display: block; color: var(--teal-head); margin-bottom: 12px; }
.case__count { font-size: 14px; font-weight: 600; color: var(--teal-ink); }
.case__text h3 { margin-top: 6px; font-size: 28px; line-height: 1.3; color: var(--navy); }
.case__note { margin-top: 14px; color: var(--muted); font-size: 15px; }

.ba { position: relative; aspect-ratio: 3 / 2; border-radius: var(--radius-lg); overflow: hidden; background: var(--tint); user-select: none; }
.ba > img, .ba__before img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba__before { position: absolute; inset: 0; z-index: 1; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.ba::after { content: ""; position: absolute; top: 0; bottom: 0; left: var(--pos); z-index: 2; width: 4px; margin-left: -2px; background: #fff; }
.ba__handle { position: absolute; top: 50%; left: var(--pos); z-index: 3; transform: translate(-50%, -50%); display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: #fff; color: var(--navy); font-size: 11px; font-weight: 700; letter-spacing: .02em; box-shadow: 0 4px 14px rgba(0, 0, 0, .2); }
.ba__tag { position: absolute; bottom: 12px; z-index: 3; padding: 3px 12px; border-radius: 999px; background: rgba(0, 110, 107, .85); color: #fff; font-size: 12px; font-weight: 600; }
.ba__tag--l { left: 12px; }
.ba__tag--r { right: 12px; }
.ba__range { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.ba:has(.ba__range:focus-visible) { outline: 3px solid var(--navy); outline-offset: 3px; }

.cases__foot { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; margin-top: 28px; }
.cases__foot .btn { justify-self: start; }

/* Gallery band: tinted section, white panel, three framed cards */
.space { background: var(--tint); padding-block: 64px 80px; }
.space__panel { position: relative; padding: 50px 80px; background: #fff; border-radius: var(--radius-lg); }
.space__track { gap: 24px; align-items: stretch; padding-block: 20px; }
.frame { width: calc((100% - 48px) / 3); border: 8px solid var(--tint); border-radius: 16px; overflow: hidden; background: #fff; }
.frame:nth-child(3n+2) { transform: translateY(-20px); }
.frame img { width: 100%; aspect-ratio: 4 / 4.600; object-fit: cover; }
.frame figcaption { padding: 16px 18px 20px; }
.frame b { display: block; font-size: 18px; color: var(--navy); line-height: 1.3; }
.frame span { display: block; margin-top: 6px; font-size: 14px; line-height: 1.6; }
.space__prev, .space__next { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; }
.space__prev { left: -25px; }
.space__next { right: -25px; }
[data-slider].is-static .arrow { display: none; }

/* Form band */
.cta { padding-block: 60px; }
.cta__band { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 332px; gap: 60px; align-items: center; max-width: 940px; margin-inline: auto; padding: 50px 56px; border-radius: var(--radius-lg); background: linear-gradient(120deg, #007370 0%, var(--brand) 45%, #00a7a3 100%); color: #fff; overflow: hidden; }
.cta__band::before { content: ""; position: absolute; left: 44%; bottom: 20px; width: 288px; height: 96px; background-image: radial-gradient(rgba(255, 255, 255, .35) 2px, transparent 2.500px); background-size: 32px 32px; }
.cta__band::after { content: ""; position: absolute; left: 50%; top: -40px; width: 110px; height: 110px; background: linear-gradient(rgba(1, 185, 181, .35), rgba(1, 185, 181, .35)) center / 36% 100% no-repeat, linear-gradient(rgba(1, 185, 181, .35), rgba(1, 185, 181, .35)) center / 100% 36% no-repeat; }
.cta__text { position: relative; z-index: 1; }
.cta__text h2 { font-size: 30px; line-height: 1.25; font-weight: 700; }
.cta__text p { margin-top: 14px; font-size: 18px; font-weight: 500; line-height: 1.6; max-width: 380px; }
.cta__form { position: relative; z-index: 1; display: grid; gap: 14px; padding: 30px; border-radius: 24px; background: #fff; color: var(--ink); }

/* Knowledge cards */
.posts { padding-top: 40px; }
.posts__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.post { display: flex; flex-direction: column; align-items: flex-start; }
.post__img, .news__img { display: block; overflow: hidden; border-radius: 20px; }
.post__img { width: 100%; margin-bottom: 18px; }
.post__img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .5s; }
.post:hover img, .news__lead:hover img, .news__item:hover img { transform: scale(1.04); }
.post h3 { font-size: 20px; line-height: 1.35; font-weight: 600; }
.post p { margin-top: 10px; font-size: 14px; color: var(--muted); flex: 1; }
.post .btn { margin-top: 18px; }
.row-head .btn { flex: none; white-space: nowrap; }
.post h3 a:hover, .news h3 a:hover { color: var(--teal-ink); }

/* News: featured item and list */
.news { padding-bottom: 80px; }
.news__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.news__lead .news__img img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .5s; }
.news__lead h3 { margin-top: 22px; font-size: 26px; line-height: 1.3; font-weight: 600; }
.news__lead p { margin-top: 12px; color: var(--muted); }
.news__lead .btn { margin-top: 22px; }
.news__list { display: grid; gap: 28px; }
.news__item { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
.news__item .news__img img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; object-position: 50% 20%; transition: transform .5s; }
.news__item h3 { font-size: 19px; line-height: 1.35; font-weight: 600; }
.news__item p { margin-top: 8px; font-size: 15px; color: var(--muted); }
.news__item .btn { margin-top: 14px; }

@media (max-width: 1100px) {
	.case { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
	.space__panel { padding: 40px 44px; }
	.space__prev { left: -14px; }
	.space__next { right: -14px; }
}

@media (max-width: 1023px) {
	.cta__band { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 36px 28px; max-width: 560px; }
	.cta__band::before, .cta__band::after { display: none; }
	.posts__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.news__grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
	.frame { width: calc((100% - 24px) / 2); }
	.frame:nth-child(3n+2) { transform: none; }
}

@media (max-width: 767px) {
	.case { grid-template-columns: minmax(0, 1fr); gap: 18px; }
	.case__text { padding-right: 0; }
	.case__quote svg { width: 34px; height: 34px; }
	.case__text h3 { font-size: 22px; }
	.cases__foot { grid-template-columns: minmax(0, 1fr); gap: 18px; justify-items: center; }
	.cases__foot .btn { justify-self: stretch; order: 2; }

	.space { padding-block: 40px 48px; }
	.space__panel { padding: 20px 16px 76px; }
	.space__track { gap: 14px; }
	.frame { width: 86%; }
	.space__prev, .space__next { top: auto; bottom: 14px; transform: none; }
	.space__prev { left: calc(50% - 60px); }
	.space__next { right: calc(50% - 60px); }

	.cta { padding-block: 32px; }
	.cta__band { padding: 28px 16px 16px; border-radius: 24px; }
	.cta__text h2 { font-size: 24px; }
	.cta__text p { font-size: 16px; }
	.cta__form { padding: 20px 16px; border-radius: 20px; }

	.posts { padding-top: 32px; }
	.posts__grid { grid-template-columns: minmax(0, 1fr); gap: 30px; }
	.news { padding-bottom: 48px; }
	.news__lead h3 { font-size: 22px; margin-top: 16px; }
	.news__list { gap: 20px; }
	.news__item { grid-template-columns: 42% minmax(0, 1fr); gap: 14px; }
	.news__item h3 { font-size: 16px; }
	.news__item p, .news__item .btn { display: none; }
	.news__item .news__img { border-radius: 14px; }
	.row-head { flex-wrap: wrap; }
	.case .ba { order: -1; }
}

/* Patients' YouTube Shorts: a row under the before/after case; covers until clicked, then the player */
.cvids { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--line); }
.cvids__head h3 { font-size: 28px; line-height: 1.3; color: var(--navy); }
.cvids__head p { margin-top: 8px; color: var(--muted); font-size: 15px; }
.cvids__row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; max-width: 900px; margin-top: 24px; }
.cvid figcaption { margin-top: 12px; font-size: 16px; line-height: 1.4; font-weight: 600; color: var(--navy); }
.yt { position: relative; aspect-ratio: 9 / 16; border-radius: var(--radius-lg); overflow: hidden; background: var(--navy); }
.yt__play { position: absolute; inset: 0; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.yt__play img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.yt__play:hover img { transform: scale(1.03); }
.yt__icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 64px; height: 64px; padding-left: 4px; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--navy); box-shadow: 0 6px 20px rgba(0, 0, 0, .25); transition: transform .2s, box-shadow .2s; }
.yt__play:hover .yt__icon { transform: translate(-50%, -50%) scale(1.08); box-shadow: 0 0 0 10px rgba(1, 185, 181, .3); }
.yt__play:focus-visible { outline: 3px solid var(--teal); outline-offset: -3px; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.cvids + .cases__foot { margin-top: 36px; }

@media (max-width: 767px) {
	.cvids { margin-top: 36px; padding-top: 28px; }
	.cvids__head h3 { font-size: 22px; }
	.cvids__row { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; }
	.cvids__row::-webkit-scrollbar { display: none; }
	.cvid { flex: none; width: 64%; scroll-snap-align: start; }
	.cvid figcaption { font-size: 15px; }
}

/* Long section title ("Mỗi nụ cười – Một hành trình…") stays on one line on desktop */
.cases .sec-head--left { max-width: none; }

/* "Khách hàng kể lại" row: heading and videos centred */
.cvids__head { text-align: center; }
.cvids__row { margin-inline: auto; }
.cvid figcaption { text-align: center; }
@media (max-width: 767px) {
	.cvids__row { margin-inline: -16px; }
}
.cvids + .cases__foot { grid-template-columns: minmax(0, 1fr); justify-items: center; }
.cvids + .cases__foot .btn { justify-self: center; }
.cvids + .cases__foot .arrows:empty, [data-slider].is-static .cvids + .cases__foot .arrows { display: none; }

/* "Khách hàng kể lại": 4 videos (28/11) — 4 columns on desktop, 2 on tablet */
@media (min-width: 1024px) {
	.cvids__row { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 1120px; }
}
@media (min-width: 768px) and (max-width: 1023px) {
	.cvids__row { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 600px; }
}
