/**
 * GlobalDevHubs brand system — palette & surfaces từ logo chính thức.
 * Navy #003366 · Globe blue #4a90e2 · Nền sạch trắng/xanh nhạt
 */

:root {
  --gdh-navy: #003366;
  --gdh-navy-deep: #002d62;
  --gdh-navy-mid: #1a4a7c;
  --gdh-blue: #4a90e2;
  --gdh-blue-bright: #1a8cff;
  --gdh-blue-light: #7eb8f0;
  --gdh-blue-pale: #e8f2fc;
  --gdh-blue-50: #f4f9ff;
  --gdh-surface: #ffffff;
  --gdh-surface-muted: #f4f7fb;
  --gdh-warm-surface: #faf8f5;
  --gdh-circuit-line: rgba(0, 51, 102, 0.07);
  --gdh-circuit-dot: rgba(74, 144, 226, 0.12);
  --gdh-gradient-hero: linear-gradient(
    135deg,
    var(--gdh-navy-deep) 0%,
    var(--gdh-navy) 45%,
    var(--gdh-navy-mid) 100%
  );
  --gdh-gradient-cta: linear-gradient(135deg, var(--gdh-navy-deep), var(--gdh-blue));
  --gdh-shadow: 0 8px 32px rgba(0, 51, 102, 0.12);
  --gdh-shadow-sm: 0 2px 12px rgba(0, 51, 102, 0.08);
}

/* ── Logo components ───────────────────────────────────────────── */

.gdh-logo {
  display: block;
  height: auto;
  object-fit: contain;
}

.gdh-logo--short {
  width: auto;
  height: 40px;
}

.gdh-logo--long {
  width: auto;
  height: 40px;
  max-width: min(280px, 52vw);
}

.gdh-logo--full {
  width: auto;
  height: 48px;
  max-width: min(320px, 60vw);
}

.gdh-logo--mark {
  width: 44px;
  height: 44px;
}

/* Solution header: logo dài thống nhất + tên sản phẩm */
.gdh-brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-shrink: 1;
  text-decoration: none;
  color: inherit;
}

.gdh-brand-lockup .gdh-logo--header,
.gdh-brand-lockup .gdh-logo--long {
  height: 34px;
  width: auto;
  max-width: min(200px, 38vw);
  flex-shrink: 0;
}

.gdh-brand-product {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--gdh-navy);
  white-space: nowrap;
  padding-left: 12px;
  border-left: 1px solid rgba(0, 51, 102, 0.15);
  line-height: 1.2;
}

.gdh-brand-lockup--footer {
  display: inline-flex;
  margin-bottom: 12px;
}

[data-theme="dark"] .gdh-brand-product {
  color: var(--text, #f0f6fc);
  border-left-color: rgba(255, 255, 255, 0.12);
}

@media (max-width: 900px) {
  .gdh-brand-lockup .gdh-logo--header,
  .gdh-brand-lockup .gdh-logo--long {
    max-width: min(168px, 34vw);
    height: 30px;
  }

  .gdh-brand-product {
    font-size: 0.72rem;
    padding-left: 8px;
  }
}

@media (max-width: 640px) {
  .site-header .gdh-brand-product {
    display: none;
  }
}

/* Legacy brand-mark — giữ cho trang chưa migrate */
body:has(.brand-mark):not(:has(.gdh-brand-lockup)) .brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: url("../assets/brand/mark-icon.svg") center / cover no-repeat !important;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 51, 102, 0.14);
  border: 1px solid rgba(0, 51, 102, 0.08);
}

body:has(.brand-mark):not(:has(.gdh-brand-lockup)) .brand {
  color: var(--gdh-navy);
  font-weight: 700;
}

[data-theme="dark"] body:has(.brand-mark):not(:has(.gdh-brand-lockup)) .brand {
  color: var(--text);
}

/* ── Circuit mesh background (tech / solution) ───────────────────── */

