/* ==========================================================================
   HEADER.CSS — Collegian Hotel & Suites
   Scope: Navigation bar, hamburger menu, hero banner, booking widget,
          SSL badge, and page banners (non-index pages).
   Load order: 2nd (after main.css — relies on :root variables)
   ========================================================================== */


/* ── Header Container ──────────────────────────────────────────────────── */
header {
  background: #ffffff;
}


/* ── Navigation Bar ────────────────────────────────────────────────────── */
header nav {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  animation: slideDown 0.6s ease both;
}

header nav ul {
  display: flex;
  justify-content: center;
  list-style: none;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
  padding: 0 20px;
}

header nav ul li a {
  display: block;
  padding: 20px 22px;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  font-weight: 700;
  transition: color 0.25s ease;
  border-bottom: 2px solid transparent;
}

header nav ul li a:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}


/* ── Language Switcher ─────────────────────────────────────────────────── */
/* Positioned absolute within sticky nav — floats to the right on desktop */
.lang-switcher {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1002;
}

.lang-current {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.88);
  font-family: 'Lato', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 6px 10px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.lang-current:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(196, 154, 78, 0.6);
}

.lang-flag {
  line-height: 0;
  flex-shrink: 0;
}

.lang-code {
  font-size: 11px;
  letter-spacing: 1.5px;
}

.lang-arrow {
  width: 8px;
  height: 5px;
  transition: transform 0.25s ease;
  opacity: 0.7;
  flex-shrink: 0;
}

.lang-current[aria-expanded="true"] .lang-arrow {
  transform: rotate(180deg);
}

/* Dropdown */
.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--navy);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  min-width: 130px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  animation: fadeIn 0.15s ease;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  font-family: 'Lato', sans-serif;
  font-size: 12px;
  letter-spacing: 0.5px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-option:hover,
.lang-option.active {
  background: rgba(196, 154, 78, 0.15);
  color: var(--gold);
}

.lang-option.active {
  font-weight: 700;
}

/* Reserve right space for the absolutely-positioned lang-switcher (~90px wide + 20px offset).
   Only applies on desktop where nav links are visible. */
@media (min-width: 769px) {
  header nav ul {
    padding-right: 110px;
  }
}


/* ── Hamburger Button (hidden on desktop, shown via responsive) ────────── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
  flex-shrink: 0;
  z-index: 1001;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(196, 154, 78, 0.6);
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
  transform-origin: center;
}

/* Open state — animates to ✕ */
.nav-toggle.open {
  background: rgba(196, 154, 78, 0.15);
  border-color: rgba(196, 154, 78, 0.6);
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; width: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* ── Hero Banner (index.html only) ─────────────────────────────────────── */
.hero-banner {
  position: relative;
  width: 100%;
  height: 80vh;
  min-height: 460px;
  overflow: hidden;
  background: var(--navy);
}

.hero-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  filter: brightness(0.6);
  animation: heroBgZoom 9s ease forwards;
}

.hero-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: 90%;
  max-width: 800px;
}

/* Decorative gold lines above and below the hero text */
.hero-text::before,
.hero-text::after {
  content: '';
  display: block;
  height: 1px;
  background: var(--gold);
  margin: 0 auto;
}

.hero-text::before {
  margin-bottom: 28px;
  animation: lineGrow 0.8s ease 0.2s both;
}

.hero-text::after {
  margin-top: 28px;
  animation: lineGrow 0.8s ease 1.2s both;
}

.hero-text h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(30px, 5.5vw, 62px);
  font-weight: 700;
  color: var(--white);
  letter-spacing: 6px;
  text-transform: uppercase;
  line-height: 1.15;
  margin-bottom: 14px;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
  animation: fadeInUp 1s ease 0.5s both;
}

.hero-text p {
  font-size: 12px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--gold-light);
  font-weight: 300;
  animation: fadeInUp 1s ease 0.85s both;
}

/* Ensure hero-text stays centered when booking bar is outside the banner */
.hero-banner .hero-text {
  top: 50%;
}


/* ── Booking Bar ───────────────────────────────────────────────────────── */
/* Sits below the hero-banner with a white "step" gap (margin-top + white header bg) */
.booking-bar {
  position: relative;
  background: var(--navy);
  border-top: 4px solid var(--gold);
  padding: 22px 48px;
  margin-top: 18px;
  box-shadow: 0 -6px 0 0 #ffffff, 0 4px 24px rgba(0, 0, 0, 0.18);
  animation: fadeInUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both;
}

.booking-form {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  max-width: 1100px;
  margin: 0 auto;
}

.booking-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
  min-width: 0;
  animation: fadeInUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.booking-field:nth-child(1) { animation-delay: 0.55s; }
.booking-field:nth-child(2) { animation-delay: 0.65s; }
.booking-field:nth-child(3) { animation-delay: 0.75s; }
.booking-field:nth-child(4) { animation-delay: 0.85s; }

.booking-submit {
  animation: fadeInUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.95s both;
}

.booking-field--sm {
  flex: 0 0 120px;
}

.booking-field label {
  font-size: 9px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  font-family: 'Lato', sans-serif;
}

.booking-field input,
.booking-field select {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 1px;
  padding: 10px 12px;
  color: var(--white);
  font-size: 13px;
  font-family: 'Lato', sans-serif;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
  width: 100%;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.booking-field input:focus,
.booking-field select:focus {
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.12);
}

/* Custom dropdown arrow */
.booking-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(196,154,78,0.8)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
  background-color: rgba(255, 255, 255, 0.07);
}

