/*
Theme Name: OPC Hub ASEAN
Theme URI: https://opchub.community
Author: OPC Hub Team
Author URI: https://opchub.community
Description: Theme CMS quản lý trang chủ OPC Hub ASEAN - Nền tảng ươm mầm 1 triệu doanh nghiệp một người.
Version: 5.0.0
License: GNU General Public License v2 or later
Text Domain: opchub
*/

/* ==========================================================================
   1. Header Styling - Exact Match with Design Prototype
   ========================================================================== */

.opc-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #EAEFF6;
  width: 100%;
}

.opc-header-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 16px;
  height: 68px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

/* 1.1 Logo */
.opc-header-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.opc-header-logo img {
  display: block;
  height: 52px;
  width: auto;
}

/* 1.2 Navigation Menu */
.opc-nav {
  display: flex;
  align-items: center;
  height: 68px;
  margin: 0 0 0 48px;
  padding: 0;
  list-style: none;
  gap: 0;
  flex: 1;
}

.opc-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 68px;
  padding: 0 10px;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #001A47;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
  box-sizing: border-box;
}

/* Gạch chân chỉ rộng bằng chữ, không tính phần đệm hai bên. */
.opc-nav-link::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 2.5px;
  border-radius: 2px 2px 0 0;
  background: transparent;
  transition: background-color 0.15s ease;
}

.opc-nav-link:hover {
  color: #0066FF !important;
}

.opc-nav-link.active {
  color: #0066FF !important;
}

.opc-nav-link.active::after {
  background: #0066FF;
}

/* 1.2.1 Menu header có mục con (dropdown) */
.opc-nav-item {
  position: relative;
  display: flex;
  align-items: center;
}

.opc-nav-item .opc-nav-link {
  gap: 6px;
}

.opc-nav-caret {
  flex-shrink: 0;
  opacity: 0.75;
  transition: transform 0.15s ease;
}

.opc-nav-has-children:hover .opc-nav-caret,
.opc-nav-has-children:focus-within .opc-nav-caret {
  transform: rotate(180deg);
  opacity: 1;
}

.opc-nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 60;
  min-width: 240px;
  padding: 8px;
  background: #FFFFFF;
  border: 1px solid #E4EBF5;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 26, 71, 0.14);
  display: none;
}

.opc-nav-has-children:hover .opc-nav-dropdown,
.opc-nav-has-children:focus-within .opc-nav-dropdown {
  display: block;
}

.opc-nav-dropdown-link {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.4;
  color: #001A47;
  text-decoration: none;
  white-space: normal;
}

.opc-nav-dropdown-link:hover,
.opc-nav-dropdown-link:focus-visible {
  background: #F1F6FF;
  color: #0066FF;
}

.opc-nav-dropdown-link.active {
  color: #0066FF;
}

/* 1.3 Right Actions (Language Pill & CTA Button) */
.opc-header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
  margin-left: 20px;
}

.opc-lang-wrapper {
  position: relative;
}

