/* ==========================================================================
   Bộ hiệu ứng chuyển động toàn site (inc/hieu-ung.php).
   ========================================================================== */

/* Lenis (cuộn mượt trên máy tính) */
html.lenis, html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }
/* style.css đặt scroll-behavior: smooth cho html: tắt khi Lenis chạy, không thì hai bộ cuộn giành nhau. */
html.lenis, html.lenis.lenis-smooth { scroll-behavior: auto !important; }

/* Tiêu đề tách chữ */
.hu-tach { perspective: 400px; }
.hu-tach .hu-chu { display: inline-block; will-change: transform, opacity; }

/* Thanh đầu trang: ẩn khi cuộn xuống, hiện khi cuộn lên */
.timona-hieu-ung .site-header {
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
}
.timona-hieu-ung .site-header.hu-an-dau { transform: translateY(-100%); }

/* Banner: phóng chậm ảnh của slide đang hiện */
.timona-hieu-ung .timona-hero { overflow: hidden; }
.timona-hieu-ung .timona-hero .is-selected img {
  animation: hu-phong-cham 7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes hu-phong-cham {
  from { transform: scale(1.08); }
  to { transform: scale(1); }
}

/* Huy hiệu xoay "Đăng ký tư vấn" trên banner */
.timona-hero { position: relative; }
/* Nổi cố định góc dưới trái (máy tính): không che chữ trong ảnh banner; góc phải đã có nút gọi/chat. */
.hu-huy-hieu {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 990;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(0, 32, 88, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 21, 63, 0.35);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), background 0.3s ease;
}
.hu-huy-hieu.hu-an { transform: scale(0); }
.hu-huy-hieu:hover { transform: scale(1.08); background: rgba(0, 32, 88, 0.95); color: #fff; }
.hu-huy-hieu svg.hu-vong {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: hu-xoay 14s linear infinite;
}
.hu-huy-hieu svg.hu-vong text {
  font-size: 10.5px;
  font-weight: 700;
  /* Khoảng chữ do textLength trong hieu-ung.js chia đều cho vừa một vòng; đặt letter-spacing sẽ làm chữ tràn, mất đuôi. */
  letter-spacing: 0;
  fill: currentColor;
}
.hu-huy-hieu .hu-mui-ten {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--color-accent-gold, #f5b800);
  color: var(--color-primary, #002058);
  font-size: 22px;
  font-weight: 700;
  transition: transform 0.35s ease;
}
.hu-huy-hieu:hover .hu-mui-ten { transform: rotate(-45deg); }
.hu-huy-hieu::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.55);
  animation: hu-vong-lan 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes hu-xoay { to { transform: rotate(360deg); } }
@keyframes hu-vong-lan {
  from { transform: scale(0.92); opacity: 1; }
  to { transform: scale(1.25); opacity: 0; }
}
@media (max-width: 768px) {
  /* Banner điện thoại có nút trong ảnh ở góc dưới: huy hiệu nổi cố định trên thanh 3 nút. */
  .hu-huy-hieu { width: 78px; height: 78px; left: auto; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); }
  .hu-huy-hieu svg.hu-vong text { font-size: 10px; }
  .hu-huy-hieu .hu-mui-ten { width: 32px; height: 32px; font-size: 16px; }
}

/* Thẻ nổi lên khi rê chuột, ảnh trong thẻ phóng nhẹ */
@media (hover: hover) and (pointer: fine) {
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .course-mini-box,
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .news-card-box,
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .branch-card-box,
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .course-card,
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .corner-tile,
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .faculty-card,
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .recap-showcase-card,
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .expert-video-box {
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.45s ease;
  }
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .course-mini-box:hover,
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .news-card-box:hover,
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .branch-card-box:hover,
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .course-card:hover,
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .corner-tile:hover,
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .faculty-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(0, 32, 88, 0.16);
  }
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .course-mini-thumb,
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .news-thumb-wrap,
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .course-card-thumb,
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .branch-thumb { overflow: hidden; }
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .course-mini-thumb img,
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .news-thumb-wrap img,
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .branch-thumb img,
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .course-card-thumb img,
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .recap-showcase-card img,
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .expert-video-box img {
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .course-mini-box:hover .course-mini-thumb img,
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .news-card-box:hover .news-thumb-wrap img,
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .branch-card-box:hover .branch-thumb img,
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .course-card:hover .course-card-thumb img,
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .recap-showcase-card:hover img,
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .expert-video-box:hover img {
    transform: scale(1.06);
  }
}

