/* ==========================================================================
   KIDO · Bổ sung cho WordPress
   Các lớp do WordPress sinh ra (menu, breadcrumb, nội dung bài viết...)
   ========================================================================== */

/* --- Menu do WP sinh (li > a, không có class trên <a>) --------------------- */
.nav__list {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__list li {
  position: relative;
}

.nav__list li > a {
  display: inline-flex;
  align-items: center;
  padding: 0.55em 0.95em;
  border-radius: var(--r-pill);
  font-size: var(--fs-base);
  font-weight: 600;
  color: inherit;
  text-decoration: none;
  transition: background-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}

.nav__list li.current-menu-item > a,
.nav__list li.current-menu-ancestor > a,
.nav__list li.current_page_item > a {
  background: var(--navy-50);
  color: var(--navy);
}

.site-header--float .nav__list li.current-menu-item > a,
.site-header--float .nav__list li.current-menu-ancestor > a,
.site-header--float .nav__list li.current_page_item > a {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.site-header.is-stuck .nav__list li.current-menu-item > a,
.site-header.is-stuck .nav__list li.current-menu-ancestor > a,
.site-header.is-stuck .nav__list li.current_page_item > a,
.site-header.is-menu-open .nav__list li.current-menu-item > a {
  background: var(--navy-50);
  color: var(--navy);
}

/* Submenu */
.nav__list .sub-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 240px;
  padding: 0.5rem;
  margin: 0;
  list-style: none;
  background: #fff;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease),
    visibility var(--dur-2);
  z-index: 10;
}

.nav__list li:hover > .sub-menu,
.nav__list li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.nav__list .sub-menu a {
  display: block;
  padding: 0.6em 0.8em;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  color: var(--ink-soft);
}

.nav__list .sub-menu a:hover {
  background: var(--sky-50);
  color: var(--navy);
}

/* Menu mobile + footer */
.mobile-menu__list,
.footer__links,
.footer__legal-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-menu__list li > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9em 0.25em;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--navy);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.footer__links li + li {
  margin-top: 0.55em;
}

.footer__links a,
.footer__legal-links a {
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  font-size: var(--fs-base);
  transition: color var(--dur-1) var(--ease);
}

.footer__links a:hover,
.footer__legal-links a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer__legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
}/* --- Breadcrumb ----------------------------------------------------------- */
.crumbs {
  margin-bottom: var(--sp-4);
  font-size: var(--fs-sm);
  color: var(--muted);
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.crumbs li {
  display: flex;
  align-items: center;
  min-width: 0;
}

.crumbs li + li::before {
  content: "›";
  margin-right: 0.4rem;
  color: var(--line-strong);
  flex: none;
}

.crumbs li:last-child {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.crumbs li:last-child > * {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crumbs a {
  color: var(--body);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--navy);
  text-decoration: underline;
}

/* --- Page hero (trang phụ) ------------------------------------------------ */
.page-hero {
  position: relative;
  /* Header sticky đã chiếm chỗ trong luồng → không cộng thêm --header-h nữa. */
  padding-block: clamp(1.5rem, 2.8vw, 2.25rem) clamp(1.25rem, 2.4vw, 2rem);
  background:
    radial-gradient(ellipse 60% 70% at 85% 0%, rgba(90, 169, 240, 0.14), transparent 60%),
    linear-gradient(180deg, var(--navy-50) 0%, #fff 100%);
  border-bottom: 1px solid var(--line);
}

.page-hero .crumbs {
  margin-bottom: clamp(0.5rem, 1.4vw, 0.9rem);
}

.page-hero h1 {
  max-width: 24ch;
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
  color: var(--navy-900);
}

.page-hero__lead {
  max-width: 62ch;
  margin-top: var(--sp-3);
  font-size: var(--fs-md);
  color: var(--body);
}

/* --- Nội dung bài viết ---------------------------------------------------- */
.prose {
  max-width: 74ch;
  font-size: var(--fs-body);
  line-height: 1.75;
  color: var(--ink-soft);
}

.prose > * + * {
  margin-top: 1.15em;
}

.prose > :first-child {
  margin-top: 0;
}

.prose h2 {
  margin-top: 2em;
  font-size: var(--fs-h3);
  line-height: var(--lh-snug);
  color: var(--navy-900);
}

.prose h3 {
  margin-top: 1.6em;
  font-size: var(--fs-h4);
  color: var(--ink);
}

.prose ul,
.prose ol {
  padding-left: 1.35em;
}

.prose li + li {
  margin-top: 0.45em;
}

.prose a {
  color: var(--navy-500);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.prose a:hover {
  color: var(--navy);
}

.prose img {
  height: auto;
  border-radius: var(--r-md);
}

.prose blockquote {
  margin: 1.6em 0;
  padding: 1em 1.25em;
  border-left: 4px solid var(--amber);
  background: var(--amber-50);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  color: var(--ink);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-base);
}

.prose th,
.prose td {
  padding: 0.65em 0.8em;
  border: 1px solid var(--line);
  text-align: left;
}

.prose th {
  background: var(--navy-50);
  color: var(--navy);
}

.article__thumb {
  margin: 0 0 1.6em;
  overflow: hidden;
  border-radius: var(--r-lg);
}

.article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin-top: var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--muted);
}

.article__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
  /* Nhịp dọc duy nhất cho trang chi tiết (không cộng thêm .section) */
  padding-block: clamp(1.75rem, 3.5vw, 3rem) clamp(2.25rem, 4.5vw, 3.5rem);
}