/* Language Capsule Button */
.opc-lang-btn {
  height: 44px;
  padding: 0 16px 0 10px;
  border: 1px solid #DCE5F2;
  border-radius: 999px;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #001A47;
  white-space: nowrap;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.opc-lang-btn:hover {
  border-color: #0066FF;
  box-shadow: 0 2px 8px rgba(0, 102, 255, 0.10);
}

.opc-lang-flag {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.opc-cur-name {
  font-size: 14px;
  font-weight: 600;
  color: #001A47;
}

.opc-chevron {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

/* Language Dropdown Menu */
.opc-lang-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 50px;
  width: 440px;
  max-height: 70vh;
  overflow: auto;
  background: #FFFFFF;
  border: 1px solid #E4EBF5;
  border-radius: 14px;
  box-shadow: 0 24px 56px rgba(0, 26, 71, 0.16);
  padding: 10px;
  z-index: 1060;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 8px;
  box-sizing: border-box;
}

.opc-lang-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: inherit;
  transition: background-color 0.15s ease;
}

.opc-lang-item:hover,
.opc-lang-item.active {
  background: #EEF4FF !important;
}

/* CTA Join Button */
.opc-cta-btn {
  height: 44px;
  padding: 0 20px;
  border-radius: 10px;
  background: #0066FF;
  color: #FFFFFF !important;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(0, 102, 255, 0.32);
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.opc-cta-btn:hover {
  background: #0052D9;
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(0, 102, 255, 0.42);
  color: #FFFFFF !important;
}

/* Link đăng nhập cạnh CTA (trang /dang-nhap/ của website) */
.opc-login-link {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  color: #001A47;
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.opc-login-link:hover {
  color: #0066FF !important;
  background: #F1F6FF;
}

.opc-drawer-login {
  margin-top: 10px;
}

/* Mobile Toggle Button */
.opc-mobile-toggle {
  display: none;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 1px solid #DCE5F2;
  border-radius: 10px;
  background: #FFFFFF;
  color: #001A47;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
  outline: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.opc-mobile-toggle:hover {
  border-color: #0066FF;
  color: #0066FF;
}

/* Mobile Drawer */
.opc-mobile-drawer {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 72px;
  height: calc(100dvh - 72px);
  z-index: 999;
  background: #FFFFFF;
  border-top: 1px solid #E4EBF5;
  box-shadow: 0 20px 40px rgba(0, 26, 71, 0.12);
  overflow: auto;
  padding: 12px 24px 36px;
  box-sizing: border-box;
}

.opc-drawer-link {
  min-height: 52px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #EEF2F8;
  font-size: 16px;
  font-weight: 600;
  color: #001A47;
  text-decoration: none;
  transition: color 0.15s ease;
}

.opc-drawer-link:hover,
.opc-drawer-link.active {
  color: #0066FF;
}

/* Mục con trong drawer mobile: thụt vào để thấy quan hệ cha – con. */
.opc-drawer-child {
  padding-left: 26px;
  min-height: 46px;
  font-size: 15px;
  font-weight: 500;
  color: #4A5B78;
}

/* ==========================================================================
   2. Responsive Breakpoints & Container Protection
   ========================================================================== */

/* Desktop: header chia 3 làn (logo – menu – hành động) để menu nằm đúng giữa trang.
   Hai làn 1fr bằng nhau nên khối menu luôn cân quanh tâm header, không lệch theo logo. */
@media (min-width: 1200px) {
  .opc-header-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    column-gap: 16px;
  }
  .opc-header-logo {
    justify-self: start;
  }
  .opc-nav {
    margin: 0;
    justify-self: center;
    justify-content: center;
    /* Khoảng thở giữa các mục: nới tối đa 20px nhưng chỉ trong phần chỗ còn dư,
       để menu không chạm cụm nút bên phải. Các dải hẹp hơn có mức riêng bên dưới;
       dải 1200-1309 đã ẩn thanh ngôn ngữ nên còn nhiều chỗ nhất. */
    column-gap: clamp(0px, calc((100vw - 1135px) / 6), 20px);
  }
  .opc-header-actions {
    margin-left: 0;
    justify-self: end;
  }
}

/* Màn hình rộng: nới khoảng cách giữa các mục menu cho thoáng như bản thiết kế. */
@media (min-width: 1560px) {
  .opc-nav {
    column-gap: 20px;
  }
  .opc-nav-link {
    padding: 0 14px;
  }
  .opc-nav-link::after {
    left: 14px;
    right: 14px;
  }
}

/* Desktop hẹp (1310px - 1459px): thu nhỏ logo/khoảng đệm để 6 mục không tràn. */
@media (max-width: 1459px) and (min-width: 1310px) {
  .opc-header-container {
    padding: 0 20px;
  }
  .opc-header-logo img {
    height: 48px;
  }
  .opc-nav-link {
    padding: 0 6px;
    font-size: 14.5px;
  }
  .opc-nav-link::after {
    left: 6px;
    right: 6px;
  }
  /* Khoảng thở giữa các mục chỉ nới trong phần chỗ còn dư, để 6 mục không tràn
     sang cụm nút bên phải ở các màn 1310-1350px. */
  .opc-nav {
    column-gap: clamp(0px, calc((100vw - 1295px) / 6), 20px);
  }
  .opc-header-actions {
    gap: 12px;
  }
  .opc-lang-btn {
    padding: 0 12px 0 8px;
  }
  .opc-cta-btn {
    padding: 0 16px;
    font-size: 13.5px;
  }
}

/* Dải 1460-1559px: chữ 16px nên cụm menu rộng nhất, chỉ nới được ít. */
@media (max-width: 1559px) and (min-width: 1460px) {
  .opc-nav {
    column-gap: clamp(0px, calc((100vw - 1442px) / 6), 20px);
  }
}

/* Desktop rất hẹp (1200px - 1309px): ẩn bong bóng ngôn ngữ để đủ chỗ cho 6 mục. */
@media (max-width: 1309px) and (min-width: 1200px) {
  .opc-lang-wrapper {
    display: none;
  }
  .opc-header-container {
    padding: 0 20px;
  }
  .opc-header-logo img {
    height: 48px;
  }
  .opc-nav-link {
    padding: 0 6px;
    font-size: 14.5px;
  }
  .opc-nav-link::after {
    left: 6px;
    right: 6px;
  }
  .opc-header-actions {
    gap: 12px;
  }
  .opc-lang-btn {
    padding: 0 12px 0 8px;
  }
  .opc-cta-btn {
    padding: 0 16px;
    font-size: 13.5px;
  }
}

/* Tablet & Mobile Screens (< 1200px) */
@media (max-width: 1199px) {
  .opc-nav,
  .opc-desktop-only {
    display: none !important;
  }
  .opc-mobile-toggle {
    display: flex !important;
  }
  .opc-header-container {
    padding: 0 20px;
  }
  .opc-header-logo {
    margin-right: auto;
  }

  /* Grid adjustments for sections below header */
  .opc-hero-feats-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  .opc-services-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .opc-comm-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .opc-projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .opc-news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .opc-partners-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
  .opc-footer-grid {
    max-width: 100% !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
  .opc-footer-brand {
    grid-column: 1 / -1 !important;
  }
  .opc-offices-grid {
    max-width: 100% !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* Small Screens (< 1000px) */
@media (max-width: 999px) {
  .opc-two-col {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .opc-cta-box {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Mobile Screens (< 768px) */
@media (max-width: 767px) {
  .opc-hero-feats-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    padding: 16px !important;
  }
  .opc-feats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 16px 8px !important;
  }
  .opc-services-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .opc-comm-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .opc-projects-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .opc-news-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .opc-partners-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .opc-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .opc-offices-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .opc-bottom-bar {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
}

/* Small Mobile Screens (< 480px) */
@media (max-width: 479px) {
  .opc-hero-feats-bar {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .opc-feats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* ==========================================================================
   Footer – tăng độ tương phản trên mobile (map nền không lấn chữ)
   ========================================================================== */
@media (max-width: 767px) {
  footer .u-4ef85c {
    background: linear-gradient(180deg, rgba(5, 15, 38, 0.97) 0%, rgba(5, 15, 38, 0.9) 100%) !important;
  }
  footer .u-a7a35d {
    opacity: 0.22;
  }
  .opc-footer-grid {
    gap: 28px 20px !important;
  }
}
