/* Clean Navbar Rewrite - No Conflicts */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

.header-glass.navbar {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 90vw;
  max-width: 1400px;
  height: 58px;
  background: rgba(35, 31, 32, 0.96);
  backdrop-filter: blur(25px);
  border: 1px solid rgba(192, 117, 45, 0.6);
  border-radius: 29px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.35);
  z-index: 10000;
  padding: 0 1.5rem 0 5px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  transition: all 0.3s ease;
}

/* The round seal sits concentric with the bar's rounded left end */
.header-glass.navbar .logo-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-shrink: 0;
  text-decoration: none;
}

.header-glass.navbar .logo-link img {
  display: block;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  transition: width 0.3s, height 0.3s;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  color: var(--color-white);
  white-space: nowrap;
}

.logo-text strong {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.logo-text small {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

@media (min-width: 769px) and (max-width: 1279px) {
  .logo-text {
    display: none;
  }
}

.header-glass.navbar .nav-container {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 2rem;
  align-items: center;
}

.nav-list a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  position: relative;
  transition: color 0.3s;
}

.nav-list a:hover {
  color: var(--color-gold);
  text-shadow: none;
}

.nav-list a:focus-visible {
  color: var(--color-gold);
  outline: 2px solid var(--color-gold);
  outline-offset: 5px;
  border-radius: 2px;
}

.nav-list a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--color-gold);
  transition: width 0.3s ease;
  transform: translateX(-50%);
}

.nav-list a:hover::after {
  width: 80%;
}

/* Dropdown Desktop */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(35, 31, 32, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(192, 117, 45, 0.45);
  border-radius: 20px;
  min-width: 250px;
  list-style: none;
  padding: 1rem 0;
  opacity: 0;
  visibility: hidden;
  margin: 0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  z-index: 10001;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  max-height: 50vh;
  overflow-y: auto;
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
}

/* Touch screens wider than the mobile drawer: no hover dropdowns */
@media (min-width: 769px) and (hover: none), (min-width: 769px) and (pointer: coarse) {
  .dropdown:hover .dropdown-menu {
    opacity: 0 !important;
    visibility: hidden !important;
  }
}

.dropdown-menu li a {
  display: block;
  padding: 0.8rem 1.5rem;
  color: white;
  font-size: 0.82rem;
  transition: padding-left 0.2s;
}

.dropdown-menu li a::after {
  display: none;
}

.dropdown-menu li a:hover,
.dropdown-menu li a:focus-visible {
  background: rgba(34, 197, 94, 0.2);
  color: white;
  outline: none;
  padding-left: 2rem;
}

/* Hamburger - MOBILE ONLY (hidden on desktop) */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 10px;
  transition: all 0.3s ease;
}

.hamburger:hover {
  background: rgba(255, 255, 255, 0.1);
}

.hamburger svg {
  width: 36px;
  height: 36px;
}

.hamburger rect {
  fill: var(--color-white) !important;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  transform-origin: center;
}

.hamburger.active rect:nth-child(1) {
  transform: rotate(45deg) translate(9px, 9px);
}

.hamburger.active rect:nth-child(2) {
  opacity: 0;
  transform: translateX(20px);
}

.hamburger.active rect:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

@media (max-width: 1024px) {
  .header-glass.navbar {
    width: 95vw;
    left: 2.5vw;
    transform: none;
    padding: 0 1.5rem 0 5px;
  }

  .nav-list {
    gap: 1.5rem;
  }
}

/* Drawer header (label + close button) - mobile only */
.drawer-head {
  display: none;
}

