/* ==========================================================================
   JJ Jenkins — Gated Brochure Download Component Styles
   Matches desktop modal (Image 2) and mobile navigation drawer (Image 3)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Desktop Navbar Brochure Button (Hidden on Mobile, Visible at >= 1200px)
   -------------------------------------------------------------------------- */
/* Hide on mobile / tablet viewports by default */
:is(.page-home, .page-about, .page-solutions, .page-services, .page-contact, .page-exhibitions, .page-privacy, .page-error, body) .site-header__actions :is(.site-header__brochure-btn, .jj-btn--brochure, button.site-header__brochure-btn),
body .site-header .site-header__actions :is(.site-header__brochure-btn, .jj-btn--brochure, button.site-header__brochure-btn),
.site-header__actions .site-header__brochure-btn,
.site-header__actions button.site-header__brochure-btn,
button.site-header__brochure-btn,
.site-header__brochure-btn,
.jj-btn--brochure {
  display: none !important;
}

@media (min-width: 1200px) {
  :is(.page-home, .page-about, .page-solutions, .page-services, .page-contact, .page-exhibitions, .page-privacy, .page-error, body) .site-header__actions :is(.site-header__brochure-btn, .jj-btn--brochure, button.site-header__brochure-btn),
  body .site-header .site-header__actions :is(.site-header__brochure-btn, .jj-btn--brochure, button.site-header__brochure-btn),
  button.site-header__brochure-btn,
  .site-header__brochure-btn,
  .jj-btn--brochure {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
    padding: 16px 16px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    padding-inline: 16px !important;
    border-radius: 9999px !important;
    background: #0F1E36 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    font-family: var(--font-heading, 'Manrope', 'Geist', sans-serif) !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em !important;
    cursor: pointer !important;
    gap: 8px !important;
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    flex: 0 0 auto !important;
    box-sizing: border-box !important;
  }

  :is(.page-home, .page-about, .page-solutions, .page-services, .page-contact, .page-exhibitions, .page-privacy, .page-error, body) .site-header__actions :is(.site-header__brochure-btn, .jj-btn--brochure, button.site-header__brochure-btn):hover,
  body .site-header .site-header__actions :is(.site-header__brochure-btn, .jj-btn--brochure, button.site-header__brochure-btn):hover,
  button.site-header__brochure-btn:hover,
  .site-header__brochure-btn:hover,
  .jj-btn--brochure:hover {
    background: #f45d35 !important;
    border-color: #f45d35 !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
    box-shadow: 0px 10px 24px -8px rgba(244, 93, 53, 0.35) !important;
  }

  :is(.page-home, .page-about, .page-solutions, .page-services, .page-contact, .page-exhibitions, .page-privacy, .page-error, body) .site-header__actions :is(.site-header__brochure-btn, .jj-btn--brochure, button.site-header__brochure-btn):active,
  body .site-header .site-header__actions :is(.site-header__brochure-btn, .jj-btn--brochure, button.site-header__brochure-btn):active,
  button.site-header__brochure-btn:active,
  .site-header__brochure-btn:active,
  .jj-btn--brochure:active {
    background: #e04b24 !important;
    border-color: #e04b24 !important;
    transform: translateY(0) !important;
  }
}

.site-header__brochure-btn:focus-visible {
  outline: 2px solid #0088ff !important;
  outline-offset: 2px !important;
}

.site-header__brochure-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

.site-header__brochure-icon svg {
  width: 15px;
  height: 15px;
  stroke: #ffffff;
  fill: none;
}

/* --------------------------------------------------------------------------
   2. Desktop Gated Lead Capture Modal (Image 2)
   -------------------------------------------------------------------------- */
.jj-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
}

.jj-modal-overlay.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.jj-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 25, 47, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: default;
}

.brochure-modal-card {
  position: relative;
  z-index: 2;
  width: min(540px, 100%);
  background: #edf1f7;
  border-radius: 28px;
  padding: 38px 40px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  transform: scale(0.96) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.jj-modal-overlay.is-active .brochure-modal-card {
  transform: scale(1) translateY(0);
}

.brochure-modal__close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.brochure-modal__close:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #0F1E36;
}

.brochure-modal__title {
  font-family: var(--font-heading, 'Geist', sans-serif);
  font-size: 26px;
  font-weight: 700;
  color: #0F1E36;
  margin: 0 0 24px 0;
  letter-spacing: -0.02em;
}

/* --------------------------------------------------------------------------
   3. Brochure Form & Pill Inputs
   -------------------------------------------------------------------------- */
.brochure-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
  margin-bottom: 20px;
}

.brochure-field {
  background: #ffffff;
  border: 1.5px solid transparent;
  border-radius: 9999px;
  padding: 8px 24px 10px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
  min-height: 58px;
  height: 58px;
  width: 100%;
}

.brochure-field-wrap {
  display: flex;
  flex-direction: column;
  position: relative;
  min-width: 0;
  width: 100%;
}

.brochure-field-wrap--half,
.brochure-field--half {
  grid-column: span 1;
}

.brochure-field-wrap--full,
.brochure-field--full {
  grid-column: 1 / -1;
}

.brochure-field:focus-within,
.brochure-field.is-focused {
  border-color: #0088ff;
  box-shadow: 0 0 0 3px rgba(0, 136, 255, 0.18);
}

