/* =========================================
   HEADER
   ========================================= */

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--color-main-header);
  color: white;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.5rem 2rem;
}

.header-top a,
.header-top a:visited,
.header-top a:hover {
  text-decoration: none;
  color: inherit;        /* keeps original text color */
  display: flex;         /* preserves your layout */
  align-items: center;
  gap: 0.6rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;

  flex: 1 1 auto;   /* THIS is what was keeping layout stable */
  min-width: 0;

  font-family: 'Roboto Condensed', 'Arial Narrow', sans-serif;

  text-decoration: none;
  color: inherit;
}

.header-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.header-brand-text span:first-child {
  font-weight: 700;
  font-size: 1.6rem;
}

.header-brand-text span:last-child {
  font-weight: 600;
  font-size: 1rem;
  opacity: 0.85;
}

.header-top img {
  height: 50px;
  max-width: 100%;
  flex-shrink: 0;
}

.fbk-logo {
  height: 70px !important;
}

/* Toggle button */
.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1.2rem;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  margin-left: 2rem;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ── Overlay ── */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1001;
}

.nav-overlay.open {
  display: block;
}

/* ── Drawer ── */
.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  height: 100%;
  background: var(--color-main-header);
  color: white;
  z-index: 1002;
  transform: translateX(100%);
  transition: transform 0.28s ease;
  overflow-y: auto;
  padding: 1rem 0 2rem;
  display: flex;
  flex-direction: column;
}

.nav-drawer.open {
  transform: translateX(0);
}

.nav-drawer__close {
  align-self: flex-end;
  margin: 0.25rem 1rem 1rem;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1.1rem;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.nav-drawer__close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Main links */
.nav-drawer__links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-drawer__links > li > a {
  display: block;
  padding: 0.85rem 1.5rem;
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  transition: background var(--transition), opacity var(--transition);
  opacity: 0.85;
}

.nav-drawer__links > li > a:hover,
.nav-drawer__links > li > a.active {
  background: rgba(255, 255, 255, 0.08);
  opacity: 1;
}

.nav-drawer__links > li > a.active {
  border-left: 3px solid var(--fbk-blue);
  padding-left: calc(1.5rem - 3px);
}

/* Sub-links */
.nav-drawer__sub {
  list-style: none;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.15);
}

.nav-drawer__sub li a {
  display: block;
  padding: 0.65rem 1.5rem 0.65rem 2rem;
  color: white;
  text-decoration: none;
  font-size: 0.9rem;
  opacity: 0.7;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: opacity var(--transition), background var(--transition);
}

.nav-drawer__sub li a:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.06);
}

/* Responsive: shrink header-top on small screens */
@media (max-width: 600px) {
  .header-top {
    flex-direction: row;
    align-items: center;
    padding: 0.6rem 1rem;
    gap: 0.75rem;
  }

  /* Hide the subtitle */
  .header-brand-text span:last-child {
    display: none;
  }

  /* Align "MoST" text to bottom of image */
  .header-top p {
    align-items: flex-end;
  }

  .header-brand-text span:first-child {
    font-size: 1.3rem;
  }

  .header-top > img {
    height: 36px;
  }

  /* Switch to vertical FBK logo */
  .fbk-logo {
    content: url('/static/images/logos/FBK_Logo_Vertical_white.png');
    height: 44px !important;
  }

  .nav-toggle {
    margin-left: auto;
    align-self: center;
  }

  .nav-drawer {
    width: 100%;
  }
}