/* ==========================================================================
   MATA Malaysia - Global Header & Navigation Styles
   Single Source of Truth: Homepage (Post ID 1251)
   Architecture: Decoupled Child Theme Stylesheet (header.css)
   ========================================================================== */

:root {
  /* Surfaces & Canvas (Crisp Architectural Light Mode) */
  --mata-bg: #ffffff;
  --mata-surface: #ffffff;
  --mata-surface-alt: #f8fafc;
  --mata-surface-raised: #f1f5f9;
  --mata-surface-blue-tint: #f0f7ff;
  --mata-border: #e2e8f0;
  --mata-border-dark: #cbd5e1;
  --mata-border-light: #f1f5f9;
  --mata-border-blue: #0066cc;
  --mata-border-blue-tint: #bfdbfe;

  /* Typography (Apple SF Pro Contrast on White) */
  --mata-text-primary: #090d16;
  --mata-text-secondary: #334155;
  --mata-text-muted: #64748b;
  --mata-text-dim: #94a3b8;

  /* Blue Accent ONLY (Apple Royal Blue / Institutional Financial Blue) */
  --mata-blue: #0066cc;
  --mata-blue-hover: #0052a3;
  --mata-blue-dark: #003d7a;
  --mata-blue-light: #eff6ff;
  --mata-blue-glow: rgba(0, 102, 204, 0.12);

  /* Modern Apple Font Stack */
  --mata-font: "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mata-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Sizing */
  --mata-max-width: 1240px;
  --mata-gutter: clamp(1.25rem, 4vw, 2.5rem);
}

/* UNIVERSAL ABSOLUTE HARD EDGES RULE - ZERO BORDER RADIUS ANYWHERE */
*, *::before, *::after,
header, nav, ul, li, a, button, div, span {
  border-radius: 0px !important;
  -webkit-border-radius: 0px !important;
  -moz-border-radius: 0px !important;
}

body.lamanify-clean-page {
  background-color: var(--mata-bg);
  color: var(--mata-text-secondary);
  font-family: var(--mata-font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Top Scroll Progress Bar */
#mataScrollProgress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--mata-blue);
  transform-origin: 0% 50%;
  transform: scaleX(0);
  z-index: 9999;
}

/* Container */
.mata-container {
  max-width: var(--mata-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--mata-gutter);
  padding-right: var(--mata-gutter);
  width: 100%;
}

/* Suppress WhatsApp overlap */

/* Suppress/Style WhatsApp widget to strict hard edges & blue accent */
.ht-ctc, .ht_ctc_chat_data, .ht-ctc-chat, .ht_ctc_chat_style {
  border-radius: 0px !important;
  z-index: 999 !important;
  bottom: 24px !important;
  right: 24px !important;
}
.ht_ctc_chat_data, .ht_ctc_padding {
  border-radius: 0px !important;
  background-color: var(--mata-blue) !important;
  box-shadow: 0 4px 14px rgba(0, 102, 204, 0.3) !important;
}
.ht-ctc svg, .ht_ctc_chat_data svg {
  border-radius: 0px !important;
}

.ht-ctc-unused {
  z-index: 999 !important;
  bottom: 24px !important;
  right: 24px !important;
}

/* Header & Best-Practice Categorized Nav with Dropdowns */
.mata-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--mata-border-light);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
}
.mata-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 1.5rem;
}
.mata-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #1d1d1f;
  flex-shrink: 0;
}

.mata-logo-img {
  height: 46px;
  width: auto;
  max-width: 182px;
  object-fit: contain;
  display: block;
}
@media (max-width: 768px) {
  .mata-logo-img {
    height: 38px;
    max-width: 150px;
  }
}
@media (max-width: 480px) {
  .mata-logo-img {
    height: 34px;
    max-width: 130px;
  }
}

.mata-logo-box {
  background: var(--mata-blue);
  color: #ffffff;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.6rem;
  border-radius: 0px !important;
}
.mata-brand-titles {
  display: flex;
  flex-direction: column;
}
.mata-brand-title {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  color: #1d1d1f;
  white-space: nowrap;
}
.mata-brand-subtitle {
  font-size: 0.65rem;
  color: #86868b;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}
@media (max-width: 1240px) {
  .mata-brand-subtitle {
    display: none;
  }
}

/* Categorized 5-Item Nav Menu */
.mata-nav-menu {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 1.8vw, 1.75rem);
  list-style: none;
  margin: 0;
  padding: 0;
}
.mata-nav-item {
  position: relative;
  display: flex;
  align-items: center;
}
.mata-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #424245;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap !important;
  padding: 1.4rem 0.35rem;
  transition: color 0.15s ease;
  position: relative;
}
.mata-nav-link:hover {
  color: var(--mata-blue);
}
.mata-nav-link.active {
  color: var(--mata-blue);
}
.mata-nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--mata-blue);
}
.mata-chevron {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  stroke: currentColor;
  flex-shrink: 0;
}
.mata-nav-item:hover .mata-chevron {
  transform: rotate(180deg);
}

