/* ========== Global ========== */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background: #f4f4f4;
  color: #333;
}

/* ========== Fixed header ========== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 999;                   /* keep header above mobile drawer */
  background: transparent;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between; /* site-name left, menu right */
  transition: background 0.3s ease;
}

header.scrolled {
  background: #247182;
  
}

/* Left title/logo */
.site-name {
  display: flex;
  align-items: center;
  font-weight: 800;
  color: #000;
  font-size: 1.2rem;
}

.site-name img {
  height: 32px;
  margin-right: 0.5rem;
}

/* Menu toggle button (mobile only) */
.menu-toggle {
  display: none;
  font-size: 1.6rem;
  background: none;
  border: none;
  color: black;
  cursor: pointer;
  line-height: 1;
  padding: .25rem .5rem;
  z-index: 1000; /* above drawer just in case */
}

/* ========== Desktop nav ========== */
nav.menu {
  display: flex;
  gap: 1rem;
  margin-left: auto; /* push to the right edge */
}

nav.menu a {
  text-decoration: none;
  color: #000;
  position: relative;
}

nav.menu .dropdown-wrapper {
  position: relative;
}

nav.menu .submenu {
  display: none;
  position: absolute;
  background: #fff;
  padding: 0.5rem 1rem;
  top: 100%;
  left: 0;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  min-width: 160px;
}

nav.menu .dropdown-wrapper:hover > .submenu {
  display: block;
}

nav.menu .submenu a {
  display: block;
  color: #000;
  padding: 0.25rem 0;
}

nav.menu a.active::after {
  content: "";
  display: block;
  height: 3px;
  background: #247182;
  margin-top: 0.25rem;
  width: 100%;
}

/* ========== Mobile drawer ========== */
.mobile-menu {
  position: fixed;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: #247182;
  color: black;
  display: flex;
  flex-direction: column;
  padding: 5rem 2rem 2rem; /* space for header, then content */
  gap: 0.25rem;
  transition: left 0.3s ease;
  z-index: 998; /* under the fixed header */
}

.mobile-menu.active {
  left: 0;
}

/* Mobile drawer header row (logo + close X) */
.mobile-menu-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
}

.mobile-menu .site-name {
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
}

.mobile-menu .site-name img {
  height: 28px;
  margin-right: 0.5rem;
}

.menu-close {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: black;
  cursor: pointer;
}

/* Mobile links spacing */
.mobile-menu a,
.mobile-menu .has-submenu > a {
  display: block;
  padding: 0.75rem 0;
  color: black;
  text-decoration: none;
  font-size: 1.1rem;
}

/* Mobile submenus (accordion) */
.mobile-menu .submenu {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0 0 0.5rem 1rem; /* indent items a bit */
}

.mobile-menu .has-submenu.open .submenu {
  display: flex;
}

/* ======= Responsive ======= */
@media (max-width: 768px) {
  nav.menu { display: none; }
  .menu-toggle { display: block; }
}
/* When header is scrolled */
header.scrolled .site-name,
header.scrolled .site-name span,
header.scrolled nav.menu a {
  color: #fff;
}

header.scrolled nav.menu a.active::after {
  background: #fff;
}

/* When mobile menu is open */
.mobile-menu.active a {
  color: #fff;
}

.mobile-menu.active a.active::after {
  background: #fff;
}
