/**
 * Language Switcher Styles — CCT Pak 20
 * Desktop: Mẫu 4 (Target Chip — nhãn hiển thị NGÔN NGỮ ĐÍCH)
 * Mobile: Mẫu 5 (Circular Token — badge hiển thị NGÔN NGỮ ĐÍCH)
 * Quy ước logic: đang xem TH → nút hiện EN; đang xem EN → nút hiện TH.
 * Strictly ZERO !important directive.
 */

/* ==========================================================================
   DESKTOP: MẪU 4 — TARGET CHIP (.cct-lang-btn-v4)
   Một viên bi tròn (icon ngôn ngữ đích) + một nhãn chữ (mã ngôn ngữ đích).
   Dùng selector cụ thể (.header .topbar a.cct-lang-btn-v4) để không bị
   các rule .topbar .social-links a (26px/32px) đè kích thước.
   ========================================================================== */
.header .topbar a.cct-lang-btn-v4,
.topbar a.cct-lang-btn-v4,
a.cct-lang-btn-v4 {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 58px;
  min-width: 58px;
  max-width: 58px;
  height: 26px;
  min-height: 26px;
  max-height: 26px;
  background: #e2e8f0;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  padding: 0;
  margin: 0 12px 0 0;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  box-sizing: border-box;
  overflow: hidden;
  flex-shrink: 0;
  line-height: 1;
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.2s ease;
}

.header .topbar a.cct-lang-btn-v4:hover,
.header .topbar a.cct-lang-btn-v4:focus,
.header .topbar a.cct-lang-btn-v4:focus-visible,
a.cct-lang-btn-v4:hover,
a.cct-lang-btn-v4:focus,
a.cct-lang-btn-v4:focus-visible {
  border-color: #94a3b8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  outline: none;
}

/* Trạng thái .is-en = site đang tiếng Anh → nút đang mời chuyển sang TH.
   Chip luôn giữ nền trung tính để không bị đọc nhầm thành "EN đang bật". */

/* Viên bi tròn chứa icon ngôn ngữ đích (cố định bên trái) */
.header .topbar a.cct-lang-btn-v4 .v4-thumb,
.topbar a.cct-lang-btn-v4 .v4-thumb,
a.cct-lang-btn-v4 .v4-thumb {
  position: absolute;
  left: 2px;
  top: 2px;
  width: 20px;
  min-width: 20px;
  max-width: 20px;
  height: 20px;
  min-height: 20px;
  max-height: 20px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  padding: 0;
  margin: 0;
  line-height: 0;
  font-size: 0;
  box-sizing: border-box;
}

/* Cờ Thái trong viên bi tròn: căn giữa tuyệt đối, không lệch */
.cct-lang-btn-v4 .v4-thumb .cct-flag-round {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  line-height: 0;
  box-sizing: border-box;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.15);
}

.cct-lang-btn-v4 .v4-thumb .cct-flag-round svg {
  display: block;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}