.gdh-bg-circuit {
  background-color: var(--gdh-blue-50);
  background-image:
    radial-gradient(circle at 12% 18%, var(--gdh-circuit-dot) 0, transparent 42%),
    radial-gradient(circle at 88% 72%, rgba(0, 51, 102, 0.05) 0, transparent 38%),
    linear-gradient(var(--gdh-circuit-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--gdh-circuit-line) 1px, transparent 1px);
  background-size: auto, auto, 28px 28px, 28px 28px;
}

.gdh-bg-corporate {
  background-color: var(--gdh-surface);
  background-image:
    radial-gradient(ellipse 80% 50% at 100% 0%, rgba(74, 144, 226, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 40% at 0% 100%, rgba(0, 51, 102, 0.06), transparent 50%);
}

.gdh-bg-profile {
  background: var(--gdh-surface);
}

.gdh-bg-warm {
  background-color: var(--gdh-warm-surface);
  background-image:
    radial-gradient(ellipse 70% 45% at 90% 10%, rgba(0, 51, 102, 0.05), transparent 50%),
    linear-gradient(180deg, #fffefb 0%, var(--gdh-warm-surface) 100%);
}

.gdh-bg-hire {
  background-color: #f8fafc;
  background-image:
    linear-gradient(180deg, rgba(0, 51, 102, 0.04) 0%, transparent 32%),
    radial-gradient(circle at 80% 20%, rgba(74, 144, 226, 0.08), transparent 45%);
}

/* ── Auto skin theo loại trang ─────────────────────────────────── */

/* Company landing (text mark GDH) */
body:has(.brand__mark) {
  background: var(--gdh-surface);
}

body:has(.brand__mark) .top-bar {
  background: var(--gdh-navy);
}

body:has(.brand__mark) .site-header {
  border-bottom-color: rgba(0, 51, 102, 0.1);
}

/* Solution SaaS landings */
body:has(.brand-mark):not(.gdh-bg-warm):not(.gdh-bg-hospitality),
body:has(.gdh-brand-lockup):not(.gdh-bg-warm):not(.gdh-bg-hospitality):not(.hire-page) {
  background-color: var(--gdh-surface-muted);
  background-image:
    radial-gradient(circle at 8% 12%, var(--gdh-circuit-dot) 0, transparent 40%),
    radial-gradient(circle at 92% 88%, rgba(0, 51, 102, 0.04) 0, transparent 35%),
    linear-gradient(var(--gdh-circuit-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--gdh-circuit-line) 1px, transparent 1px);
  background-size: auto, auto, 32px 32px, 32px 32px;
}

[data-theme="dark"] body:has(.brand-mark),
[data-theme="dark"] body:has(.gdh-brand-lockup):not(.hire-page) {
  background-color: var(--bg);
  background-image: none;
}

/* Hospitality / F&B verticals */
body.gdh-bg-hospitality {
  background-color: var(--gdh-warm-surface) !important;
  background-image:
    radial-gradient(ellipse 65% 40% at 85% 8%, rgba(0, 51, 102, 0.06), transparent 48%),
    linear-gradient(180deg, #fffdfb 0%, var(--gdh-warm-surface) 100%) !important;
}

/* Company profile landing */
body:has(.profile-brand__mark),
body:has(.profile-header) {
  background: var(--gdh-surface);
}

body:has(.profile-top) .profile-top {
  background: var(--gdh-navy);
}

/* Hire / careers */
body.hire-page {
  background-color: #f8fafc;
  background-image:
    linear-gradient(180deg, rgba(0, 51, 102, 0.035) 0%, transparent 28%),
    radial-gradient(circle at 75% 15%, rgba(74, 144, 226, 0.07), transparent 42%);
}

body.hire-page .hire-header__brand {
  gap: 0.65rem;
}

body.hire-page .hire-header__brand .gdh-logo {
  flex-shrink: 0;
}

body.hire-page .hire-hero {
  background:
    linear-gradient(180deg, rgba(0, 51, 102, 0.05) 0%, transparent 42%),
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(74, 144, 226, 0.08), transparent 55%);
}

/* ── Buttons & accents (GDH navy primary) ────────────────────────── */

body:has(.brand-mark) .btn-primary,
body:has(.gdh-brand-lockup):not(.hire-page) .btn-primary {
  background: var(--gdh-gradient-cta);
  color: #fff;
  border-color: transparent;
}

body:has(.brand-mark) .btn-primary:hover,
body:has(.gdh-brand-lockup):not(.hire-page) .btn-primary:hover {
  filter: brightness(1.06);
}

body:has(.brand__mark) .btn-primary {
  background: var(--gdh-gradient-cta);
}

body:has(.brand__mark) .btn-outline {
  border-color: var(--gdh-navy);
  color: var(--gdh-navy);
}

body:has(.brand__mark) .btn-outline:hover {
  background: var(--gdh-blue-pale);
}

/* Hero glow dùng accent nhưng pha navy */
body:has(.brand-mark) .hero-glow,
body:has(.gdh-brand-lockup):not(.hire-page) .hero-glow {
  background: radial-gradient(
    ellipse at 50% 0%,
    color-mix(in srgb, var(--accent) 28%, var(--gdh-navy) 12%),
    transparent 68%
  );
  opacity: 0.42;
}

body:has(.brand-mark) .cta-band,
body:has(.gdh-brand-lockup):not(.hire-page) .cta-band {
  background: linear-gradient(
    180deg,
    transparent,
    color-mix(in srgb, var(--gdh-blue-pale) 80%, var(--accent) 20%)
  );
}

body:has(.brand-mark) .site-header.is-scrolled,
body:has(.brand-mark) .site-header.nav-open,
body:has(.gdh-brand-lockup):not(.hire-page) .site-header.is-scrolled,
body:has(.gdh-brand-lockup):not(.hire-page) .site-header.nav-open {
  background: color-mix(in srgb, var(--gdh-surface) 94%, var(--gdh-blue-pale)) !important;
  border-bottom: 1px solid rgba(0, 51, 102, 0.08);
  box-shadow: var(--gdh-shadow-sm);
}

[data-theme="dark"] body:has(.brand-mark) .site-header.is-scrolled,
[data-theme="dark"] body:has(.brand-mark) .site-header.nav-open,
[data-theme="dark"] body:has(.gdh-brand-lockup):not(.hire-page) .site-header.is-scrolled,
[data-theme="dark"] body:has(.gdh-brand-lockup):not(.hire-page) .site-header.nav-open {
  background: color-mix(in srgb, var(--bg-elevated) 96%, transparent) !important;
  border-bottom-color: var(--border);
}

/* Solution header — tránh menu xuống dòng khi có lockup + CTA */
body:has(.gdh-brand-lockup):not(.hire-page) .header-inner {
  position: relative;
  flex-wrap: nowrap;
  gap: clamp(10px, 1.5vw, 20px);
}

body:has(.gdh-brand-lockup):not(.hire-page) .gdh-brand-lockup {
  flex: 0 1 auto;
  min-width: 0;
}

body:has(.gdh-brand-lockup):not(.hire-page) .nav-main {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  gap: clamp(8px, 1vw, 18px);
  min-width: 0;
}

body:has(.gdh-brand-lockup):not(.hire-page) .nav-main a {
  white-space: nowrap;
  font-size: clamp(0.75rem, 0.82vw, 0.875rem);
}

body:has(.gdh-brand-lockup):not(.hire-page) .header-actions {
  flex-shrink: 0;
  gap: clamp(6px, 0.8vw, 10px);
}

body:has(.gdh-brand-lockup):not(.hire-page) .header-actions .btn {
  white-space: nowrap;
  padding: 10px 14px;
  font-size: clamp(0.75rem, 0.82vw, 0.875rem);
}

@media (max-width: 1140px) {
  body:has(.gdh-brand-lockup):not(.hire-page) .site-header .gdh-brand-product {
    display: none;
  }
}

@media (max-width: 1080px) {
  body:has(.gdh-brand-lockup):not(.hire-page) .nav-main {
    display: none;
  }

  body:has(.gdh-brand-lockup):not(.hire-page) .header-actions .btn-ghost {
    display: none;
  }

  body:has(.gdh-brand-lockup):not(.hire-page) .nav-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  body:has(.gdh-brand-lockup):not(.hire-page) .nav-main.is-open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 12px 16px 16px;
    background: var(--bg-elevated, #ffffff);
    border-bottom: 1px solid var(--border, #d0d7de);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    gap: 0;
    z-index: 101;
  }

  body:has(.gdh-brand-lockup):not(.hire-page) .nav-main.is-open a {
    padding: 12px 8px;
    border-bottom: 1px solid var(--border, #d0d7de);
    white-space: normal;
    font-size: 0.92rem;
  }

  body:has(.gdh-brand-lockup):not(.hire-page) .nav-main.is-open a:last-child {
    border-bottom: 0;
  }
}

/* Print profile cover */
.cover-logo img,
.brand__mark img,
.profile-brand__logo {
  display: block;
  object-fit: contain;
}

/* ── Partner logos ─────────────────────────────────────────────── */

.gdh-partners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.gdh-partner-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 76px;
  margin: 0;
  padding: 14px 18px;
  border: none;
  border-radius: 12px;
  background: var(--gdh-surface);
  box-shadow: var(--gdh-shadow-sm);
  transition: box-shadow 0.15s, transform 0.15s;
}

.gdh-partner-logo:hover {
  box-shadow: 0 6px 20px rgba(0, 51, 102, 0.08);
  transform: translateY(-1px);
}

.gdh-partner-logo img {
  display: block;
  width: auto;
  max-width: 124px;
  max-height: 34px;
  object-fit: contain;
  filter: grayscale(15%);
  opacity: 0.92;
}

.gdh-partner-logo:hover img {
  filter: none;
  opacity: 1;
}

.gdh-partners-grid--profile {
  margin: 16px 0 22px;
}

/* ── Client engagement cards ───────────────────────────────────── */

.clients-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.clients-detail-grid--profile {
  grid-template-columns: 1fr;
  margin-top: 16px;
  margin-bottom: 18px;
}

.clients-scroll-hint {
  margin: 22px 0 10px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--gdh-gray-500, #6b7280);
}

.clients-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 4px 4px 14px;
  margin: 0 -4px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 51, 102, 0.25) transparent;
}

.clients-scroll:focus-visible {
  outline: 2px solid var(--gdh-blue-600, #2563a8);
  outline-offset: 2px;
  border-radius: 8px;
}

.clients-scroll::-webkit-scrollbar {
  height: 7px;
}

.clients-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 51, 102, 0.22);
  border-radius: 999px;
}

