/* =============================================================
   TARA INDIA — header.css
   Navigation bar: desktop + mobile.
   ============================================================= */


/* ── 1. SITE HEADER ─────────────────────────────────────────────
   ---------------------------------------------------------------- */
.site-header {
  border-bottom: 1px solid #f1f1f1;
}

.navbar {
  max-height: 90px;
  max-width: 1300px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
  padding-inline: 1.25rem;
  position: relative;
}

.custom-logo {
  height: 50px;
  width: auto;
}

.logo-text {
  font-size: 1.4rem;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--accent-color);
}


/* ── 2. NAVBAR SECTIONS ─────────────────────────────────────────
   ---------------------------------------------------------------- */
.nav-left,
.nav-center,
.nav-right {
  display: flex;
  align-items: center;
}

.nav-left {
  flex: 0 0 auto;
  padding: 10px 0;
}

.nav-center {
  flex: 1 1 auto;
  justify-content: center;
}

.nav-right {
  flex: 0 0 auto;
  gap: 0.75rem;
}


/* ── 3. NAV BUTTONS ─────────────────────────────────────────────
   ---------------------------------------------------------------- */
.nav-right .btn-outline,
.mobile-actions .btn-outline {
  color: #1B6FBF;
  border-color: #1B6FBF;
  background: transparent;
}

.nav-right .btn-outline:hover {
  background: #E3F0FB;
}


/* ── 4. DESKTOP MENU ────────────────────────────────────────────
   ---------------------------------------------------------------- */
.nav-menu {
  list-style: none;
  display: flex;
  gap: 1.75rem;
}

.nav-menu a {
  text-decoration: none;
  font-size: 0.95rem;
  color: #3b3326;
  position: relative;
}

.menu-header-container > .menu {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: clamp(2px, 0.5vw, 10px);  /* tighter gap frees space for larger font */
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu-header-container .menu > li {
  position: relative;
}

.menu-header-container .menu > li > a {
  align-items: center;
  gap: 2px;
  padding: 10px 4px;
  border-radius: 5px;
  text-decoration: none;
  color: inherit;
  font-weight: 700;
  font-size: clamp(0.82rem, 1.0vw, 0.95rem);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.menu-header-container .menu > li > a:hover {
  background: var(--background-light-gray);
}

.menu-header-container .menu > li.menu-item-has-children > a::after,
.menu-item-has-children > a::after {
  content: "▾";
  font-size: 12px;
  opacity: .7;
  margin-left: 4px;
  transition: transform .15s ease;
}

.menu-header-container .menu > li:hover > a::after,
.menu-header-container .menu > li:focus-within > a::after,
.menu-item-has-children:hover > a::after,
.menu-item-has-children:focus-within > a::after {
  transform: rotate(180deg);
}


/* ── 5. DROPDOWN SUBMENU ────────────────────────────────────────
   ---------------------------------------------------------------- */
.menu-header-container .menu > li .sub-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 220px;
  padding: 8px;
  margin: 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 5px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 40;
}

.menu-header-container .menu > li:hover > .sub-menu,
.menu-header-container .menu > li:focus-within > .sub-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.menu-header-container .sub-menu > li > a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 5px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.menu-header-container .sub-menu > li > a:hover {
  background: var(--background-light-gray);
}


/* ── 6. HAMBURGER + MOBILE DONATE ───────────────────────────────
   ---------------------------------------------------------------- */
.hamburger,
.mobile-donate {
  display: none;
}

.hamburger {
  border: none;
  background: none;
  cursor: pointer;
  padding: 0.25rem;
  flex-direction: column;
  gap: 4px;
}

.hamburger span {
  width: 20px;
  height: 2px;
  background: var(--accent-color);
  border-radius: 999px;
}


/* ── 7. MOBILE MENU OVERLAY ─────────────────────────────────────
   ---------------------------------------------------------------- */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: #fff;
  padding: 1.25rem 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1000;
}

.mobile-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  overflow-x: hidden;
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.close-menu {
  font-size: 1.5rem;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--accent-color);
}

/* Hide the original WP-rendered nested menu (JS rebuilds panels) */
.mobile-menu .sub-menu           { display: none !important; }
.mobile-nav a {
  text-decoration: none;
  font-size: 1rem;
  color: #3b3326;
}

.mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}


