/* =========================================
   1. Variables & Global Defaults
   ========================================= */
:root {
  /* Government/Trust Palette */
  --ha-primary: #003366; /* Deep Navy Blue */
  --ha-secondary: #ffffff; /* Bright Action Blue */
  --ha-accent: #e3f2fd; /* Light Blue Background */
  --ha-text-dark: #2c3e50;
  --ha-text-light: #546e7a;
  --ha-white: #ffffff;
  --ha-border: #e0e0e0;

  /* Spacing & Layout */
  --header-height: 80px;
  --container-width: 1920px;
  --radius-sm: 4px;
  --transition: all 0.3s ease;
}

/* =========================================
     2. Header Layout (Desktop First)
     ========================================= */
section.main-home-banner-slider {
  position: relative;
  height: 100vh;
}

/* Sub Home Banner Slider - For non-front pages */
section.sub-home-banner-slider {
  position: relative;
  min-height: 60vh;
  height: 60vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

section.sub-home-banner-slider .page-banner {
  position: absolute;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  top: 0;
}

section.sub-home-banner-slider .banner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(15, 23, 42, 0.9) 0%,
    rgba(15, 23, 42, 0.7) 40%,
    rgba(15, 23, 42, 0.1) 100%
  );
  z-index: 1;
}

section.sub-home-banner-slider .banner-content-container {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
}

section.sub-home-banner-slider .banner-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  color: #fff;
}

section.sub-home-banner-slider .banner-title {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
  margin: 0;
}

.site-header {
  height: var(--header-height);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid #ffffff47;
  transition: var(--transition);
  background: transparent;
  backdrop-filter: blur(10px);
}

/* Sticky Header State - When Scrolled */
.site-header.sticky {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid var(--ha-border);
}

.site-header.sticky .nav-menu li a {
  color: var(--ha-text-dark) !important;
}

.site-header.sticky .nav-menu li a:hover,
.site-header.sticky .nav-menu li.current-menu-item a {
  color: var(--ha-secondary);
}

.site-header.sticky .user-greeting {
  color: var(--ha-text-dark);
}

.site-header.sticky .user-greeting strong {
  color: var(--ha-primary);
}

.site-header.sticky .btn-login,
.site-header.sticky .btn-logout {
  color: var(--ha-text-dark);
  border-color: var(--ha-border);
}

.site-header.sticky .btn-login:hover {
  background-color: var(--ha-secondary);
  color: #fff;
  border-color: var(--ha-secondary);
}

.site-header.sticky .mobile-menu-toggle span {
  background-color: var(--ha-primary);
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  width: 90%;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

/* Logo Styling */
.site-logo a {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.site-logo img {
  max-height: 50px; /* Constrain logo height */
  width: auto;
}

/* =========================================
     3. Navigation Menu (Desktop)
     ========================================= */
.main-navigation {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 24px;
}

.nav-menu li a {
  text-decoration: none;
  color: var(--ha-white);
  font-weight: 500;
  font-size: 1rem;
  padding: 8px 0;
  position: relative;
  transition: var(--transition);
}

/* Hover Effect: Underline expands */
.nav-menu li a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--ha-secondary);
  transition: var(--transition);
}

.nav-menu li a:hover,
.nav-menu li.current-menu-item a {
  color: var(--ha-secondary);
}

.nav-menu li a:hover::after,
.nav-menu li.current-menu-item a::after {
  width: 100%;
}

/* =========================================
     4. User Actions (Login/Profile)
     ========================================= */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 15px;
  padding-left: 20px;
  border-left: 1px solid var(--ha-border); /* Separator */
}

.user-greeting {
  font-size: 0.85rem;
  color: var(--ha-white);
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-align: right;
}

.user-greeting strong {
  color: var(--ha-primary);
  font-size: 0.95rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
}

.btn-login {
  background-color: transparent;
  color: #fff;
  border: 1px solid var(--ha-border);
  padding: 6px 15px;
}

.btn-login:hover {
  background-color: var(--ha-secondary);
  border-color: var(--ha-secondary);
  transform: translateY(-1px);
}

.btn-logout {
  background-color: transparent;
  color: #fff;
  border: 1px solid var(--ha-border);
  padding: 6px 15px;
}

.btn-logout:hover {
  background-color: #f8f9fa;
  color: #d32f2f; /* Red for logout warning */
  border-color: #d32f2f;
}

.btn-icon {
  font-size: 1.1em;
}

/* =========================================
     5. Mobile Toggle (Hamburger)
     ========================================= */
.mobile-menu-toggle {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1001;
}

.mobile-menu-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--ha-primary);
  margin-bottom: 5px;
  border-radius: 2px;
  transition: var(--transition);
}

/* =========================================
     6. Responsive Design (Tablets & Mobile)
     ========================================= */
@media (max-width: 992px) {
  .site-header {
    height: 70px;
  }

  .mobile-menu-toggle {
    display: block;
  }

  /* Hide Main Nav by default on mobile */
  .main-navigation {
    position: fixed;
    top: 70px; /* Below header */
    left: 0;
    right: 0;
    background-color: var(--ha-white);
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
    gap: 0;
    border-top: 1px solid var(--ha-border);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);

    /* Animation State: Closed */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
  }

  /* Animation State: Open (When Javascript adds .is-active) */
  .main-navigation.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  /* Stack Menu Items */
  .nav-menu {
    flex-direction: column;
    width: 100%;
    gap: 0;
  }

  .nav-menu li {
    width: 100%;
    border-bottom: 1px solid #f1f1f1;
  }

  .nav-menu li a {
    display: block;
    padding: 15px 0;
    font-size: 1.1rem;
  }

  .nav-menu li a::after {
    display: none; /* Remove underline effect on mobile */
  }

  /* User Actions in Mobile Menu */
  .nav-actions {
    flex-direction: column; /* Stack actions */
    border-left: none;
    padding-left: 0;
    padding-top: 20px;
    margin-top: 20px;
    gap: 15px;
    align-items: flex-start;
  }

  .user-info {
    width: 100%;
    padding: 10px;
    background-color: var(--ha-accent);
    border-radius: var(--radius-sm);
  }

  .user-greeting {
    text-align: left;
    flex-direction: row;
    gap: 5px;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  /* Hamburger Animation to 'X' */
  .mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
  }
  .mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }
  .mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
  }
}