.clients-detail-grid--horizontal {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  margin-top: 0;
  width: max-content;
  min-width: 100%;
  padding: 4px 2px 6px;
}

.clients-detail-grid--horizontal .client-card {
  flex: 0 0 min(320px, 78vw);
  max-width: 320px;
  scroll-snap-align: start;
}

.profile-clients-disclaimer {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-left: 3px solid var(--gdh-blue-500, #2563a8);
  background: var(--gdh-blue-50, #f4f9ff);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--gdh-gray-700, #444);
}

.client-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--gdh-surface, #fff);
  box-shadow: var(--gdh-shadow-sm, 0 2px 8px rgba(0, 51, 102, 0.06));
  border: none;
}

.client-card__head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.client-card__logo {
  flex-shrink: 0;
  min-width: 132px;
  min-height: 68px;
  margin: 0;
  padding: 10px 12px;
  box-shadow: none;
  background: transparent;
}

.client-card .gdh-partner-logo:hover {
  box-shadow: none;
  transform: none;
}

.client-card__logo img {
  max-width: 108px;
  max-height: 30px;
}

.client-card__meta {
  min-width: 0;
}

.client-card__title {
  margin: 0 0 4px;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--gdh-blue-900, #003366);
  line-height: 1.3;
}

.client-card__industry {
  margin: 0;
  font-size: 0.82rem;
  color: var(--gdh-gray-500, #6b7280);
  line-height: 1.45;
}

.client-card__country {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gdh-blue-700, #1a4a7c);
  line-height: 1.3;
}

.client-card__country-flag {
  font-size: 1rem;
  line-height: 1;
}

.client-card__link {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gdh-blue-600, #2563a8);
  text-decoration: none;
}

.client-card__link:hover {
  text-decoration: underline;
}

.client-card__label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gdh-blue-700, #1a4a7c);
}

.client-card__list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.88rem;
  color: var(--gdh-gray-700, #444);
  line-height: 1.55;
}

.client-card__list li + li {
  margin-top: 4px;
}

.client-card--logistics,
.client-card--banking,
.client-card--hospitality,
.client-card--retail,
.client-card--construction,
.client-card--publishing,
.client-card--proptech {
  border-top: none;
}

#clientsLogoGrid {
  margin-bottom: 4px;
}

