/* =========================================================
   LML Learner Header Interactions
   Consolidated source for desktop/touch menu behavior and mobile header layout.
   Loaded after design-system.css and before page-specific styles.
   ========================================================= */

/* Learner navigation interaction states */
/* Base: only the learner main menu links */
.site-header .main-menu-band .main-nav a {
  transition:
    color .14s ease,
    background-color .14s ease !important;
  animation: none !important;
  transform: none !important;
  box-shadow: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  will-change: auto !important;
  -webkit-tap-highlight-color: transparent !important;
  touch-action: manipulation !important;
}

/* Kill inherited hover movement/shadow from global button/card/nav rules */
.site-header .main-menu-band .main-nav a:hover,
.site-header .main-menu-band .main-nav a:active,
.site-header .main-menu-band .main-nav a:focus,
.site-header .main-menu-band .main-nav a.active {
  transition:
    color .14s ease,
    background-color .14s ease !important;
  animation: none !important;
  transform: none !important;
  box-shadow: none !important;
  filter: none !important;
  backdrop-filter: none !important;
}

/* Underline indicator: quick hover/active response */
.site-header .main-menu-band .main-nav a::after,
.site-header .main-menu-band .main-nav a:hover::after,
.site-header .main-menu-band .main-nav a:active::after,
.site-header .main-menu-band .main-nav a:focus::after,
.site-header .main-menu-band .main-nav a.active::after {
  transition:
    transform .14s ease,
    background-color .14s ease,
    opacity .14s ease !important;
  animation: none !important;
  transform-origin: center !important;
}

.site-header .main-menu-band .main-nav a::after {
  transform: scaleX(0) !important;
}

/* Desktop with mouse: keep hover visual, but make it instant */
@media (hover: hover) and (pointer: fine) {
  .site-header .main-menu-band .main-nav a:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, .08) !important;
  }

  .site-header .main-menu-band .main-nav a:hover::after {
    background: var(--gold-500, #f4c542) !important;
    opacity: 1 !important;
    transform: scaleX(1) !important;
  }
}

/* Click response: immediate feedback, no delayed movement */
.site-header .main-menu-band .main-nav a:active {
  color: #ffffff !important;
  background: rgba(255, 255, 255, .11) !important;
}

.site-header .main-menu-band .main-nav a:active::after {
  background: transparent !important;
  opacity: 0 !important;
  transform: scaleX(0) !important;
}

/* Prevent focus from looking like a stuck hover after click */
.site-header .main-menu-band .main-nav a:focus,
.site-header .main-menu-band .main-nav a:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.site-header .main-menu-band .main-nav a:not(.active):focus,
.site-header .main-menu-band .main-nav a:not(.active):focus-visible {
  color: rgba(255, 255, 255, .94) !important;
  background: transparent !important;
}

.site-header .main-menu-band .main-nav a:not(.active):focus::after,
.site-header .main-menu-band .main-nav a:not(.active):focus-visible::after {
  background: transparent !important;
  opacity: 0 !important;
  transform: scaleX(0) !important;
}

/* Active page state remains visible */
.site-header .main-menu-band .main-nav a.active,
.site-header .main-menu-band .main-nav a.active:focus,
.site-header .main-menu-band .main-nav a.active:focus-visible {
  color: #ffffff !important;
  background: rgba(255, 255, 255, .08) !important;
}

.site-header .main-menu-band .main-nav a.active::after,
.site-header .main-menu-band .main-nav a.active:focus::after,
.site-header .main-menu-band .main-nav a.active:focus-visible::after {
  background: var(--gold-500, #f4c542) !important;
  opacity: 1 !important;
  transform: scaleX(1) !important;
}

/* If menu contains icon spans, make them instant too */
.site-header .main-menu-band .main-nav .nav-icon,
.site-header .main-menu-band .main-nav a span,
.site-header .main-menu-band .main-nav a i,
.site-header .main-menu-band .main-nav a svg {
  transition:
    color .14s ease,
    opacity .14s ease !important;
  animation: none !important;
  transform: none !important;
  filter: none !important;
}

/* Touch devices: disable hover simulation to prevent stuck state */
@media (hover: none), (pointer: coarse) {
  .site-header .main-menu-band .main-nav a:hover,
  .site-header .main-menu-band .main-nav a:not(.active):hover,
  .site-header .main-menu-band .main-nav a:not(.active):focus,
  .site-header .main-menu-band .main-nav a:not(.active):focus-visible {
    color: rgba(255, 255, 255, .94) !important;
    background: transparent !important;
  }

  .site-header .main-menu-band .main-nav a:hover::after,
  .site-header .main-menu-band .main-nav a:not(.active):hover::after,
  .site-header .main-menu-band .main-nav a:not(.active):focus::after,
  .site-header .main-menu-band .main-nav a:not(.active):focus-visible::after {
    background: transparent !important;
    opacity: 0 !important;
    transform: scaleX(0) !important;
  }

  .site-header .main-menu-band .main-nav a:active {
    color: #ffffff !important;
    background: rgba(255, 255, 255, .11) !important;
  }

  .site-header .main-menu-band .main-nav a.active,
  .site-header .main-menu-band .main-nav a.active:hover,
  .site-header .main-menu-band .main-nav a.active:focus,
  .site-header .main-menu-band .main-nav a.active:focus-visible {
    color: #ffffff !important;
    background: rgba(255, 255, 255, .08) !important;
  }

  .site-header .main-menu-band .main-nav a.active::after,
  .site-header .main-menu-band .main-nav a.active:hover::after,
  .site-header .main-menu-band .main-nav a.active:focus::after,
  .site-header .main-menu-band .main-nav a.active:focus-visible::after {
    background: var(--gold-500, #f4c542) !important;
    opacity: 1 !important;
    transform: scaleX(1) !important;
  }
}


/* Mobile learner header layout */
@media (max-width: 720px) {
  /* Hide the third supporting line on mobile only:
     "เรียนรู้ • ทดลอง • รับเกียรติบัตร" */
  .site-header .header-strip .header-brand-meta {
    display: none !important;
  }

  /* Make the remaining two lines more compact */
  .site-header .header-strip {
    min-height: auto !important;
    padding: 7px 0 8px !important;
  }

  .site-header .header-strip .header-strip-inner {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 1px !important;
    min-height: 0 !important;
    text-align: center !important;
    white-space: normal !important;
    overflow: visible !important;
    line-height: 1.25 !important;
  }

  .site-header .header-strip .header-strip-inner span {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    text-align: center !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  .site-header .header-strip .header-brand-name {
    color: var(--lml-gold-500, var(--gold-500, #f4c542)) !important;
    font-size: .88rem !important;
    font-weight: 950 !important;
    line-height: 1.22 !important;
  }

  .site-header .header-strip .header-brand-tagline {
    color: rgba(255, 255, 255, .96) !important;
    font-size: .78rem !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
  }
}

@media (max-width: 380px) {
  .site-header .header-strip .header-brand-name {
    font-size: .84rem !important;
  }

  .site-header .header-strip .header-brand-tagline {
    font-size: .74rem !important;
  }
}
