/**
 * @file
 * Header and navigation styles.
 * Fixed transparent header with scroll-triggered background change.
 */

.re-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: var(--re-z-header);
  padding: 2rem 0;
  transition: all var(--re-duration-normal) var(--re-ease-out);
}

.re-header.re-header--scrolled {
  background-color: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(12px);
  padding: 1rem 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.re-header.re-header--dark {
  background-color: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.re-header__container {
  max-width: var(--re-container-max);
  margin: 0 auto;
  padding: 0 var(--re-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--re-space-lg);
}

.re-header__logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  background-color: #fff;
  border-radius: 0;
  padding: 4px;
}

.re-header__logo img {
  height: 75px; /* Adjusted height */
  width: auto;   /* Auto width to maintain aspect ratio */
  transition: all var(--re-duration-fast) var(--re-ease-out);
}

.re-header--scrolled .re-header__logo img {
  height: 60px; /* Adjusted height for scrolled state */
}

/* === Navigation === */
.re-nav__list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.re-nav__link {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-family: var(--re-font-body);
  font-size: var(--re-text-xs);
  font-weight: 600;
  letter-spacing: var(--re-tracking-wide);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  position: relative;
  transition: color var(--re-duration-fast) var(--re-ease-out);
  line-height: var(--re-leading-snug);
  white-space: nowrap;
}

.re-nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: var(--re-red);
  transition: all var(--re-duration-normal) var(--re-ease-out);
  transform: translateX(-50%);
}

.re-nav__link:hover,
.re-nav__link.is-active {
  color: var(--re-white);
}

.re-nav__link:hover::after,
.re-nav__link.is-active::after {
  width: 24px;
}

.re-header__actions {
  flex-shrink: 0;
}

/* === Mobile Toggle === */
.re-nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: calc(var(--re-z-header) + 2);
}

.re-nav__toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--re-white);
  border-radius: var(--re-radius-full);
  transition: all var(--re-duration-fast) var(--re-ease-out);
  transform-origin: center;
}

.re-nav__toggle.is-open .re-nav__toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.re-nav__toggle.is-open .re-nav__toggle-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.re-nav__toggle.is-open .re-nav__toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 900px) {
  .re-nav__toggle {
    display: flex;
  }

  .re-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(360px, 85vw);
    height: 100vh;
    background-color: var(--re-black);
    padding: 6rem var(--re-gutter) var(--re-space-xl);
    transition: right var(--re-duration-normal) var(--re-ease-out);
    z-index: calc(var(--re-z-header) + 1);
    overflow-y: auto;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
  }

  .re-nav.is-open {
    right: 0;
  }

  .re-nav__list {
    flex-direction: column;
    gap: 0;
  }

  .re-nav__item {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .re-nav__link {
    display: block;
    padding: 1.25rem 0;
    font-size: var(--re-text-base);
    color: rgba(255, 255, 255, 0.6);
  }

  .re-nav__link:hover {
    color: var(--re-white);
  }

  .re-nav__link::after {
    display: none;
  }

  .re-header__actions {
    display: none;
  }

  .re-nav.is-open + .re-header__actions {
    display: none;
  }
}

/* Mobile overlay when nav is open */
.re-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: var(--re-z-header);
  opacity: 0;
  visibility: hidden;
  transition: all var(--re-duration-normal) var(--re-ease-out);
}

.re-nav-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}
