/* ========================================
   Canonical NAV - single source of truth.
   Matches the home page (index.html) design.
   Used by: front-page.php, header.php, all 6 tpl-*.php
   ======================================== */

/* If tokens aren't already defined (e.g. category pages), import them. */
:root {
  --cream: #F0EBE8;
  --cream-deep: #E6DED8;
  --pink: #C9A6A0;
  --pink-soft: #E8D4CE;
  --pink-whisper: #F5E9E5;
  --terracotta: #D4735E;
  --terracotta-deep: #BC5C48;
  --teal: #2C5F5D;
  --teal-deep: #1F4846;
  --ink: #2C5F5D;
  --ink-soft: #4A6B6A;
  --ink-mute: #8A9A99;
  --white: #FFFFFF;
  --font-sans: 'Heebo', system-ui, sans-serif;
  --font-display: 'Rubik', 'Heebo', system-ui, sans-serif;
}

/* ===== NAV (canonical) ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(240, 235, 232, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(201, 166, 160, 0.2);
  font-family: var(--font-sans);
}

.nav-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 18px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  position: relative;
}

.nav-logo { display: inline-flex; align-items: center; }
.nav-logo img { height: 92px; width: auto; display: block; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  font-size: 15px;
  color: var(--ink);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  position: relative;
  padding: 6px 0;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 1.5px;
  background: var(--terracotta);
  transition: width 0.25s ease;
}

.nav-links a:hover { color: var(--terracotta); }
.nav-links a:hover::after { width: 100%; }

.nav-links .is-current { color: var(--terracotta); }
.nav-links .is-current::after { width: 100%; }

/* Dropdown (home design: .nav-drop-wrap / .nav-drop-trigger / .nav-drop-panel) */
.nav-drop-wrap {
  display: inline-block;
  position: relative;
}

.nav-drop-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  color: var(--ink);
  padding: 6px 0;
  font: inherit;
  user-select: none;
  position: relative;
}
.nav-drop-trigger:hover { color: var(--terracotta); }
.nav-drop-trigger.is-current { color: var(--terracotta); }
.nav-drop-trigger::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 1.5px;
  background: var(--terracotta);
  transition: width 0.25s ease;
}
.nav-drop-wrap:hover .nav-drop-trigger::after,
.nav-drop-trigger.is-current::after { width: 100%; }

.nav-drop-trigger svg { margin-top: 2px; }

.nav-drop-panel {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  min-width: 260px;
  background: #fff;
  border: 1px solid rgba(201, 166, 160, 0.25);
  border-radius: 12px;
  padding: 14px 0 10px;
  box-shadow: 0 20px 50px rgba(42, 42, 46, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 100;
}

.nav-drop-wrap:hover .nav-drop-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-drop-title {
  display: block;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terracotta);
  padding: 0 22px 10px;
  border-bottom: 1px solid rgba(201, 166, 160, 0.2);
  margin-bottom: 8px;
  font-weight: 700;
}

.nav-drop-panel a {
  display: block;
  padding: 10px 22px;
  font-size: 15px;
  color: var(--ink);
  transition: background 0.15s, color 0.15s;
}

.nav-drop-panel a::after { display: none; }

.nav-drop-panel a:hover {
  background: rgba(217, 161, 143, 0.08);
  color: var(--terracotta);
}

.nav-drop-panel a.is-current {
  color: var(--terracotta);
  font-weight: 500;
}

/* Desktop: the overview ("לעמוד הראשי") link at top of the dropdown */
.nav-drop-overview {
  color: var(--terracotta) !important;
  font-weight: 600;
  border-bottom: 1px solid rgba(201,166,160,0.18);
  margin: 0 8px 8px;
  padding: 8px 14px !important;
  font-size: 13.5px !important;
}
.nav-drop-overview:hover { background: rgba(217,161,143,0.08); }

.nav-cta {
  padding: 11px 22px;
  border: 1px solid var(--teal);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--teal);
  text-decoration: none;
  transition: all 0.25s;
  white-space: nowrap;
}

.nav-cta:hover { background: var(--teal); color: var(--cream); }

/* Mobile hamburger */
.nav-hamburger {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  width: 40px;
  height: 40px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}
.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
  transition: transform .2s, opacity .2s;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .nav-links { display: none; }
  .nav-hamburger { display: inline-flex; }
  .nav-logo img { height: 76px; }

  /* Mobile layout: logo RIGHT, hamburger LEFT (Hebrew RTL).
     First child (logo) → flex-start = RIGHT in RTL.
     Last child (hamburger) → flex-end = LEFT in RTL. */
  .nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    direction: rtl;
  }
  .nav-cta { display: none; }
}

@media (max-width: 640px) {
  .nav-inner { padding: 10px 20px; }
  .nav-logo {
    max-width: calc(100vw - 80px);
  }
  .nav-logo img { height: 60px; }
  .nav-hamburger {
    width: 40px;
    height: 40px;
    padding: 8px;
  }
}