/* -------------------------
   Journal-Style Header
   Sticky, translucent, and smooth dropdowns + dark mobile drawer
-------------------------- */

header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  backdrop-filter: blur(10px);
  background: rgba(253, 252, 251, 0.75);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* Keep light translucent look while scrolling */
header.scrolled {
  background: rgba(253, 252, 251, 0.75);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 20px;
  padding: 12px 24px;   /* moderate padding for balanced height */
  min-height: 60px;     /* brings header back to ~60–64px tall */
}

.brand-link {
  font-family: "DM Serif Text", serif;
  font-size: 20px;
  color: #1e1e1e;
  text-decoration: none;
  letter-spacing: 0.3px;
}

/* Main navigation */
nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-link,
.category-name {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: "Inter", sans-serif;
  font-weight: 500;
  color: #1e1e1e;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover,
.category-name:hover {
  background: rgba(107, 76, 230, 0.07);
}

/* Dropdown arrow indicator */
.category-name::after {
  content: "▾";
  font-size: 11px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0.8;
}

.category-name.active::after {
  transform: rotate(180deg);
  opacity: 1;
}

.dropdown {
  position: relative;
  display: inline-block;
}

/* Dropdown menu */
.subcategory-list {
  position: absolute;
  top: 100%;
  left: 0;
  list-style: none;
  margin: 0;
  padding: 8px 0;
  background: #ffffff; /* solid white, no transparency */
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  transform-origin: top center;
  transform: scaleY(0.8) translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 999;
  min-width: 100%; /* ensures dropdown is at least as wide as the category */
  display: block !important;
}

.subcategory-list.show {
  transform: scaleY(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.subcategory-nav {
  display: block;
  padding: 10px 16px;
  color: #1e1e1e;
  text-decoration: none;
  font-size: 15px;
  transition: background 0.2s ease, padding-left 0.2s ease;
}

.subcategory-nav:hover {
  background: rgba(107, 76, 230, 0.07);
  /* padding-left: 20px; */
}

/* Mobile hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 18px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  margin-left:25px;
  z-index: 1001;
  transition: transform 0.25s ease;
  order: -1; /* ensures it appears before the brand */
  margin-right: 8px;
}

/* Thin, elegant bars */
.hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background-color: rgba(30, 30, 30, 0.85);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Animation on click */
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translateY(8px);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translateY(-8px);
}

/* Subtle hover glow */
.hamburger:hover span {
  background-color: #4f39c4;
}

/* Only show on mobile */
@media (max-width: 900px) {
  .hamburger {
    display: flex;
  }
  .desktop-nav {
    display: none;
  }
}

/* Mobile drawer */
/* --- MOBILE DRAWER (Dark Transparent Look) --- */
.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 75%;
  height: 100vh;
  background: rgba(18, 18, 18, 0.88); /* deep semi-transparent */
  backdrop-filter: blur(12px);
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateX(-100%);
  z-index: 999;
  padding: 80px 24px 40px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

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

/* --- MOBILE NAV --- */
/* --- MOBILE DRAWER --- */
.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 62%; /* slightly narrower */
  max-width: 360px;
  height: 100vh;
  background: rgba(18, 18, 18, 0.9);
  backdrop-filter: blur(14px);
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateX(-100%);
  z-index: 999;
  padding: 100px 26px 40px; /* pushed down from 80px → 100px */
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

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

/* --- MOBILE NAV CONTENT --- */
.mobile-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px; /* reduced gap to tighten spacing */
}

.mobile-nav .nav-link,
.mobile-nav .category-name {
  font-size: 1.2rem; /* slightly larger */
  font-weight: 500;
  color: rgba(255, 255, 255, 0.93);
  text-decoration: none;
  width: 100%;
  text-align: left;
  padding: 4px 0;
  transition: color 0.25s ease, transform 0.25s ease;
}

.mobile-nav .nav-link:hover,
.mobile-nav .category-name:hover {
  color: #fff;
  transform: translateX(2px);
}

/* --- SUBCATEGORY DROPDOWNS --- */
.subcategory-list {
  margin-top: 6px;
  margin-left: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(32, 32, 32, 0.85); /* darker translucent */
  backdrop-filter: blur(10px);
  border-radius: 8px;
  padding: 8px 10px;
  width: calc(100% - 12px);
  overflow: hidden; /* keeps dropdown within box */
}

.subcategory-nav {
  list-style: none;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.88);
  padding: 6px 0;
  width: 100%;
  transition: color 0.25s ease, transform 0.25s ease;
}

.subcategory-nav:hover {
  color: #ffffff;
  transform: none;
}





/* Drawer Overlay */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 900;
}

.drawer-overlay.show {
  opacity: 1;
  pointer-events: auto;
}


/* Responsive adjustments */
@media (max-width: 900px) {
  nav {
    display: none;
  }

  .hamburger {
    display: flex;
  }
}



/* -------------------------------------------------
   DESKTOP VS MOBILE NAV DIFFERENTIATION
-------------------------------------------------- */

/* Default (desktop) */
@media (min-width: 901px) {
  .dropdown {
    position: relative; /* anchor subcategory list */
  }

  .dropdown .subcategory-list {
    position: absolute;
    top: calc(100%);
    left: -15%;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    padding: 10px 12px;
    display: none;
    flex-direction: column;
    gap: 6px;
    z-index: 999;
    min-width: max-content;
    max-width: 220px;
  }

  .dropdown:hover .subcategory-list {
    display: flex;
  }

  .subcategory-nav {
    list-style: none;
    color: rgba(30, 30, 30, 0.85);
    font-size: 0.95rem;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.25s ease, color 0.25s ease;
    white-space: nowrap;
  }

  .subcategory-nav:hover {
    background: rgba(107, 76, 230, 0.08);
    color: #4f39c4;
  }
}

/* Mobile drawer version */
@media (max-width: 900px) {
  .subcategory-list {
    margin-top: 6px;
    margin-left: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(32, 32, 32, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 8px 10px;
    width: calc(100% - 12px);
    overflow: hidden;
  }

  .subcategory-nav {
    list-style: none;
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.88);
    padding: 6px 0;
    width: 100%;
    transition: color 0.25s ease;
    white-space: normal;
    word-break: break-word;
  }

  .subcategory-nav:hover {
    color: #ffffff;
  }
}
