/* Khối Hero slides. Token: theme.json custom.hero-slides (interval, fade, step, border, shadow, lift, tones.<khóa>.base/glow1/glow2). */
.bl-hs { --hs: var(--wp--custom--hero-slides--fade); width: 100%; max-width: var(--wp--custom--hero-slides--max); margin-inline: auto; }
.bl-hs__frame {
	position: relative;
	display: grid;
	grid-template: minmax(0, 1fr) / minmax(0, 1fr);
	container-type: inline-size;
	border-radius: var(--wp--custom--radius--lg);
	/* Không viền: mép khung nhoè vào nền bằng quầng sáng (custom.hero-slides.halo) + bóng màu bên dưới (shadow) — tách nền nhờ mảng pastel + quầng, không có đường kẻ. */
	box-shadow: var(--wp--custom--hero-slides--halo), var(--wp--custom--hero-slides--shadow);
	overflow: hidden;
	background: var(--wp--preset--color--surface);
	touch-action: pan-y;
	aspect-ratio: var(--wp--custom--hero-slides--ratio-mobile);
}
/* Máy tính: khung hơi chữ nhật nằm (custom.hero-slides.ratio); hình giữ tỉ lệ, đặt giữa theo chiều cao. Điện thoại: tỉ lệ gần hình (chữ trong hình ≥12px). */
@media (min-width: 782px) {
	.bl-hs__frame { aspect-ratio: var(--wp--custom--hero-slides--ratio); }
	.bl-hs__slide { min-height: 0; overflow: hidden; }
	.bl-hs__slide > .bl-svg:not(:has(.bl-anim)) { width: auto; height: 100%; max-width: 100%; }
	.bl-hs__slide.is-tone-dash > .bl-svg { width: auto; height: 84%; max-width: 92%; }
}
.bl-hs__slide {
	--t-base: var(--wp--preset--color--brand-tint);
	--t-g1: var(--wp--preset--color--brand-soft);
	--t-g2: var(--wp--preset--color--brand-soft);
	grid-area: 1 / 1;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	background:
		radial-gradient(circle at 1.5px 1.5px, color-mix(in srgb, var(--wp--preset--color--brand) 9%, transparent) 1.1px, transparent 1.6px) 0 0 / 22px 22px,
		radial-gradient(ellipse at 88% 8%, var(--t-g1), transparent 62%),
		radial-gradient(ellipse at 4% 100%, var(--t-g2), transparent 66%),
		var(--t-base);
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--hs) ease, visibility 0s linear var(--hs);
}
.bl-hs__slide.is-on { opacity: 1; visibility: visible; transition: opacity var(--hs) ease, visibility 0s; z-index: 1; }
.bl-hs__slide > .bl-svg { display: block; width: 100%; height: auto; min-height: 0; }
/* Slide là hình workspace cũ (khung app 400 đơn vị): đặt giữa, chừa lề như các slide khác. */
.bl-hs__slide > .bl-svg:has(.bl-anim), .bl-hs__slide.is-tone-dash > .bl-svg { width: 86%; box-shadow: none; filter: drop-shadow(var(--wp--custom--hero-slides--lift)); }
.bl-hs__cap {
	position: absolute;
	inset-inline: 6.6%;
	margin: 0;
	font-family: var(--wp--preset--font-family--sans);
	font-weight: 800;
	font-size: clamp(1.25rem, 6.2cqi, 2.25rem);
	line-height: 1.1;
	letter-spacing: -0.02em;
	/* xanh thương hiệu pha tối: ≥4,5:1 trên mọi vùng nền pastel (kể cả tâm quầng màu) */
	color: color-mix(in srgb, var(--wp--preset--color--brand) 70%, var(--wp--preset--color--ink));
	text-wrap: balance;
}
.bl-hs__cap.is-bottom { bottom: 5.5%; }
.bl-hs__cap.is-top { top: 5%; color: var(--wp--preset--color--ink); padding-inline-end: 14%; font-size: clamp(1.1rem, 5.2cqi, 1.9rem); }
/* Nền từng tông */
.bl-hs__slide.is-tone-dash { --t-base: var(--wp--custom--hero-slides--tones--dash--base); --t-g1: var(--wp--custom--hero-slides--tones--dash--glow-1); --t-g2: var(--wp--custom--hero-slides--tones--dash--glow-2); }
.bl-hs__slide.is-tone-night { --t-base: var(--wp--custom--hero-slides--tones--night--base); --t-g1: var(--wp--custom--hero-slides--tones--night--glow-1); --t-g2: var(--wp--custom--hero-slides--tones--night--glow-2); }
.bl-hs__slide.is-tone-sky { --t-base: var(--wp--custom--hero-slides--tones--sky--base); --t-g1: var(--wp--custom--hero-slides--tones--sky--glow-1); --t-g2: var(--wp--custom--hero-slides--tones--sky--glow-2); }
.bl-hs__slide.is-tone-violet { --t-base: var(--wp--custom--hero-slides--tones--violet--base); --t-g1: var(--wp--custom--hero-slides--tones--violet--glow-1); --t-g2: var(--wp--custom--hero-slides--tones--violet--glow-2); }
.bl-hs__slide.is-tone-teal { --t-base: var(--wp--custom--hero-slides--tones--teal--base); --t-g1: var(--wp--custom--hero-slides--tones--teal--glow-1); --t-g2: var(--wp--custom--hero-slides--tones--teal--glow-2); }
.bl-hs__slide.is-tone-mint { --t-base: var(--wp--custom--hero-slides--tones--mint--base); --t-g1: var(--wp--custom--hero-slides--tones--mint--glow-1); --t-g2: var(--wp--custom--hero-slides--tones--mint--glow-2); }
.bl-hs__slide.is-tone-indigo { --t-base: var(--wp--custom--hero-slides--tones--indigo--base); --t-g1: var(--wp--custom--hero-slides--tones--indigo--glow-1); --t-g2: var(--wp--custom--hero-slides--tones--indigo--glow-2); }
.bl-hs__slide.is-tone-lilac { --t-base: var(--wp--custom--hero-slides--tones--lilac--base); --t-g1: var(--wp--custom--hero-slides--tones--lilac--glow-1); --t-g2: var(--wp--custom--hero-slides--tones--lilac--glow-2); }
/* Viền thẻ trắng trong hình: tương phản ≥3:1 với nền pastel (WCAG 1.4.11) — màu custom.hero-slides.border. */
.bl-hs .bl-svg .s-hs-edge { stroke: var(--wp--custom--hero-slides--border); stroke-width: 1.5px; }
/* Thẻ nổi trong hình + hiện lần lượt khi slide được chọn */
.bl-hs .bl-svg .bl-hs-lift { filter: drop-shadow(var(--wp--custom--hero-slides--lift)); }
.bl-hs .bl-svg .bl-hs-in { opacity: 0; transform: translateY(10px); }
.bl-hs__slide.is-on .bl-svg .bl-hs-in {
	opacity: 1; transform: none;
	transition: opacity var(--hs) ease, transform var(--hs) ease;
	transition-delay: calc(var(--i, 0) * var(--wp--custom--hero-slides--step) + var(--wp--custom--hero-slides--step));
}
.bl-hs__slide.is-on .bl-svg .bl-hs-sweep { transform-origin: 240px 196px; animation: bl-hs-sweep 4s linear infinite; }
@keyframes bl-hs-sweep { to { transform: rotate(360deg); } }
/* Điều khiển: nút dừng/chạy + chấm (thanh chạy = thời gian còn lại của slide) */
.bl-hs__nav { display: flex; align-items: center; justify-content: center; gap: var(--wp--preset--spacing--20); margin-top: var(--wp--preset--spacing--30); }
.bl-hs__dots { display: flex; align-items: center; gap: 2px; }
.bl-hs__dot, .bl-hs__play {
	display: inline-grid; place-items: center;
	min-width: var(--wp--custom--touch-target); min-height: var(--wp--custom--touch-target);
	padding: 0; border: 0; background: transparent; cursor: pointer; border-radius: 999px;
}
.bl-hs__dot span { display: block; width: 8px; height: 8px; border-radius: 999px; background: var(--wp--preset--color--ink-soft); opacity: .45; transition: width var(--hs) ease, opacity var(--hs) ease; position: relative; overflow: hidden; }
.bl-hs__dot.is-on span { width: 28px; opacity: 1; background: color-mix(in srgb, var(--wp--preset--color--brand) 25%, transparent); }
.bl-hs__dot.is-on span::after { content: ""; position: absolute; inset: 0; background: var(--wp--preset--color--brand); transform-origin: left; transform: scaleX(var(--p, 1)); }
.bl-hs.is-playing .bl-hs__dot.is-on span::after { animation: bl-hs-bar var(--bl-hs-int, 6s) linear forwards; }
.bl-hs.is-held .bl-hs__dot.is-on span::after { animation-play-state: paused; }
@keyframes bl-hs-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.bl-hs__icon { width: 14px; height: 14px; position: relative; }
.bl-hs__icon::before, .bl-hs__icon::after { content: ""; position: absolute; top: 1px; bottom: 1px; width: 4px; border-radius: 1px; background: var(--wp--preset--color--ink-soft); }
.bl-hs__icon::before { left: 2px; } .bl-hs__icon::after { right: 2px; }
.bl-hs__play[aria-pressed="true"] .bl-hs__icon::after { display: none; }
.bl-hs__play[aria-pressed="true"] .bl-hs__icon::before { left: 3px; width: 0; height: 0; top: 0; bottom: auto; background: none; border-radius: 0; border-style: solid; border-width: 7px 0 7px 11px; border-color: transparent transparent transparent var(--wp--preset--color--ink-soft); }
.bl-hs__dot:focus-visible, .bl-hs__play:focus-visible { outline: var(--wp--custom--focus-ring); outline-offset: 2px; }
.bl-hs:not(.is-js) .bl-hs__play { visibility: hidden; }
@media (prefers-reduced-motion: reduce) {
	.bl-hs__slide, .bl-hs__slide.is-on, .bl-hs__slide.is-on .bl-svg .bl-hs-in { transition: none !important; }
	.bl-hs .bl-svg .bl-hs-in { opacity: 1; transform: none; }
	.bl-hs__slide.is-on .bl-svg .bl-hs-sweep { animation: none; }
	.bl-hs__play { display: none; }
}

