/**
 * @file
 * Navigation styles — horizontal nav, dropdowns, mobile offcanvas.
 */

.main-menu {
  width: 100%;
}

.area-main-menu {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Main nav list */
.main-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
}

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

.main-menu ul > li > a {
  display: block;
  padding: 15px 18px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.main-menu ul > li > a:hover,
.main-menu ul > li.is-active > a,
.main-menu ul > li > a.is-active {
  color: #82fec8;
}

/* Dropdown menus */
.main-menu ul > li > ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  list-style: none;
  padding: 8px 0;
  margin: 0;
}

.main-menu ul > li:hover > ul {
  display: block;
}

.main-menu ul > li > ul > li > a {
  display: block;
  padding: 8px 20px;
  font-size: 13px;
  color: #3e3e3e;
  text-decoration: none;
  transition: all 0.2s ease;
}

.main-menu ul > li > ul > li > a:hover {
  background: #f5f5f5;
  color: #1a73e8;
}

/* ── Mobile offcanvas ────────────────────────────────────────────────── */
/**
 * .gva-offcanvas-mobile holds the main menu at every width. On desktop it is
 * the inline horizontal bar in the header, so it must stay visible there
 * (the mobile-menu JS keeps it inside the header at desktop widths). The
 * mobile rules below turn it into a slide-in panel.
 */
@media (min-width: 992px) {
  .gva-offcanvas-mobile {
    display: block !important;
  }
}

@media (max-width: 991px) {
  /**
   * The off-canvas panel is always in the DOM at mobile widths; we use a
   * translate to slide it off-screen by default and back in when `.open` is
   * toggled. `display: none` is unreliable because the area-main-menu flex
   * parent + some hover JS can re-show it; transform avoids that fight.
   *
   * The `.header-v1` prefix is needed to win specificity against the
   * front-page override that forces the offcanvas background transparent.
   */
  .header-v1 .gva-offcanvas-mobile,
  .gva-offcanvas-mobile {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: #fff;
    color: #222;
    z-index: 10001;
    overflow-y: auto;
    padding: 64px 20px 20px;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.25);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    visibility: hidden;
  }

  /* Beat the .page-admission-front transparent-bg override (same specificity
     + !important to settle any future cascade conflicts). */
  .page-admission-front .header-v1 .gva-offcanvas-mobile,
  body.page-admission-front .gva-offcanvas-mobile,
  .header-v1 .area-main-menu .gva-offcanvas-mobile,
  body .gva-offcanvas-mobile {
    background: #fff !important;
  }

  .gva-offcanvas-mobile.open,
  .header-v1 .gva-offcanvas-mobile.open,
  body .gva-offcanvas-mobile.open,
  body.page-admission-front .gva-offcanvas-mobile.open {
    transform: translateX(0) !important;
    visibility: visible !important;
    /* The front-page CSS sets pointer-events:none on .header-v1 (so admin
       toolbar dropdowns can be clicked through it). The offcanvas is a child
       of .header-v1, so we must re-enable pointer events explicitly here, and
       on every descendant, otherwise menu links cannot be tapped. */
    pointer-events: auto !important;
  }

  .gva-offcanvas-mobile.open *,
  .header-v1 .gva-offcanvas-mobile.open * {
    pointer-events: auto !important;
  }

  /* Close (×) button injected at top of panel for accessibility */
  .gva-offcanvas-mobile::before {
    content: '×';
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 28px;
    line-height: 1;
    color: #260387;
    cursor: pointer;
    pointer-events: none;  /* visual marker only — the .menu-bar toggle handles close */
  }

  /* Vertical list inside the open panel — markup is
     .gva-offcanvas-mobile > div > nav > ul > li > a (no .main-menu class).
     Target the nested ul/a directly so the items are readable on the white
     panel regardless of upstream colour rules. */
  .gva-offcanvas-mobile ul {
    list-style: none;
    margin: 0;
    padding: 0;
    flex-direction: column;
    width: 100%;
  }

  .gva-offcanvas-mobile ul li {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .gva-offcanvas-mobile a,
  .gva-offcanvas-mobile a:link,
  .gva-offcanvas-mobile a:visited,
  .gva-offcanvas-mobile nav a,
  .gva-offcanvas-mobile nav a:link,
  .gva-offcanvas-mobile nav a:visited,
  .gva-offcanvas-mobile ul li a,
  .gva-offcanvas-mobile ul li a:link,
  .gva-offcanvas-mobile ul li a:visited {
    display: block;
    padding: 14px 4px !important;
    border-bottom: 1px solid #eee;
    color: #260387 !important;
    font-size: 15px;
    text-transform: none;
    letter-spacing: 0;
    text-decoration: none;
    background: transparent !important;
  }

  .gva-offcanvas-mobile a:hover,
  .gva-offcanvas-mobile a.is-active,
  .gva-offcanvas-mobile a[aria-current="page"] {
    color: #5e5afe !important;
    background: #f5f3ff !important;
  }

  .gva-offcanvas-mobile ul > li > ul {
    position: static;
    box-shadow: none;
    display: block;
    padding-left: 15px;
  }

  /* Belt-and-braces: if anything resurrects the inline nav outside the
     offcanvas at mobile width, it MUST not paint over the hero. */
  .area-main-menu > .main-menu,
  .area-main-menu > nav.main-menu,
  .header-main-inner > .main-menu {
    display: none !important;
  }

  /* Overlay removed — the panel dismisses on outside-tap via JS.
     Hard-hide any stale overlay that older cached JS may still inject. */
  .mobile-menu-overlay,
  .mobile-menu-overlay.active {
    display: none !important;
    pointer-events: none !important;
  }
}