.article__aside {
  display: grid;
  gap: var(--sp-4);
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

.aside-card {
  padding: var(--sp-5);
  background: var(--navy-900);
  border-radius: var(--r-lg);
  color: rgba(255, 255, 255, 0.8);
}

.aside-card h2,
.aside-card__title {
  margin: 0 0 0.35em;
  font-size: var(--fs-lg);
  color: #fff;
}

.aside-card p {
  margin: 0 0 1rem;
  font-size: var(--fs-sm);
}

.aside-card--plain {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--body);
}

.aside-card--plain h2 {
  color: var(--navy);
  font-size: var(--fs-base);
}

.aside-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.aside-list a {
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  text-decoration: none;
}

.aside-list a:hover {
  color: var(--navy);
  text-decoration: underline;
}

@media (max-width: 960px) {
  .article__layout {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(1.5rem, 4vw, 2.25rem);
    padding-block: 1.5rem 2.25rem;
  }
  .article__layout .prose {
    max-width: 72ch;
    margin-inline: auto;
  }
  .article__aside {
    position: static;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

/* --- Phân trang ----------------------------------------------------------- */
.pagination {
  margin-top: clamp(2rem, 4vw, 3rem);
}

.pagination ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pagination a,
.pagination span {
  display: grid;
  place-items: center;
  min-width: 44px;
  height: 44px;
  padding: 0 0.75em;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: #fff;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
}

.pagination .current {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.pagination a:hover {
  border-color: var(--navy-200);
  color: var(--navy);
}

/* --- Form bổ sung --------------------------------------------------------- */
.kido-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form__note--error {
  color: #b3261e;
  font-weight: 600;
}

.search-form {
  display: flex;
  gap: 0.5rem;
  margin-top: var(--sp-4);
  max-width: 480px;
}

.search-form input[type="search"] {
  flex: 1;
  min-height: 44px;
  padding: 0.55rem 0.9rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-sm);
  font-size: var(--fs-base);
}

/* --- Ảnh trong thẻ -------------------------------------------------------- */
.post__media img,
.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --- Tiện ích ------------------------------------------------------------- */
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.alignwide {
  margin-inline: calc(50% - min(50vw - 2rem, 640px));
  max-width: none;
}

.alignfull {
  margin-inline: calc(50% - 50vw);
  max-width: 100vw;
}

.aligncenter {
  margin-inline: auto;
}

.wp-caption {
  max-width: 100%;
}

.wp-caption-text {
  margin-top: 0.5em;
  font-size: var(--fs-xs);
  color: var(--muted);
}

/* --- Bình luận ------------------------------------------------------------ */
.comments-area {
  max-width: 74ch;
  padding-block: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
  margin-top: var(--sp-7);
}

.comment-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--sp-4);
}

