/* ==========================================
   PlanetRadio.ro — Header + Main Nav (v2)
   Full rewrite 2026-07-26, replacing 7 overlapping files that had
   accumulated conflicting breakpoints (600/768/769/820/900/1023/1024px)
   and two competing JS handlers for the same dropdown. Two confirmed,
   reproduced bugs this fixes:
     1. Mobile "Radio" dropdown toggled open+closed on a single tap
        (header-mobile-menu.js and header-mobile-accordion.js both
        listened for the same click and fought each other).
     2. On tablets (~769-1023px), the hamburger was hidden (only shown
        under 768px) AND the desktop hover-dropdown doesn't work on
        touch, so "Informatii"'s submenu (Termeni, Confidentialitate,
        Cookies, Parteneriate, Publicitate, Contact) was unreachable
        from the nav entirely at that width.

   Fix approach: a single breakpoint (900px) instead of six different
   ones, and dropdown open/close is driven by an explicit caret button
   (js/header-nav.js) that works identically via mouse, touch and
   keyboard - hover is just a bonus on top for desktop, never the only
   way in.

   Single source of truth for .site-header/.main-nav/.logo/.nav-dropdown -
   see foundation-dark-v1.css for the (now header-free) base reset this
   sits on top of.
========================================== */

:root {
  --pr-header-h: 64px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(14, 15, 20, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid #1e2130;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--pr-header-h);
}

/* ============ LOGO ============ */

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-mark {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  color: #e10600;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: #ffffff;
}

.logo-text::after {
  content: ".ro";
  margin-left: 3px;
  font-weight: 500;
  color: #e10600;
}

/* ============ HAMBURGER (mobile only) ============ */

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.mobile-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
}

.mobile-menu-toggle .bar {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: #ffffff;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.mobile-menu-toggle[aria-expanded="true"] .bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"] .bar:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] .bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============ NAV: DESKTOP (> 900px) ============ */

/* Direct-child combinator on purpose: .nav-dropdown-menu is ALSO a <ul>
   nested inside .main-nav (via <li class="nav-dropdown">), so a plain
   descendant selector here (.main-nav ul) would match it too - and at
   higher specificity than the plain ".nav-dropdown-menu" class alone,
   winning over its "display:none" and forcing every dropdown open and
   inline at all times regardless of .is-open. */
.main-nav > ul {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav > ul > li {
  position: relative;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  color: #cfd2e6;
  padding: 9px 12px;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}

.main-nav > ul > li > a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.main-nav a.is-active {
  color: #ffffff;
  background: rgba(225, 6, 0, 0.15);
}

.main-nav a:focus-visible {
  outline: 2px solid #e10600;
  outline-offset: 2px;
}

/* dropdown parent: link + separate caret button, side by side */
.nav-dropdown {
  display: flex;
  align-items: center;
}

.nav-dropdown-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-left: -4px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 6px;
  color: #9aa0c3;
  cursor: pointer;
}

.nav-dropdown-caret:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.nav-dropdown-caret svg {
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
}

.nav-dropdown.is-open .nav-dropdown-caret svg {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  display: none;
  list-style: none;
  margin: 0;
  padding: 6px;
}

.nav-dropdown.is-open > .nav-dropdown-menu {
  display: block;
}

@media (min-width: 901px) {
  .nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    min-width: 230px;
    background: #12141c;
    border: 1px solid #1e2130;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
    z-index: 1200;
  }

  /* progressive enhancement: hover opens it too, for mouse users -
     the caret button remains the reliable way in for touch/keyboard */
  .nav-dropdown:hover > .nav-dropdown-menu {
    display: block;
  }

  .nav-dropdown-menu li a {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #d7d9ee;
    white-space: nowrap;
  }

  .nav-dropdown-menu li a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
  }
}

/* ============ FAVORITES CTA PILL ============ */

.main-nav .nav-favorites a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff3b6b, #ff6b81);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(255, 59, 107, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.main-nav .nav-favorites a:hover {
  color: #fff;
  background: linear-gradient(135deg, #ff3b6b, #ff6b81);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(255, 59, 107, 0.5);
}

body.page-favorites .main-nav .nav-favorites a {
  background: linear-gradient(135deg, #ff1744, #ff4569);
}

/* ============ NAV: MOBILE (<= 900px) ============ */

@media (max-width: 900px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - var(--pr-header-h));
    overflow-y: auto;
    background: #0b0d12;
    border-top: 1px solid #1e2130;
    border-bottom: 1px solid #1e2130;
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.4);
  }

  .main-nav.is-open {
    display: block;
  }

  .main-nav > ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px 0;
  }

  .main-nav > ul > li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .main-nav a {
    border-radius: 0;
    padding: 14px 20px;
    width: 100%;
    font-size: 1rem;
  }

  .nav-dropdown {
    flex-wrap: wrap;
  }

  .nav-dropdown-toggle {
    flex: 1;
  }

  .nav-dropdown-caret {
    width: 48px;
    height: 48px;
    margin: 0;
    border-radius: 0;
  }

  .nav-dropdown-menu {
    width: 100%;
    padding: 0;
    background: #060708;
  }

  .nav-dropdown-menu li a {
    padding: 12px 20px 12px 34px;
    font-size: 0.92rem;
    color: #c7cae0;
  }

  .nav-dropdown-menu li a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
  }

  .main-nav .nav-favorites {
    padding: 12px 20px;
  }

  .main-nav .nav-favorites a {
    width: 100%;
    justify-content: center;
    padding: 12px;
  }
}