/* Vị trí trong hero (cột .bl-hero-cols): máy tính — căn giữa theo chiều dọc với khối chữ (chữ dịch dài/ngắn vẫn cân);
   điện thoại — slide nằm ngay dưới tiêu đề H1 (cột trái "mở" ra bằng display: contents rồi xếp thứ tự). */
@media (min-width: 782px) {
	.wp-block-columns.bl-hero-cols { align-items: center !important; }
	.wp-block-columns.bl-hero-cols > .wp-block-column { align-self: center; }
}
@media (max-width: 781px) {
	.wp-block-columns.bl-hero-cols { display: flex; flex-direction: column; align-items: stretch !important; gap: var(--wp--preset--spacing--40) !important; }
	.bl-hero-cols > .wp-block-column { display: contents; }
	.bl-hero-cols > .wp-block-column > * { order: 4; margin-block: 0; }
	.bl-hero-cols > .wp-block-column > .is-style-eyebrow { order: 1; }
	.bl-hero-cols > .wp-block-column > :is(h1, .wp-block-heading) { order: 2; }
	.bl-hero-cols > .wp-block-column > .bl-hs { order: 3; }
	/* 8 chấm + nút dừng vừa bề ngang điện thoại: vùng bấm rộng 32px (≥24px — WCAG 2.5.8), cao giữ touch-target. */
	.bl-hs__dot { min-width: 32px; }
	.bl-hs__dots { gap: 0; }
}