.comment-body {
  padding: var(--sp-4);
  background: var(--sky-50);
  border-radius: var(--r-md);
}

/* --- Chỉnh vài chi tiết khi dùng WP --------------------------------------- */
.hero__title a,
.post__body h2 a,
.program h2 a {
  color: inherit;
  text-decoration: none;
}

.post__body h2 {
  margin: 0;
  font-size: var(--fs-h4);
  line-height: var(--lh-snug);
}

.program h2 {
  margin: 0;
  font-size: var(--fs-h4);
}

.site-header--float .nav__list li > a {
  color: #fff;
}

.site-header.is-stuck .nav__list li > a,
.site-header.is-menu-open .nav__list li > a {
  color: var(--navy);
}

/* --- Trang liên hệ -------------------------------------------------------- */
.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.contact__info h2 {
  margin-bottom: var(--sp-4);
  font-size: var(--fs-h3);
  color: var(--navy-900);
}

.contact__list {
  list-style: none;
  margin: 0 0 var(--sp-6);
  padding: 0;
  display: grid;
  gap: var(--sp-4);
}

.contact__list li {
  display: flex;
  gap: 0.85em;
  align-items: flex-start;
}

.contact__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  background: var(--mint-50);
  color: var(--mint);
}

.contact__list strong {
  display: block;
  font-size: var(--fs-sm);
  color: var(--ink);
}

.contact__list p {
  margin: 0.15em 0 0;
  font-size: var(--fs-sm);
  color: var(--body);
  line-height: 1.55;
}

.contact__list a {
  color: var(--navy);
  text-decoration: none;
}

.contact__map iframe {
  display: block;
}

.contact__form .form-card {
  border: 1px solid var(--line);
}

@media (max-width: 900px) {
  .contact {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- Thẻ bản đồ ----------------------------------------------------------- */
.map-card {
  display: grid;
  gap: 0.75rem;
  justify-items: start;
  padding: var(--sp-5);
  background: var(--sky-50);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.map-card__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}

.map-card strong {
  display: block;
  font-size: var(--fs-sm);
  color: var(--ink);
}

.map-card p {
  margin: 0.2em 0 0;
  font-size: var(--fs-sm);
  color: var(--body);
}

/* --- Header: đảm bảo nav không chồng lên hotline/CTA ---------------------- */
.header__inner {
  justify-content: space-between;
  gap: var(--sp-4);
}

.header__actions {
  flex: none;
}

.nav {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: center;
  margin-inline: 0;
}

.nav__list {
  flex-wrap: nowrap;
}

.nav__list li > a {
  white-space: nowrap;
  padding-inline: 0.8em;
}

@media (max-width: 1280px) {
  .nav__list li > a {
    font-size: 0.875rem;
    padding-inline: 0.6em;
  }
  .header__hotline-label {
    display: none;
  }
}

/* --- Nav ẩn trên tablet/mobile (ghi đè do wp.css nạp sau header.css) ------- */
@media (max-width: 1080px) {
  .nav {
    display: none;
  }
}

@media (max-width: 640px) {
  .article__layout {
    padding-block: 1.25rem 2rem;
  }
  .article__aside {
    gap: var(--sp-3);
  }
  .prose {
    font-size: 1rem;
    line-height: 1.7;
  }
  .prose h2 {
    margin-top: 1.6em;
  }
  .article__layout .prose {
    max-width: none;
  }
  .page-hero {
    padding-block: 1.25rem 1.25rem;
  }
  .page-hero h1 {
    font-size: clamp(1.75rem, 1.25rem + 3.2vw, 2.35rem);
  }
}

/* --- Cột phụ: mục lục & trang liên quan ----------------------------------- */
.article__aside {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  max-height: calc(100dvh - var(--header-h) - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--navy-300) transparent;
  padding-right: 4px;
}

/* Khi cột phụ dài hơn màn hình: hiện thanh cuộn rõ + mờ dần ở đáy để biết còn nội dung */
.article__aside::-webkit-scrollbar {
  width: 7px;
}

.article__aside::-webkit-scrollbar-track {
  background: transparent;
}

.article__aside::-webkit-scrollbar-thumb {
  background: var(--navy-300);
  border-radius: 999px;
}

.article__aside::-webkit-scrollbar-thumb:hover {
  background: var(--navy-500);
}

.article__aside.is-scrollable {
  box-shadow: inset 0 -26px 18px -18px rgba(11, 36, 68, 0.35);
  border-radius: var(--r-lg);
}

.aside-card--toc {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--body);
}

.aside-card__title {
  margin: 0 0 0.5em;
  font-size: var(--fs-base);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
}

.aside-card--plain .aside-card__title {
  color: var(--navy);
}

.aside-card--toc .aside-card__title {
  font-size: var(--fs-base);
  letter-spacing: 0.02em;
  color: var(--navy);
}

.toc {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.15rem;
  counter-reset: toc;
}

.toc__item {
  counter-increment: toc;
}

.toc__item a {
  display: block;
  padding: 0.45em 0.6em;
  border-left: 2px solid transparent;
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
  font-size: var(--fs-sm);
  line-height: 1.45;
  color: var(--ink-soft);
  text-decoration: none;
  transition: background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease),
    border-color var(--dur-1) var(--ease);
}

