/**
 * TLJCC Site Header Stylesheet
 * Converted from TLJCC NEW/about-hero-desktop-concept.html
 * Design System: Tunku Laksamana Johor Cancer Centre
 */

/* ==========================================================================
   Design Tokens & CSS Variables
   ========================================================================== */
:root {
  --page-max: 100%;
  --container: 1320px;
  --navy: #263778;
  --navy-dark: #111b43;
  --navy-deep: #08112d;
  --red: #ce2028;
  --red-hover: #b51c23;
  --red-light: #ce2028;
  --yellow: #f6eb16;
  --ink: #121d3d;
  --muted: #68728a;
  --warm-white: #f7f4ed;
  --paper: #fff;
  --line: #d9deea;
  --mist: #edf1f7;

  /* Namespace Aliases */
  --tljcc-page-max: var(--page-max);
  --tljcc-container: var(--container);
  --tljcc-navy: var(--navy);
  --tljcc-navy-dark: var(--navy-dark);
  --tljcc-navy-deep: var(--navy-deep);
  --tljcc-red: var(--red);
  --tljcc-red-light: var(--red-light);
  --tljcc-yellow: var(--yellow);
  --tljcc-ink: var(--ink);
  --tljcc-muted: var(--muted);
  --tljcc-warm-white: var(--warm-white);
  --tljcc-paper: var(--paper);
  --tljcc-line: var(--line);
  --tljcc-mist: var(--mist);
}

/* ==========================================================================
   Avenir Font Declarations (Local System Mappings with Robust Fallbacks)
   ========================================================================== */
@font-face {
  font-family: "Avenir";
  src: local("Avenir Heavy"), local("Avenir-Heavy"), local("Avenir Heavy Regular");
  font-weight: 600;
  font-style: normal;
}
@font-face {
  font-family: "Avenir";
  src: local("Avenir Heavy"), local("Avenir-Heavy"), local("Avenir Black"), local("Avenir-Black");
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: "Avenir";
  src: local("Avenir Medium"), local("Avenir-Medium");
  font-weight: 500;
  font-style: normal;
}
@font-face {
  font-family: "Avenir";
  src: local("Avenir Book"), local("Avenir-Book"), local("Avenir");
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: "Avenir";
  src: local("Avenir Light"), local("Avenir-Light");
  font-weight: 300;
  font-style: normal;
}

/* ==========================================================================
   Global / Layout Foundation for Header
   ========================================================================== */
.tljcc-header-wrapper {
  width: 100%;
  position: relative;
  z-index: 1000;
  font-family: 'Avenir', 'Avenir Next', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.tljcc-header-wrapper .shell,
.site-header .shell,
.utility-bar .shell {
  width: min(calc(100% - 48px), var(--container, 1320px));
  max-width: var(--container, 1320px);
  margin-inline: auto;
  box-sizing: border-box;
}

/* Skip link accessibility */
.skip-link {
  position: fixed;
  z-index: 9999;
  top: 12px;
  left: 12px;
  padding: 12px 16px;
  color: var(--navy-deep);
  background: var(--yellow);
  font-family: 'Avenir', 'Avenir Next', system-ui, -apple-system, sans-serif;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  border-radius: 4px;
  transform: translateY(-160%);
  transition: transform .2s ease-in-out;
}
.skip-link:focus {
  transform: translateY(0);
  outline: 3px solid var(--navy-deep);
  outline-offset: 2px;
}

/* Focus styles */
.site-header a:focus-visible,
.site-header button:focus-visible,
.utility-bar a:focus-visible,
.utility-bar button:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

/* ==========================================================================
   Top Utility Bar
   ========================================================================== */
.utility-bar {
  width: 100%;
  display: block;
  height: 28px;
  color: rgba(255, 255, 255, 0.86);
  background: var(--navy);
  font-size: 10.5px;
  font-family: 'Avenir', 'Avenir Next', system-ui, -apple-system, sans-serif;
  line-height: 28px;
  position: relative;
  z-index: 1001;
}

.utility-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  box-sizing: border-box;
}

.utility-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.86);
  white-space: nowrap;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  font-size: 10.5px;
  font-family: inherit;
  cursor: pointer;
  transition: color .2s ease;
}

.utility-link:hover {
  color: #fff;
}

.chevron {
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  display: inline-block;
  transition: transform .2s ease;
}

.search-icon {
  position: relative;
  width: 10px;
  height: 10px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  display: inline-block;
}

.search-icon::after {
  content: "";
  position: absolute;
  right: -3px;
  bottom: -2px;
  width: 4px;
  height: 1.5px;
  background: currentColor;
  transform: rotate(45deg);
}

/* ==========================================================================
   Site Header: Brand, Single-Row Navigation, Appointment CTA
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  box-shadow: 0 4px 20px rgba(7, 31, 82, 0.07);
  width: 100%;
}

.header-inner {
  width: 100%;
  height: 106px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(14px, 1.8vw, 32px);
  box-sizing: border-box;
}

/* Brand Logo & Typography */
.brand {
  display: flex;
  align-items: center;
  gap: 18px;
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
  color: inherit;
}