.booking-field select option {
  background: var(--navy);
  color: var(--white);
}

/* Date picker icon — gold tint */
.booking-field input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7) sepia(1) saturate(2) hue-rotate(5deg);
  cursor: pointer;
  opacity: 0.7;
}

.booking-field input[type="date"]::-webkit-inner-spin-button {
  display: none;
}

.booking-submit {
  background: var(--gold);
  color: var(--navy);
  border: none;
  padding: 11px 32px;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 900;
  font-family: 'Lato', sans-serif;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
  height: 42px;
  align-self: flex-end;
}

.booking-submit:hover {
  background: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(196, 154, 78, 0.4);
}

.booking-submit:active {
  transform: translateY(0);
}

/* SSL trust badge — below the submit button */
.ssl-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.45);
  font-family: 'Lato', sans-serif;
  margin-top: 10px;
  justify-content: flex-end;
}

.ssl-badge svg {
  width: 13px;
  height: 13px;
  color: var(--gold);
  flex-shrink: 0;
}


/* ── Page Banner (non-index pages — replaces hero) ──────────────────────── */
header > h1 {
  background: var(--navy);
  color: var(--white);
  text-align: center;
  padding: 72px 20px;
  font-family: 'Playfair Display', serif;
  font-size: clamp(22px, 4vw, 38px);
  font-weight: 600;
  letter-spacing: 5px;
  text-transform: uppercase;
  line-height: 1.2;
  animation: fadeInUp 0.9s ease 0.3s both;
}

/* Animated gold underline */
header > h1::after {
  content: '';
  display: block;
  height: 2px;
  background: var(--gold);
  margin: 18px auto 0;
  animation: lineGrowShort 0.7s ease 0.9s both;
}


/* ── Responsive — Header ───────────────────────────────────────────────── */

/* Large phones / tablets */
@media (max-width: 768px) {
  /* Switch nav to hamburger mode */
  header nav {
    display: flex;
    align-items: center;
    padding: 0 18px;
    min-height: 56px;
    position: sticky;
    top: 0;
  }

  .nav-toggle { display: flex; }

  /* Push lang-switcher left to clear the 44px hamburger + 18px padding */
  .lang-switcher { right: 72px; }

  header nav ul {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--navy);
    padding: 8px 0 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 999;
    max-height: calc(100dvh - 56px);
    overflow-y: auto;
  }

  header nav ul.open { display: flex; animation: fadeIn 0.18s ease; }
  header nav ul li   { width: 100%; }

  header nav ul li a {
    padding: 15px 24px;
    font-size: 12px;
    letter-spacing: 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
    display: block;
  }

  header nav ul li:last-child a { border-bottom: none !important; }

  /* Hero */
  .hero-banner      { height: auto; min-height: 300px; }
  .hero-banner img  { height: 58vh; min-height: 300px; position: relative; }
  .hero-text h1     { font-size: clamp(24px, 6vw, 40px); letter-spacing: 3px; }
  .hero-text p      { font-size: 11px; letter-spacing: 3px; }

  /* Booking bar — grid layout on mobile */
  .booking-bar      { padding: 16px 18px; margin-top: 12px; }
  .booking-form     {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 10px;
    align-items: end;
    width: 100%;
  }
  .booking-field    { flex: unset; width: auto; align-self: stretch; }
  .booking-field--sm { flex: unset; width: auto; align-self: stretch; }
  .booking-submit   { grid-column: 1 / -1; width: 100%; padding: 13px; font-size: 12px; height: auto; }

  /* Page banner */
  header > h1 { padding: 52px 20px; font-size: clamp(20px, 5vw, 32px); letter-spacing: 3px; }
}

/* Phones portrait */
@media (max-width: 480px) {
  header nav            { min-height: 52px; }
  header nav ul         { top: 52px; max-height: calc(100dvh - 52px); }
  .hero-banner          { height: 52vh; min-height: 260px; }
  .hero-text h1         { font-size: clamp(20px, 7vw, 30px); letter-spacing: 2px; }
  .hero-text p          { font-size: 10px; letter-spacing: 2px; }
  .hero-text::before,
  .hero-text::after     { display: none; }
  header > h1           { padding: 40px 16px; letter-spacing: 2px; font-size: clamp(18px, 5.5vw, 26px); }
}

/* Small phones */
@media (max-width: 375px) {
  .hero-text h1 { font-size: 18px; letter-spacing: 1.5px; }
  header > h1   { font-size: 16px; letter-spacing: 1.5px; padding: 34px 14px; }
  .lang-code    { display: none; }
}


/* ── Mobile Booking Card — enhanced style ──────────────────────────────── */
@media (max-width: 768px) {
  .booking-bar {
    margin: 12px 14px 0;
    border-radius: 0 0 18px 18px;
    box-shadow: 0 -6px 0 0 #fff, 0 16px 44px rgba(0, 0, 0, 0.3);
  }

  .booking-bar::before {
    content: 'RESERVE YOUR STAY';
    display: block;
    font-family: 'Lato', sans-serif;
    font-size: 8px;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.28);
    text-align: center;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  .booking-field input,
  .booking-field select {
    border-radius: 6px;
    padding: 10px 12px;
  }

  .booking-submit {
    border-radius: 6px;
    letter-spacing: 3px;
    box-shadow: 0 4px 22px rgba(196, 154, 78, 0.32);
  }

  .ssl-badge {
    justify-content: center;
    margin-top: 14px;
  }
}

@media (max-width: 480px) {
  .booking-bar {
    margin: 10px 10px 0;
    border-radius: 0 0 14px 14px;
  }
}