.toc__item--h3 a {
  padding-left: 1.5em;
  font-size: var(--fs-xs);
  color: var(--body);
}

.toc__item a:hover {
  background: var(--sky-50);
  color: var(--navy);
  border-left-color: var(--sky);
}

.toc__item a.is-current {
  background: var(--amber-50);
  border-left-color: var(--amber);
  color: var(--navy);
  font-weight: 600;
}

/* Neo cuộn: tránh bị header che */
.prose :is(h2, h3) {
  scroll-margin-top: calc(var(--header-h) + 20px);
}

@media (max-width: 960px) {
  .article__aside {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* Breadcrumb gọn trên mobile: Trang chủ › [tiêu đề] */
@media (max-width: 640px) {
  .crumbs ol {
    flex-wrap: nowrap;
  }
  .crumbs li:nth-child(n + 2):not(:last-child) {
    display: none;
  }
  .crumbs li:last-child::before {
    margin-right: 0.4rem;
  }
}

/* --- Liên kết nhanh ở trang Liên hệ --------------------------------------- */
.contact__links {
  margin-top: var(--sp-5);
  padding: var(--sp-5);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.contact__links .aside-card__title {
  color: var(--navy);
  font-size: var(--fs-sm);
  margin-bottom: 0.75em;
}

.contact__links .aside-list a {
  display: inline-block;
  padding: 0.35em 0;
  color: var(--navy-500);
  text-decoration: none;
}

.contact__links .aside-list a:hover {
  color: var(--navy);
  text-decoration: underline;
}


/* --- Quy trình: timeline mốc tròn + mũi tên + vòng lặp --------------------- */
.tln__dots {
  display: inline-flex;
  gap: 10px;
  margin-top: var(--sp-4);
}

.tln__dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: block;
}

.tln-wrap {
  --rail: 190px;
  position: relative;
  margin-top: clamp(1rem, 2.5vw, 1.75rem);
}

.tln {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  padding: var(--rail) 0 260px;
  list-style: none;
}

/* Trục ngang chạy suốt, lặp lại qua mọi mốc */
.tln::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--gutter));
  right: calc(-1 * var(--gutter));
  top: var(--rail);
  height: 2px;
  background: var(--line-strong);
}