/* High-Precision Left-Anchored Dropdown Menus */
.mata-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  transform: translateY(8px);
  background: #ffffff;
  border: 1px solid var(--mata-border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.03);
  padding: 0.6rem 0;
  min-width: 300px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s ease;
  z-index: 1050;
  border-radius: 0px !important;
}
.mata-dropdown::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
  background: transparent;
}
.mata-nav-item:hover .mata-dropdown,
.mata-nav-item:focus-within .mata-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.mata-dropdown-right {
  left: auto !important;
  right: 0 !important;
}

.mata-dropdown-link {
  display: block;
  padding: 0.75rem 1.25rem;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all 0.15s ease;
}
.mata-dropdown-link:hover {
  background: var(--mata-surface-alt);
  border-left-color: var(--mata-blue);
}
.mata-dd-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 0.2rem;
  white-space: nowrap;
}
.mata-dropdown-link:hover .mata-dd-title {
  color: var(--mata-blue);
}
.mata-dd-desc {
  font-size: 0.75rem;
  color: #86868b;
  line-height: 1.35;
  white-space: normal;
}

.mata-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.mata-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 0px !important;
  cursor: pointer;
  border: 1px solid transparent;
  line-height: 1;
  white-space: nowrap !important;
}
.mata-btn span {
  display: inline-block;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.mata-btn:hover span {
  transform: translateX(3px);
}
.mata-btn-sm {
  padding: 0.45rem 0.95rem;
  font-size: 0.82rem;
}
.mata-btn-primary {
  background: var(--mata-blue);
  color: #ffffff;
  border-color: var(--mata-blue);
}
.mata-btn-primary:hover {
  background: var(--mata-blue-hover);
  border-color: var(--mata-blue-hover);
  color: #ffffff;
}
.mata-btn-secondary {
  background: #ffffff;
  color: #1d1d1f;
  border-color: var(--mata-border);
}
.mata-btn-secondary:hover {
  background: var(--mata-surface-alt);
  color: var(--mata-blue);
  border-color: var(--mata-blue);
}

.mata-nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--mata-border);
  color: #1d1d1f;
  padding: 0.4rem 0.5rem;
  cursor: pointer;
  line-height: 1;
  border-radius: 0px !important;
}

/* Standalone Mobile Drawer Placed OUTSIDE Header to bypass backdrop-filter containing block trap */
.mata-mobile-drawer {
  display: none;
  position: fixed;
  top: 68px;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ffffff;
  border-bottom: 1px solid var(--mata-border);
  padding: 1.5rem;
  z-index: 9999;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}
.mata-mobile-drawer.active {
  display: block;
}
.mata-mobile-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 0 0 2rem 0;
  padding: 0;
}
.mata-mob-group {
  border-bottom: 1px solid var(--mata-border-light);
  padding-bottom: 0.85rem;
}
.mata-mob-head {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}
.mata-mob-sub {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--mata-blue);
}
.mata-mob-sub a {
  color: #64748b;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 400;
  padding: 0.2rem 0;
}
.mata-mob-sub a:hover {
  color: var(--mata-blue);
}

@media (max-width: 1120px) {
  .mata-nav-menu, .mata-nav-actions .mata-btn { display: none !important; }
  .mata-nav-toggle { display: inline-flex !important; align-items: center; justify-content: center; }
}


/* Suppress article reading progress bar on member dashboard & clean app portals */
body.page-template-template-clean-page #mataScrollProgress,
.mata-member-nav-strip ~ #mataScrollProgress,
.page-id-1338 #mataScrollProgress,
.page-id-1339 #mataScrollProgress {
  display: none !important;
}

/* Crisp single line alignment for member navigation tabs */
.mata-member-nav-strip {
  position: relative;
  border-bottom: 1px solid var(--mata-border-light, #e2e8f0);
}
.mata-member-nav-links a {
  position: relative;
}
.mata-member-nav-links a.active {
  margin-bottom: -1px;
}
