/*
File: header.css - NEW NAVIGATION DESIGN
Purpose: Header, navigation, and search functionality styles matching mockup design
Dependencies: style.css (for CSS custom properties)
Load Order: 2nd
*/

/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
  --rust-red: #cc4020;
  --teal-blue: #4f9aa8;
  --highlight-yellow: #e1a038;
  --forest-green: #1b5137;
  --text-white: #ffffff;
  --text-dark: #333333;
  --shadow-color: rgba(0, 0, 0, 0.25);
  --transition-base: 0.3s ease;
  --transition-fast: 0.2s ease;
  --transition-slow: 0.4s ease;
}

/* ===== MAIN HEADER CONTAINER ===== */
.header {
  position: sticky;
  background: rgba(255, 255, 255, 0.85);
  top: 0;
  left: 0;
  height: 65px; /* logo-box height (60px) + 5px gap below it, 0 gap above */
  display: flex;
  align-items: flex-start; /* was center — flex-start removes the gap above the logo/menu row */
  padding: 0 10px;
  margin-top: -1px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  width: 100vw;
  box-sizing: border-box;
}

/* ===== LOGO BOX ===== */
.logo-box {
  background: var(--rust-red);
  width: auto; /* Changed from 15% to auto */
  height: 60px;
  border-radius: 0 0 20px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-white);
  font-size: 24px;
  margin-right: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: background-color var(--transition-base);
  min-width: 210px; /* Wide enough for ~192px logo + padding */
  padding: 0 15px; /* Padding on both sides */
}

.logo-box:hover {
  background: #a63117;
  transition: background-color var(--transition-base);
}

