/* ===========================
    HEADER STYLING + GRID LAYOUT & GENERAL STYLES
   =========================== */

/* Container for the entire page using CSS Grid */
.index-wrapper {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "logo header header"
    "top-title top-title top-title"
    "main main main"
    "footer footer footer";
}

/* Top banner styling - a thin yellow strip with centered bold text */
.top-banner {
  height: 20px;
  background-color: #f3c30d; /* Primary colour yellow */
  color: black;
  text-align: center;
  font-weight: bold;
  font-size: 1rem;
  font-family: 'Lato', sans-serif;
  letter-spacing: 3px;
  padding: 8px 0;
}

/* Logo container styling */
.logo {
  grid-area: logo;
  display: flex;
  align-items: center;
}

.logo img {
  height: 150px;
  width: auto;
}

/* Header container styling */
.header {
  grid-area: header;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Main title - "Alava Honey" */
.top-title {
  grid-area: top-title;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  color: #f3c30d; /* Brand yellow */
  font-family: 'Ultra', serif;
  letter-spacing: 3px;
}

/* ===========================
   MAIN NAVIGATION
   =========================== */

ul.nav {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 60px; /* Even spacing between main nav links */
  margin: 0;
  padding: 0;
}

ul.nav li {
  position: relative;
}

ul.nav li a {
  font-weight: 900;
  font-size: 1.5rem;
  text-decoration: none;
  color: black;
  padding: 12px 18px;
  display: block;
  position: relative;
  transition: color 0.3s ease;
  font-family: 'Lato', sans-serif;
}

/* Underline animation */
ul.nav li a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 2px;
  height: 2px;
  width: 0%;
  background: #f5c922;
  transition: width 0.3s ease;
}

ul.nav li a:hover::after {
  width: 100%;
}

/* Hide dropdown navigation by default */
ul.nav .dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #f3c30d;
  border: 2px solid black;
  min-width: 180px;
  border-radius: 2px;
  z-index: 100;
  list-style: none;
  margin: 0;
  padding: 0;
}

ul.nav .dropdown li a {
  display: block;
  width: 100%;
  padding: 12px 0;      /* Vertical padding only */
  text-align: center;
  font-size: 1.2rem;
  color: black;
  background: none;     /* yellow background shows through */
  text-decoration: none;
  box-sizing: border-box;
  transition: background 1s ease, color 1s ease;
}

/* On hover over a dropdown item, change background to dark and text to white */
ul.nav .dropdown li:hover a {
  background-color: #333;
  color: white;
  font-weight: bolder;
}

/* ===========================
   MENU HEADER & HAMBURGER ICON
   =========================== */

.menu-header {
  display: block;
}

/* Hide the FontAwesome bars icon until mobile screen */
.fa-bars {
  display: none;
  visibility: hidden;
}

.dropbtn i {
  margin-left: 6px;
  font-size: 1rem;
  color: black; /* Brand black for consistency */
}

/* ===========================
   TYPOGRAPHY 
   =========================== */

h1 {
  font-family: "Francois One", sans-serif;
  font-size: 4rem;
}

h2 {
  font-family: "Francois One", sans-serif;
  font-size: 3rem;
}

h3 {
  font-family: "Francois One", sans-serif;
  font-size: 2rem;
}

h4 {
  font-family: "Francois One", sans-serif;
  font-size: 1.5rem;
}

p {
  font-family: 'Lato', sans-serif;
  font-size: 1.5rem;
}

.francois-one-regular {
  font-family: "Francois One", sans-serif;
  font-weight: 400;
  font-style: normal;
}

/* ===========================
   LINK STYLING 
   =========================== */
a:link {
  color: #E69D00;
  background-color: transparent;
  text-decoration: none;
}

a:visited {
  color: #E69D00;
  background-color: transparent;
  text-decoration: none;
}

a:hover {
  color: black;
  background-color: transparent;
  text-decoration: underline;
}

a:active {
  color: white;
  background-color: transparent;
  text-decoration: underline;
}

/* ===========================
   DESKTOP-ONLY STYLES ( MORE THAN 768px)
   =========================== */

@media (min-width: 768px) {
  /* Show dropdown navigation on hover */
  ul.nav li:hover .dropdown {
    display: block;
  }

  .fa-bars {
    display: none !important;
    visibility: hidden !important;
  }
}

/* ===========================
   MOBILE‐ONLY STYLES (LESS THAN 768px)
   =========================== */

@media (max-width: 767px) {
  /* Change grid layout for mobile */
  .index-wrapper {
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-areas:
      "header logo currency"
      "top-title top-title top-title"
      "main main main"
      "footer footer footer";
  }

  /* Align header content to the left with some padding */
  .header {
    justify-content: flex-start;
    padding-left: 10px;
  }

  /* Center the logo */
  .logo {
    justify-content: center;
  }

  /* Reduce top-title font size and center it */
  .top-title {
    font-size: 1rem;
    text-align: center;
  }

  /* Show the hamburger icon on mobile, make it clickable */
  .fa-bars {
    display: inline-block !important;
    visibility: visible !important;
    color: black;
    font-size: 1.8rem;
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    position: relative;
    z-index: 2000;
  }

  /* Positioning container for the mobile menu (dropdown curtain) */
  .menu-header {
    position: relative;
  }

  /* Container for the sliding mobile menu; hidden by default through max-height */
  .menu-content {
    position: absolute;
    top: 100%;
    margin-top: 40px; /* Space below header row */
    left: 0;
    width: 95vw;    
    max-height: 0;  /* Collapsed by default */
    overflow: hidden;
    background-color: white;
    border: 2px solid #f3c30d; 
    box-sizing: border-box;
    z-index: 1000;
    transition: max-height 1s ease;
  }
  /* When the hamburger is clicked, the mobile menu expands fully */
  .menu-content.show {
    max-height: 100vh;
  }

  /* Stack navigation links vertically on mobile */
  ul.nav {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    list-style: none;
    gap: 0;
  }

  /* Each item - full-width with yellow bottom border */
  ul.nav li {
    margin: 0;
    border-bottom: 2px solid #f3c30d;
    width: 100%;
  }

  ul.nav li a {
    display: block;
    width: 100%;
    padding: 16px 0;
    text-align: center;
    background-color: white;
    color: black;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 800;
    box-sizing: border-box;
  }

  /* Active (when the user has clicked) state for mobile nav links: dark background, white text(like the hover effect on desktop) */
  ul.nav li a:active {
    background-color: #333;
    color: white;
    font-weight: bolder;
  }

  .dropbtn {
    padding: 16px 0;
    position: relative;
  }

  /* dropdown container initially hidden on mobile; expanded with JS */
  ul.nav .dropdown {
    position: static; /* No absolute positioning on mobile */
    width: 100%;
    background-color: #f3c30d; 
    margin: 0;
    padding: 0;
    max-height: 0; /* Collapsed by default */
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.2s ease;
    box-sizing: border-box;
    border: none; 
    display: none;
  }

  ul.nav .dropdown.expanded {
    display: block;
    max-height: 500px;
  }

  ul.nav .dropdown li {
    margin: 0;
    border-bottom: 2px solid black;
    width: 100%;
    background: transparent;
  }

  /* Submenu link styling on mobilem - block-level, centered text */
  ul.nav .dropdown li a {
    display: block;
    width: 100%;
    padding: 12px 24px;
    font-size: 1rem;
    color: black;
    background: transparent;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
  }
}