/* ================= MOBILE (<= 768px) ================= */
@media (max-width: 768px) {
  header.header-glass.navbar {
    height: 55px !important;
    padding: 0 1rem 0 5px !important;
    justify-content: space-between !important;
    gap: 1rem !important;
    transform: none !important;
    left: 2.5vw !important;
    width: 95vw !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  }

  header.header-glass.navbar .logo-link img {
    width: 43px !important;
    height: 43px !important;
  }

  header.header-glass.navbar .hamburger {
    display: block !important;
    margin-left: auto;
    padding: 0.5rem !important;
    background: rgba(255,255,255,0.1) !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255,255,255,0.3) !important;
  }

  header.header-glass.navbar .hamburger svg {
    width: 28px !important;
    height: 28px !important;
  }

  /* The bar must not be a containing block for the fixed drawer below */
  header.header-glass.navbar {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* ---- Full-height slide-in drawer ---- */
  .header-glass.navbar .nav-container {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(86vw, 360px);
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex: none;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
    background: rgb(28, 25, 26);
    border-left: 1px solid rgba(192, 117, 45, 0.4);
    transform: translateX(100%);
    visibility: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.3s;
    z-index: 9998;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  }

  .header-glass.navbar .nav-container.active {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
    box-shadow: -16px 0 48px rgba(0, 0, 0, 0.45);
  }

  /* Drawer header: label + close button */
  .drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0.9rem 1rem 0.9rem 1.25rem;
    background: rgb(28, 25, 26);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .drawer-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
  }

  .drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    color: var(--color-white);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
  }

  .drawer-close:hover,
  .drawer-close:focus-visible {
    background: rgba(255, 255, 255, 0.1);
    outline: none;
  }

  /* Dimmed page behind the drawer */
  .header-glass.navbar::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 9997;
    pointer-events: none;
  }

  .header-glass.navbar:has(.nav-container.active)::after {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  html.nav-open,
  html.nav-open body {
    overflow: hidden;
  }

  /* ---- Links ---- */
  .nav-menu {
    flex: 1;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    padding: 0.25rem 0 1rem;
  }

  .nav-list li {
    width: 100%;
  }

  .nav-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0;
    text-transform: none;
    color: var(--color-white);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    transition: background 0.2s ease;
  }

  .nav-list a:hover,
  .nav-list a:active,
  .nav-list a:focus-visible {
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-white);
    outline: none;
  }

  /* No underline animation in the drawer */
  .nav-list a::after,
  .nav-list a:hover::after {
    display: none;
  }

  /* Chevron on items that open a sub-menu */
  .nav-list .dropdown > a::after,
  .nav-list .dropdown > a:hover::after {
    content: '';
    display: block;
    position: static;
    flex: none;
    width: 8px;
    height: 8px;
    margin-right: 4px;
    background: none;
    border-right: 2px solid rgba(255, 255, 255, 0.7);
    border-bottom: 2px solid rgba(255, 255, 255, 0.7);
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.25s ease;
  }

  .nav-list .dropdown.active > a {
    background: rgba(255, 255, 255, 0.06);
  }

  .nav-list .dropdown.active > a::after {
    transform: translateY(2px) rotate(225deg);
  }

  /* ---- Sub-menus ---- */
  .nav-container .dropdown-menu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    min-width: 0;
    max-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .dropdown.active .dropdown-menu {
    max-height: 360px;
  }

  .dropdown-menu li a,
  .dropdown-menu li a:hover,
  .dropdown-menu li a:focus-visible {
    padding: 0.8rem 1.25rem 0.8rem 2.25rem;
    font-size: 0.93rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    border-bottom: 0;
  }

  .dropdown-menu li a:hover,
  .dropdown-menu li a:focus-visible {
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-white);
  }

  .dropdown-menu li:last-child a {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  /* ---- Writer dashboard link (signed-in writers only) ---- */
  #profile-link a {
    justify-content: center;
    margin: 1.25rem 1.25rem 0;
    padding: 0.8rem 1rem;
    font-size: 0.93rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 10px;
  }

  #profile-link a:hover {
    background: rgba(255, 255, 255, 0.08);
  }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  .header-glass.navbar .nav-container,
  .header-glass.navbar .nav-container.active {
    transition: none;
  }
}


/* Scrolled state */
.header-glass.navbar.scrolled {
  top: 0.5rem;
  height: 52px;
}

.header-glass.navbar.scrolled .logo-link img {
  width: 40px;
  height: 40px;
}