/* Mũi tên chỉ chiều trên trục, đặt giữa các mốc */
.tln__chev {
  position: absolute;
  top: var(--rail);
  width: 9px;
  height: 9px;
  margin-top: -4.5px;
  border-top: 2px solid var(--navy-300);
  border-right: 2px solid var(--navy-300);
  border-radius: 1px;
  transform: translateX(-50%) rotate(45deg);
  z-index: 1;
}

/* Mũi tên kép ở đầu trục */
.tln__start {
  position: absolute;
  left: calc(-1 * var(--gutter) - 52px);
  top: var(--rail);
  width: 48px;
  height: 28px;
  margin-top: -14px;
  color: var(--navy-300);
}

.tln__start svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Biểu tượng vòng lặp ở cuối trục */
.tln__end {
  position: absolute;
  right: calc(-1 * var(--gutter) - 50px);
  top: var(--rail);
  width: 46px;
  height: 46px;
  margin-top: -23px;
  color: var(--navy-300);
}

.tln__end svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Vòng lặp: nét đứt nối mốc cuối trở về mốc đầu */
.tln__loop {
  position: absolute;
  left: calc(-1 * var(--gutter));
  right: calc(-1 * var(--gutter));
  top: var(--rail);
  bottom: 40px;
  border: 2px dashed var(--navy-200);
  border-top: 0;
  border-radius: 0 0 30px 30px;
  pointer-events: none;
}

/* Mũi tên chỉ lên mốc 01 ở cuối vòng lặp */
.tln__loop-arrow {
  position: absolute;
  left: 8%;
  bottom: 40px;
  width: 9px;
  height: 9px;
  margin-left: -4.5px;
  margin-bottom: -4.5px;
  border-top: 2px solid var(--navy-300);
  border-left: 2px solid var(--navy-300);
  border-radius: 1px;
  transform: rotate(-45deg);
}

.tln__loop-label {
  position: absolute;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  padding: 4px 14px;
  border-radius: var(--r-pill);
  background: var(--sky-50);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy-500);
  white-space: nowrap;
}

.tln__item {
  position: relative;
}

/* Mốc: vòng tròn lồng nhau + chấm màu */
.tln__node {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--nc);
  box-shadow: inset 0 0 0 5px #fff, inset 0 0 0 6px color-mix(in srgb, var(--nc) 45%, #fff);
  z-index: 2;
}

.tln__node::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--nc);
}

/* Số lớn phía đối diện nội dung */
.tln__num {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(1.6rem, 1.1rem + 1.4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--nc);
  line-height: 1;
  text-transform: uppercase;
}

/* Dây nối từ mốc tới khối nội dung, chấm màu ở đầu dây */
.tln__stem {
  position: absolute;
  left: 50%;
  width: 2px;
  height: 44px;
  background: var(--nc);
  transform: translateX(-50%);
  z-index: 1;
}

.tln__stem::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--nc);
  transform: translateX(-50%);
}

.tln__body {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 210px);
  text-align: left;
  /* nền trùng màu section để nét đứt vòng lặp không cắt qua chữ */
  background: var(--sky-50);
  z-index: 2;
}

.tln__label {
  margin: 0 0 0.35em;
  font-size: var(--fs-sm);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink);
  line-height: 1.3;
}

.tln__text {
  margin: 0;
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--body);
}

/* Gạch màu luôn nằm ở phía ngoài (xa trục), không chạm dây nối */
.tln__item--down .tln__body {
  border-bottom: 2px solid var(--nc);
  padding-bottom: 0.55em;
}

.tln__item--up .tln__body {
  border-top: 2px solid var(--nc);
  padding-top: 0.55em;
}

/* Bố cục so le: mốc lẻ — số trên, nội dung dưới */
.tln__item--down .tln__num { top: -96px; transform: translate(-50%, -100%); }
.tln__item--down .tln__stem { top: 22px; }
.tln__item--down .tln__stem::after { bottom: -4px; }
.tln__item--down .tln__body { top: 76px; }

/* Mốc chẵn — nội dung trên, số dưới */
.tln__item--up .tln__num { top: 96px; }
.tln__item--up .tln__stem { top: -66px; }
.tln__item--up .tln__stem::after { top: -4px; }
.tln__item--up .tln__body { top: -76px; transform: translate(-50%, -100%); }

