.nav-bar{
    display: flex;
    align-items: center;
    justify-content: space-around;
}
.nav-list{
    display: flex;
    gap: 20px;
    list-style: none;
    font-size: 16px;
    font-family: cursive;
}
.nav-list li:hover{
 cursor: pointer;
 color: purple;
 /* font-weight: 600; */
 background-color: lightsalmon;
}

.fa-solid{
    font-size: 16px;
    color: white;
    margin-left: 10px;
}
.button{
    background-color: green;
    color: white;
    border: none;
    padding: 10px 22px;
    border-radius: 10px;
}
h1, h2
{
    font-family: cursive;
    color: purple;
}

h3
{
    font-family: cursive;
    color: green;
}

header.head{
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: lightgray;
    padding: 0px;
}

span.label{
    position: absolute;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 5px;
}

div.hero{
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: lightgray;
    padding: 0px;
}

.dropdown {
  position: relative; /* Keeps the dropdown menu anchored to this item */
  display: inline-block;
}

/* Main link styling */
.dropdown-toggle {
  text-decoration: none;
  color: #333;
  
  display: block;
}

/* Submenu - Hidden by default */
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;            /* Positions submenu directly below parent */
  left: 0;
  background-color: #ffffff;
  min-width: 220px;
  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  z-index: 1000;
}

/* Submenu links */
.dropdown-menu li a {
  color: #333;
  text-decoration: none;
  
  display: block;
  white-space: nowrap; /* Prevents long titles from wrapping awkwardly */
}

/* Hover effects */
.dropdown-menu li a:hover {
  background-color: #f1f1f1;
}

/* SHOW DROPDOWN ON HOVER */
.dropdown:hover .dropdown-menu {
  display: block;
}

body{
    background-color: darkgray;
    margin-top: 0;
    
}



.grid-container{
    border: 2px transparent brown;
    padding: 1rem;
    display: grid;
    /* grid-template-columns: 100px 300px 100px; */
    grid-template-columns: repeat(4, 1fr);
    /* grid-template-rows: 200px 200px; */
    grid-template-rows: repeat(3, 200px);
    /* gap: 30px; */
    /* justify-content: space-around; */
    background-color:#333    

}
.grid-child{
    border: 1px transparent blue;
}
.child-1{
    grid-column: span 2;
}
.child-3{
    grid-row: span 3;
}
.child-5{
    grid-column: span 2;
}

.child-6{
    grid-column: span 3;
}


/* ==========================================
   RESPONSIVE MEDIA QUERIES
   ========================================== */

/* --- TABLETS (Max-Width: 992px) --- */
@media screen and (max-width: 992px) {
  /* Navigation adjustments */
  .nav-bar {
    padding: 10px 16px;
    justify-content: space-between;
  }

  .nav-list {
    gap: 12px;
    font-size: 15px;
  }

  /* Grid Layout: Adjust to 2 columns */
  .grid-container {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto; /* Dynamic height instead of fixed 200px */
    gap: 16px;
  }

  /* Reset fixed spans for tablet structure */
  .child-1, 
  .child-5, 
  .child-6 {
    grid-column: span 2; /* Spans full 2-column width */
  }

  .child-3 {
    grid-row: span 1; /* Reset multi-row span to fit stacked layout */
  }

  .grid-child {
    min-height: 180px;
  }
}


/* --- MOBILE DEVICES (Max-Width: 768px) --- */
@media screen and (max-width: 768px) {
  /* Navigation Bar: Stack items vertically */
  .nav-bar {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    text-align: center;
  }

  .nav-list {
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 10px;
    padding-left: 0;
  }

  .button {
    width: 100%;
    max-width: 250px;
  }

  /* Dropdown Menu alignment for mobile */
  .dropdown {
    width: 100%;
  }

  .dropdown-menu {
    position: static; /* Dropdown flows naturally below the toggle on touch screens */
    width: 100%;
    box-shadow: none;
    border: 1px solid #ddd;
  }

  /* Header and Hero adjustments */
  header.head,
  div.hero {
    padding: 20px 10px;
  }

  /* Grid Layout: Single column stack for mobile phones */
  .grid-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    padding: 0.5rem;
    gap: 12px;
  }

  /* All grid children take full width */
  .child-1,
  .child-3,
  .child-5,
  .child-6,
  .grid-child {
    grid-column: span 1 !important;
    grid-row: span 1 !important;
    min-height: 150px;
  }
}


/* --- SMALL MOBILE PHONES (Max-Width: 480px) --- */
@media screen and (max-width: 480px) {
  .nav-list {
    font-size: 14px;
  }

  .button {
    padding: 8px 16px;
    font-size: 14px;
  }

  span.label {
    font-size: 12px;
    padding: 2px 6px;
  }
}