/* =====================================================================
   U-BIS site-wide UI layer (loaded after style.css)
   1. Layout & header fixes   2. Shared components (hero, headings, CTA)
   ===================================================================== */

/* ---------- 1. Layout ---------- */
:root { --page-max: 1240px; --page-gutter: 2rem; }
@media (max-width: 768px) { :root { --page-gutter: 1.25rem; } }

/* One page width for every page, the same as the home page: 1240px including the side gutters */
.u-wrap, .container, .news-wrap, .ss-wrap { box-sizing: border-box; width: 100%; max-width: var(--page-max); margin-left: auto; margin-right: auto; padding-left: var(--page-gutter); padding-right: var(--page-gutter); }
/* Tailwind's CDN stylesheet loads after ours with its own .container, max-w-* and px-* rules */
.container { max-width: var(--page-max) !important; padding-left: var(--page-gutter) !important; padding-right: var(--page-gutter) !important; }

/* Original layouts relied on the old 15vw side padding */
.admission-banner { width: 100%; margin-left: 0; margin-right: 0; }

/* ---------- Site header (views/partials/site_header.php) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: rgba(255, 255, 255, 0.94); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid rgba(0, 33, 71, 0.07); transition: box-shadow 0.3s ease, background-color 0.3s ease; }
.site-header.is-scrolled { background: rgba(255, 255, 255, 0.98); box-shadow: 0 10px 30px rgba(0, 33, 71, 0.08); }

/* Utility bar */
.sh-utility { background: var(--color-primary); font-size: 0.8rem; max-height: 40px; overflow: hidden; transition: max-height 0.3s ease, opacity 0.3s ease; }
.site-header.is-scrolled .sh-utility { max-height: 0; opacity: 0; }
.sh-utility-inner { display: flex; justify-content: space-between; align-items: center; height: 38px; }
.sh-utility-group { display: flex; align-items: center; gap: 1.6rem; }
.sh-utility a { color: rgba(255, 255, 255, 0.8); text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem; transition: color 0.2s ease; }
.sh-phones { display: inline-flex; align-items: center; gap: 0.5rem; color: rgba(255, 255, 255, 0.8); white-space: nowrap; }
.sh-phones i { color: var(--color-accent); }
.sh-phones .sh-sep { opacity: 0.45; }
.sh-drawer .sh-phones { display: grid; grid-template-columns: auto auto; justify-content: start; align-items: center; column-gap: 0.55rem; row-gap: 0.2rem; color: var(--color-primary); font-weight: 600; }
.sh-drawer .sh-phones i { grid-row: span 9; }
.sh-drawer .sh-phones .sh-sep { display: none; }
.sh-drawer .sh-phones a { color: var(--color-primary); text-decoration: none; }
.sh-drawer .sh-phones i { color: #b45309; }
.sh-utility a:hover { color: #fff; }
.sh-utility i { color: var(--color-accent); font-size: 0.75rem; }
.sh-utility-group:last-child > a + a { position: relative; }
.sh-utility-group:last-child > a + a::before { content: ''; position: absolute; left: -0.8rem; top: 50%; width: 1px; height: 12px; margin-top: -6px; background: rgba(255, 255, 255, 0.2); }

/* EN | TH switch */
.sh-lang { display: inline-flex; align-items: center; padding: 2px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.16); }
.sh-lang a, .sh-lang span { padding: 0.12rem 0.62rem; border-radius: 999px; font-weight: 700; font-size: 0.72rem; letter-spacing: 0.06em; line-height: 1.7; text-decoration: none; }
.sh-lang .is-current { background: var(--color-accent); color: var(--color-primary); }

/* Main bar */
.sh-main-inner { display: flex; align-items: center; gap: 1.5rem; height: 80px; transition: height 0.3s ease; }
.site-header.is-scrolled .sh-main-inner { height: 68px; }
.sh-logo { display: flex; align-items: center; flex-shrink: 0; margin-right: auto; }
.sh-logo img { height: 50px; width: auto; display: block; transition: height 0.3s ease; }
.site-header.is-scrolled .sh-main-inner .sh-logo img { height: 44px; }
.sh-nav { height: 100%; }
.sh-menu { display: flex; align-items: stretch; gap: 0.15rem; height: 100%; margin: 0; padding: 0; list-style: none; }
.sh-menu > li { position: relative; display: flex; align-items: center; }
.sh-link { position: relative; display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.55rem 0.8rem; border: 0; border-radius: 10px; background: none; font: inherit; font-weight: 600; font-size: 0.96rem; color: var(--color-primary); text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color 0.2s ease; }
.sh-link i { font-size: 0.6rem; opacity: 0.55; transition: transform 0.25s ease; }
.sh-link::after { content: ''; position: absolute; left: 0.8rem; right: 0.8rem; bottom: 0.15rem; height: 2px; border-radius: 2px; background: var(--color-accent); transform: scaleX(0); transform-origin: left; transition: transform 0.25s ease; }
.sh-link:hover, .sh-item.is-open > .sh-link { background: rgba(0, 33, 71, 0.05); }
.sh-link.is-active::after { transform: scaleX(1); }
.sh-item.is-open > .sh-toggle i { transform: rotate(180deg); }

/* Dropdown panels */
.sh-panel { display: none; position: absolute; top: 100%; left: 50%; z-index: 20; padding-top: 6px; transform: translateX(-50%); }
.sh-item.is-open > .sh-panel { display: block; animation: sh-panel-in 0.2s ease-out; }
@media (hover: hover) {
    .sh-item:hover > .sh-link { background: rgba(0, 33, 71, 0.05); }
    .sh-item:hover > .sh-toggle i { transform: rotate(180deg); }
    .sh-item:hover > .sh-panel { display: block; animation: sh-panel-in 0.2s ease-out; }
}
@keyframes sh-panel-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
/* The last menu item opens to the left so its panel never runs off the screen */
.sh-menu > li:last-child > .sh-panel { left: auto; right: -0.5rem; transform: none; animation-name: sh-panel-in-end; }
.sh-menu > li:last-child .sh-panel-card::before { left: auto; right: 3rem; transform: rotate(45deg); }
@keyframes sh-panel-in-end { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.sh-panel-card { position: relative; display: flex; gap: 0.5rem; padding: 0.6rem; background: #fff; border-radius: 18px; border: 1px solid rgba(0, 33, 71, 0.07); box-shadow: 0 30px 60px -12px rgba(0, 33, 71, 0.25), 0 12px 24px -8px rgba(0, 33, 71, 0.1); }
.sh-panel-card::before { content: ''; position: absolute; top: -7px; left: 50%; width: 13px; height: 13px; background: #fff; border-left: 1px solid rgba(0, 33, 71, 0.07); border-top: 1px solid rgba(0, 33, 71, 0.07); border-radius: 3px 0 0 0; transform: translateX(-50%) rotate(45deg); }
.sh-panel-list { flex: 1; min-width: 350px; margin: 0; padding: 0; list-style: none; }
.sh-panel-link { display: flex; align-items: flex-start; gap: 0.85rem; padding: 0.7rem 0.8rem; border-radius: 12px; text-decoration: none; transition: background-color 0.2s ease; }
.sh-panel-link:hover, .sh-panel-link[aria-current="page"] { background: var(--color-surface); }
.sh-ico { flex-shrink: 0; width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: rgba(251, 191, 36, 0.16); color: #b45309; font-size: 0.95rem; transition: background-color 0.2s ease, color 0.2s ease; }
.sh-panel-link:hover .sh-ico, .sh-panel-link[aria-current="page"] .sh-ico { background: var(--color-primary); color: var(--color-accent); }
.sh-panel-text { display: flex; flex-direction: column; gap: 0.15rem; padding-top: 0.1rem; }
.sh-panel-text strong { color: var(--color-primary); font-size: 0.95rem; font-weight: 700; line-height: 1.3; }
.sh-panel-text small { color: var(--color-text-light); font-size: 0.82rem; line-height: 1.45; }
.sh-ext { font-size: 0.62rem; opacity: 0.5; margin-left: 0.2rem; }

/* Admissions panel: "Visit U-BIS" card */
.sh-promo { position: relative; width: 250px; flex-shrink: 0; display: flex; flex-direction: column; gap: 0.45rem; padding: 1.4rem 1.3rem 1.2rem; border-radius: 14px; overflow: hidden; color: rgba(255, 255, 255, 0.82);
    background: linear-gradient(180deg, rgba(0, 33, 71, 0.08) 0%, rgba(0, 33, 71, 0.55) 26%, rgba(0, 33, 71, 0.94) 50%, #002147 100%), url('images/UBISBG.jpg') center 12% / 140% auto no-repeat, #002147; }
.sh-promo-eyebrow { margin-top: 4.2rem; color: var(--color-accent); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.sh-promo strong { color: #fff; font-size: 1.25rem; line-height: 1.25; }
.sh-promo p { margin: 0 0 0.6rem; font-size: 0.86rem; line-height: 1.55; }
.sh-promo .btn { margin-top: auto; padding: 0.6rem 1rem; font-size: 0.86rem; }
.sh-promo-call { justify-content: center; display: inline-flex; gap: 0.4rem; align-items: center; margin-top: 0.3rem; color: rgba(255, 255, 255, 0.8); font-size: 0.8rem; text-decoration: none; }
.sh-promo-call:hover { color: #fff; }

/* CTA + burger */
.sh-cta { flex-shrink: 0; padding: 0.65rem 1.35rem !important; font-size: 0.92rem !important; white-space: nowrap; box-shadow: 0 8px 18px rgba(251, 191, 36, 0.3); }
.sh-burger { display: none; flex-shrink: 0; width: 46px; height: 46px; border: 0; border-radius: 12px; background: var(--color-primary); cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 5px; box-shadow: 0 6px 14px rgba(0, 33, 71, 0.18); }
.sh-burger span { display: block; width: 20px; height: 2px; border-radius: 2px; background: #fff; }

/* Mobile drawer */
.sh-drawer { position: fixed; inset: 0; z-index: 1100; visibility: hidden; transition: visibility 0s linear 0.35s; }
.sh-drawer.is-open { visibility: visible; transition-delay: 0s; }
.sh-backdrop { position: absolute; inset: 0; background: rgba(0, 20, 48, 0.55); opacity: 0; transition: opacity 0.35s ease; }
.sh-drawer.is-open .sh-backdrop { opacity: 1; }
.sh-drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(400px, 88vw); will-change: transform; display: flex; flex-direction: column; background: #fff; box-shadow: -20px 0 50px rgba(0, 20, 48, 0.25); transform: translateX(100%); transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.sh-drawer.is-open .sh-drawer-panel { transform: none; }
.sh-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 1.25rem; border-bottom: 1px solid rgba(0, 33, 71, 0.08); }
.sh-drawer-head .sh-logo img { height: 42px; }
.sh-close { width: 42px; height: 42px; border-radius: 12px; border: 1px solid rgba(0, 33, 71, 0.12); background: #fff; color: var(--color-primary); font-size: 1.15rem; cursor: pointer; }
.sh-drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0.4rem 1.25rem 1rem; }
.sh-m-link { display: flex; align-items: center; justify-content: space-between; padding: 0.95rem 0.25rem; border-bottom: 1px solid rgba(0, 33, 71, 0.07); color: var(--color-primary); font-weight: 700; font-size: 1.05rem; text-decoration: none; cursor: pointer; list-style: none; }
.sh-m-link::-webkit-details-marker { display: none; }
.sh-m-link i { font-size: 0.72rem; opacity: 0.55; transition: transform 0.25s ease; }
.sh-m-link.is-active { color: #b45309; }
.sh-m-group[open] > .sh-m-link { border-bottom-color: transparent; }
.sh-m-group[open] > .sh-m-link i { transform: rotate(180deg); }
.sh-m-group ul { display: grid; gap: 0.15rem; margin: 0; padding: 0 0 0.8rem; list-style: none; border-bottom: 1px solid rgba(0, 33, 71, 0.07); }
.sh-m-group li a { display: flex; align-items: center; gap: 0.8rem; padding: 0.5rem; border-radius: 12px; color: var(--color-text); font-weight: 500; text-decoration: none; }
.sh-m-group li a:hover, .sh-m-group li a[aria-current="page"] { background: var(--color-surface); color: var(--color-primary); font-weight: 600; }
.sh-m-group .sh-ico { width: 34px; height: 34px; border-radius: 10px; font-size: 0.85rem; }
.sh-drawer-foot { display: grid; gap: 0.9rem; padding: 1rem 1.25rem 1.25rem; border-top: 1px solid rgba(0, 33, 71, 0.08); background: var(--color-surface); }
.sh-drawer-foot .btn { width: 100%; }
.sh-drawer-meta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.sh-drawer-meta > a { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--color-primary); font-weight: 600; text-decoration: none; }
.sh-drawer-meta > a i { color: #b45309; }
.sh-drawer .sh-lang { background: #fff; border-color: rgba(0, 33, 71, 0.12); }
.sh-drawer .sh-lang a { color: var(--color-primary); }
body.nav-open { overflow: hidden; }

@media (max-width: 1240px) {
    .sh-cta { display: none; }
    .sh-link { padding: 0.55rem 0.65rem; }
    .sh-link::after { left: 0.65rem; right: 0.65rem; }
}
@media (max-width: 1080px) {
    .sh-utility, .sh-nav { display: none; }
    .sh-burger { display: flex; }
    .sh-cta { display: inline-block; padding: 0.55rem 1.05rem !important; font-size: 0.86rem !important; box-shadow: none; }
    .sh-main-inner, .site-header.is-scrolled .sh-main-inner { height: 70px; gap: 0.75rem; }
    .sh-logo img, .site-header.is-scrolled .sh-main-inner .sh-logo img { height: 44px; }
}
@media (max-width: 479px) { .sh-cta { display: none; } }
@media (min-width: 1081px) { .sh-drawer { display: none; } }
@media (prefers-reduced-motion: reduce) {
    .sh-drawer, .sh-drawer-panel, .sh-backdrop { transition: none; }
    .sh-panel { animation: none !important; }
}

/* ---------- 2. Shared components ---------- */

.u-eyebrow { display: inline-flex; align-items: center; gap: 0.6rem; color: #b45309; font-weight: 700; font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; }
.u-eyebrow::before { content: ''; width: 28px; height: 2px; background: var(--color-accent); }
.u-section { padding: 96px 0; }
.u-section.tight { padding: 64px 0; }
.u-section.surface { background: var(--color-surface); }
.u-section.white { background: #fff; }
.u-head { margin-bottom: 3rem; max-width: 760px; }
.u-head.center { text-align: center; margin-left: auto; margin-right: auto; }
.u-head h2 { font-size: clamp(1.9rem, 3.2vw, 2.6rem); color: var(--color-primary); margin: 0.7rem 0 0.8rem; line-height: 1.2; }
.u-head p { color: var(--color-text-light); font-size: 1.08rem; line-height: 1.75; margin: 0; }

/* Page hero (light, consistent with the header) */
.u-hero { position: relative; padding: 175px 0 80px; overflow: hidden;
    background: radial-gradient(800px 420px at 90% 0%, rgba(240, 180, 41, 0.18) 0%, transparent 60%),
                radial-gradient(700px 380px at 0% 100%, rgba(11, 69, 156, 0.09) 0%, transparent 65%),
                linear-gradient(180deg, #f4f7fc 0%, #ffffff 100%); }
.u-hero::before { content: ''; position: absolute; inset: 0; opacity: 0.35; pointer-events: none; background-image: radial-gradient(rgba(0, 33, 71, 0.10) 1px, transparent 1px); background-size: 22px 22px; -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%); mask-image: linear-gradient(180deg, #000 0%, transparent 85%); }
.u-hero .u-wrap { position: relative; z-index: 1; }
.u-hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 4rem; align-items: center; }
.u-hero.no-image .u-hero-grid { grid-template-columns: 1fr; text-align: center; }
.u-hero.no-image .u-hero-text { max-width: 820px; margin: 0 auto; }
.u-hero.no-image .u-crumbs, .u-hero.no-image .u-hero-actions { justify-content: center; }
.u-crumbs { display: flex; flex-wrap: wrap; gap: 0.55rem; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-light); margin-bottom: 1.4rem; }
.u-crumbs a { color: var(--color-primary); text-decoration: none; }
.u-crumbs a:hover { text-decoration: underline; }
.u-crumbs .sep { color: var(--color-accent); }
.u-hero h1 { font-size: clamp(2.3rem, 4.6vw, 3.8rem); line-height: 1.08; color: var(--color-primary); margin: 0.8rem 0 1.2rem; letter-spacing: -0.01em; }
.u-hero .u-lead { color: var(--color-text-light); font-size: 1.15rem; line-height: 1.8; margin: 0; max-width: 640px; }
.u-hero.no-image .u-lead { margin: 0 auto; }
.u-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; margin-top: 2rem; }
.u-hero-media { position: relative; }
.u-hero-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 24px; border: 6px solid #fff; box-shadow: 0 25px 50px rgba(0, 33, 71, 0.16); display: block; }
.u-hero-media::before { content: ''; position: absolute; inset: 26px -18px -18px 26px; border-radius: 26px; background: rgba(240, 180, 41, 0.22); z-index: -1; }
.u-link { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; color: var(--color-primary); text-decoration: none; }
.u-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.u-link.light { color: #fff; }

/* Page banner (interior pages): school photo under a navy gradient, title bottom-left */
.u-banner { position: relative; isolation: isolate; display: flex; align-items: flex-end; min-height: 500px; padding: 170px 0 76px; overflow: hidden; background: var(--color-primary); color: #fff; }
.u-banner-img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transform: scale(1.03); animation: u-banner-in 1.4s ease-out both; }
.u-banner-shade { position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(90deg, rgba(0, 24, 54, 0.94) 0%, rgba(0, 33, 71, 0.82) 34%, rgba(0, 33, 71, 0.42) 66%, rgba(0, 33, 71, 0.16) 100%),
                linear-gradient(0deg, rgba(0, 24, 54, 0.62) 0%, rgba(0, 24, 54, 0) 46%); }
.u-banner::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-accent) 22%, rgba(251, 191, 36, 0) 60%); }
.u-banner-inner { position: relative; width: 100%; }
.u-banner-inner > * { max-width: 720px; }
.u-banner .u-crumbs { color: rgba(255, 255, 255, 0.72); margin-bottom: 1.6rem; }
.u-banner .u-crumbs a { color: #fff; }
.u-banner .u-eyebrow { color: var(--color-accent); }
.u-banner h1 { color: #fff; font-size: clamp(2.4rem, 4.8vw, 3.9rem); line-height: 1.08; letter-spacing: -0.015em; margin: 0.5rem 0 0; text-shadow: 0 2px 24px rgba(0, 16, 40, 0.35); }
.u-banner .u-eyebrow + h1 { margin-top: 0.9rem; }
.u-banner .u-lead { color: rgba(255, 255, 255, 0.88); font-size: 1.15rem; line-height: 1.75; margin: 1.2rem 0 0; }
.u-banner .u-hero-actions { margin-top: 2.1rem; }
@keyframes u-banner-in { from { transform: scale(1.09); } to { transform: scale(1.03); } }
@media (max-width: 760px) {
    .u-banner { min-height: 440px; padding: 140px 0 56px; }
    .u-banner-shade { background: linear-gradient(180deg, rgba(0, 33, 71, 0.55) 0%, rgba(0, 33, 71, 0.72) 45%, rgba(0, 24, 54, 0.94) 100%); }
    .u-banner .u-lead { font-size: 1.04rem; }
}
@media (prefers-reduced-motion: reduce) { .u-banner-img { animation: none; } }

/* CTA band */
.u-cta { border-radius: 26px; padding: 3.2rem; display: flex; justify-content: space-between; align-items: center; gap: 2rem; flex-wrap: wrap; background: linear-gradient(135deg, #002147 0%, #0b459c 100%); position: relative; overflow: hidden; }
.u-cta::after { content: ''; position: absolute; right: -70px; top: -70px; width: 260px; height: 260px; border-radius: 50%; background: rgba(240, 180, 41, 0.18); }
.u-cta h2 { color: #fff; font-size: 1.8rem; margin: 0 0 0.6rem; line-height: 1.25; }
.u-cta p { color: rgba(255, 255, 255, 0.82); margin: 0; max-width: 580px; line-height: 1.7; }
.u-cta-actions { position: relative; z-index: 1; display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }

/* Cards */
.u-card { background: #fff; border: 1px solid rgba(0, 33, 71, 0.08); border-radius: 20px; padding: 2rem 1.8rem; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.u-card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(0, 33, 71, 0.10); }
.u-icon { width: 52px; height: 52px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; background: rgba(240, 180, 41, 0.16); color: #b45309; font-size: 1.3rem; margin-bottom: 1.2rem; }
.u-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.u-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }

@media (max-width: 960px) {
    .u-hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
    .u-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .u-section { padding: 72px 0; }
}
@media (max-width: 640px) {
    .u-hero { padding: 140px 0 56px; }
    .u-grid-3, .u-grid-2 { grid-template-columns: 1fr; }
    .u-cta { padding: 2.2rem 1.6rem; }
    .u-hero-media::before { inset: 14px -8px -10px 14px; }
}

/* ---------- Click-to-load video ---------- */
.u-video { position: relative; aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; cursor: pointer; background: #000; box-shadow: 0 25px 50px rgba(0, 33, 71, 0.2); }
.u-video img { width: 100%; height: 100%; object-fit: cover; opacity: 0.88; transition: opacity 0.3s ease, transform 0.6s ease; display: block; }
.u-video:hover img { opacity: 1; transform: scale(1.02); }
.u-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.u-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 88px; height: 88px; border-radius: 50%; border: 0; background: var(--color-accent); color: var(--color-primary); font-size: 1.7rem; cursor: pointer; box-shadow: 0 0 0 14px rgba(240, 180, 41, 0.28); transition: transform 0.2s ease; }
.u-play i { margin-left: 6px; }
.u-video:hover .u-play { transform: translate(-50%, -50%) scale(1.07); }

/* ---------- Home hero ---------- */
.home-hero { position: relative; min-height: 92vh; display: flex; align-items: center; padding: 190px 0 120px; background-size: cover; background-position: center 30%; overflow: hidden; }
.home-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(0, 20, 48, 0.92) 0%, rgba(0, 33, 71, 0.78) 38%, rgba(0, 33, 71, 0.25) 75%, rgba(0, 33, 71, 0.1) 100%); }
.home-hero .u-wrap { position: relative; z-index: 1; width: 100%; }
.home-hero-text { max-width: 660px; color: #fff; }
.home-hero .u-eyebrow { color: var(--color-accent); }
.home-hero h1 { font-size: clamp(2.8rem, 6vw, 5rem); line-height: 1.02; color: #fff; margin: 1rem 0 1.4rem; letter-spacing: -0.02em; }
.home-hero h1 span { display: block; color: var(--color-accent); font-size: 0.42em; letter-spacing: 0.32em; font-weight: 700; margin-top: 0.8rem; }
.home-hero p { color: rgba(255, 255, 255, 0.86); font-size: 1.18rem; line-height: 1.8; max-width: 560px; margin: 0; }
.home-hero .u-hero-actions .btn-outline { color: #fff; border-color: rgba(255, 255, 255, 0.55); }
.home-hero .u-hero-actions .btn-outline:hover { background: #fff; color: var(--color-primary); }
.home-facts { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2.8rem; padding: 0; list-style: none; }
.home-facts li { display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.6rem 1rem; border-radius: 999px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.18); color: #fff; font-weight: 600; font-size: 0.92rem; backdrop-filter: blur(6px); }
.home-facts i { color: var(--color-accent); }
.home-scroll { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 1; color: rgba(255, 255, 255, 0.8); font-size: 1.3rem; animation: homeBounce 2s infinite; }
@keyframes homeBounce { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }
@media (max-width: 640px) {
    .home-hero { min-height: 0; padding: 150px 0 90px; }
    .home-hero::before { background: linear-gradient(180deg, rgba(0, 20, 48, 0.85) 0%, rgba(0, 33, 71, 0.75) 100%); }
    .home-scroll { display: none; }
}

/* ---------- Footer ---------- */
.site-footer { position: relative; background: #001a3a; color: rgba(255, 255, 255, 0.78); padding: 88px 0 0; overflow: hidden; }
.site-footer::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--color-accent) 0%, #f59e0b 40%, #0b459c 100%); }
.site-footer::after { content: ''; position: absolute; right: -180px; top: -180px; width: 460px; height: 460px; border-radius: 50%; background: radial-gradient(circle, rgba(11, 69, 156, 0.45) 0%, transparent 70%); pointer-events: none; }
.site-footer .u-wrap { position: relative; z-index: 1; }
.sf-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1.45fr; gap: 2.5rem; padding-bottom: 3.5rem; }
.sf-logo img { width: 88px; height: 88px; border-radius: 18px; display: block; box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3); }
.sf-tagline { margin: 1.4rem 0 1.6rem; font-size: 0.95rem; line-height: 1.75; max-width: 300px; color: rgba(255, 255, 255, 0.7); }
.sf-social { display: flex; gap: 0.6rem; }
.sf-social a { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.12); text-decoration: none; transition: all 0.2s ease; }
.sf-social a:hover { background: var(--color-accent); color: var(--color-primary); border-color: var(--color-accent); transform: translateY(-2px); }
.sf-col h2 { color: #fff; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; margin: 0.3rem 0 1.3rem; }
.sf-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.sf-col a { color: rgba(255, 255, 255, 0.72); text-decoration: none; font-size: 0.93rem; transition: color 0.2s ease; }
.sf-col a:hover { color: var(--color-accent); }
.sf-ext { font-size: 0.65rem; opacity: 0.6; margin-left: 2px; }
.sf-contact li { display: flex; gap: 0.7rem; align-items: flex-start; font-size: 0.92rem; line-height: 1.6; }
.sf-contact li i { color: var(--color-accent); width: 16px; margin-top: 0.3rem; flex-shrink: 0; }
.sf-contact a { word-break: break-word; }
.sf-phones { display: flex; flex-direction: column; }
.sf-cta { margin-top: 1.4rem; padding: 0.65rem 1.4rem !important; font-size: 0.92rem !important; color: var(--color-primary) !important; }
.sf-accredit { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem 1.25rem; padding: 1.6rem 0; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.sf-accredit-label { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255, 255, 255, 0.55); }
.sf-badge { height: 48px; padding: 6px 14px; border-radius: 10px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12); display: inline-flex; align-items: center; }
.sf-badge-light { background: #fff; }
.sf-badge img { height: 100%; width: auto; display: block; }
.sf-portals { margin-left: auto; display: flex; gap: 1.25rem; flex-wrap: wrap; }
.sf-portals a { color: rgba(255, 255, 255, 0.8); text-decoration: none; font-size: 0.9rem; font-weight: 600; }
.sf-portals a:hover { color: var(--color-accent); }
.sf-portals i { color: var(--color-accent); margin-right: 0.3rem; }
.sf-bottom { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1.4rem 0 1.6rem; border-top: 1px solid rgba(255, 255, 255, 0.1); font-size: 0.86rem; color: rgba(255, 255, 255, 0.55); }
.sf-bottom p { margin: 0; }
.sf-bottom-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.sf-bottom-links a { color: rgba(255, 255, 255, 0.7); text-decoration: none; }
.sf-bottom-links a:hover { color: #fff; }
@media (max-width: 1080px) {
    .sf-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sf-brand { grid-column: 1 / -1; }
    .sf-contact { grid-column: span 3; }
}
@media (max-width: 640px) {
    .site-footer { padding-top: 64px; }
    .sf-grid { grid-template-columns: 1fr 1fr; gap: 2rem 1.5rem; }
    .sf-contact { grid-column: 1 / -1; }
    .sf-portals { margin-left: 0; }
}

/* ---------- Accessibility & polish ---------- */
.skip-link { position: absolute; left: 1rem; top: -60px; z-index: 2000; background: var(--color-primary); color: #fff; padding: 0.7rem 1.2rem; border-radius: 10px; font-weight: 700; text-decoration: none; transition: top 0.2s ease; }
.skip-link:focus { top: 1rem; }
main:focus { outline: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(251, 191, 36, 0.85); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(251, 191, 36, 0.35); color: var(--color-primary); }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
    .fade-up { opacity: 1 !important; transform: none !important; }
}

/* ---------- Home trust strip ---------- */
.trust-strip { position: relative; z-index: 3; margin-top: -56px; margin-bottom: 8px; }
.trust-grid { list-style: none; margin: 0; padding: 0.4rem; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: #fff; border-radius: 22px; box-shadow: 0 25px 50px rgba(0, 33, 71, 0.14); border: 1px solid rgba(0, 33, 71, 0.06); }
.trust-grid li { display: flex; align-items: center; gap: 0.9rem; padding: 1.3rem 1.4rem; }
.trust-grid li + li { border-left: 1px solid rgba(0, 33, 71, 0.08); }
.trust-icon { width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: rgba(251, 191, 36, 0.16); color: #b45309; font-size: 1.2rem; }
.trust-grid strong { display: block; color: var(--color-primary); font-size: 0.98rem; line-height: 1.3; }
.trust-grid small { display: block; color: var(--color-text-light); font-size: 0.82rem; line-height: 1.4; margin-top: 0.15rem; }
@media (max-width: 1080px) {
    .trust-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .trust-grid li:nth-child(3) { border-left: 0; }
    .trust-grid li:nth-child(n+3) { border-top: 1px solid rgba(0, 33, 71, 0.08); }
}
@media (max-width: 560px) {
    .trust-strip { margin-top: -36px; }
    .trust-grid { grid-template-columns: 1fr; }
    .trust-grid li + li { border-left: 0; border-top: 1px solid rgba(0, 33, 71, 0.08); }
}

/* ---------- Mobile polish ---------- */
@media (max-width: 640px) {
    .home-hero h1 span { letter-spacing: 0.16em; }
    .u-head h2 { font-size: 1.7rem; }
    .u-hero h1 { font-size: 2.2rem; }
}

/* ---------- Footer refinements (seamless with the home page wave, no broken e-mails) ---------- */
.site-footer { background: var(--color-primary); }
.site-footer::before { display: none; }
.sf-grid { grid-template-columns: 1.25fr 0.85fr 1.05fr 0.95fr 1.6fr; }
.sf-tagline { max-width: 290px; text-wrap: pretty; }
.sf-contact a { white-space: nowrap; word-break: normal; overflow-wrap: normal; }
.sf-contact li { font-size: 0.9rem; }
@media (max-width: 1080px) { .sf-contact a { white-space: normal; overflow-wrap: anywhere; } }

/* ---------- Home closing section (blends into the footer) ---------- */
.home-final { position: relative; padding: 140px 0 120px; background-size: cover; background-position: center 35%; text-align: center; overflow: hidden; }
.home-final::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 33, 71, 0.55) 0%, rgba(0, 33, 71, 0.82) 55%, var(--color-primary) 100%); }
.home-final .u-wrap { position: relative; z-index: 1; }
.home-final-inner { max-width: 760px; margin: 0 auto; }
.home-final .u-eyebrow { color: var(--color-accent); }
.home-final h2 { color: #fff; font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.15; margin: 0.9rem 0 1rem; }
.home-final p { color: rgba(255, 255, 255, 0.85); font-size: 1.12rem; line-height: 1.8; margin: 0 auto; max-width: 640px; }
.home-final .u-hero-actions { justify-content: center; }
.home-final-outline { color: #fff !important; border-color: rgba(255, 255, 255, 0.55) !important; }
.home-final-outline:hover { background: #fff !important; color: var(--color-primary) !important; }
.home-final-contact { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.75rem 2rem; margin-top: 2.2rem; }
.home-final-contact a { color: rgba(255, 255, 255, 0.85); text-decoration: none; font-weight: 600; }
.home-final-contact a:hover { color: #fff; }
.home-final-contact i { color: var(--color-accent); margin-right: 0.35rem; }

/* Footer: no glow at the top edge (it showed a seam), balanced tagline */
.site-footer::after { top: auto; bottom: -220px; right: -160px; opacity: 0.6; }
.sf-tagline { max-width: 270px; text-wrap: balance; }

/* ---------- Footer: tablet & mobile layout ---------- */
@media (max-width: 1080px) {
    .sf-grid { gap: 2.5rem 2rem; }
    /* Brand row: logo on the left, tagline + social beside it */
    .sf-brand { display: grid; grid-template-columns: auto 1fr; column-gap: 1.5rem; align-items: center; }
    .sf-brand .sf-logo { grid-row: 1 / span 2; }
    .sf-tagline { margin: 0 0 0.9rem; max-width: 520px; align-self: end; }
    .sf-social { align-self: start; }
    .sf-contact ul { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; }
}
@media (max-width: 640px) {
    .site-footer { padding-top: 56px; }
    .sf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.25rem 1.25rem; padding-bottom: 2.5rem; }

    /* Brand: centred stack */
    .sf-brand { grid-template-columns: 1fr; justify-items: center; text-align: center; }
    .sf-brand .sf-logo { grid-row: auto; }
    .sf-logo img { width: 72px; height: 72px; border-radius: 16px; }
    .sf-tagline { margin: 1rem auto 1.2rem; max-width: 340px; align-self: auto; }
    .sf-social { justify-content: center; }
    .sf-social a { width: 44px; height: 44px; }

    /* Link columns: bigger tap targets, tighter rhythm */
    .sf-col h2 { margin: 0 0 0.5rem; }
    .sf-col ul { gap: 0; }
    .sf-col li > a { display: inline-flex; align-items: center; gap: 0.3rem; min-height: 40px; padding: 0.1rem 0; overflow-wrap: anywhere; }
    .sf-admissions { grid-column: 1 / -1; }
    .sf-admissions ul { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.25rem; }

    /* Contact: card with a full-width CTA */
    .sf-contact { grid-column: 1 / -1; padding: 1.4rem 1.25rem; border-radius: 16px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); }
    .sf-contact ul { grid-template-columns: 1fr; gap: 0.9rem; }
    .sf-contact li a { display: inline-block; padding: 0.15rem 0; }
    .sf-phones { gap: 0.2rem; }
    .sf-cta { display: flex !important; justify-content: center; align-items: center; width: 100%; min-height: 48px; margin-top: 1.3rem; }

    /* Accreditation + portals */
    .sf-accredit { justify-content: center; gap: 0.9rem; padding: 1.6rem 0; }
    .sf-accredit-label { flex-basis: 100%; text-align: center; }
    .sf-badge { height: 44px; }
    .sf-portals { flex-basis: 100%; margin: 0.4rem 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
    .sf-portals a { display: flex; align-items: center; justify-content: center; gap: 0.45rem; min-height: 48px; padding: 0.5rem 0.75rem; border-radius: 12px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12); font-size: 0.86rem; text-align: center; line-height: 1.3; }
    .sf-portals i { margin-right: 0; }

    /* Bottom bar: links first, copyright last, clear of the iOS home indicator */
    .sf-bottom { flex-direction: column-reverse; text-align: center; gap: 0.75rem; padding: 1.2rem 0 calc(1.4rem + env(safe-area-inset-bottom, 0px)); font-size: 0.82rem; }
    .sf-bottom-links { justify-content: center; gap: 0 1.25rem; }
    .sf-bottom-links a { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 40px; }
}
@media (max-width: 360px) {
    .sf-grid { column-gap: 1rem; }
    .sf-portals { grid-template-columns: 1fr; }
}

/* Thai has no capitals: wide letter-spacing (meant for English uppercase labels) breaks up the script */
html[lang="th"] :is(.u-eyebrow, .u-crumbs, .tl-label, .vg-tag, .vg-meta small, .sh-promo-eyebrow, .sf-col h2, .news-eyebrow, .ss-eyebrow, .ss-crumbs, .article-crumbs, .campus-tag, .sh-lang, .tl-ov-label) { letter-spacing: 0.01em; }
