﻿/* Basic resets and container */
.container {
  width: 100%;
  /*max-width: 1200px;*/
  margin: auto;
}
.toggleMenu, .toggleMenu a {
  display: none;
  padding: 10px 15px;
  color: #ffffff;
  cursor: pointer;
  text-decoration: none;
  font-family: "Google Sans Flex", !important, sans-serif;
}
.nav {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav a {
  padding: 10px 15px;
  color: #fff;
  text-decoration: none;
  display: block;
}

/* Desktop styles - Right-aligned menu */
@media (min-width: 951px) {
  .nav {
    display: flex;
    justify-content: flex-end;  /* Keeps menu aligned to the right */
  }
}

.nav > li {
  position: relative;
  flex: 0 1 auto;
}

/* First-level dropdowns on desktop */
.nav > li > ul {
  position: absolute;
  top: 100%;
  left: 0;
  width: 14em;
  background: #015023;
  opacity: 0;
  transform: translateY(10px);
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  z-index: 999;
box-shadow: 0px 6px 10px 0px rgba(0,0,0,0.75);
-webkit-box-shadow: 0px 6px 10px 0px rgba(0,0,0,0.75);
-moz-box-shadow: 0px 6px 10px 0px rgba(0,0,0,0.75);
}

/* Open first-level on hover/focus (desktop) */
.nav > li:hover > ul,
.nav > li.focus > ul {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

/* Third-level menus (World Show subs, etc.) */
.nav li ul li ul {
  position: static;
  width: auto;
  background: #015023;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  padding-left: 20px;
  margin: 0;
}

/* Open third-level on click */
.nav li ul li.open > ul {
  max-height: 200px;
  overflow: visible;
}

/* Third-level link styling */
.nav li ul li ul a {
  color: #fff;
  border-top: 1px solid #000000;
  display: block;
  padding: 10px 15px;
}

/* Hover/focus effects (desktop) */
@media (min-width: 951px) {
  .nav a:hover,
  .nav a:focus-visible {
    background: rgba(0, 0, 0, 0.0);
  }
  .nav li ul li ul a:hover,
  .nav li ul li ul a:focus-visible {
    background: rgba(0, 0, 0, 0.0);
  }
}

/* Visible focus outline */
.nav a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Font Awesome arrows */
.nav li.has-sub > a::after {
  font-family: FontAwesome;
  content: "\f078";
  font-size: 0.4em;
  margin-left: 8px;
}

/* Ensure containers don't clip dropdowns */
.navContainer {
  overflow: visible;
}

/* Progressive scaling (desktop medium screens) */
@media screen and (max-width: 1200px) {
  .nav a {
    padding: 10px 12px;
    font-size: 0.95em;
  }
}
@media screen and (max-width: 1100px) {
  .nav a {
    padding: 10px 10px;
    font-size: 0.90em;
  }
}
@media screen and (max-width: 1000px) {
  .nav a {
    padding: 10px 8px;
    font-size: 0.85em;
  }
}

/* Mobile styles - FULLY CENTERED + FULL-WIDTH SUBMENUS */
@media screen and (max-width: 951px) {
  .toggleMenu {
    display: block;
    margin:auto;
    text-align: center;
    width: 100%;
    background: #015023;  /*Matches your header bar */
    /*border:1px solid rgba(255,255,255,0.25);*/
  }

  .nav {
    display: none;
    flex-direction: column;
    text-align: center;         /* Centers all text/links */
    width: 100%;
    background: rgba(0,0,0,0.55);           /* Optional: solid background for full menu */
  }

  .nav > li {
    width: 100%;
  }

  /* Top-level items - full width, centered text */
  .nav > li > a {
    font-size: 22px;           /* Slightly larger on mobile */
    padding: 15px;
  }

  /* All submenus (second and third level) - full width */
  .nav li ul {
    position: static;
    width: 100%;                /* Full screen width */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    opacity: 1;
    transform: none;
    visibility: visible;
    background: #ff0000;        /* Second-level background */
    text-align: center;         /* Center submenu links */
  }

  /* Third-level specifically */
  .nav li ul li ul {
    width: 100%;
  background: #2D3A98;       /* Darker for third-level */
    padding-left: 0;            /* Remove indent - full width */
  }

  /* Open any submenu */
  .nav li.open > ul {
    max-height: 800px;          /* Large enough for all items */
  }

  /* Links inside submenus - full width, centered */
  .nav li ul a {
    padding: 12px 15px;
    font-size: 22px;
  }

  /* Arrow on mobile - still floats right for clarity */
  .nav li.has-sub > a::after {
    content: "\f078";
    font-size: 0.4em;
    float: right;
    margin-right: 10px;
    margin-top: 8px;
  }
}