/* =========================================================
   HEADER & NAVIGATION
   ========================================================= */

.site-header {
  position: relative;
  z-index: 1000;
    margin-top: 10px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: center;
  color: var(--heading);
  font-size: 1.8rem;
  font-weight: 700;
  text-decoration: none;
}

.logo:hover,
.logo:focus {
  color: var(--heading);
}

.logo img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

/* =========================================================
   DESKTOP MAIN NAV
   ========================================================= */

#mainNav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

#mainNav > a,
.nav-section-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 36px;
  box-sizing: border-box;

  padding: 0 16px;

  background: transparent;
  border: 0;
  border-radius: var(--radius);

  color: var(--text);
  font-size: 1.4rem;
  font-weight: 500;

  line-height: 1;
  text-decoration: none;
  cursor: pointer;

  transition: var(--transition);
}

#mainNav > a:hover,
.nav-section-button:hover {
  color: var(--heading);
  background: var(--light);
}

/* =========================================================
   DROPDOWN — DESKTOP
   ========================================================= */

.nav-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}
.dropdown-menu,
.framework-dropdown-menu {
  position: absolute;

  top: calc(100% + 8px);
  left: 0;

  opacity: 0;
  visibility: hidden;

  transform: translateY(8px);

  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);

  box-shadow: var(--shadow);

  z-index: 1001;

  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s ease;
}

/* Category dropdown */

.dropdown-menu {
  display: flex;
  flex-direction: column;

  min-width: 220px;
  padding: 8px;
}

/* Framework dropdown */

.framework-dropdown-menu {
  display: grid;

  grid-template-columns: repeat(2, 1fr);

  width: 430px;
  padding: 8px;
}

/* Desktop hover only */

@media (min-width: 861px) {
  .nav-dropdown:hover > .dropdown-menu,
  .nav-dropdown:hover > .framework-dropdown-menu,
  .nav-dropdown:focus-within > .dropdown-menu,
  .nav-dropdown:focus-within > .framework-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

/* =========================================================
   DROPDOWN ITEMS
   ========================================================= */

.nav-category-button,
.framework-dropdown-menu a {
  display: block;

  width: 100%;

  padding: 9px 12px;

  background: transparent;
  border: 0;
  border-radius: 6px;

  color: var(--text);

  font-size: 1.3rem;
  text-align: left;
  text-decoration: none;

  cursor: pointer;
}

.nav-category-button:hover,
.framework-dropdown-menu a:hover {
  background: var(--light);
  color: var(--primary);
}

.nav-all-button {
  font-weight: 700;

  border-bottom: 1px solid var(--border);

  margin-bottom: 6px;
}

/* =========================================================
   HAMBURGER
   ========================================================= */

#menuToggle {
  display: none;

  padding: 8px 12px;

  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);

  color: var(--heading);

  font-size: 1.8rem;

  cursor: pointer;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 860px) {
  /* Hamburger */

  #menuToggle {
    display: block;
  }

  .submit-navigation-link {
    display: none;
  }
  /* Main mobile navigation */

  #mainNav {
    display: none;

    position: absolute;

    top: 100%;
    left: 0;
    right: 0;

    flex-direction: column;
    align-items: stretch;

    gap: 0;

    padding: 10px 16px 16px;

    background: var(--header);

    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);

    box-shadow: var(--shadow);

    z-index: 1000;
  }

  /* Hamburger opens menu */

  #mainNav.open {
    display: flex;
  }

  /* Every top-level item is vertical */

  #mainNav > a,
  #mainNav .nav-section-button {
    display: flex;

    width: 100%;
    min-height: 46px;

    align-items: center;
    justify-content:space-between;

    padding: 12px 14px;

    color: var(--text);

    text-align: left;

    border-radius: var(--radius);
  }

  /* No desktop hover background on mobile */

  #mainNav > a:hover,
  #mainNav .nav-section-button:hover {
    background: transparent;
    color: var(--text);
  }

  /* Each dropdown takes full width */

  .nav-dropdown {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  /* =======================================================
     MOBILE DROPDOWN CLOSED
     ======================================================= */

  .dropdown-menu,
  .framework-dropdown-menu {
    position: static;

    display: none;

    width: 100%;
    min-width: 0;

    margin: 0;

    padding: 4px 0 8px 14px;

    background: transparent;

    border: 0;
    border-left: 2px solid var(--primary);
    border-radius: 0;

    box-shadow: none;

    opacity: 1;
    visibility: visible;

    transform: none;
  }

  /* =======================================================
     MOBILE DROPDOWN OPEN
     ======================================================= */

  .nav-dropdown.active > .dropdown-menu {
    display: block;

    flex-direction: column;
  }

  .nav-dropdown.active > .framework-dropdown-menu {
    display: flex;

    flex-direction: block;
  }

  /* =======================================================
     MOBILE DROPDOWN ITEMS
     ======================================================= */

  .nav-category-button,
  .framework-dropdown-menu a {
    width: 100%;

    padding: 10px 14px;

    color: var(--text);

    font-size: 1.3rem;

    text-align: left;
  }

  /* No hover behavior on mobile */

  .nav-category-button:hover,
  .framework-dropdown-menu a:hover {
    background: transparent;
    color: var(--text);
  }

  /* Optional visual indicator */

  .nav-section-button::after {
    content: "›";

    font-size: 1.8rem;

    transition: transform 0.2s ease;
  }

  .nav-dropdown.active > .nav-section-button::after {
    transform: rotate(90deg);
  }
}

/* =======================================================
   Submit navigation
======================================================= */

.submit-navigation-link {
  background: #176b3a !important;
  color: #ffffff !important;
  text-decoration: none;
  font-weight: 600;

  padding: 0.25rem 0.7rem !important;

  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;

  box-sizing: border-box;

  border-radius: 6px;
  white-space: nowrap;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin: 0 !important;

  line-height: 1;
}
@media (max-width: 860px) {
  #submitNavigation {
    display: none !important;
  }
}

/* =========================================================
   MOBILE HEADER ACTIONS
   ========================================================= */

.mobile-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Submit + button */

.mobile-submit-button {
  display: none;

  width: 40px;
  height: 40px;

  align-items: center;
  justify-content: center;

  background: #176b3a;
  color: #ffffff !important;

  border-radius: var(--radius);

  font-size: 1.8rem;
  font-weight: 700;

  line-height: 1;
  text-decoration: none;

  box-sizing: border-box;

  transition:
    background-color 0.2s ease,
    transform 0.2s ease;
}

.mobile-submit-button:hover {
  background: #12572f;
}

.mobile-submit-button:active {
  transform: translateY(1px);
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 860px) {
  .mobile-submit-button {
    display: inline-flex;
  }

  #menuToggle {
    display: block;
  }
}
/* =======================================================
   Submit navigation
======================================================= */

.submit-navigation-link {
  background: #176b3a !important;
  color: #ffffff !important;
  text-decoration: none;
  font-weight: 600;

  padding: 0.25rem 0.7rem !important;

  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;

  box-sizing: border-box;

  border-radius: 6px;
  white-space: nowrap;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin: 0 !important;

  line-height: 1;
}
