/* ============================================================
   Header dropdown (desktop nav sub-menu)
   Shared across all pages. Used for «Επιστημονικές Ομάδες Used for "Συγγραφικές Ομάδες" → Δημοσιεύσεις. Δημιουργικό» (formerly «Συγγραφικές Ομάδες» dropdown).
   ============================================================ */

.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.nav-dropdown-toggle .ddi {
  font-size: 16px !important;
  transition: transform 0.2s ease;
  opacity: 0.7;
}
.nav-dropdown:hover .ddi,
.nav-dropdown:focus-within .ddi {
  transform: rotate(180deg);
  opacity: 1;
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #001f41;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  min-width: 240px;
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
  z-index: 60;
  margin-top: 6px;
}
.nav-dropdown-menu::before {
  /* Bridge the hover gap between trigger and menu */
  content: '';
  position: absolute;
  bottom: 100%;
  left: 0; right: 0;
  height: 10px;
}
.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav-dropdown-menu a:hover,
.nav-dropdown-menu a:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  outline: none;
}
.nav-dropdown-menu a .material-symbols-outlined {
  font-size: 18px !important;
  color: #ffe08c;
  flex-shrink: 0;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* Mobile menu sub-items (when the collapsible panel is visible) */
#mobile-menu .mobile-sub {
  padding-left: 1.75rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
}
#mobile-menu .mobile-sub::before {
  content: '└';
  margin-right: 6px;
  opacity: 0.5;
}

/* ============================================================
   Responsive header redesign (≤1023px = below lg breakpoint)
   Stack: row 1 = logos centered, row 2 = nav, row 3 = social + search
   Hides hamburger & mobile-menu panel (nav is now always visible).
   ============================================================ */

@media (max-width: 1529px) {

  /* The single horizontal row "flex items-center justify-between h-20" → vertical stack */
  header.glass-nav > div > div.h-20 {
    flex-direction: column !important;
    height: auto !important;
    padding-top: 12px;
    padding-bottom: 12px;
    gap: 10px;
    justify-content: center !important;
  }

  /* Logos row — center horizontally, scale down */
  header.glass-nav > div > div.h-20 > a {
    justify-content: center;
    width: 100%;
  }
  header.glass-nav > div > div.h-20 > a > div {
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
  }
  header.glass-nav > div > div.h-20 > a img {
    height: 44px !important;
  }

  /* Show the nav inline (override Tailwind's hidden md:flex) */
  header.glass-nav > div > div.h-20 > nav {
    display: flex !important;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    width: 100%;
  }

  /* Right cluster — center social + search, hide hamburger */
  header.glass-nav > div > div.h-20 > div:last-child {
    justify-content: center;
    width: 100%;
  }
  header.glass-nav button#mobile-menu-toggle {
    display: none !important;
  }
  /* Reveal the social slot that Tailwind hid (hidden lg:block) */
  header.glass-nav [data-social-slot="header"] {
    display: flex !important;
    align-items: center;
  }

  /* Hide the now-redundant collapsible mobile menu panel */
  header.glass-nav #mobile-menu {
    display: none !important;
  }

  /* Stacked nav: dropdown menu should stay positioned over its trigger,
     not get clipped by the wrapping nav. Re-anchor with a slight offset
     so it's visible above other wrapped items. */
  .nav-dropdown-menu {
    z-index: 70;
  }

  /* Filter / sticky tab bars: pin them precisely below the (variable-height,
     stacked) header. `--header-h` is published live by components.js via a
     ResizeObserver, so this stays correct on resize / nav wrap. */
  .filter-bar-sticky.sticky.top-20,
  section.vol-tab-bar-wrap.sticky.top-20 {
    top: var(--header-h, 168px) !important;
  }
}

/* Very narrow phones — shrink logos + nav text */
@media (max-width: 480px) {
  header.glass-nav > div > div.h-20 > a img {
    height: 34px !important;
  }
  header.glass-nav > div > div.h-20 > a > div {
    gap: 10px;
  }
  header.glass-nav > div > div.h-20 > nav a {
    font-size: 0.78rem !important;
  }
  header.glass-nav > div > div.h-20 > nav {
    gap: 0.85rem;
  }
  /* Sticky offset still uses the live --header-h published by JS. */
  .filter-bar-sticky.sticky.top-20,
  section.vol-tab-bar-wrap.sticky.top-20 {
    top: var(--header-h, 156px) !important;
  }
}

/* Desktop / wide-viewport sticky too — keeps offset accurate even if the
   header height changes (e.g. logo size tweak). */
@media (min-width: 1530px) {
  .filter-bar-sticky.sticky.top-20,
  section.vol-tab-bar-wrap.sticky.top-20 {
    top: var(--header-h, 80px) !important;
  }
}
