/* Reset margins and paddings */

html, body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  overflow-x: hidden;
}

html {
    /* Forces the browser to always reserve space for the vertical scrollbar, */
    /* preventing the layout from shifting when content height changes. */
    overflow-y: scroll;
}

/* Navbar - Main container (keep both selectors for base styles) */
#navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(0,0,0,0.2);
  backdrop-filter: blur(20px);
  color: #fff;
  padding: 1rem 2rem;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  /* Consolidated transitions */
  transition: 
    background 0.6s ease-in-out,
    color 0.6s ease-in-out,
    box-shadow 0.2s ease-in-out;
}

/* Nav links container */
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-family:'Playfair Display', serif;
}

/* Navbar links - SPECIFIC to #navbar only */
#navbar a {
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  transition: color 0.6s ease;
}

#navbar a:hover {
  color: #C09853;
  text-decoration: underline;
}

.dropdown {
    position: relative;
}

/* Navbar states - SPECIFIC to #navbar only */
#navbar.scrolled {
  background: rgba(44, 74, 107, 0.95);
  backdrop-filter: blur(20px);
}

/* Dark nav mode - SPECIFIC to #navbar only */
#navbar.nav-dark {
  background: rgba(44, 74, 107, 0.95);
  color: #F4F1E8;
}

#navbar.nav-dark a { 
  color: #F4F1E8; 
}

#navbar.nav-dark a:hover { 
  color: #C09853; 
}

/* Light nav mode - SPECIFIC to #navbar only */
#navbar.nav-light {
  background: rgba(244, 241, 232, 0.95);
  color: #2C4A6B;
}

#navbar.nav-light a { 
  color: #2C4A6B; 
}

#navbar.nav-light a:hover { 
  color: #C09853; 
}

/* Logo styling */
.logo {
  font-size: 2.2rem;
  font-weight: 600;
  font-family: 'Playfair Display', serif;
  color: #2C4A6B;
  letter-spacing: 0.015em;
  transition: color 0.4s ease;
}

.logo span {
  color: #C09853;
  transition: color 0.4s ease;
}

/* Logo color adjustments for dark navbar - SPECIFIC to #navbar only */
#navbar.nav-dark .logo {
  color: #F4F1E8;
}

#navbar.nav-dark .logo span {
  color: #C09853;
}

.logo-link,
.logo-link:hover,
.logo-link:visited,
.logo-link:active,
.logo-link:focus {
  text-decoration: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
  color: inherit;
  transition: all 0.3s ease;
}

.logo-link:hover .logo {
  transform: translateY(-2px);
}

.logo-link:hover .logo span {
  color: #C09853;
}

/* Add to global-styles.css */
/* Target the anchor tag <a> with the class .welcome-message */
#navbar a.welcome-message,
#navbar a.welcome-message:visited {
    color: #C09853; /* This will now likely win the conflict */
    font-size: 1.05rem;
    font-weight: 600;
    font-family: 'Playfair Display', serif;
    letter-spacing: 0.02em;
    padding-left: 1rem;
    padding-right: .9rem;
    text-decoration: none;
}

#navbar a.welcome-message:hover {
    color: #d4a866;
}

.dropdown > a {
  position: relative; /* needed for absolute positioning of pseudo-element */
}

.dropdown > a::before {
  content: '';
  position: absolute;
  top: -10px;
  bottom: -10px;
  left: -10px;
  right: -10px;
  pointer-events: auto; /* important so it catches hover */
  /* background: rgba(0,0,0,0.1);  -- use this temporarily to see the hover zone */
}

.dropdown-menu .dropdown-hide {
  display: none;
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(244, 241, 232, 0.95);
  box-shadow: 0 8px 24px rgba(44, 74, 107, 0.15);
  z-index: 1001;
  backdrop-filter: blur(20px);
  border-radius: 8px;
  min-width: 165px;
  border: 1px solid rgba(192, 152, 83, 0.2);
  margin-bottom: .2em;
}

.dropdown:hover .dropdown-menu {
  display: block;
}

/* Optional: Add some spacing and styling for the dropdown menu items */
.dropdown-menu a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px 12px 16px;
  /*padding: 24px 16px 18px 11px; /* Add extra top padding here instead */
  color: #2C4A6B !important;
  text-decoration: none;
  text-align: center;
  text-decoration: none !important;
}

.dropdown-menu::before {
  content: '';
  position: absolute;
  top: -12px; /* matches the visual gap */
  left: 0;
  width: 100%;
  height: 8px;
  background: transparent;
  pointer-events: auto;
  z-index: 1002; /* just above the dropdown menu itself */
}

.dropdown-menu a:hover {
  color: #C09853 !important;
  background-color: rgba(192, 152, 83, 0.1); /* Optional hover background */
}


/* ===== Responsive Navbar ===== */

/* Tablet landscape - prevent wrapping */
@media (min-width: 768px) and (max-width: 1024px) {
  .logo {
    font-size: 1.8rem;
  }
  
  .nav-links {
    gap: 0.8rem;
  }
  
  .nav-links a {
    font-size: 0.9rem;
  }
  
  #navbar {
    padding: 1.4rem 1rem;
  }
}

/* Mobile/Tablet overrides */
@media (max-width: 767px) {
  .nav-links {
    flex-direction: column;
    gap: 1rem;
    display: none; 
    padding: 1rem;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  }
  nav, #navbar {
    margin-bottom: 2vh;
  }
  .nav-links.open {
    display: flex; 
    position: absolute;
    top: 60px; 
    right: 1rem;
    width: 180px;
    background-color: inherit;
  }
  /* Hamburger menu */
  #hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
  }
  #hamburger span {
    width: 25px;
    height: 3px;
    background-color: currentColor;
    border-radius: 2px;
  }
}

/* Extra small screens tweaks */
@media (max-width: 767px) and (min-width: 480px) {
  .logo {
    font-size: 1.8rem;
  }
  #navbar a {
    font-size: 0.9rem;
  }
  nav, #navbar {
    margin-bottom: 1.5vh;
  }
}

#navbar .user-dropdown .user-dropdown-menu {
    right: 0;
}

#navbar .user-dropdown a.welcome-message {
    color: #c59a61; /* Your specific gold color */
}