@media (min-width: 992px) {
  .gva-offcanvas-mobile {
    transform: none !important;
    visibility: visible !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    overflow: visible !important;
  }
}

/* ============================================
   LOCAL TASKS — View / Edit / Delete tabs
   Rendered as:
     <div id="block-neurotecheu-primary-local-tasks">
       <h2 class="visually-hidden">Primary tabs</h2>
       <ul><li><a>View</a></li><li><a>Edit</a></li>...</ul>
     </div>
   Target via id*= so it works for both primary and secondary.
   ============================================ */
[id*="local-tasks"] > ul,
.tabs {
  margin: 0 0 24px 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 2px solid #e0e0e0;
}

[id*="local-tasks"] > ul > li,
.tabs li {
  margin: 0;
  padding: 0;
  list-style: none;
}

[id*="local-tasks"] > ul > li > a,
.tabs a,
.tabs a:link,
.tabs a:visited {
  display: inline-block;
  padding: 10px 22px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-decoration: none;
  color: #555;
  background: #f5f5f5;
  border: 1px solid #d6d6d6;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  transition: background 0.2s, color 0.2s;
  position: relative;
  top: 2px;
}

[id*="local-tasks"] > ul > li > a:hover,
[id*="local-tasks"] > ul > li > a:focus,
.tabs a:hover,
.tabs a:focus {
  background: #e3f2fd;
  color: #0d47a1;
  border-color: #90caf9;
}

/* Active tab — Drupal adds is-active via JS */
[id*="local-tasks"] > ul > li.is-active > a,
[id*="local-tasks"] > ul > li > a.is-active,
.tabs a.is-active,
.tabs li.is-active a {
  background: #fff;
  color: #1565c0;
  border-color: #e0e0e0;
  border-bottom: 2px solid #fff;
  font-weight: 700;
}

@media (max-width: 600px) {
  [id*="local-tasks"] > ul,
  .tabs {
    gap: 4px;
  }

  [id*="local-tasks"] > ul > li > a,
  .tabs a {
    padding: 8px 14px;
    font-size: 13px;
  }
}
