/* ==============================================
   PPS Site Header
   Matches ourpublicservice.org header pattern
=============================================== */

.pps-site-header {
  position: relative;
  z-index: 100;
  background: #fff;
  font-family: "Gotham A","Gotham B",Arial,sans-serif;
}

/* -----------------------------------------------
   Top Bar (logo + utility links)
----------------------------------------------- */
.pps-top-bar {
  border-bottom: 1px solid #e0e0e0;
  padding: 0;
}

.pps-top-bar__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.pps-top-bar__logo {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  flex-shrink: 0;
  padding: 12px 0 12px 16px;
}

.pps-top-bar__logo img {
  height: 58px;
  width: auto;
  display: block;
}

/* Utility links (Contact | Donate | All Sites) */
.pps-top-bar__utility {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: stretch;
  gap: 0;
  flex-shrink: 0;
}

.pps-top-bar__utility li {
  display: flex;
  align-items: stretch;
}

.pps-util-link {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: #333;
  background: #f3f3f4;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  gap: 5px;
  line-height: 1;
}

.pps-util-link:hover {
  background: #e5e5e6;
  color: #000;
}

.pps-top-bar__utility li:first-child .pps-util-link {
  border-radius: 0 0 0 8px;
}

.pps-util-link--donate {
  background: #00ce7c;
  color: #fff;
}

.pps-util-link--donate:hover {
  background: #00b56c;
  color: #fff;
}

.pps-util-link--allsites {
  background: #4c5258;
  color: #fff;
}

.pps-util-link--allsites:hover {
  background: #3a3f44;
  color: #fff;
}

.pps-util-link--allsites svg {
  transition: transform 0.2s;
}

.pps-util-link--allsites[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* All Sites dropdown */
.pps-util-allsites {
  position: relative;
}

.pps-allsites-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-top: none;
  list-style: none;
  margin: 0;
  padding: 10px 0;
  z-index: 400;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.pps-allsites-dropdown.is-open {
  display: block;
}

.pps-allsites-dropdown li a {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  padding: 8px 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #101820;
  text-decoration: none;
  white-space: nowrap;
  box-sizing: border-box;
}

.pps-allsites-dropdown li a:hover {
  color: #0084d4;
}

/* -----------------------------------------------
   Main Navigation
----------------------------------------------- */
.pps-main-nav {
  border-bottom: 1px solid #e0e0e0;
}

.pps-main-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  width: 100%;
}

.pps-main-nav__list > li > a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 12px;
  font-size: 15px;
  font-weight: 700;
  color: #101820;
  text-decoration: none;
  white-space: nowrap;
  text-align: center;
}

.pps-main-nav__list > li > a:hover {
  background: #2e6da4;
  color: #fff;
}

/* Dropdowns in main nav */
.pps-main-nav__list > li {
  position: relative;
  flex: 1;
  display: flex;
  justify-content: center;
}

/* -----------------------------------------------
   Cost of Cutting Science dropdown
----------------------------------------------- */

/* Nav inner is the positioning parent for the full-width panel */
.pps-main-nav__inner {
  position: relative;
}

/* The li itself must not constrain the dropdown width */
.pps-main-nav__has-dropdown {
  position: static !important;
}

/* The trigger button — identical appearance to sibling <a> links */
.pps-main-nav__dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  padding: 14px 12px;
  font-size: 15px;
  font-weight: 700;
  color: #101820;
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  font-family: inherit;
  line-height: inherit;
}

.pps-main-nav__dropdown-toggle:hover,
.pps-main-nav__dropdown-toggle[aria-expanded="true"] {
  background: #00a859;
  color: #fff;
}

.pps-main-nav__dropdown-toggle svg {
  flex-shrink: 0;
  transition: transform 0.2s;
}

.pps-main-nav__dropdown-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* Full-width mega-menu panel */
.pps-main-nav__mega {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-top: 2px solid #0084d4;
  margin: 0;
  padding: 0;
  z-index: 300;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  flex-direction: row;
}

.pps-main-nav__mega.is-open {
  display: flex;
}

/* Left column: section title */
.pps-main-nav__mega-title {
  flex: 0 0 240px;
  padding: 20px 28px;
  font-size: 18px;
  font-weight: 700;
  color: #101820;
  border-right: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
}

/* Right column: links */
.pps-main-nav__mega-links {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pps-main-nav__mega-links li a {
  display: block;
  padding: 10px 28px;
  font-size: 14px;
  font-weight: 600;
  color: #101820;
  text-decoration: none;
  white-space: nowrap;
}

.pps-main-nav__mega-links li a:hover {
  color: inherit;
  background: none;
}

/* Hide main nav + utility links on mobile (hamburger takes over) */
@media screen and (max-width: 768px) {
  .pps-top-bar__inner {
    align-items: center;
  }
  .pps-top-bar__tagline {
    display: none;
  }
  .pps-main-nav {
    display: none;
  }
  /* Hide Contact, Donate, All Sites — keep only the hamburger */
  .pps-top-bar__utility > li:not(.pps-mobile-menu-toggle-wrap) {
    display: none;
  }
}

/* -----------------------------------------------
   Mobile hamburger toggle (shown only on mobile)
----------------------------------------------- */
.pps-mobile-menu-toggle-wrap {
  display: none;
}

@media screen and (max-width: 768px) {
  .pps-mobile-menu-toggle-wrap {
    display: flex;
    align-items: center;
    margin-right: 10px;
  }
}

.pps-mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  width: 40px;
  height: 40px;
}

