/* ============================================
   NAVIGATION COMPONENT - Exact Talgildu.fo Match
   ============================================ */

.header {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 104px;
  margin: 0;
  padding: 0;
  background-color: rgba(255, 255, 255, 0.98);
  border: none;
  border-bottom: 1px solid rgba(35, 58, 117, 0.1);
  color: rgb(0, 0, 0);
  font-family: var(--font-sans, "Source Sans Pro", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif);
  font-size: 16px;
  opacity: 1;
  overflow: visible;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

/* Scrolled state - no additional styles needed for fixed positioning */

.header__inner {
  max-width: 1180px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
}

.header__logo {
  display: flex;
  align-items: center;
  margin-right: 0;
}

.header__logo-image {
  height: 65px;
  width: auto;
  /* No filter - use original logo colors */
}

.header__logo:hover {
  opacity: 1;
}

.header__menu-button {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  cursor: pointer;
  position: relative;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.header__menu-button:hover {
  opacity: 0.8;
}

.header__menu-button:active {
  transform: scale(0.95);
}

/* Hamburger Lines (Closed State) */
.hamburger-line {
  width: 20px;
  height: 2px;
  background-color: #000000;
  border-radius: 2px;
  transition: all 0.35s ease;
  position: absolute;
}

/* Position each line absolutely for precise control */
.hamburger-line:nth-child(1) {
  top: 12px;
}

.hamburger-line:nth-child(2) {
  top: 50%;
  transform: translateY(-50%);
}

.hamburger-line:nth-child(3) {
  bottom: 12px;
}

/* X Icon Transformation (Open State) */
/* When aria-expanded="true", transform to X */

/* Top line: Rotates 45° and moves to center */
.header__menu-button[aria-expanded="true"] .hamburger-line:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

/* Middle line: Scales to 0 and fades out */
.header__menu-button[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: translateY(-50%) scale(0);
}

/* Bottom line: Rotates -45° and moves to center */
.header__menu-button[aria-expanded="true"] .hamburger-line:nth-child(3) {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}

.header__menu {
  display: block;
  list-style: none;
  margin: 0;
  margin-left: auto;
  padding: 0;
  float: right;
}

.header__menu::after {
  content: "";
  display: table;
  clear: both;
}

.header__menu-item {
  padding: 0;
  margin: 0;
  float: left;
  border-left: 0.8px solid rgba(0, 0, 0, 0.1);
  height: 104px;
  display: flex;
  align-items: center;
}

.header__menu-item:first-child {
  border-left: 0.8px solid rgba(0, 0, 0, 0);
}

.header__menu-item:last-child {
  border-right: 0.8px solid rgba(0, 0, 0, 0.1);
}

.header__menu-link {
  color: rgb(0, 0, 0);
  font-family: var(--font-sans, "Source Sans Pro", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif);
  font-weight: 400;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: normal;
  padding: 0 14px;
  transition: color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 16px;
  white-space: nowrap;
  text-decoration: none;
  height: 100%;
}

.header__menu-link:hover {
  color: #5AB6A0;
}

.header__menu-link--active {
  color: #5AB6A0;
}

.header__menu-link--lang-toggle {
  color: rgb(0, 0, 0);
}

.header__menu-link--lang-toggle:hover {
  color: rgb(0, 0, 0);
}

/* Language Switcher (for future use) */
.nav__lang-switch {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: clamp(0.9375rem, 1.5vw, 1rem); /* Minimum 15px, prefer 16px */
  font-weight: 600;
  color: var(--color-text);
  opacity: 0.95; /* Higher contrast for accessibility */
  transition: opacity var(--transition-fast);
  line-height: 1.5;
}

.nav__lang-switch:hover {
  opacity: 1;
}

.lang-link {
  color: var(--color-text);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  text-decoration: none;
  cursor: pointer;
}

.lang-link:hover {
  color: var(--color-accent);
  background: rgba(124, 77, 255, 0.1);
}

.lang-link--active {
  color: var(--color-accent);
  background: rgba(124, 77, 255, 0.15);
  font-weight: 700;
  cursor: default;
}

[data-theme="dark"] .nav__lang-switch {
  color: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .lang-link {
  color: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .lang-link:hover {
  color: white;
  background: rgba(124, 77, 255, 0.2);
}

[data-theme="dark"] .lang-link--active {
  color: white;
  background: rgba(124, 77, 255, 0.25);
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .header__inner {
    justify-content: space-between;
    align-items: center;
  }
  
  .header__logo {
    flex-shrink: 0;
  }
  
  .header__menu-button {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    flex-shrink: 0;
  }
  
  nav {
    display: block;
  }
  
  .header__menu {
    position: fixed;
    top: 104px;
    left: 0;
    width: 100%;
    height: calc(100vh - 104px);
    display: flex;
    flex-direction: column;
    float: none;
    margin-left: 0;
    margin-right: 0;
    background: #fafafb;
    backdrop-filter: blur(10px);
    padding: 2rem;
    gap: 1rem;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    z-index: 1030;
  }
  
  .header__menu-item {
    float: none;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    height: auto;
    width: 100%;
  }
  
  .header__menu-item:last-child {
    border-bottom: none;
  }
  
  .header__menu--open {
    transform: translateX(0);
  }
  
  .header__menu-item {
    width: 100%;
    float: none;
    border: none;
    height: auto;
  }
  
  .header__menu-link {
    width: 100%;
    text-align: left;
    padding: 1rem;
    font-size: 1.125rem;
  }
  
  .nav__lang-switch {
    margin-top: var(--space-md);
    justify-content: center;
  }
}

/* ============================================
   DROPDOWN NAVIGATION MENU
   ============================================ */

.header__menu-item--has-dropdown {
  position: relative;
  display: flex;
  justify-content: center;
  z-index: 1052;
}

.header__menu-link--dropdown {
  background: #fafafb;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  position: relative;
  z-index: 3;
}

.header__menu-link--dropdown > * {
  position: relative;
  z-index: 1;
}

.header__menu-link--dropdown:hover {
  color: #5AB6A0;
}

.header__menu-link--dropdown[aria-expanded="true"] {
  color: #5AB6A0;
}


/* Remove chevron from navbar item */

.header__dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  min-width: 220px;
  background: #fafafb;
  border: none;
  list-style: none;
  margin: 0;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 1050;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}


.header__menu-item--has-dropdown:hover .header__dropdown,
.header__menu-link--dropdown[aria-expanded="true"] + .header__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.header__dropdown li {
  margin: 0;
  padding: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.header__dropdown li:last-child {
  border-bottom: none;
}

.header__dropdown-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  color: rgb(0, 0, 0);
  font-family: var(--font-sans, "Source Sans Pro", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif);
  font-weight: 400;
  font-size: 15px;
  text-transform: none;
  letter-spacing: normal;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
  border-left: none;
  position: relative;
}

.header__dropdown-link::after {
  content: '→';
  font-size: 16px;
  color: #5AB6A0;
  margin-left: 8px;
  flex-shrink: 0;
  transition: color 0.15s ease, transform 0.15s ease;
  line-height: 1;
  font-weight: normal;
}

.header__dropdown-link:hover {
  background-color: rgba(90, 182, 160, 0.1);
  color: #5AB6A0;
}

.header__dropdown-link:hover::after {
  color: #5AB6A0;
  transform: translateX(2px);
}

.header__dropdown-link--active {
  background-color: rgba(90, 182, 160, 0.1);
  color: #5AB6A0;
  font-weight: 400;
}

.header__dropdown-link--active::after {
  color: #5AB6A0;
}

/* Override dark theme for dropdown - always use same color as navbar */
[data-theme="dark"] .header__dropdown {
  background: #fafafb !important;
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .header__dropdown-link {
  color: rgb(0, 0, 0) !important;
}

[data-theme="dark"] .header__dropdown-link::after {
  color: #5AB6A0 !important;
}

[data-theme="dark"] .header__dropdown-link:hover {
  background-color: rgba(90, 182, 160, 0.1);
  color: #5AB6A0 !important;
}

[data-theme="dark"] .header__dropdown-link:hover::after {
  color: #5AB6A0 !important;
  transform: translateX(2px);
}

[data-theme="dark"] .header__dropdown-link--active {
  background-color: rgba(90, 182, 160, 0.1);
  color: #5AB6A0 !important;
}

[data-theme="dark"] .header__dropdown-link--active::after {
  color: #5AB6A0 !important;
}

/* Mobile Dropdown Styles */
@media (max-width: 768px) {
  .header__menu-item--has-dropdown {
    width: 100%;
  }
  
  .header__menu-link--dropdown {
    width: 100%;
    text-align: left;
    padding: 1rem;
    font-size: 1.125rem;
    justify-content: space-between;
  }
  
  .header__menu-link--dropdown::after {
    margin-left: auto;
  }
  
  .header__dropdown {
    position: static;
    width: 100%;
    opacity: 1;
    visibility: visible;
    transform: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, border-top 0.3s ease;
    border: none;
    border-top: none;
    box-shadow: none;
    background: rgba(0, 0, 0, 0.05);
  }
  
  .header__menu-link--dropdown[aria-expanded="true"] + .header__dropdown {
    max-height: 500px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
  }
  
  .header__dropdown-link {
    padding: 0.875rem 1rem 0.875rem 2rem;
    font-size: 1rem;
  }
  
  /* Override dark theme for dropdown on mobile - always white */
  [data-theme="dark"] .header__dropdown {
    background: #fafafb !important;
  }
  
  [data-theme="dark"] .header__menu-link--dropdown[aria-expanded="true"] + .header__dropdown {
    border-top-color: rgba(0, 0, 0, 0.1);
  }
}