/* =========================================================================
   Header Secondary Menu + Popup modal
   Styled with the staging design tokens (CSS custom properties).
   This file is enqueued directly; the same rules live in
   assets/scss/parts/_secondary-menu.scss for the SCSS build.
   ========================================================================= */

/* ---- Desktop: sits in the header before the dark/light toggle ---- */
.header-secondary {
   display: flex;
   align-items: center;
   height: 100%;
}

.header-secondary__list {
   list-style: none;
   margin: 0;
   padding: 0;
   display: flex;
   align-items: center;
   height: 100%;
   font-family: "Barlow Semi Condensed", sans-serif;
}

.header-secondary__item {
   display: flex;
   align-items: center;
   position: relative;
   transition: 0.3s;
}

.header-secondary__link {
   display: inline-flex;
   align-items: center;
   gap: 8px;
   padding: 10px;
   color: var(--menu-link);
   font-size: 16px;
   line-height: 18px;
   text-decoration: none;
   cursor: pointer;
   background: none;
   border: 0;
   transition: color 0.3s ease;
}

.header-secondary__link:hover,
.header-secondary__link:focus {
   color: var(--menu-hover);
   text-decoration: none;
}

.header-secondary__icon {
   display: inline-block;
   width: 20px;
   height: 20px;
   object-fit: contain;
   flex: 0 0 auto;
}

.header-secondary__label {
   display: inline-block;
}

/* ---- Second level (dropdown) ---- */
.header-secondary__link--has-child {
   cursor: pointer;
}

.header-secondary__chevron {
   width: 12px;
   height: auto;
   flex: 0 0 auto;
   transition: transform 0.3s ease;
}

.header-secondary__submenu {
   display: none;
   list-style: none;
   margin: 0;
   padding: 12px 0;
   position: absolute;
   top: 100%;
   right: 0;
   left: auto;
   z-index: 30;
   min-width: 220px;
   background: var(--primary-second-background);
   box-shadow: 0 24px 44px rgba(9, 27, 28, 0.18);
   border-radius: 4px;
}

.header-secondary__item--has-child:hover .header-secondary__submenu {
   display: block;
}

.header-secondary__item--has-child:hover .header-secondary__chevron {
   transform: rotate(180deg);
}

.header-secondary__subitem {
   display: block;
   width: 100%;
}

.header-secondary__sublink {
   display: flex;
   align-items: center;
   gap: 8px;
   padding: 8px 24px;
   color: var(--menu-link);
   font-size: 15px;
   line-height: 1.3;
   text-decoration: none;
   transition: color 0.3s ease;
}

.header-secondary__sublink:hover,
.header-secondary__sublink:focus {
   color: var(--menu-hover);
   text-decoration: none;
}

/* ---- Mobile: relocated into the main menu panel (#headerMenu) ---- */
@media (max-width: 1121.98px) {
   #headerMenu .header-secondary {
      display: block;
      width: 100%;
      height: auto;
      /* Separate the secondary menu from the main menu items above it */
      margin-top: 12px;
      border-top: 1px solid var(--fourth-color);
   }

   #headerMenu .header-secondary__list {
      display: block;
      width: 100%;
      height: auto;
   }

   #headerMenu .header-secondary__item {
      display: block;
      width: 100%;
      border-bottom: 1px solid var(--fourth-color);
   }

   #headerMenu .header-secondary__link {
      width: 100%;
      padding: 20px;
      font-size: 20px;
      line-height: 1.2;
      font-weight: 500;
      color: var(--primary-color);
   }

   #headerMenu .header-secondary__link:hover,
   #headerMenu .header-secondary__link:focus {
      color: var(--menu-hover);
   }

   #headerMenu .header-secondary__icon {
      width: 24px;
      height: 24px;
   }

   /* Second level on mobile: inline accordion under the parent */
   #headerMenu .header-secondary__item {
      position: static;
      flex-wrap: wrap;
   }

   #headerMenu .header-secondary__link--has-child {
      justify-content: space-between;
   }

   #headerMenu .header-secondary__chevron {
      width: 24px;
      height: 12px;
   }

   #headerMenu .header-secondary__submenu {
      display: none;
      position: static;
      width: 100%;
      min-width: 0;
      padding: 0;
      background: transparent;
      box-shadow: none;
      border-radius: 0;
   }

   /* Override desktop hover-open on touch devices */
   #headerMenu .header-secondary__item--has-child:hover .header-secondary__submenu {
      display: none;
   }

   #headerMenu .header-secondary__item--has-child.active .header-secondary__submenu {
      display: block;
   }

   #headerMenu .header-secondary__item--has-child.active .header-secondary__chevron {
      transform: rotate(180deg);
   }

   #headerMenu .header-secondary__subitem {
      border-top: 1px solid var(--fourth-color);
   }

   #headerMenu .header-secondary__sublink {
      padding: 16px 20px 16px 40px;
      font-size: 18px;
      font-weight: 500;
      line-height: 1.2;
      color: var(--primary-color);
   }

   #headerMenu .header-secondary__sublink:hover,
   #headerMenu .header-secondary__sublink:focus {
      color: var(--menu-hover);
   }
}

/* ---- Popup modal (reuses .team-modal / .modal-* styling) ---- */
.popup-modal {
   display: none;
}

.popup-modal .modal-body {
   padding-top: 0;
}

.popup-modal__content {
   color: var(--primary-color);
}

.popup-modal__content :last-child {
   margin-bottom: 0;
}

.popup-modal__form {
   margin-top: 20px;
}

.popup-modal .popup-modal__close {
   background: none;
   border: 0;
   padding: 0;
   cursor: pointer;
   line-height: 0;
}

/* ---- This modal only: the form has no inner SimpleBar scroller, so the
   team-modal height clamp (max-height:637px / overflow:hidden) cuts it off.
   Let this modal grow and scroll instead. Other modals are untouched. ---- */
.popup-modal.fancybox__content {
   max-height: 90vh !important;
   overflow-y: auto !important;
   overflow-x: hidden !important;
   scrollbar-width: thin;
   scrollbar-color: #785f40 transparent;
}

.popup-modal.fancybox__content::-webkit-scrollbar {
   width: 6px;
}

.popup-modal.fancybox__content::-webkit-scrollbar-thumb {
   background-color: #785f40;
   border-radius: 3px;
}

.popup-modal .modal {
   overflow: visible !important;
}

@media (max-width: 767.98px) {
   .popup-modal .modal-dialog-centered {
      align-items: flex-start;
   }
}

/* =========================================================================
   Flexible block: Columns Content Modal
   ========================================================================= */
.columns-content-modal__row {
   row-gap: 10px;
}

.columns-content-modal__title {
   color: var(--primary-color);
}

.columns-content-modal__content {
   color: var(--primary-color);
}

.columns-content-modal__content :last-child {
   margin-bottom: 0;
}

.columns-content-modal__button {
   display: inline-flex;
}