/* ── 8. MOBILE PANEL NAVIGATION ─────────────────────────────────
   Two panels side by side; each slides via translateX.
   Root slides left, child slides in from right.
   ---------------------------------------------------------------- */
.mobile-nav {
  position: relative;
  overflow: hidden;
  flex: 1;
}

.mobile-nav ul { list-style: none; }

.mobile-nav-panels {
  position: relative;
  width: 100%;
  min-height: 300px;
}

/* Each panel is absolutely positioned and fills the container */
.mobile-panel {
  position: absolute;
  inset: 0;
  padding: 0;
  background: #fff;
  transition: transform 0.25s ease;
  overflow-y: auto;
}

/* Default state: root visible, child off to the right */
.mobile-panel-root  { transform: translateX(0%); }
.mobile-panel-child { transform: translateX(100%); }

/* show-child: root slides left, child slides in */
.mobile-menu.show-child .mobile-panel-root  { transform: translateX(-100%); }
.mobile-menu.show-child .mobile-panel-child { transform: translateX(0%); }

/* Panel lists */
.panel-list { list-style: none; margin: 0; padding: 0.5rem 0; }
.panel-list > li { padding-inline: 0.25rem; }

/* Panel links and buttons */
.panel-link,
.panel-list > li > button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.9rem 0.75rem;
  text-align: left;
  text-decoration: none;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  color: #3b3326;
  border-radius: 10px;
  cursor: pointer;
  box-sizing: border-box;
}

.panel-link:hover,
.panel-list > li > button:hover { background: #f5f5f5; }

/* Caret on parent items */
.caret { font-size: 1.1rem; opacity: 0.6; flex-shrink: 0; }

/* ── Split row: real link + chevron button side by side ── */
.panel-split-row {
  display: flex;
  align-items: stretch;
  border-radius: 10px;
  overflow: hidden;
}

.panel-split-row .panel-link-text {
  flex: 1;
  border-radius: 10px 0 0 10px;
  justify-content: flex-start;
}

.panel-chevron-btn {
  flex-shrink: 0;
  width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-left: 1px solid #ebebeb;
  font-size: 1.4rem;
  color: #888;
  cursor: pointer;
  border-radius: 0 10px 10px 0;
  transition: background 0.15s ease;
}

.panel-chevron-btn:hover { background: #f0f0f0; color: #1B6FBF; }

/* Child panel header */
.panel-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.25rem 0.25rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid #f0f0f0;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  font-size: 0.85rem;
  color: #3b3326;
}

.back-btn:hover { background: #f5f5f5; }

.back-arrow  { font-size: 1.1rem; line-height: 1; }
.panel-title { margin: 0; font-size: 0.95rem; font-weight: 600; color: #3b3326; }

.mobile-nav-actions-custom {
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  gap: 0.5rem;
}


/* ── 9. RESPONSIVE ──────────────────────────────────────────────
   ---------------------------------------------------------------- */
@media (max-width: 1024px) {
  .nav-center,
  .nav-right  { display: none; }

  .mobile-donate {
    display: inline-flex;
    margin-left: auto;
    margin-right: 0.5rem;
  }

  .hamburger { display: flex; }
}

@media (max-width: 600px) {
  .mobile-nav-actions-custom {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .mobile-panel,
  .menu-header-container .menu > li .sub-menu {
    transition: none;
  }
}


/* ── 10. LANGUAGE FLAG SWITCHER ─────────────────────────────────
   Flag emoji pills — show the non-active flag at reduced opacity,
   highlight the active one. Desktop: in nav-right. Mobile: above
   the action buttons in the mobile menu.
   ---------------------------------------------------------------- */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
}

.lang-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  line-height: 1;
  text-decoration: none;
  opacity: 0.40;
  transition: opacity .15s ease, transform .15s ease;
  border-radius: 4px;
  padding: 2px 3px;
}

.lang-flag:hover        { opacity: 0.75; transform: scale(1.12); }
.lang-flag--active      { opacity: 1; }
.lang-flag--active:hover { transform: scale(1.05); }

/* Mobile variant — slightly larger, centred */
.lang-switcher--mobile {
  justify-content: center;
  gap: 8px;
  margin-bottom: 0.25rem;
}

.lang-switcher--mobile .lang-flag {
  font-size: 1.6rem;
  padding: 4px 6px;
}