/* Icon quả địa cầu trong viên bi tròn: triệt tiêu vertical-align âm của phosphor */
.cct-lang-btn-v4 .v4-thumb .v4-globe-icon {
  font-size: 13px;
  color: var(--church-ocean-deep, #0b7294);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  vertical-align: 0;
}

/* Nhãn mã ngôn ngữ ĐÍCH (EN khi đang xem TH · TH khi đang xem EN) */
.cct-lang-btn-v4 .v4-label {
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1;
  color: var(--church-navy-primary, #1a2258);
  pointer-events: none;
  user-select: none;
}


/* ==========================================================================
   MOBILE: CỤM ĐIỀU HƯỚNG (.mobile-nav-cluster)
   Đồng bộ chiều cao nút ngôn ngữ (.cct-lang-btn-v5) & nút hamburger (.mobile-nav-toggle)
   Chuẩn hóa kích thước micro-compact 26px x 26px siêu tinh gọn
   ========================================================================== */
.mobile-nav-cluster {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-left: auto;
  flex-shrink: 0;
}

/* Nút hamburger trong cụm mobile: chuẩn hóa chiều cao 26px */
.mobile-nav-cluster .mobile-nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  min-width: 26px;
  max-width: 26px;
  height: 26px;
  min-height: 26px;
  max-height: 26px;
  padding: 0;
  margin: 0;
  border-radius: 5px;
  box-sizing: border-box;
}

.mobile-nav-cluster .mobile-nav-toggle.mobile-nav-toggle.mobile-nav-toggle::before {
  width: 15px;
  height: 1.5px;
  border-radius: 1px;
  box-shadow: 0 -4.5px 0 currentColor, 0 4.5px 0 currentColor;
}

/* Nút ngôn ngữ Mẫu 5: cao đúng 26px bằng nút hamburger bên cạnh */
.mobile-nav-cluster .cct-lang-btn-v5,
.cct-lang-btn-v5 {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  min-width: 26px;
  max-width: 26px;
  height: 26px;
  min-height: 26px;
  max-height: 26px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  flex-shrink: 0;
  transition: border-color 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
}

.cct-lang-btn-v5:hover,
.cct-lang-btn-v5:focus,
.cct-lang-btn-v5:focus-visible {
  border-color: rgba(255, 255, 255, 0.65);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  transform: none;
  outline: none;
}

.cct-lang-btn-v5:active {
  transform: scale(0.96);
}

/* Cờ Thái bên trong 22px, viền ngoài chỉ mỏng 1.5px-2px siêu ôm khít */
.cct-lang-btn-v5 .v5-flag-icon {
  width: 22px;
  min-width: 22px;
  max-width: 22px;
  height: 22px;
  min-height: 22px;
  max-height: 22px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.12);
}

.cct-lang-btn-v5 .v5-flag-icon svg {
  display: block;
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  margin: 0;
  padding: 0;
}

/* Icon quả địa cầu tiếng Anh: 16px, vừa khít tâm nút 26px */
.cct-lang-btn-v5 .v5-globe-icon {
  font-size: 16px;
  color: var(--church-ocean-deep, #0b7294);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  vertical-align: 0;
}

/* Badge góc micro 6.5px — nền xanh đại dương = đích là EN (site đang TH) */
.cct-lang-btn-v5 .v5-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: var(--church-ocean-deep, #0b7294);
  color: #ffffff;
  font-size: 6.5px;
  font-weight: 700;
  line-height: 1;
  padding: 1px 2.5px;
  border-radius: 2px;
  border: 1px solid #ffffff;
  letter-spacing: 0.02em;
}

/* .is-en = site đang tiếng Anh → đích là TH: badge navy */
.cct-lang-btn-v5.is-en .v5-badge {
  background: var(--church-navy-primary, #1a2258);
}

/* Màn hình điện thoại siêu nhỏ (< 360px) */
@media (max-width: 360px) {
  .mobile-nav-cluster .mobile-nav-toggle,
  .mobile-nav-cluster .cct-lang-btn-v5,
  .cct-lang-btn-v5 {
    width: 24px;
    min-width: 24px;
    max-width: 24px;
    height: 24px;
    min-height: 24px;
    max-height: 24px;
  }

  .cct-lang-btn-v5 .v5-flag-icon {
    width: 20px;
    min-width: 20px;
    max-width: 20px;
    height: 20px;
    min-height: 20px;
    max-height: 20px;
  }

  .cct-lang-btn-v5 .v5-flag-icon svg {
    width: 20px;
    height: 20px;
  }

  .cct-lang-btn-v5 .v5-globe-icon {
    font-size: 14px;
  }

  .mobile-nav-cluster {
    gap: 22px;
  }
}

/* Giảm chuyển động */
@media (prefers-reduced-motion: reduce) {
  .cct-lang-btn-v4,
  .cct-lang-btn-v5 {
    transition: none;
  }
}