.brochure-field-wrap.is-invalid .brochure-field,
.brochure-field.is-invalid {
  border-color: var(--color-error, #b3261e) !important;
  box-shadow: inset 0 0 0 1px var(--color-error, #b3261e), 0 0 0 3px rgba(179, 38, 30, 0.15) !important;
}

.brochure-field__error {
  display: none;
  margin: 6px 0 0;
  padding: 0 18px;
  font-family: var(--font-body, 'Manrope', sans-serif);
  font-size: 12px;
  line-height: 1.4;
  color: var(--color-error, #b3261e);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.brochure-field__error:not(:empty),
.brochure-field-wrap.is-invalid .brochure-field__error,
.brochure-field.is-invalid .brochure-field__error,
.brochure-field.is-invalid + .brochure-field__error,
.brochure-form__recaptcha.is-invalid .brochure-field__error {
  display: block !important;
}

.brochure-field__label {
  font-family: var(--font-body, 'Manrope', sans-serif);
  font-size: 11px;
  font-weight: 500;
  color: #8a96a6;
  margin-bottom: 2px;
  line-height: 1.2;
  cursor: text;
}

.brochure-field__input {
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-heading, 'Geist', sans-serif);
  font-size: 15px;
  font-weight: 600;
  color: #0F1E36;
  padding: 0;
  width: 100%;
}

.brochure-field__input::placeholder {
  color: #a0aec0;
  font-weight: 400;
}

.brochure-form__recaptcha {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  margin: 4px 0 16px 0;
  width: 100%;
}

.brochure-form__recaptcha .g-recaptcha {
  display: inline-block;
  transition: outline 0.2s ease;
}

.brochure-form__recaptcha.is-invalid .g-recaptcha {
  outline: 2px solid var(--color-error, #b3261e);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (max-width: 480px) {
  .brochure-form__recaptcha {
    transform: scale(0.92);
    transform-origin: left center;
  }
}

.brochure-form__status {
  font-family: var(--font-body, 'Manrope', sans-serif);
  font-size: 13.5px;
  min-height: 22px;
  margin-bottom: 12px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.brochure-form__status.is-success {
  color: #15803d;
}

.brochure-form__status.is-error {
  color: var(--color-error, #b3261e);
}

.brochure-form__actions {
  display: flex;
}

.brochure-form__submit {
  height: 46px;
  padding: 0 28px;
  border-radius: 9999px;
  background: #0F1E36;
  color: #ffffff;
  font-family: var(--font-heading, 'Geist', sans-serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
}

.brochure-form__submit:hover {
  background: #193154;
  transform: translateY(-1px);
}

.brochure-form__submit:active {
  transform: translateY(0);
}

.brochure-form__submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.jj-btn--block {
  width: 100% !important;
}

/* --------------------------------------------------------------------------
   4. Mobile Navigation Drawer Integration (Image 3)
   -------------------------------------------------------------------------- */
@media (max-width: 1199.98px) {
  /* Hide desktop header brochure pill on mobile screens */
  :is(.page-home, .page-about, .page-solutions, .page-services, .page-contact, .page-exhibitions, .page-privacy, .page-error, body) .site-header__actions :is(.site-header__brochure-btn, .jj-btn--brochure, button.site-header__brochure-btn),
  body .site-header .site-header__actions :is(.site-header__brochure-btn, .jj-btn--brochure, button.site-header__brochure-btn),
  .site-header__actions .site-header__brochure-btn,
  .site-header__actions button.site-header__brochure-btn,
  button.site-header__brochure-btn,
  .site-header__brochure-btn,
  .jj-btn--brochure {
    display: none !important;
  }

  /* Mobile Drawer Full Screen / Scrollable Container */
  .primary-nav {
    background: #edf1f7 !important;
    padding: 20px 20px 36px 20px !important;
  }

  /* Mobile Nav Links: with horizontal dividers */
  .primary-nav__list {
    gap: 0 !important;
  }

  .primary-nav__item {
    border-bottom: 1px solid #dce3eb !important;
  }

  .primary-nav__link {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 16px 4px !important;
    font-size: 17px !important;
    font-weight: 600 !important;
    color: #0F1E36 !important;
    background: transparent !important;
    border-radius: 0 !important;
  }

  .primary-nav__link:hover,
  .primary-nav__link.is-active,
  .primary-nav__link[aria-current="page"] {
    background: transparent !important;
    color: #0088ff !important;
  }

  /* Embedded Brochure Form in Mobile Drawer */
  .primary-nav__mobile-brochure {
    display: block !important;
    margin-top: 24px !important;
    padding-top: 6px !important;
  }

  .primary-nav__mobile-brochure .brochure-form__grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
  }

  .primary-nav__mobile-brochure .brochure-field {
    width: 100% !important;
    grid-column: span 2 !important;
  }

  .primary-nav__mobile-brochure .brochure-form__submit {
    width: 100% !important;
    height: 52px !important;
    font-size: 16px !important;
  }

  .primary-nav__mobile-brochure .brochure-form__recaptcha {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 8px 0 16px 0 !important;
    width: 100% !important;
    overflow: hidden !important;
  }

  .primary-nav__mobile-brochure .brochure-form__recaptcha .g-recaptcha {
    transform: scale(0.88);
    transform-origin: center center;
  }

  @media (max-width: 360px) {
    .primary-nav__mobile-brochure .brochure-form__recaptcha .g-recaptcha {
      transform: scale(0.8);
    }
  }
}

/* Safety guard: remove mobile header (logo & close button) and chevrons */
.primary-nav__mobile-header,
.primary-nav__mobile-brand,
.primary-nav__mobile-close,
.primary-nav__chevron {
  display: none !important;
}

/* On Desktop: hide mobile-only brochure container */
@media (min-width: 1200px) {
  .primary-nav__mobile-brochure {
    display: none !important;
  }
}
