@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

:root {
    --primary-color: white;
    --hover-color:  yellow;
    --accent-color: rgb(85, 100, 133);
    --text-color: #0d3658f2;
    --logo-red: #c70850;
    --active-button-bg: #C1D2E0;
}

*{
    margin:0;
    padding: 0;
    box-sizing: border-box;
}

html{
    font-family: 'Montserrat', serif;
    color: var(--text-color);
}

body{
    min-height: 100vh;
    min-height: 100dvh;
    background-color: var(--primary-color);
}

.container {
    padding: min(1em, 1%);
    width: 95%;
    max-width: 1100px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
  font-size: 22px;
  font-weight: bold;
}

.logo img{
    height:auto; 
    max-height:11vh; 
    min-height:9vh; 
    width:auto;
}

nav{
    background-color: var(--primary-color);
    /* border-bottom: 1px solid var(--hover-color); */
}

nav ul{
    list-style: none;
    display: flex;
}

nav .home-li{
    margin-right: auto;
}

nav li{
    display: flex;
}

nav a {
    display: flex;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 700;
    padding: 1em 0.9em 0.9em;
    transition: background-color 150ms ease;
}

nav a:hover{
    background-color: var(--active-button-bg);
}

nav a.active-link{
    
    border-bottom: 3px solid var(--logo-red);
}

nav a.accent-link{
    background-color: var(--accent-color);
}

/* ***************Sub Menu ******************** */

.has-submenu {
  position: relative;
}

/* Dropdown */
.dropdown {
    position: absolute;
    list-style: none;
    z-index: 1;
    top: 101%;
    left: 0;
    background: #104b7df2;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.4s ease;
}

/* Triangle */
.dropdown::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 20px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 10px solid #104b7df2;
}

.dropdown a {
    padding: 10px;
    color: yellow;
}

li:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown li {
  padding: 5px 10px
}

.dropdown li a:hover {
  color: yellow;
}

.has-submenu:hover .dropdown {
  display: block;
}

/* ************************************************* */

#open-sidebar-button{
    display: none;
    background: none;
    border: none;
    padding: 1em;
    margin-left: auto;
    cursor: pointer;
}
#close-sidebar-button{
    display: none;
    background: none;
    border: none;
    padding: 1em;
    cursor: pointer;
}
#overlay{
    background: rgba(0, 0, 0, 0.5);
    position: fixed;
    inset: 0;
    z-index: 9;
    display: none;
}

@media screen and (max-width: 700px ){
    #open-sidebar-button, #close-sidebar-button{
        display: block;
    }
    nav{
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: min(15em, 100%);
        z-index: 10;
        border-left: 1px solid var(--hover-color);
        transition: right 300ms ease-in-out;
    }
    nav.show{
        right: 0;
    }

    nav.show ~ #overlay{
        display: block;
    }

    nav ul{
        width: 100%;
        flex-direction: column;
    }
    nav a{
        width: 100%;
        padding-left: 2.5em;
    }
    nav .home-li{
        margin-right: unset;
    }

    .logo img{
        height:60px; 
        width:auto;
    }
    /* ********** Submenu ************ */
.has-submenu {
    position: relative;
    /* Optional: Ensure the trigger link area is visually distinct */
}
    
  .dropdown {
    position: absolute;
    top: 100%; /* Positions the top edge of the dropdown exactly at the bottom edge of its parent (.has-submenu) */
    left: 0;  
    width: 100%;
    /* background: #e71f6d; */
    display: block;
  }

  .has-submenu.open .dropdown {
    display: block;
  }

  .nav-links li a {
    position: static;
    display: flex;
    flex-direction: row;
  }

  /* Triangle */
  .dropdown::before {
    display: none;
      content: "";
      position: absolute;
      top: -10px;
      left: 20px;
      border-left: 8px solid transparent;
      border-right: 8px solid transparent;
      border-bottom: 10px solid #104b7df2;
  }

    /* ********** Submenu ************ */
}