/* Rê chuột (chỉ máy có chuột): gương lướt qua ảnh, nút đổ màu chéo, icon lật, thẻ đổ nền từ dưới lên.
   Cùng kiểu với bản mẫu (image-anime, btn-default, hover-flip, mission-vision-item). */
@media (hover: hover) and (pointer: fine) {
  /* Gương: dải sáng chéo bung ra rồi tan khi rê vào ảnh. */
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) :is(.course-mini-thumb, .news-thumb-wrap, .course-card-thumb, .gallery-item, .branch-thumb,
    .faculty-card-photo, .corner-tile, .recap-hero-img, .media-frame, .page-hero-media, .review-video,
    .timona-chung-anh-giua, .hero-portrait-grid > a) {
    position: relative;
    overflow: hidden;
  }
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .leader-photo { overflow: hidden; } /* giữ sticky sẵn có */
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) :is(.course-mini-thumb, .news-thumb-wrap, .course-card-thumb, .gallery-item, .branch-thumb,
    .faculty-card-photo, .corner-tile, .recap-hero-img, .media-frame, .page-hero-media, .review-video,
    .timona-chung-anh-giua, .hero-portrait-grid > a, .leader-photo)::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 0;
    background: rgba(251, 252, 253, 0.3);
    transform: translate(-50%, -50%) rotate(-45deg);
    z-index: 3;
    pointer-events: none;
  }
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) :is(.course-mini-thumb, .news-thumb-wrap, .course-card-thumb, .gallery-item, .branch-thumb,
    .faculty-card-photo, .corner-tile, .recap-hero-img, .media-frame, .page-hero-media, .review-video,
    .timona-chung-anh-giua, .hero-portrait-grid > a, .leader-photo):hover::after,
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) :is(.course-mini-box, .news-card-box, .branch-card-box, .course-card, .faculty-card):hover
    :is(.course-mini-thumb, .news-thumb-wrap, .course-card-thumb, .branch-thumb, .faculty-card-photo)::after {
    height: 250%;
    background: transparent;
    transition: all 0.6s linear;
  }
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) :is(.gallery-item, .faculty-card-photo, .corner-tile, .media-frame, .page-hero-media,
    .timona-chung-anh-giua, .hero-portrait-grid > a, .leader-photo) img {
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) :is(.gallery-item, .faculty-card, .corner-tile, .media-frame, .page-hero-media,
    .timona-chung-anh-giua, .hero-portrait-grid > a, .leader-photo):hover img {
    transform: scale(1.05);
  }

  /* Nút: nền đậm đổ chéo từ trái sang rồi phủ kín. */
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) :is(.btn-hero-primary, .btn-pill-blue, .btn-center-more, .btn-hero-ghost, .btn-outline-navy,
    .news-tab-btn:not(.active)) {
    position: relative;
    overflow: hidden;
    isolation: isolate;
  }
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) :is(.btn-hero-primary, .btn-pill-blue, .btn-center-more, .btn-hero-ghost, .btn-outline-navy,
    .news-tab-btn:not(.active))::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -15%;
    width: 0;
    height: 106%;
    background: var(--hu-nen-nut, #002058);
    transform: skew(45deg);
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: -1;
  }
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) :is(.btn-hero-primary, .btn-pill-blue, .btn-center-more, .btn-hero-ghost, .btn-outline-navy,
    .news-tab-btn:not(.active)):hover::after {
    left: 0;
    width: 100%;
    transform: skew(0);
  }
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) :is(.btn-hero-primary, .btn-pill-blue, .btn-center-more):hover { color: #fff; }
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .btn-hero-ghost { --hu-nen-nut: #fff; }
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .btn-hero-ghost:hover { background: transparent; color: var(--color-primary, #002058); }
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .btn-outline-navy:hover,
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .news-tab-btn:not(.active):hover { background: transparent; color: #fff; }
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .news-tab-btn:not(.active):hover { background: #e2e8f0; }
  /* Nút gửi form là ô input (không có lớp giả): nền đậm trượt từ trái bằng bóng trong. */
  /* Lặp lớp để thắng quy tắc của form (ux/form.css). Form cam: đổ xanh thương hiệu; form xanh: đổ xanh đậm hơn. */
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) input.wpcf7-submit.wpcf7-submit.wpcf7-submit {
    transition: box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1), transform 0.3s ease, opacity 0.2s ease;
  }
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) input.wpcf7-submit.wpcf7-submit.wpcf7-submit:hover {
    box-shadow: inset 32em 0 0 0 #00153f, 0 6px 18px rgba(0, 32, 88, 0.3);
  }
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .timona-cta-dang-ky input.wpcf7-submit.wpcf7-submit.wpcf7-submit:hover {
    box-shadow: inset 32em 0 0 0 #002058, 0 6px 18px rgba(0, 32, 88, 0.3);
  }

  /* Liên kết "Xem thêm": gạch chân chạy từ trái sang. */
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .section-link-more {
    background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
    padding-bottom: 2px;
    transition: background-size 0.4s cubic-bezier(0.22, 1, 0.36, 1), color 0.3s ease;
  }
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .section-link-more:hover { text-decoration: none; background-size: 100% 2px; }

  /* Icon tròn: đổi sang vàng và lật khi rê vào khối chứa. */
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) :is(.stat-icon-circle, .feature-icon, .course-mini-icon-circle) {
    transition: background-color 0.4s ease, border-color 0.4s ease, transform 0.4s ease;
  }
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) :is(.stat-icon-circle, .feature-icon, .course-mini-icon-circle) svg {
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), stroke 0.3s ease;
  }
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) :is(.stat-item, .feature-tile, .contact-card, .course-mini-box):hover
    :is(.stat-icon-circle, .feature-icon, .course-mini-icon-circle) {
    background-color: var(--color-accent-gold, #fbb01a);
    border-color: var(--color-accent-gold, #fbb01a);
  }
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) :is(.stat-item, .feature-tile, .contact-card, .course-mini-box):hover
    :is(.stat-icon-circle, .feature-icon, .course-mini-icon-circle) svg {
    transform: rotateY(180deg);
    stroke: var(--color-primary, #002058);
  }

  /* Thẻ sứ mệnh / tầm nhìn / giá trị: nền xanh dâng từ dưới lên, chữ đổi sáng. */
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .mvv-card { position: relative; overflow: hidden; isolation: isolate; transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .mvv-card::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 0;
    background: var(--color-primary, #002058);
    transition: height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: -1;
  }
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .mvv-card:hover { transform: translateY(-6px); }
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .mvv-card:hover::before { height: 100%; }
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .mvv-card :is(h3, p, .mvv-label) { transition: color 0.4s ease; }
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .mvv-card:hover h3 { color: #fff; }
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .mvv-card:hover p { color: rgba(255, 255, 255, 0.85); }
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .mvv-card:hover .mvv-label { color: var(--color-accent-gold, #fbb01a); }

  /* Nút nổi gọi / Zalo: nhấc nhẹ. */
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .float-action-btn { transition: transform 0.3s ease; }
  .timona-hieu-ung:where(:not(.hu-tat-chuot)) .float-action-btn:hover { transform: translateY(-3px); }
}

/* Logo báo chí chạy ngang liên tục */
.press-logos-ribbon.hu-chay-ngang {
  display: block;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.hu-chay-ngang .hu-bang {
  display: flex;
  gap: var(--hu-khoang, 24px);
  width: max-content;
  animation: hu-chay 28s linear infinite;
}
.hu-chay-ngang:hover .hu-bang { animation-play-state: paused; }
.hu-chay-ngang .press-item-box { flex: none; }
@keyframes hu-chay {
  to { transform: translateX(calc(-50% - var(--hu-khoang, 24px) / 2)); }
}

/* Con trỏ chuột tuỳ biến (chỉ máy tính). Tài khoản quản trị tắt bằng công tắc trên thanh admin (body.hu-tat-chuot). */
.hu-tat-chuot .hu-con-tro { display: none; }
.hu-con-tro {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100000;
  pointer-events: none;
  contain: layout style size;
}
.hu-con-tro::before {
  content: "";
  position: absolute;
  top: -26px;
  left: -26px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-primary, #002058);
  transform: scale(0);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.1s;
}
.hu-con-tro.-hien::before { transform: scale(0.22); }
.hu-con-tro.-bam::before { transform: scale(0.28); }
.hu-con-tro.-lien-ket::before { transform: scale(0.75); background: var(--color-accent-gold, #f5b800); opacity: 0.35; }
.hu-con-tro.-chu::before { transform: scale(1.7); opacity: 0.9; }
.hu-con-tro.-an::before { transform: scale(0); }
.hu-con-tro-chu {
  position: absolute;
  top: -20px;
  left: -30px;
  width: 60px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  opacity: 0;
  transform: scale(0) rotate(10deg);
  transition: opacity 0.35s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.hu-con-tro.-chu .hu-con-tro-chu { opacity: 1; transform: scale(1); }

@media (prefers-reduced-motion: reduce) {
  .timona-hieu-ung .timona-hero .is-selected img,
  .hu-huy-hieu svg.hu-vong,
  .hu-huy-hieu::after,
  .hu-chay-ngang .hu-bang { animation: none; }
}
