/**
 * @file
 * Header styles for NextDC theme.
 * Styles the header region to match the design with teal background,
 * logo on left, menu in center, and donate button on right.
 */

/* Header Region */
.nextdc-region--nextdc-header {
  background-color: #3BB7B3;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
  min-height: 80px;
  width: 100%;
  overflow: hidden;
  transition: min-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nextdc-region--nextdc-header .nextdc-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
  width: 100%;
}

/* Branding/Logo - Left side */
.nextdc-region--nextdc-header .nextdc-branding {
  flex-shrink: 0;
  margin: 0;
  padding: 0;
}

.nextdc-region--nextdc-header .nextdc-branding__logo {
  display: block;
  padding: 10px 20px;
}

.nextdc-region--nextdc-header .nextdc-branding__logo img {
  max-height: 72px;
  width: auto;
  height: auto;
}

/* Navigation Menu - Center */
.nextdc-region--nextdc-header nav {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.nextdc-region--nextdc-header .menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
  align-items: center;
  justify-content: center;
}

.nextdc-region--nextdc-header .menu .menu-item {
  margin: 0;
  padding: 0 20px;
}

.nextdc-region--nextdc-header .menu .menu-item a {
  color: #201850;
  text-decoration: none;
  text-transform: uppercase;
  font-family: "Jost", sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.032em;
  display: block;
  line-height: 130%;
  transition: color 0.3s ease;
  position: relative;
  padding-bottom: 3px;
}

.nextdc-region--nextdc-header .menu .menu-item a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: #201850;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.nextdc-region--nextdc-header .menu .menu-item a:hover::after {
  @media screen and (min-width: 1025px) {
    transform: scaleX(1);
  }
}

/* Active menu item underline */
.nextdc-region--nextdc-header .menu .menu-item--active-trail a,
.nextdc-region--nextdc-header .menu .menu-item a.is-active {
  border-bottom: 3px solid #201850;
  padding-bottom: 0;
}

/* Donate Button Block - Right side */
.nextdc-region--nextdc-header [id^="block-nextdc-donation"],
.nextdc-region--nextdc-header .nextdc-block--block-content1bda4cdc-db40-4e41-afae-0c7bce8b07ab {
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  height: 100%;
  display: flex;
  align-items: stretch;
}

.nextdc-region--nextdc-header [id^="block-nextdc-donation"] .nextdc-block__content,
.nextdc-region--nextdc-header .nextdc-block--block-content1bda4cdc-db40-4e41-afae-0c7bce8b07ab .nextdc-block__content {
  padding: 0;
  margin: 0;
  height: 100%;
  display: flex;
  align-items: stretch;
}

.nextdc-region--nextdc-header [id^="block-nextdc-donation"] a,
.nextdc-region--nextdc-header .nextdc-block--block-content1bda4cdc-db40-4e41-afae-0c7bce8b07ab a {
  background-color: #BA3430;
  color: #ffffff;
  text-decoration: none;
  text-transform: uppercase;
  font-family: "Jost", sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 130%;
  letter-spacing: 0.032em;
  padding: 40px 66px 40px 64px;

  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.nextdc-region--nextdc-header [id^="block-nextdc-donation"] a::before,
.nextdc-region--nextdc-header .nextdc-block--block-content1bda4cdc-db40-4e41-afae-0c7bce8b07ab a::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 5px;
  width: 0;
  height: 0;
  border-top: 3px solid transparent;
  border-left: 3px solid transparent;
  transition: width 0.5s ease 0s, height 0.5s ease 0s, border-color 0s ease 0.5s;
  z-index: 1;
  pointer-events: none;
  box-sizing: border-box;
}

.nextdc-region--nextdc-header [id^="block-nextdc-donation"] a::after,
.nextdc-region--nextdc-header .nextdc-block--block-content1bda4cdc-db40-4e41-afae-0c7bce8b07ab a::after {
  content: '';
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 0;
  height: 0;
  border-bottom: 3px solid transparent;
  border-right: 3px solid transparent;
  transition: width 0.5s ease 0s, height 0.5s ease 0s, border-color 0s ease 0.5s;
  z-index: 1;
  pointer-events: none;
  box-sizing: border-box;
}

.nextdc-region--nextdc-header [id^="block-nextdc-donation"] a:hover,
.nextdc-region--nextdc-header .nextdc-block--block-content1bda4cdc-db40-4e41-afae-0c7bce8b07ab a:hover {
  background-color: #ffffff;
  color: #201850;
}

.nextdc-region--nextdc-header [id^="block-nextdc-donation"] a:hover::before,
.nextdc-region--nextdc-header .nextdc-block--block-content1bda4cdc-db40-4e41-afae-0c7bce8b07ab a:hover::before {
  @media screen and (min-width: 1025px) {
  width: calc(100% - 10px);
  height: calc(100% - 10px);
    border-top-color: #210850;
    border-left-color: #210850;
    transition: width 0.5s ease 0s, height 0.5s ease 0s, border-color 0s ease 0s;
  }
}

.nextdc-region--nextdc-header [id^="block-nextdc-donation"] a:hover::after,
.nextdc-region--nextdc-header .nextdc-block--block-content1bda4cdc-db40-4e41-afae-0c7bce8b07ab a:hover::after {
  @media screen and (min-width: 1025px) { 
  width: calc(100% - 10px);
  height: calc(100% - 10px);
  border-bottom-color: #210850;
  border-right-color: #210850;
  transition: width 0.5s ease 0s, height 0.5s ease 0s, border-color 0s ease 0s;
  }
}

/* Mobile Menu Toggle Button */
.nextdc-mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #201850;
  font-size: 24px;
  cursor: pointer;
  padding: 10px 20px;
  z-index: 1001;
  position: relative;
  line-height: 1;
  transition: color 0.3s ease;
}