/* Mobile: chuyển về timeline dọc, ẩn vòng lặp & mũi tên */
@media (max-width: 900px) {
  .tln-wrap {
    padding: 0;
    margin-top: 0;
  }
  .tln {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 0;
    margin-top: var(--sp-5);
  }
  .tln::before {
    left: 21px;
    right: auto;
    top: 12px;
    bottom: 12px;
    width: 2px;
    height: auto;
    background: var(--line-strong);
  }
  .tln__chev,
  .tln__loop,
  .tln__loop-arrow,
  .tln__loop-label,
  .tln__start,
  .tln__end {
    display: none;
  }
  .tln__item {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: start;
    gap: 0 1.1rem;
    padding-bottom: 1.6rem;
  }
  .tln__node {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    width: 42px;
    height: 42px;
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
    margin-top: 2px;
  }
  .tln__stem {
    display: none;
  }
  /* ghi đè mọi quy tắc so le của desktop */
  .tln__item--up .tln__num,
  .tln__item--down .tln__num,
  .tln__item--up .tln__body,
  .tln__item--down .tln__body {
    position: static;
    transform: none;
    width: auto;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    grid-column: 2;
  }
  .tln__item--up .tln__num,
  .tln__item--down .tln__num {
    order: 1;
    font-size: 1.35rem;
    margin-bottom: 0.1em;
  }
  .tln__item--up .tln__body,
  .tln__item--down .tln__body {
    order: 2;
    background: transparent;
    border-top: 0;
    padding-top: 0;
    border-bottom: 2px solid var(--nc);
    padding-bottom: 0.55em;
  }
  .tln__label {
    font-size: var(--fs-sm);
  }
  .tln__text {
    font-size: var(--fs-sm);
  }
}



/* --- Tour cơ sở vật chất (trang riêng) ------------------------------------ */
.page-hero__lead {
  margin-top: 0.75rem;
  max-width: 68ch;
}

.page-hero__lead p:last-child {
  margin-bottom: 0;
}

.section--tour {
  padding-top: clamp(1.5rem, 3vw, 2.25rem);
}

.tour {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}

.tour__nav {
  position: sticky;
  top: calc(var(--header-h, 76px) + 1.25rem);
  display: grid;
  gap: 2px;
  border-left: 2px solid var(--line);
}

.tour__nav a {
  display: block;
  padding: 0.55em 0.9em;
  margin-left: -2px;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease),
    background-color var(--dur-2) var(--ease);
}

.tour__nav a:hover {
  color: var(--navy);
  background: var(--navy-50);
}

.tour__nav a.is-active {
  color: var(--navy);
  border-left-color: var(--navy);
  background: var(--navy-50);
  font-weight: 800;
}

.tour__list {
  display: grid;
  gap: clamp(1.75rem, 3.5vw, 3rem);
}

.tour__item {
  scroll-margin-top: calc(var(--header-h, 76px) + 1.5rem);
}

.tour__media {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--sky-50);
  aspect-ratio: 16 / 9;
  cursor: zoom-in;
}

.tour__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--dur-3) var(--ease);
}

.tour__media:hover img,
.tour__media:focus-visible img {
  transform: scale(1.03);
}

.tour__zoom {
  position: absolute;
  right: 14px;
  top: 14px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--navy);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}

.tour__media:hover .tour__zoom,
.tour__media:focus-visible .tour__zoom {
  opacity: 1;
  transform: none;
}

.tour__cap {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  margin-top: 0.9rem;
}

.tour__num {
  flex: none;
  font-size: var(--fs-sm);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--lilac);
}

.tour__title {
  margin: 0 0 0.3em;
  font-size: var(--fs-xl);
  line-height: 1.3;
}

.tour__text {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--body);
  max-width: 62ch;
}