.brand img,
.brand .brand-logo-img {
  width: 86px;
  height: 88px;
  object-fit: contain;
  flex-shrink: 0;
  transition: transform .2s ease;
}

.brand:hover img,
.brand:hover .brand-logo-img {
  transform: scale(1.025);
}

.brand-copy {
  color: var(--navy-deep);
  line-height: 1.25;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-copy strong,
.brand-copy span {
  display: block;
  font-family: "Times New Roman", Times, "Liberation Serif", serif;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--navy-deep);
  line-height: 1.24;
}

.brand-copy span {
  margin-top: 2px;
}

/* Single-Row Navigation Menu */
.nav-menu {
  display: flex;
  align-items: center;
  gap: clamp(14px, 1.8vw, 26px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
  color: var(--ink);
  font-family: 'Avenir', 'Avenir Next', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .035em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s ease;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-link::after {
  content: "";
  position: absolute;
  right: 100%;
  bottom: 0;
  left: 0;
  height: 2.5px;
  background: var(--red);
  transition: right .22s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
  color: var(--navy);
}

.nav-link:hover::after,
.nav-link.active::after,
.nav-item.current-menu-item > .nav-link::after,
.nav-item.current-page-ancestor > .nav-link::after {
  right: 0;
}

.nav-link.active,
.nav-item.current-menu-item > .nav-link,
.nav-item.current-page-ancestor > .nav-link {
  color: var(--red);
  font-weight: 700;
}

/* More Dropdown Menu */
.nav-item-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.nav-dropdown-trigger .nav-chevron {
  display: inline-block;
  transition: transform .22s ease, opacity .22s ease;
  opacity: .7;
}

.nav-item-dropdown:hover .nav-dropdown-trigger .nav-chevron,
.nav-item-dropdown.is-open .nav-dropdown-trigger .nav-chevron {
  transform: rotate(180deg);
  opacity: 1;
  color: var(--red);
}

.nav-item-dropdown:hover .nav-dropdown-trigger::after,
.nav-item-dropdown.is-open .nav-dropdown-trigger::after {
  right: 0;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 240px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--red);
  border-radius: 0 0 6px 6px;
  box-shadow: 0 16px 36px rgba(8, 17, 45, 0.12), 0 4px 12px rgba(8, 17, 45, 0.05);
  padding: 8px 0;
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
  list-style: none;
  margin: 0;
}

.nav-dropdown-menu::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}

.nav-item-dropdown:hover .nav-dropdown-menu,
.nav-item-dropdown:focus-within .nav-dropdown-menu,
.nav-item-dropdown.is-open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-dropdown-menu a,
.nav-dropdown-menu .dropdown-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 22px;
  color: var(--ink);
  font-family: 'Avenir', 'Avenir Next', system-ui, -apple-system, sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .02em;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background .18s ease, color .18s ease, border-color .18s ease, padding-left .18s ease;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a:focus,
.nav-dropdown-menu .dropdown-link:hover,
.nav-dropdown-menu .dropdown-link:focus {
  background: #f4f6fa;
  color: var(--navy);
  border-left-color: var(--red);
  padding-left: 25px;
}

.nav-dropdown-menu a.active,
.nav-dropdown-menu li.current-menu-item > a {
  color: var(--red);
  font-weight: 700;
  border-left-color: var(--red);
  background: #fcf6f6;
}

/* Primary Appointment CTA Slot */
.header-cta-slot {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.appointment {
  min-width: 160px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
  border-radius: 3px;
  color: #fff !important;
  background: var(--red);
  font-family: 'Avenir', 'Avenir Next', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .03em;
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  box-sizing: border-box;
}

.appointment:hover {
  background: #b51c23;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(206, 32, 40, 0.28);
}

.appointment-arrow {
  font-size: 11px;
  transition: transform .2s ease;
  display: inline-block;
}

.appointment:hover .appointment-arrow {
  transform: translateX(3px);
}

/* Mobile Toggle Button */
.mobile-nav-toggle,
.site-header .mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: 0;
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  z-index: 1005;
  border-radius: 4px;
  transition: background .2s ease;
}

.mobile-nav-toggle:hover,
.site-header .mobile-nav-toggle:hover {
  background: rgba(38, 55, 120, 0.06);
}

.mobile-nav-toggle .hamburger-bar,
.site-header .mobile-nav-toggle .hamburger-bar {
  display: block;
  width: 24px;
  height: 2.5px;
  background-color: var(--navy-deep, #08112d);
  border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease;
}

.mobile-nav-toggle[aria-expanded="true"] .hamburger-bar:nth-child(1),
.site-header .mobile-nav-toggle[aria-expanded="true"] .hamburger-bar:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
.mobile-nav-toggle[aria-expanded="true"] .hamburger-bar:nth-child(2),
.site-header .mobile-nav-toggle[aria-expanded="true"] .hamburger-bar:nth-child(2) {
  opacity: 0;
}
.mobile-nav-toggle[aria-expanded="true"] .hamburger-bar:nth-child(3),
.site-header .mobile-nav-toggle[aria-expanded="true"] .hamburger-bar:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* ==========================================================================
   Mobile Nav Drawer (Enhanced Drawer for Small Screens)
   ========================================================================== */
.tljcc-mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  visibility: hidden;
  transition: visibility .3s ease;
}

