* {
  margin: 0px;
  padding: 0px;
  box-sizing: border-box;
  font-family: 'Oswald', sans-serif;
}

header#masthead {
  margin-bottom: 1.5rem;
  padding-top: 1rem;
}

.site-branding {
  display: flex;
  background: white;
  padding: 1.5rem;
  align-items: center;
  justify-content: space-between;

  .site-title a {
      font-size: 1.75rem;
      text-transform: uppercase;
      margin-right: 7px;
      &:hover {
          text-decoration: none;
      }
  }

  img.custom-logo {
      width: 150px;
      height: auto;
  }
}

.menu-main-menu-container {
  background: #f7f7f7;
  margin-bottom: 45px;
}

.main-navigation {
  width: 100%; /* Ensure full width */

  ul {
      justify-content: center;
      list-style: none;
      padding: 0;
      margin: 0;
      width: 100%; /* Ensure full width */
      background: #ffffff;
      box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;

      li {
          padding: 20px;
          text-align: left;
          position: relative; /* Needed for absolute positioning of sub-menu */
          background: #ffffff;

          a {
              display: block;
              padding: 1em;
              text-decoration: none;
              white-space: nowrap;
              color: #fff;

              &:visited {
                  color: black;
              }

              &:hover {
                  background: rgb(225, 225, 225);
              }
          }

          ul.sub-menu {
              display: none; /* Initially hide sub-menus */
              position: absolute;
              top: 100%;
              left: 0;
              width: 200px;
              background: #eee;
              box-shadow: none;
              flex-wrap: wrap;
              text-align: left;
              font-size: 14px;
              box-shadow: none;

              .menu-item-has-children:after {
                  content: '⮟';
                  color: black;
                  box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
                  top: 50%;
                  right: 4px;
                  margin-top: -9px;
                  font-size: 12px;
                  position: absolute;
                  transform: rotate(270deg);

                  &:hover {
                      color: rgb(217, 217, 217);
                  }
              }

              li {
                  position: relative;
                  text-align: left;
                  width: fit-content;
                  box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;

                  a {
                      padding: 6px 15px;
                      text-transform: none;
                      color: black;

                      &:hover {
                          background: white;
                          color: black;
                      }

                      &:hover::before {
                          background: none;
                      }
                  }

                  /* Nested sub-menu styling */
                  &:hover > ul.sub-menu {
                      display: block;
                      left: 100%;
                      top: 0;
                  }

                  &:hover,
                  &.focus {
                      ul.sub-menu {
                          /* LEVEL 3 */
                          left: 0px;
                          top: 0px;
                          border-left: none;
                          border-top: none;
                          font-size: 12px;

                          .menu-item-has-children:after {
                              content: '';
                          }
                      }
                  }
              }

              ul ul {
                  display: none; /* hide 4th level onwards */
              }
          }

          &:hover > ul.sub-menu {
              display: block;
          }

          &:hover a {
              background: #fafafa;
          }
      }
  }
}

.menu {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;

  li {
      padding: 20px;
  }

  a:visited {
      color: black;
  }
}

.menu-toggle {
  background: none;
  border: none;
  position: absolute;
  top: 10%;
  right: 2rem;

  img {
      width: 1.5rem;
      height: auto;
  }
}

  .menu {
      padding: 0;
      margin: 0;
      width: 100%; /* Ensure full width */

      li {
          ul {
              position: static;
              display: none;

              li {
                  padding: 10px;
              }
          }

          &:hover > ul {
              display: block;
          }
      }
  }

.menu-item-has-children:after {
  content: '⮟';
  top: 50%;
  right: 8%;
  margin-top: -5px;
  font-size: 12px;
  position: absolute;
}

.current-menu-item {
  border-bottom: solid 2px gray;
  color: black;
}

.main-navigation ul ul {
  display: inline-block;
  background: white;

  a {
      background-color: white;

      &:hover {
          background: #c2e8f6;
      }
  }
}

#primary {
  article {
    background: white;
    box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
    padding: 25px;
  }

  a {
    text-decoration: underline;
  }

  @media only screen and (max-width: 600px) {
    padding: 20px;
    margin-left: 0;
  }

  @media only screen and (max-width: 1024px) {
    margin: 0;
  }
  
  .entry-title {
    a {
      text-decoration: none;
      color: #121212;
    }
  }
}

#secondary {
  background: white;
  color: rgb(27, 27, 27);
  
  ul {
    list-style: none;
    margin: 0;
    
    li {
      padding: 10px 0;
      
      a {
        color: #1e73be;
      }
    }
  }
  
  .widget {
    box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
    padding: 20px;
  }
}

.site-footer {
  grid-area: footer;
  width: 100%;
  position: relative;
  bottom: 0;
  background: #f1f1f1;
  padding: 20px 0;
  text-align: center;
}