.logo-box a {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.logo-box img {
  max-height: 50px;
  width: auto;
  filter: brightness(1.1);
}

/* ===== DESKTOP MENU BAR ===== */
.menu-bar {
  display: flex;
  flex: 1;
  gap: 0px;
  position: relative;
}

.menu-button {
  position: relative;
  flex: 1;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  cursor: pointer;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.menu-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  fill: var(--teal-blue);
  z-index: 3;
  transition: fill var(--transition-base);
}

.menu-text {
  position: relative;
  color: var(--text-white);
  top: -3px;
  font-family: 'Fraunces', serif;
  font-weight: bold;
  font-size: clamp(0.8rem, 2vw, 1rem);
  z-index: 5;
  pointer-events: none;
  text-align: center;
  line-height: 1.2;
  padding: 0 5px;
}

.menu-text-link {
    text-decoration: none;
    color: inherit;
}

.menu-text-link:hover {
    text-decoration: none;
}

.menu-text-link {
    position: relative;
    z-index: 10;
    pointer-events: auto;
    display: block;
}

.menu-button svg {
    pointer-events: none;
}

.menu-button:hover .menu-svg {
  fill: var(--highlight-yellow);
}

/* ===== DROPDOWN SYSTEM ===== */
.dropdown {
  position: absolute;
  top: 100%; 
  left: 0;     
  width: 100%; 
  transform: translateY(-10px) scaleY(0);
  transform-origin: top center;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(.34,1.56,.64,1), opacity var(--transition-base);
  z-index: 0;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.menu-button.active .dropdown,
.dropdown.open {
  transform: translateY(0) scaleY(1);
  opacity: 1;
  pointer-events: auto;
}

.dropdown-svg {
  position: absolute;
  top: -12px;
  left: 0;
  width: 100%;
  height: 110%;
  fill: #5cb7c7;
  z-index: 0;
}

.dropdown-content {
  position: relative;
  top: -10px;
  padding: 15px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  font-size: 1.1rem;
  color: var(--text-white);
  z-index: 1;
}

.dropdown-item {
  color: var(--text-white);
  line-height: 1.6;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  text-align: center;
  transition: background var(--transition-fast);
  word-wrap: break-word;
  width: 90%;
  font-family: 'Fraunces', serif;
  font-weight: 600; /* Updated from 500 to 600 */
}

.dropdown-item a {
  color: inherit;
  text-decoration: none;
  display: block;
  width: 100%;
}

.dropdown-item:hover {
  background: var(--highlight-yellow);
  border-radius: 5px;
}

/* ===== SEARCH FUNCTIONALITY ===== */
.search-button {
  position: relative;
  flex: 1;
  height: 60px;
  display: flex;
  align-items: flex-start !important; /* FIXED: Changed from center to flex-start */
  justify-content: center;
  overflow: visible;
  cursor: pointer;
  padding-top: 35px !important; /* FIXED: Adjust vertical position */
  background: none !important;
  border: none !important;
}

.search-icon {
  width: 20px;
  height: 20px;
  fill: var(--text-white);
  top: -15px !important; /* FIXED: Move up to keep inside button */
  z-index: 10 !important; /* FIXED: Above background */
  position: relative;
  transform: scale(1) !important; /* FIXED: Normal size */
  align-self: flex-start !important;
  margin-top: 0 !important;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  display: inline-block !important;
}

/* Override any lingering test styles */
.menu-text.search-icon,
span.menu-text.search-icon,
.search-button .menu-text.search-icon,
.menu-button.search-button .menu-text.search-icon,
.menu-button.search-button > .menu-text.search-icon,
.menu-button.search-button span.menu-text.search-icon {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  top: -15px !important;
  transform: scale(1.0) !important;
}

.search-button:hover .menu-svg {
  fill: var(--highlight-yellow);
}

/* Search dropdown */
.search-dropdown .dropdown-content {
  flex-direction: column;
  align-items: center;
  padding: 20px;
  gap: 12px;
}

.search-dropdown input[type="text"] {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
  font-family: 'Work Sans', sans-serif;
  margin-bottom: 8px;
}

.search-dropdown button {
  background: transparent;
  color: var(--text-white);
  border: 2px solid var(--text-white);
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-family: 'Fraunces', serif;
  font-weight: 600;
  transition: all var(--transition-base);
  margin-top: 4px;
}

.search-dropdown button:hover {
  color: var(--text-white);
  background: var(--highlight-yellow);
  border: 2px solid transparent;
} 

/* ===== HAMBURGER MENU ===== */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;   
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: var(--rust-red);
  cursor: pointer;
  position: absolute;
  right: 25px;
  top: 5px; /* (65px header - 55px button) / 2, centred in the new shorter header */
  transition: background var(--transition-base);
  z-index: 9001;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hamburger:hover {
  background: #a63117;
  transition: background-color var(--transition-base);
}

.hamburger span {
  width: 28px;
  height: 4px;
  background: var(--text-white);
  border-radius: 2px;
  transition: transform 0.4s ease, opacity var(--transition-base);
  transform-origin: center;
}

/* Default hamburger X (55px circle, 28px bars) */
.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* Tablet adjustments (50px circle, 24px bars) */
@media (max-width: 768px) {
  .hamburger.open span:nth-child(1) {
    transform: rotate(45deg) translate(6.6px, 6.7px);
  }
  .hamburger.open span:nth-child(3) {
    transform: rotate(-45deg) translate(6.6px, -6.7px);
  }
}

/* Mobile adjustments (45px circle, 20px bars) */
@media (max-width: 480px) {
  .hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(6.5px, 6.5px);
  }
  .hamburger.open span:nth-child(3) {
    transform: rotate(-45deg) translate(6.5px, -6.5px);
  }
}

/* ===== MOBILE MENU ===== */
.mobile-menu {
  position: fixed;
  top: 100px; /* shifted up 5px to match the header's new 65px height */
  width: 100vw;
  height: calc(100vh - 100px); /* Use remaining viewport height */
  background: rgba(255, 255, 255, 0.85);
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  padding: 20px 0; /* Add padding instead of margin */
  overflow-y: auto; /* Enable vertical scrolling for the menu */
  overflow-x: hidden; /* Prevent horizontal scroll */
  display: flex;
  align-items: flex-start; /* Changed from center to flex-start */
  flex-direction: column;
  backdrop-filter: blur(8px);
  right: -100vw;
  transition: right 0.4s ease;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.mobile-menu.open {
  right: 0;
}

/* Prevent body scroll when mobile menu is open */
body.mobile-menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

.mobile-menu-button {
  position: relative;
  width: 100%;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  cursor: pointer;
  margin-bottom: 10px;
}

.mobile-menu-button .menu-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  fill: var(--teal-blue);
  z-index: 3;
  transition: fill var(--transition-base);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.01)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.mobile-menu-button:hover .menu-svg {
  fill: var(--highlight-yellow);
}

.mobile-menu-button .menu-text {
  position: relative;
  color: var(--text-white);
  top: -3px;
  font-family: 'Fraunces', serif;
  font-weight: bold;
  font-size: 1.3rem;
  z-index: 5;
  pointer-events: none;
  text-align: center;
}

.mobile-dropdown {
  position: relative;
  width: 100%;
  top: -25px;
  max-height: none;
  opacity: 1;
  overflow: visible;
  margin-top: -5px;
  z-index: 2;
}

.mobile-dropdown-svg {
  position: absolute;
  top: -40px;
  left: 0;
  width: 100%;
  overflow: visible;
  height: calc(100% + 25px);
  fill: #5cb7c7;
  z-index: 0;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.mobile-dropdown-content {
  position: relative;
  top: -10px;
  padding: 25px 20px 15px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  font-size: 1.2rem;
  color: var(--text-white);
  z-index: 1;
}

.mobile-dropdown-item {
  color: var(--text-white);
  line-height: 1.6;
  cursor: pointer;
  padding: 8px 15px;
  border-radius: 8px;
  text-align: center;
  transition: background var(--transition-fast);
  word-wrap: break-word;
  font-family: 'Fraunces', serif;
  font-weight: 600; /* Updated from 500 to 600 */
  font-size: 1.2rem;
  width: 100%;
}

.mobile-dropdown-item a {
  color: inherit;
  text-decoration: none;
  display: block;
  width: 100%;
}

.mobile-dropdown-item:hover {
  background: var(--highlight-yellow);
  border-radius: 0px;
}

.mobile-menu .menu-box {
  position: relative;
  top: 20px; /* Reduced from 70px */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 15px;
  width: 100%;
  max-width: 400px;
  margin: 0 auto; /* Center the menu box */
  padding: 0 20px; /* Add horizontal padding */
  box-sizing: border-box;
}

/* ===== RESPONSIVE BREAKPOINTS ===== */
@media (max-width: 1125px) {
  .menu-bar {
    display: none;
  }
  .hamburger {
    display: flex;
  }
}

@media (min-width: 1126px) {
  .mobile-menu {
    display: none !important;
  }
}

/* Tablet adjustments */
@media (max-width: 768px) {
  .header {
    padding: 0 15px;
    height: 57.5px; /* logo-box height (55px) + 2.5px gap below (half the desktop gap) */
  }
  
  .logo-box {
    width: auto;
    min-width: 100px;
    height: 55px;
  }
  
  .logo-box img {
    max-height: 45px;
  }
  
  .hamburger {
    width: 50px;
    height: 50px;
    right: 10px;
    top: 3.75px; /* (57.5px header - 50px button) / 2, centred */
  }
  
  .hamburger span {
    width: 24px;
    height: 3px;
  }
  
  .mobile-menu {
    top: 72.5px; /* shifted up to match the shorter 57.5px header */
  }
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .header {
    padding: 0 10px;
    height: 52.5px; /* logo-box height (50px) + 2.5px gap below (half the desktop gap) */
  }
  
  .logo-box {
    min-width: 80px;
    height: 50px;
    font-size: 18px;
  }
  
  .logo-box img {
    max-height: 40px;
  }
  
  .hamburger {
    width: 45px;
    height: 45px;
    right: 8px;
    top: 3.75px; /* (52.5px header - 45px button) / 2, centred */
  }
  
  .hamburger span {
    width: 20px;
    height: 3px;
  }
  
  .mobile-menu {
    top: 62.5px; /* shifted up to match the shorter 52.5px header */
    gap: 5px;
  }
  
  .mobile-menu .menu-box {
    top: 40px;
    gap: 10px;
    padding: 0 10px;
  }
  
  .mobile-menu-button .menu-text {
    font-size: 1.1rem;
  }
  
  .mobile-dropdown-item {
    font-size: 1rem;
    padding: 6px 12px;
  }
}