#clientsLogoGrid .gdh-partner-logo {
  box-shadow: none;
  background: transparent;
  min-height: 64px;
  padding: 8px 12px;
}

#clientsLogoGrid .gdh-partner-logo:hover {
  box-shadow: none;
  transform: none;
}

/* Copyright certificates */
.copyrights-disclaimer {
  font-size: 0.875rem;
  color: var(--gray-600, #4b5563);
  margin: 0 0 1rem;
  line-height: 1.5;
}

.copyrights-summary-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.copyrights-summary-table th,
.copyrights-summary-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
}

.copyrights-summary-title {
  font-size: 0.8125rem;
  color: var(--gray-600, #4b5563);
}

.copyrights-grid {
  display: grid;
  gap: 1.25rem;
}

.copyrights-grid--profile {
  grid-template-columns: 1fr;
}

.copyrights-scroll-hint {
  font-size: 0.75rem;
  color: var(--gray-500, #6b7280);
  margin: 0 0 0.5rem;
  text-align: center;
}

.copyrights-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.5rem;
}

.copyrights-scroll:focus-visible {
  outline: 2px solid var(--brand-primary, #0d47a1);
  outline-offset: 2px;
}

.copyrights-grid--horizontal {
  display: flex;
  gap: 1rem;
  width: max-content;
  min-width: 100%;
}

.copyrights-grid--horizontal .copyright-card {
  flex: 0 0 min(88vw, 420px);
  scroll-snap-align: start;
}

.copyright-card {
  display: grid;
  gap: 1rem;
  border: none;
  background: var(--gray-50, #f9fafb);
  border-radius: 12px;
  padding: 1rem;
}

.copyright-card__badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-primary, #0d47a1);
  margin-bottom: 0.35rem;
}

.copyright-card__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  line-height: 1.35;
}

.copyright-card__subtitle {
  font-size: 0.8125rem;
  color: var(--gray-600, #4b5563);
  margin: 0 0 0.75rem;
  line-height: 1.4;
}

.copyright-card__facts {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.8125rem;
}

.copyright-card__facts div {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.5rem;
}

.copyright-card__facts dt {
  margin: 0;
  font-weight: 600;
  color: var(--gray-700, #374151);
}

.copyright-card__facts dd {
  margin: 0;
  color: var(--gray-600, #4b5563);
}

.copyright-card__figure {
  margin: 0;
  text-align: center;
}

.copyright-card__image {
  max-width: 100%;
  height: auto;
  max-height: 520px;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.copyrights-root--error::after {
  content: "Không tải được dữ liệu bản quyền.";
  display: block;
  color: var(--gray-500, #6b7280);
  font-size: 0.875rem;
}

.clients-root--error .clients-detail-grid::before {
  content: "Không tải được danh sách khách hàng.";
  display: block;
  color: var(--gdh-gray-500, #6b7280);
  font-size: 0.9rem;
}