@media screen and (max-width: 768px) {
  .pps-mobile-toggle {
    display: flex;
  }
}

.pps-mobile-toggle span {
  display: block;
  height: 2px;
  width: 24px;
  background: #101820;
  border-radius: 2px;
  transition: all 0.2s;
}

/* -----------------------------------------------
   Mobile menu panel
----------------------------------------------- */
#pps-mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: #fff;
  z-index: 99999;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  max-height: 100vh;
  overflow-y: auto;
}

/* Push panel below WP admin bar when present */
.admin-bar #pps-mobile-menu {
  top: 46px; /* mobile admin bar height */
  max-height: calc(100vh - 46px);
}

@media screen and (min-width: 783px) {
  .admin-bar #pps-mobile-menu {
    top: 32px; /* desktop admin bar height */
    max-height: calc(100vh - 32px);
  }
}

#pps-mobile-menu.is-open {
  transform: translateY(0);
}

.pps-mobile-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e0e0e0;
}

.pps-mobile-menu__logo img {
  height: 44px;
  width: auto;
}

.pps-mobile-menu__close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: #101820;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pps-mobile-menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pps-mobile-menu__list > li > a,
.pps-mobile-menu__sub-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  font-size: 17px;
  font-weight: 700;
  color: #101820;
  text-decoration: none;
  border-bottom: 1px solid #f0f0f0;
  width: 100%;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.pps-mobile-menu__list > li > a:hover,
.pps-mobile-menu__sub-toggle:hover {
  background: #f5f5f5;
  color: #2e6da4;
}

.pps-mobile-menu__chevron {
  flex-shrink: 0;
  transition: transform 0.2s;
}

.pps-mobile-menu__sub-toggle[aria-expanded="true"] .pps-mobile-menu__chevron {
  transform: rotate(90deg);
}

/* Sub-menu (Cost of Cutting Science accordion) */
.pps-mobile-menu__sub {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  background: #f9f9f9;
  border-bottom: 1px solid #f0f0f0;
}

.pps-mobile-menu__sub.is-open {
  display: block;
}

.pps-mobile-menu__sub li a {
  display: block;
  padding: 13px 20px 13px 36px;
  font-size: 14px;
  font-weight: 600;
  color: #2e6da4;
  text-decoration: none;
  border-bottom: 1px solid #ececec;
}

.pps-mobile-menu__sub li a:hover {
  background: #eef4fb;
}

.pps-mobile-menu__empty {
  display: block;
  padding: 13px 20px 13px 36px;
  font-size: 13px;
  color: #999;
}

/* Footer: All Sites + Contact + Donate */
.pps-mobile-menu__footer {
  border-top: 1px solid #e0e0e0;
}

/* All Sites toggle row */
.pps-mobile-menu__allsites-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 18px 24px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: #3a4a5c;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.pps-mobile-menu__allsites-toggle:hover {
  background: #2e3d4f;
}

.pps-mobile-menu__allsites-toggle[aria-expanded="true"] svg {
  transform: rotate(90deg);
}

.pps-mobile-menu__allsites-toggle svg {
  transition: transform 0.2s;
  flex-shrink: 0;
}

/* All Sites sub-list */
.pps-mobile-menu__allsites-list {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  background: #f0f2f4;
}

.pps-mobile-menu__allsites-list.is-open {
  display: block;
}

.pps-mobile-menu__allsites-list li a {
  display: block;
  padding: 12px 24px 12px 36px;
  font-size: 13px;
  font-weight: 600;
  color: #3a4a5c;
  text-decoration: none;
  border-bottom: 1px solid #e0e4e8;
}

.pps-mobile-menu__allsites-list li a:hover {
  background: #e4e8ec;
}

/* Contact + Donate full-width */
.pps-mobile-menu__actions {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pps-mobile-menu__action-link {
  display: block;
  padding: 16px 24px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  color: #101820;
  border-bottom: 1px solid #e0e0e0;
}

.pps-mobile-menu__action-link:hover {
  background: #f5f5f5;
}

.pps-mobile-menu__action-link--donate {
  background: #00a859;
  color: #fff;
  border-bottom: none;
}

.pps-mobile-menu__action-link--donate:hover {
  background: #008f4c;
}

/* Backdrop */
#pps-mobile-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99998;
}

#pps-mobile-backdrop.is-open {
  display: block;
}
