/* Edmates Header - Complete Original Design (No Dropdowns) */

/* Core variables */
:root {
  --header-height: 3.5rem;
  --bg-color: #F7F9FA;
  --primary: #e50916;
  --primary-hover: #cc0814;
  --primary-light: #fef2f2;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.15), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --trans-fast: 0.15s ease;
}

/* Base reset */
.edmates-header * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* Hide original theme header */
.site-header:not(.edmates-header), 
#masthead:not(.edmates-header),
header.header:not(.edmates-header) {
  display: none;
}

/* Header structure */
.edmates-header {
  position: sticky;
  top: 0;
  z-index: 49;
  width: 100%;
  height: var(--header-height);
  background-color: var(--bg-color);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: var(--shadow-sm);
  -webkit-font-smoothing: antialiased;
  transition: box-shadow var(--trans-fast), border-color var(--trans-fast);
}

.edmates-header.scrolled {
  box-shadow: var(--shadow-md);
}

.edmates-header-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 0.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

/* Logo */
.edmates-logo {
  display: flex;
  align-items: center;
}

.edmates-logo a {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.edmates-logo-img {
  height: 1.55rem;
  width: auto;
}

/* Navigation */
.edmates-nav {
  display: flex;
  align-items: center;
}

.edmates-nav-list {
  display: flex;
  list-style: none;
}

.nav-item {
  position: relative;
  margin-left: 2rem;
}

.nav-item:first-child {
  margin-left: 0;
}

.nav-link {
  color: var(--slate-700);
  font-weight: 700;
  font-size: 0.9375rem;
  padding: 0.5rem 0;
  display: inline-flex;
  align-items: center;
  line-height: 1.5;
  text-decoration: none;
  transition: color var(--trans-fast);
}

.nav-link:hover, .nav-link:focus {
  color: var(--primary);
}

/* Button styles */
.edmates-apply-btn, 
.edmates-mobile-apply-btn {
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 9999px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background-color var(--trans-fast);
}

.edmates-apply-btn:hover, 
.edmates-mobile-apply-btn:hover,
.edmates-apply-btn:active, 
.edmates-mobile-apply-btn:active,
.edmates-apply-btn:focus, 
.edmates-mobile-apply-btn:focus {
  background-color: var(--primary-hover);
  color: white !important;
}

/* Extra specific selector to ensure text stays white */
.edmates-apply-btn:active span, 
.edmates-mobile-apply-btn:active span {
  color: white !important;
}

.edmates-apply-btn {
  padding: 0.53rem 1.5rem;
  font-size: 0.875rem;
  margin-left: 1.5rem;
  line-height: 1.4;
}

.edmates-mobile-apply-btn {
  display: none;
  padding: 0.43rem 1rem;
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.4;
}

/* Button caret */
.edmates-apply-btn::after,
.edmates-mobile-apply-btn::after {
  content: "›";
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 1.25em;
  line-height: 1;
  font-weight: bold;
  transition: transform var(--trans-fast);
}

.edmates-apply-btn:hover::after,
.edmates-mobile-apply-btn:hover::after {
  transform: translateX(2px);
}

/* Mobile menu */
.edmates-mobile-menu-btn {
  display: none;
  background: transparent !important;
  border: none;
  cursor: pointer;
  padding: 0.75rem;
  color: var(--slate-700);
  z-index: 51;
  position: relative;
}

.edmates-mobile-menu-btn:hover,
.edmates-mobile-menu-btn:focus,
.edmates-mobile-menu-btn:active,
.edmates-mobile-menu-btn.active {
  background: transparent !important;
}

/* Hamburger */
.edmates-hamburger {
  position: relative;
  width: 1.5rem;
  height: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: transparent !important;
}

.edmates-hamburger span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--slate-700);
  border-radius: 9999px;
  transition: transform 0.25s ease, top 0.25s ease;
}

.edmates-hamburger span:nth-child(1) {
  top: calc(50% - 5px);
}

.edmates-hamburger span:nth-child(2) {
  top: calc(50% + 5px);
}

.edmates-mobile-menu-btn.active .edmates-hamburger span:nth-child(1) {
  top: 50%;
  transform: rotate(45deg);
}

.edmates-mobile-menu-btn.active .edmates-hamburger span:nth-child(2) {
  top: 50%;
  transform: rotate(-45deg);
}

/* Overlay */
.edmates-overlay {
  display: none;
  position: fixed;
  top: 3.5rem;
  left: 0;
  width: 100%;
  height: calc(100vh - 3.5rem);
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 48;
  transition: opacity 0.2s ease;
}

.edmates-overlay.active {
  display: block;
}

/* Accessibility */
.nav-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

@media (prefers-reduced-motion) {
  .edmates-header * {
    transition: none;
  }
}

/* WordPress admin compatibility */
.admin-bar .edmates-header {
  top: 32px;
}

.admin-bar .edmates-header .edmates-nav {
  top: 32px;
  height: calc(100vh - 32px);
}

@media screen and (max-width: 782px) {
  .admin-bar .edmates-header {
    top: 46px;
  }
  
  .admin-bar .edmates-header .edmates-nav {
    top: 46px;
    height: calc(100vh - 46px);
  }
}

/* Responsive breakpoints */
@media (max-width: 1200px) {
  .edmates-header-container {
    width: 100%;
    padding: 0 1rem;
  }
}

@media (max-width: 1024px) {
  .nav-item {
    margin-left: 1.5rem;
  }
}

/* Mobile fixes */
@media (max-width: 768px) {
  .edmates-header {
    position: sticky;
    z-index: 49;
  }
  
  .edmates-header-container {
    padding: 0;
  }
  
  .edmates-logo {
    padding-left: 20px;
  }
  
  .edmates-logo-img {
    height: 1.275rem;
  }
  
  /* Show mobile elements */
  .edmates-center-container,
  .edmates-right-container,
  .edmates-mobile-menu-btn,
  .edmates-mobile-apply-btn {
    display: block;
  }
  
  .edmates-center-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    background: transparent !important;
  }
  
  /* Force-remove background from mobile menu components but preserve the hamburger lines */
  .edmates-center-container,
  .edmates-mobile-menu-btn,
  .edmates-hamburger {
    background-color: transparent !important;
  }
  
  .edmates-right-container {
    position: absolute;
    right: 20px;
    z-index: 50;
  }
  
  .edmates-apply-btn {
    display: none;
  }
  
  /* Mobile nav */
  .edmates-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 20rem;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-color);
    padding: 5rem 1.5rem 1.5rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -5px 0 25px -5px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    z-index: 48;
    pointer-events: none;
  }
  
  .edmates-nav.active {
    transform: translateX(0);
    pointer-events: auto;
  }
  
  .edmates-nav-list {
    flex-direction: column;
    width: 100%;
    margin-bottom: 1.5rem;
  }
  
  .nav-item {
    margin-left: 0;
    width: 100%;
    border-bottom: 1px solid var(--slate-100);
  }
  
  .nav-link {
    padding: 1rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
  }
}