@media (max-width: 900px) {
  .tour {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
  }
  .tour__nav {
    position: static;
    top: auto;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    border-left: 0;
    padding-bottom: 0.35rem;
    scrollbar-width: none;
  }
  .tour__nav::-webkit-scrollbar {
    display: none;
  }
  .tour__nav a {
    flex: none;
    margin-left: 0;
    border-left: 0;
    border-bottom: 2px solid transparent;
    border-radius: var(--r-sm);
    padding: 0.5em 0.85em;
    white-space: nowrap;
  }
  .tour__nav a.is-active {
    border-left-color: transparent;
    border-bottom-color: var(--navy);
  }
  .tour__media {
    aspect-ratio: 4 / 3;
  }
}

/* --- Hệ thống cơ sở: bản đồ + dải thẻ -------------------------------------- */
.section--branches {
  padding-top: clamp(1.25rem, 2.5vw, 2rem);
}

.branches__filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.branches__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.5em 0.95em;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--ink-soft);
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
  transition: border-color var(--dur-2) var(--ease), background-color var(--dur-2) var(--ease),
    color var(--dur-2) var(--ease);
}

.branches__chip span {
  display: inline-grid;
  place-items: center;
  min-width: 1.6em;
  padding: 0 0.35em;
  border-radius: var(--r-pill);
  background: var(--navy-50);
  color: var(--navy);
  font-size: var(--fs-xs);
}

.branches__chip:hover {
  border-color: var(--navy-300);
  color: var(--navy);
}

.branches__chip.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.branches__chip.is-active span {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.branches__mapwrap {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
}

.branches__info {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 650;
  width: min(320px, calc(100% - 28px));
  padding: 0.85rem 1rem;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 34px -24px rgba(11, 36, 68, 0.85);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.branches__info[hidden] {
  display: none;
}

.branches__info strong {
  font-size: var(--fs-base);
  color: var(--navy-900);
  padding-right: 1.6rem;
}

.branches__info span {
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--body);
}

.branches__info-row {
  display: flex;
  gap: 0.9rem;
  margin-top: 0.35rem;
  font-size: var(--fs-xs);
  font-weight: 800;
}

.branches__info-row a {
  color: var(--navy);
  text-decoration: none;
}

.branches__info-row a:hover {
  text-decoration: underline;
}

.branches__info-close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.branches__info-close:hover {
  background: var(--navy-50);
  color: var(--navy);
}

.branches__map {
  position: relative;
  height: clamp(320px, 46vw, 440px);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--sky-50);
  z-index: 0;
}

.branches__map .leaflet-container {
  background: var(--sky-50);
  font-family: inherit;
}

.branches__map .leaflet-control-attribution {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.85);
}

/* Ghim */
.kido-pin {
  background: none;
  border: 0;
}

.kido-pin__dot {
  display: block;
  width: 20px;
  height: 20px;
  margin: 3px;
  border-radius: 50%;
  background: var(--navy);
  border: 3px solid #fff;
  box-shadow: 0 6px 14px -6px rgba(11, 36, 68, 0.8);
  transition: transform var(--dur-2) var(--ease), background-color var(--dur-2) var(--ease);
}

.leaflet-marker-icon:hover .kido-pin__dot {
  transform: scale(1.15);
  background: var(--amber-600);
}

/* Ghim đang chọn: khác màu hẳn các ghim còn lại */
.kido-pin.is-active .kido-pin__dot {
  background: var(--amber);
  border-color: #fff;
  transform: scale(1.3);
  box-shadow: 0 0 0 6px rgba(238, 168, 47, 0.28), 0 10px 18px -10px rgba(11, 36, 68, 0.85);
}

.kido-pin.is-active {
  z-index: 900 !important;
}

/* Dải thẻ */
.branches__slider {
  display: flex;
  gap: clamp(0.75rem, 1.5vw, 1rem);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  /* chừa chỗ để bóng đổ không bị cắt bởi vùng cuộn */
  padding: 1.5rem 0 1.75rem;
  scroll-padding-inline: 4px;
  scrollbar-width: none;
}