.tljcc-mobile-drawer.is-open {
  visibility: visible;
}

.tljcc-mobile-drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 17, 45, 0.6);
  opacity: 0;
  transition: opacity .3s ease;
  backdrop-filter: blur(2px);
}

.tljcc-mobile-drawer.is-open .tljcc-mobile-drawer__overlay {
  opacity: 1;
}

.tljcc-mobile-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(85vw, 360px);
  background: #fff;
  box-shadow: -8px 0 24px rgba(8, 17, 45, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.tljcc-mobile-drawer.is-open .tljcc-mobile-drawer__panel {
  transform: translateX(0);
}

.tljcc-mobile-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.tljcc-mobile-drawer__title {
  font-family: "Times New Roman", Times, serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--navy-deep);
}

.tljcc-mobile-drawer__close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
  padding: 4px;
}

.tljcc-mobile-drawer__nav {
  padding: 16px 0;
  display: flex;
  flex-direction: column;
}

.tljcc-mobile-drawer__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background .15s ease, color .15s ease, border-left .15s ease;
}

.tljcc-mobile-drawer__link:hover,
.tljcc-mobile-drawer__link.active {
  background: #f4f6fa;
  color: var(--red);
  border-left-color: var(--red);
}

.tljcc-mobile-drawer__divider {
  height: 1px;
  background: var(--line);
  margin: 12px 24px;
}

/* Utility Items inside Mobile Drawer */
.tljcc-mobile-drawer__utility-group {
  padding-top: 2px;
  padding-bottom: 8px;
}

.tljcc-mobile-drawer__link--utility {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted, #5b667d);
  padding: 11px 24px;
  cursor: pointer;
}

.tljcc-mobile-drawer__link--utility:hover,
.tljcc-mobile-drawer__link--utility:focus {
  background: #f4f6fa;
  color: var(--navy, #263778);
  border-left-color: var(--navy, #263778);
}

.tljcc-drawer-utility-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.tljcc-mobile-drawer__link--utility .search-icon {
  width: 11px;
  height: 11px;
  border-color: currentColor;
}

.tljcc-mobile-drawer__link--utility .search-icon::after {
  background: currentColor;
}

.tljcc-mobile-drawer__link--utility .chevron {
  width: 6px;
  height: 6px;
  border-color: currentColor;
}

.tljcc-mobile-drawer__actions {
  margin-top: auto;
  padding: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tljcc-mobile-drawer__cta {
  width: 100%;
  text-align: center;
  padding: 12px 20px;
  font-size: 13.5px;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1280px) {
  .header-inner {
    height: 96px;
    gap: clamp(12px, 1.5vw, 24px);
  }
  .brand {
    gap: 14px;
  }
  .brand img,
  .brand .brand-logo-img {
    width: 72px;
    height: 74px;
  }
  .brand-copy strong,
  .brand-copy span {
    font-size: 13.5px;
  }
  .nav-menu {
    gap: clamp(10px, 1.2vw, 18px);
  }
  .nav-link {
    font-size: 13px;
    padding: 8px 0;
  }
  .appointment {
    min-width: auto;
    padding: 0 16px;
    font-size: 13px;
    height: 42px;
    min-height: 42px;
  }
}

/* Tablet View Adaptations (max-width: 1080px) - Replace CTA with Hamburger Icon */
@media (max-width: 1080px) {
  .utility-bar {
    display: none !important;
  }

  .header-inner {
    height: 78px;
    gap: 16px;
    justify-content: space-between;
  }

  /* Hide Desktop Navigation Menu on Tablet */
  .nav-menu {
    display: none !important;
  }

  /* Replace Header CTA button with Hamburger Menu Icon */
  .site-header .header-cta-slot .appointment {
    display: none !important;
  }

  .mobile-nav-toggle {
    display: flex !important;
  }

  .brand {
    gap: 12px;
  }

  .brand img,
  .brand .brand-logo-img {
    width: 58px;
    height: 60px;
  }

  .brand-copy strong,
  .brand-copy span {
    font-size: 12px;
    line-height: 1.22;
  }

  .tljcc-header-wrapper .shell,
  .site-header .shell {
    width: min(calc(100% - 36px), var(--container, 1320px));
  }
}

@media (max-width: 600px) {
  .header-inner {
    height: 68px;
    padding: 6px 0;
  }

  .brand {
    gap: 8px;
  }

  .brand img,
  .brand .brand-logo-img {
    width: 46px;
    height: 48px;
  }

  .brand-copy strong,
  .brand-copy span {
    font-size: 10.5px;
  }

  .tljcc-header-wrapper .shell,
  .site-header .shell {
    width: min(calc(100% - 24px), var(--container, 1320px));
  }
}

@media (max-width: 400px) {
  .brand-copy strong {
    font-size: 9.5px;
  }
  .brand-copy span {
    font-size: 9px;
  }
}