.nextdc-mobile-menu-toggle .menu-icon {
  display: inline-block;
  font-size: 28px;
  line-height: 1;
  font-weight: 300;
  width: 28px;
  height: 28px;
  text-align: center;
  vertical-align: middle;
}

.nextdc-mobile-menu-toggle:hover {
  opacity: 0.8;
}

.nextdc-mobile-menu-toggle[aria-expanded="true"] {
  color: #201850;
}

/* Off-Canvas Menu Styles */
/* Padding is handled in off-canvas-fixes.css for smooth transitions */

/* Off-Canvas Menu Items */
.nextdc-off-canvas-menu {
  opacity: 0;
  transition: opacity 0.3s ease 0.1s;
  display: block;
  width: 100%;
}

.nextdc-off-canvas.is-open .nextdc-off-canvas-menu {
  opacity: 1;
  transition: opacity 0.3s ease 0.1s;
}

/* Ensure smooth closing for menu items */
.nextdc-off-canvas:not(.is-open) .nextdc-off-canvas-menu {
  transition: opacity 0.2s ease 0s;
}

.nextdc-off-canvas .menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex !important;
  flex-direction: column !important;
  width: 100%;
}

.nextdc-off-canvas .menu .menu-item {
  margin: 0;
  padding: 0;
  display: block;
  width: 100%;
}

.nextdc-off-canvas .menu .menu-item a {
  color: #201850;
  text-decoration: none;
  text-transform: uppercase;
  font-family: "Jost", sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.032em;
  display: block;
  padding: 12px 0;
  line-height: 1.5;
  border-bottom: none;
}

.nextdc-off-canvas .menu .menu-item--active-trail a,
.nextdc-off-canvas .menu .menu-item a.is-active {
  @media screen and (max-width: 1024px) {
    display: inline-block !important;
  }
}

/* Off-Canvas Donate Button Container */
.nextdc-off-canvas-donate {
  display: block;
  width: 100%;
}

/* Off-Canvas Donate Button */
.nextdc-off-canvas [id^="block-nextdc-donation"],
.nextdc-off-canvas .nextdc-block--block-content1bda4cdc-db40-4e41-afae-0c7bce8b07ab {
  margin-top: 20px;
  padding-top: 20px;
  opacity: 0;
  transition: opacity 0.3s ease 0.1s;
  display: block !important;
  width: 100%;
  @media screen and (min-width: 1025px) {
    padding: 20px 20px 0 20px;

  }
}

.nextdc-off-canvas.is-open [id^="block-nextdc-donation"],
.nextdc-off-canvas.is-open .nextdc-block--block-content1bda4cdc-db40-4e41-afae-0c7bce8b07ab {
  opacity: 1;
  transition: opacity 0.3s ease 0.1s;
  display: block !important;
}

/* Ensure smooth closing for donate button */
.nextdc-off-canvas:not(.is-open) [id^="block-nextdc-donation"],
.nextdc-off-canvas:not(.is-open) .nextdc-block--block-content1bda4cdc-db40-4e41-afae-0c7bce8b07ab {
  transition: opacity 0.2s ease 0s;
}

.nextdc-off-canvas [id^="block-nextdc-donation"] a,
.nextdc-off-canvas .nextdc-block--block-content1bda4cdc-db40-4e41-afae-0c7bce8b07ab a {
  width: 100%;
  padding: 20px;
  text-align: center;
  background-color: #BA3430;
  color: #ffffff;
  border: none;
  border-radius: 0;
}

.nextdc-off-canvas [id^="block-nextdc-donation"] a:hover,
.nextdc-off-canvas .nextdc-block--block-content1bda4cdc-db40-4e41-afae-0c7bce8b07ab a:hover {
  background-color: #BA3430;
  color: #ffffff;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .nextdc-region--nextdc-header {
    flex-wrap: wrap;
    min-height: auto;
    position: relative;
    z-index: 1001;
  }

  /* Hide desktop menu */
  .nextdc-region--nextdc-header nav {
    display: none;
  }

  /* Show mobile menu toggle */
  .nextdc-mobile-menu-toggle {
    display: block;
  }

  .nextdc-off-canvas.is-open .nextdc-off-canvas-menu{
    @media screen and (max-width: 1024px) {
      display: block !important;
      .nextdc-region--nextdc-header [id^="block-nextdc-donation"],
      .nextdc-region--nextdc-header .nextdc-block--block-content1bda4cdc-db40-4e41-afae-0c7bce8b07ab {
        display: block !important;
      }
      border-top: 1px solid rgba(32, 24, 80, 0.2);
    }
  }  

  /* Hide desktop donate button in header */
  .nextdc-region--nextdc-header [id^="block-nextdc-donation"],
  .nextdc-region--nextdc-header .nextdc-block--block-content1bda4cdc-db40-4e41-afae-0c7bce8b07ab {
    display: none !important;
  }

  /* Ensure off-canvas donate button is visible when menu is open */
  .nextdc-off-canvas.is-open [id^="block-nextdc-donation"],
  .nextdc-off-canvas.is-open .nextdc-block--block-content1bda4cdc-db40-4e41-afae-0c7bce8b07ab {
    display: block !important;
    opacity: 1 !important;
  }
}

@media (max-width: 768px) {
  .nextdc-region--nextdc-header {
    padding: 10px 0;
    min-height: 60px;
  }

  .nextdc-region--nextdc-header .nextdc-branding__logo {
    padding: 10px 20px;
  }

  .nextdc-region--nextdc-header .nextdc-branding__logo img {
    max-height: 50px;
  }

  .nextdc-mobile-menu-toggle {
    font-size: 20px;
    padding: 10px 15px;
  }
}