/* Home page sections (views/pages/index.php) */

/* Trust strip sits on the hero edge; below the edge it shares the next section's background */
.trust-strip { margin-bottom: 0; background: linear-gradient(180deg, transparent 56px, var(--color-surface) 56px); }

.hm-section { padding: 104px 0; }
.hm-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; flex-wrap: wrap; margin-bottom: 3rem; }
.hm-head-row .u-head { margin-bottom: 0; }
.hm-head-row .btn { white-space: nowrap; }

/* ---------- Our Purpose ---------- */
.hm-purpose { background: var(--color-surface); padding: 88px 0 104px; }
.hm-purpose-grid { display: grid; grid-template-columns: 1fr 1.08fr; gap: 4.5rem; align-items: center; }
.hm-purpose-text h2 { font-size: clamp(2rem, 3.4vw, 2.8rem); line-height: 1.15; color: var(--color-primary); margin: 0.9rem 0 1.4rem; letter-spacing: -0.01em; }
.hm-purpose-text p { color: var(--color-text-light); font-size: 1.06rem; line-height: 1.85; margin: 0 0 1.6rem; }
.hm-quote { margin: 0 0 1.8rem; padding: 1.3rem 1.5rem 1.3rem 1.6rem; background: #fff; border-left: 4px solid var(--color-accent); border-radius: 0 18px 18px 0; color: var(--color-primary); font-size: 1.06rem; line-height: 1.75; font-weight: 500; box-shadow: 0 10px 30px rgba(0, 33, 71, 0.06); }
.hm-video { margin: 0; position: relative; }
.hm-video-frame { position: relative; }
.hm-video-frame::before { content: ''; position: absolute; inset: 26px -20px -20px 26px; border-radius: 26px; background: rgba(251, 191, 36, 0.22); z-index: 0; }
.hm-video .u-video { position: relative; z-index: 1; border-radius: 22px; border: 6px solid #fff; box-shadow: 0 24px 50px rgba(0, 33, 71, 0.16); }
.hm-video figcaption { position: relative; z-index: 1; margin-top: 2.6rem; color: var(--color-text-light); font-weight: 600; font-size: 0.95rem; }
.hm-video figcaption i { color: #ff0000; margin-right: 0.35rem; }

/* ---------- Why U-BIS (pillars) ---------- */
.hm-why { background: #fff; }
.hm-pillars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.75rem; }
.hm-pillar { display: flex; flex-direction: column; }
.hm-pillar-img { position: relative; border-radius: 20px; overflow: hidden; aspect-ratio: 4 / 3; margin-bottom: 1.5rem; box-shadow: 0 15px 35px rgba(0, 33, 71, 0.10); }
.hm-pillar-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; display: block; }
.hm-pillar:hover .hm-pillar-img img { transform: scale(1.05); }
.hm-pillar-icon { position: absolute; left: 1rem; bottom: -1px; transform: translateY(50%); width: 48px; height: 48px; border-radius: 14px; background: var(--color-accent); color: var(--color-primary); display: flex; align-items: center; justify-content: center; font-size: 1.15rem; box-shadow: 0 8px 18px rgba(251, 191, 36, 0.4); }
.hm-pillar-img { overflow: visible; }
.hm-pillar-img img { border-radius: 20px; }
.hm-pillar h3 { color: var(--color-primary); font-size: 1.22rem; margin: 0.9rem 0 0.6rem; line-height: 1.3; }
.hm-pillar p { color: var(--color-text-light); font-size: 0.97rem; line-height: 1.75; margin: 0; }

/* ---------- Admissions ---------- */
.hm-admit { background: var(--color-surface); }
.hm-admit-card { display: grid; grid-template-columns: 1.12fr 1fr; border-radius: 30px; overflow: hidden; background: var(--color-primary); box-shadow: 0 30px 60px rgba(0, 33, 71, 0.18); }
.hm-admit-media { position: relative; min-height: 460px; }
.hm-admit-media > img:first-child { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hm-admit-polaroid { position: absolute; right: -34px; bottom: 34px; width: 38%; aspect-ratio: 4 / 3; object-fit: cover; border: 7px solid #fff; border-radius: 10px; transform: rotate(4deg); box-shadow: 0 18px 35px rgba(0, 0, 0, 0.3); z-index: 2; }
.hm-admit-body { position: relative; padding: 3.6rem 3.4rem 3.4rem 4.4rem; color: #fff; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.hm-admit-body::after { content: ''; position: absolute; right: -110px; top: -110px; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02) 70%, transparent); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 0 0 46px rgba(255, 255, 255, 0.025); }
.hm-admit-body .u-eyebrow { color: var(--color-accent); position: relative; z-index: 1; }
.hm-admit-body h2 { color: #fff; font-size: clamp(1.8rem, 3vw, 2.5rem); line-height: 1.2; margin: 0.8rem 0 1rem; position: relative; z-index: 1; }
.hm-admit-body p { color: rgba(255, 255, 255, 0.82); line-height: 1.8; margin: 0 0 1.4rem; position: relative; z-index: 1; }
.hm-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; position: relative; z-index: 1; }
.hm-checks li { display: flex; gap: 0.7rem; align-items: center; color: #fff; font-weight: 600; }
.hm-checks i { color: var(--color-accent); }
.hm-admit-body .u-hero-actions { position: relative; z-index: 1; }

/* ---------- Academic pathways ---------- */
.hm-paths { background: #fff; }
.hm-stages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.75rem; }
.hm-stage { display: flex; flex-direction: column; background: #fff; border-radius: 22px; overflow: hidden; border: 1px solid rgba(0, 33, 71, 0.08); box-shadow: 0 12px 30px rgba(0, 33, 71, 0.06); text-decoration: none; color: inherit; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.hm-stage:hover { transform: translateY(-6px); box-shadow: 0 24px 48px rgba(0, 33, 71, 0.13); }
.hm-stage-img { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.hm-stage-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.hm-stage:hover .hm-stage-img img { transform: scale(1.05); }
.hm-stage-tag { position: absolute; left: 1rem; top: 1rem; background: rgba(255, 255, 255, 0.95); color: var(--color-primary); font-weight: 700; font-size: 0.8rem; padding: 0.35rem 0.85rem; border-radius: 999px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12); }
.hm-stage-body { padding: 1.6rem 1.6rem 1.7rem; display: flex; flex-direction: column; flex: 1; }
.hm-stage-body h3 { color: var(--color-primary); font-size: 1.4rem; margin: 0 0 0.4rem; }
.hm-stage-sub { color: #b45309; font-weight: 600; font-size: 0.95rem; line-height: 1.5; margin: 0 0 0.8rem !important; }
.hm-stage-body p { color: var(--color-text-light); line-height: 1.75; margin: 0 0 1.2rem; font-size: 0.97rem; }
.hm-more { margin-top: auto; color: var(--color-primary); font-weight: 700; }
.hm-more i { transition: transform 0.2s ease; }
.hm-stage:hover .hm-more i { transform: translateX(4px); }
.hm-studio { display: grid; grid-template-columns: 1.15fr 1fr; gap: 0; margin-top: 2rem; border-radius: 26px; overflow: hidden; background: var(--color-surface); border: 1px solid rgba(0, 33, 71, 0.06); }
.hm-studio-img { min-height: 380px; position: relative; }
.hm-studio-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hm-studio-body { padding: 3rem 3rem 3.2rem; display: flex; flex-direction: column; justify-content: center; }
.hm-studio-body h3 { color: var(--color-primary); font-size: clamp(1.7rem, 2.6vw, 2.2rem); margin: 0.7rem 0 0.5rem; }
.hm-studio-body p { color: var(--color-text-light); line-height: 1.8; margin: 0 0 1.5rem; }
.hm-studio-body .btn { align-self: flex-start; }

/* ---------- U-BIS Highlights: featured story + list ---------- */
.hm-news { background: var(--color-surface); padding: 104px 0 96px; }
.hl-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 2.6rem; }
.hl-head-text { max-width: 640px; }
.hl-head h2 { font-size: clamp(1.9rem, 3.2vw, 2.6rem); color: var(--color-primary); margin: 0.7rem 0 0.6rem; line-height: 1.2; }
.hl-head p { color: var(--color-text-light); font-size: 1.05rem; line-height: 1.7; margin: 0; }
.hl-all { display: inline-flex; align-items: center; gap: 0.55rem; flex-shrink: 0; color: var(--color-primary); font-weight: 700; text-decoration: none; padding: 0.75rem 1.3rem; border: 1.5px solid rgba(0, 33, 71, 0.18); border-radius: 999px; background: #fff; transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease; }
.hl-all:hover { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.hl-all i { font-size: 0.85em; transition: transform 0.2s ease; }
.hl-all:hover i { transform: translateX(3px); }

.hl { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); gap: 1.75rem; }
.hl.is-single { grid-template-columns: minmax(0, 1fr); }

/* Stage: every slide sits in the same grid cell, the active one fades in */
.hl-stage { display: grid; grid-template-columns: minmax(0, 1fr); border-radius: 22px; overflow: hidden; background: var(--color-primary); box-shadow: 0 28px 60px -24px rgba(0, 33, 71, 0.45); touch-action: pan-y; }
.hl-slide { grid-area: 1 / 1; opacity: 0; visibility: hidden; transition: opacity 0.7s ease, visibility 0s linear 0.7s; }
.hl-slide.is-active { opacity: 1; visibility: visible; transition: opacity 0.7s ease, visibility 0s; z-index: 1; }
.hl-link { position: relative; display: block; height: 100%; aspect-ratio: 3 / 2; color: #fff; text-decoration: none; }
.hl-media { position: absolute; inset: 0; overflow: hidden; }
.hl-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 7s ease-out; }
.hl-slide.is-active .hl-media img { transform: scale(1); }
.hl-slide:not(.is-image) .hl-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 20, 45, 0.92) 0%, rgba(0, 20, 45, 0.55) 38%, rgba(0, 20, 45, 0) 68%); }
.hl-badge { position: absolute; top: 1.4rem; left: 1.4rem; z-index: 1; display: inline-flex; align-items: center; gap: 0.45rem; background: rgba(255, 255, 255, 0.96); color: var(--color-primary); font-size: 0.82rem; font-weight: 700; padding: 0.45rem 0.95rem; border-radius: 999px; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14); }
.hl-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--color-accent-hover); }
.hl-body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 2.4rem 2.6rem; }
.hl-body h3 { color: #fff; font-size: clamp(1.45rem, 2.3vw, 2.1rem); line-height: 1.25; margin: 0; max-width: 30ch; text-wrap: balance; }
.hl-summary { color: rgba(255, 255, 255, 0.84); font-size: 1rem; line-height: 1.65; margin: 0.7rem 0 0; max-width: 60ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hl-more { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 1.2rem; color: var(--color-accent); font-weight: 700; font-size: 0.95rem; }
.hl-more i { font-size: 0.85em; transition: transform 0.2s ease; }
a.hl-link:hover .hl-more i { transform: translateX(4px); }
a.hl-link:focus-visible { outline: 3px solid var(--color-accent); outline-offset: -3px; }

/* Side: controls + list of all highlights */
.hl-side { display: flex; flex-direction: column; min-width: 0; }
.hl-controls { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 0.25rem 1rem; border-bottom: 1px solid rgba(0, 33, 71, 0.1); margin-bottom: 0.6rem; }
.hl-count { color: var(--color-text-light); font-size: 0.95rem; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.hl-count b { color: var(--color-primary); font-size: 1.35rem; font-weight: 800; }
.hl-buttons { display: flex; gap: 0.5rem; }
.hl-btn { width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid rgba(0, 33, 71, 0.16); background: #fff; color: var(--color-primary); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 0.9rem; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease; }
.hl-btn:hover { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.hl-btn:focus-visible, .hl-tab:focus-visible { outline: 3px solid var(--color-accent-hover); outline-offset: 2px; }
.hl-list-wrap { position: relative; flex: 1; min-height: 0; }
.hl-list { position: absolute; inset: 0; overflow-y: auto; list-style: none; margin: 0; padding: 0 0.25rem 0 0; display: flex; flex-direction: column; gap: 0.25rem; scrollbar-width: thin; }
.hl-tab { position: relative; display: flex; align-items: center; gap: 1rem; width: 100%; padding: 0.55rem 0.6rem; border: 0; border-radius: 14px; background: transparent; text-align: left; cursor: pointer; overflow: hidden; transition: background 0.25s ease, box-shadow 0.25s ease; }
.hl-tab:hover { background: rgba(255, 255, 255, 0.7); }
.hl-tab.is-active { background: #fff; box-shadow: 0 10px 26px -12px rgba(0, 33, 71, 0.3); }
.hl-thumb { flex: 0 0 96px; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: #dfe6ee; }
.hl-thumb img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.75); opacity: 0.85; transition: filter 0.25s ease, opacity 0.25s ease; }
.hl-tab:hover .hl-thumb img, .hl-tab.is-active .hl-thumb img { filter: none; opacity: 1; }
.hl-tab-text { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.hl-tab-text small { color: #b45309; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.hl-tab-text strong { color: var(--color-primary); font-size: 0.98rem; line-height: 1.4; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; opacity: 0.78; transition: opacity 0.25s ease; }
.hl-tab.is-active strong, .hl-tab:hover strong { opacity: 1; }
.hl-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; }
.hl-progress span, .hl-bar span { display: block; height: 100%; width: 0; background: var(--color-accent-hover); }
.hl-tab.is-active .hl-progress span { width: 100%; }
.hl-bar.is-active span, .hl-bar.is-done span { width: 100%; }
/* Autoplay: the active bar fills over the slide's time, and ui.js moves on when it ends */
.hl.is-playing .hl-tab.is-active .hl-progress span, .hl.is-playing .hl-bar.is-active span { animation: hl-progress 6.5s linear forwards; animation-play-state: var(--hl-play, running); }
/* ...and holds while the pointer or keyboard focus is on the carousel */
.hl:hover, .hl:has(:focus-visible) { --hl-play: paused; }
@keyframes hl-progress { from { width: 0; } to { width: 100%; } }
.hl-bars { display: none; }
html[lang="th"] .hl-tab-text small { letter-spacing: 0.01em; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
    .hl { grid-template-columns: minmax(0, 1fr); }
    .hl-list-wrap { flex: none; }
    .hl-list { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; overflow: visible; padding: 0; }
    .hm-purpose-grid { grid-template-columns: 1fr; gap: 3rem; }
    .hm-pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 2.5rem; }
    .hm-admit-card, .hm-studio { grid-template-columns: 1fr; }
    .hm-admit-media { min-height: 320px; }
    .hm-admit-polaroid { right: 24px; bottom: -40px; width: 34%; }
    .hm-admit-body { padding: 3.6rem 2.4rem 2.8rem; }
    .hm-stages { grid-template-columns: 1fr 1fr; }
    .hm-studio-img { min-height: 280px; }
}
@media (max-width: 640px) {
    .hm-section { padding: 72px 0 !important; }
    .hm-news { padding: 72px 0; }
    .hl-head { flex-direction: column; align-items: flex-start; gap: 1.2rem; margin-bottom: 1.8rem; }
    .hl { gap: 1rem; }
    /* Phones: picture on top, text below, and story-style progress bars instead of the list */
    .hl-stage { border-radius: 18px; background: #fff; box-shadow: 0 18px 40px -22px rgba(0, 33, 71, 0.4); }
    .hl-link { aspect-ratio: auto; display: flex; flex-direction: column; color: var(--color-primary); }
    .hl-media { position: relative; inset: auto; aspect-ratio: 16 / 10; }
    .hl-slide:not(.is-image) .hl-media::after { display: none; }
    .hl-badge { top: 0.9rem; left: 0.9rem; font-size: 0.75rem; padding: 0.35rem 0.75rem; }
    .hl-body { position: static; padding: 1.2rem 1.25rem 1.4rem; }
    .hl-body h3 { color: var(--color-primary); font-size: 1.2rem; }
    .hl-summary { color: var(--color-text-light); font-size: 0.93rem; }
    .hl-more { color: #b45309; margin-top: 0.9rem; }
    .hl-side { flex-direction: column-reverse; }
    .hl-controls { border-bottom: 0; padding: 0; margin: 0; }
    .hl-list-wrap { display: none; }
    .hl-bars { display: flex; gap: 6px; margin-bottom: 0.9rem; }
    .hl-bar { flex: 1; height: 4px; border-radius: 4px; background: rgba(0, 33, 71, 0.14); overflow: hidden; }
    .hl-btn { width: 40px; height: 40px; }
    .hm-purpose { padding: 64px 0 72px; }
    .hm-pillars, .hm-stages { grid-template-columns: 1fr; }
    .hm-video-frame::before { inset: 16px -10px -12px 16px; }
    .hm-video figcaption { margin-top: 1.8rem; }
    .hm-admit-media { min-height: 240px; }
    .hm-admit-polaroid { display: none; }
    .hm-admit-body { padding: 2.4rem 1.6rem 2.2rem; }
    .hm-studio-body { padding: 2rem 1.6rem 2.2rem; }
}