.branches__slider::-webkit-scrollbar {
  display: none;
}

.branch-card {
  --bc: var(--navy);
  --bb: var(--navy-50);
  position: relative;
  flex: 0 0 clamp(280px, 32%, 380px);
  scroll-snap-align: start;
  display: flex;
  gap: 0.9rem;
  padding: 1rem 1rem 1rem 1.15rem;
  background: linear-gradient(180deg, #fff 55%, color-mix(in srgb, var(--bb) 60%, #fff));
  border: 1px solid color-mix(in srgb, var(--bc) 22%, #fff);
  border-left: 4px solid var(--bc);
  border-radius: var(--r-lg);
  cursor: pointer;
  text-align: left;
  box-shadow: 0 6px 16px -14px rgba(11, 36, 68, 0.6);
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease),
    transform var(--dur-2) var(--ease);
}

.branch-card:hover {
  border-color: color-mix(in srgb, var(--bc) 55%, #fff);
  transform: translateY(-3px);
  box-shadow: 0 16px 28px -22px rgba(11, 36, 68, 0.75);
}

.branch-card.is-active {
  border-color: color-mix(in srgb, var(--bc) 45%, #fff);
  box-shadow: 0 20px 32px -24px rgba(11, 36, 68, 0.7);
}

/* Chấm màu góc trên phải — dấu hiệu “đang chọn” */
.branch-card__dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bc);
  box-shadow: 0 0 0 3px #fff, 0 4px 10px -4px rgba(11, 36, 68, 0.7);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
  pointer-events: none;
}

.branch-card.is-active .branch-card__dot {
  opacity: 1;
  transform: scale(1);
}

.branch-card[hidden] {
  display: none;
}

.branch-card:focus-visible {
  outline: 3px solid var(--navy-300);
  outline-offset: 2px;
}

.branch-card__thumb {
  flex: none;
  width: 84px;
  height: 84px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--sky-50);
}

.branch-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.branch-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.branch-card__index {
  align-self: flex-start;
  padding: 0.15em 0.5em;
  border-radius: var(--r-pill);
  background: var(--bb);
  color: var(--bc);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.06em;
}

.branch-card__title {
  font-size: var(--fs-base);
  color: var(--navy-900);
  line-height: 1.3;
}

.branch-card__addr {
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--body);
}

.branch-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-top: 0.35rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--bc);
}

.branch-card__meta a {
  text-decoration: none;
  color: var(--bc);
}

.branch-card__meta a:hover {
  text-decoration: underline;
}

.branch-card__meta span {
  font-weight: 500;
  color: var(--muted);
}

.branch-card__dir {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  margin-top: 0.45rem;
  font-size: var(--fs-xs);
  font-weight: 800;
  color: var(--bc);
  text-decoration: none;
}

.branch-card__dir:hover {
  text-decoration: underline;
}

.branches--no-map .branches__map {
  display: none;
}

/* Bảng màu cho từng cơ sở (xoay vòng khi có nhiều cơ sở) */
.branch-card--mint  { --bc: var(--mint);      --bb: var(--mint-50); }
.branch-card--amber { --bc: var(--amber-600); --bb: var(--amber-50); }
.branch-card--coral { --bc: #C0553F;          --bb: var(--peach-50); }
.branch-card--sky   { --bc: var(--navy-500);  --bb: var(--sky-50); }
.branch-card--lilac { --bc: var(--lilac);     --bb: var(--lilac-50); }
.branch-card--navy  { --bc: var(--navy);      --bb: var(--navy-50); }

@media (max-width: 900px) {
  .branch-card {
    flex: 0 0 86%;
  }
  .branches__map {
    height: 300px;
  }
}

/* Trang liên hệ: link danh sách cơ sở */
.contact__more {
  margin-top: 0.35rem;
  font-size: var(--fs-sm);
  font-weight: 700;
}

.contact__more a {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  color: var(--navy);
  text-decoration: none;
}

.contact__more a:hover {
  text-decoration: underline;
}
