/* iadvl-ap UI enhancements
   Subtle polish layered on top of existing Webflow CSS.
   Goals: button feedback, focus visibility, modal/card/dropdown smoothness,
   image fade-in, back-to-top, scroll reveal. No layout/branding changes. */

/* ---------- 1. Buttons: hover, focus, active feedback ---------- */
.read_more_button,
.form_button,
.outline_btn,
.download_button_general_2,
.sidebar_button,
.login-button,
.fp_email_submit,
.foot_link_item {
  transition:
    background-color .2s ease,
    color .2s ease,
    border-color .2s ease,
    box-shadow .2s ease,
    transform .15s ease,
    opacity .2s ease;
}

.read_more_button:hover,
.form_button:hover,
.login-button:hover,
.fp_email_submit:hover {
  background-color: #1a5a9e; /* slightly darker than --theme #226dbb */
  box-shadow: 0 6px 16px rgba(34, 109, 187, 0.22);
  transform: translateY(-1px);
}

.read_more_button:active,
.form_button:active,
.login-button:active,
.fp_email_submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(34, 109, 187, 0.18);
}

.outline_btn:hover {
  background-color: var(--theme);
  color: #fff;
  box-shadow: 0 6px 16px rgba(34, 109, 187, 0.18);
}

.outline_btn:active {
  transform: translateY(1px);
}

/* Stable typography so the button text never shifts on hover/active.
   Webflow's `.w-button` uses `line-height: inherit`, which can drift if a parent
   line-height differs; pinning it here keeps the text glyph centered identically
   across all states. */
.download_button_general_2 {
  line-height: 1.4;
  vertical-align: middle;
}

/* No translateY here on purpose.
   The parent `.heading_and_button_2:hover` already lifts the whole row by -2px,
   so adding another -1px on the button caused the button text to jump relative
   to the row label (the "elevation/unelevation" effect on hover). The shadow
   alone provides the elevated feel for the button itself. */
.download_button_general_2:hover {
  background-color: #1d83b3; /* darker shade of --lite_highlighter #269bcf */
  box-shadow: 0 6px 16px rgba(38, 155, 207, 0.28);
}

.download_button_general_2:active {
  box-shadow: 0 2px 6px rgba(38, 155, 207, 0.22);
}

.sidebar_button {
  border-left-color: transparent;
}

.sidebar_button:hover {
  background-color: rgba(38, 155, 207, 0.06);
  border-left-color: #269bcf;
}

.foot_link_item:hover {
  color: var(--theme) !important;
  opacity: 1;
  transform: translateX(2px);
}

/* ---------- 2. Nav links: subtle transition ---------- */
.nav_link,
.dropdown_link,
.dropdown_toggle {
  transition: color .2s ease, background-color .2s ease, opacity .2s ease;
}

.nav_link:hover {
  opacity: 0.85;
}

/* ---------- 3. Focus-visible (keyboard accessibility) ---------- */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--theme);
  outline-offset: 2px;
  border-radius: 4px;
}

.read_more_button:focus-visible,
.form_button:focus-visible,
.login-button:focus-visible,
.fp_email_submit:focus-visible,
.download_button_general_2:focus-visible {
  outline-offset: 3px;
}

/* ---------- 4. Form input focus + smooth transitions ---------- */
.text_field,
.textarea,
.login-form input[type="email"],
.login-form input[type="password"],
.fp_input_field {
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.text_field:focus,
.textarea:focus,
.login-form input[type="email"]:focus,
.login-form input[type="password"]:focus,
.fp_input_field:focus {
  border-color: var(--theme) !important;
  box-shadow: 0 0 0 3px rgba(34, 109, 187, 0.12);
  outline: none;
}

/* ---------- 5. Modal/popup smooth open/close ---------- */
/* Login modal: inline JS sets style.display, we only fade opacity smoothly. */
.popup_login.site_modal {
  transition: opacity .25s ease;
  pointer-events: none;
}

.popup_login.site_modal.is-open {
  opacity: 1 !important;
  pointer-events: auto;
}

.popup_login.site_modal .auth_wrap {
  transform: scale(0.97) translateY(8px);
  opacity: 0;
  transition: transform .28s cubic-bezier(.2,.8,.25,1), opacity .25s ease;
}

.popup_login.site_modal.is-open .auth_wrap {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Forgot password popup: same approach — JS sets display, we just fade opacity. */
.forgot_pass_popup {
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}

.forgot_pass_popup.is-open {
  opacity: 1;
  pointer-events: auto;
}

.forgot_pass_popup .fp_popup_item {
  transform: scale(0.97) translateY(8px);
  opacity: 0;
  transition: transform .28s cubic-bezier(.2,.8,.25,1), opacity .25s ease;
}

.forgot_pass_popup.is-open .fp_popup_item {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* ---------- 6. Doc cards: subtle lift on hover ---------- */
.heading_and_button_2 {
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  border: 1px solid transparent;
}

.heading_and_button_2:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.06);
  border-color: rgba(34, 109, 187, 0.12);
}

/* Office-bearer / past-office-bearer cards: elevate on hover.
   Base style in iadvl-ap.webflow.css already sets `box-shadow: 0 0 5px #0003`,
   so the hover state lifts the card and deepens the shadow for an elevated feel. */
.officers-stack {
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  will-change: transform;
}

.officers-stack:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.14);
  border-color: rgba(34, 109, 187, 0.18);
}

/* ---------- 7. Dropdown menu: hover-to-open on desktop + smooth fade ----------
   iadvl-ap's webflow.js is a stripped build without the dropdown module,
   so ui-enhancements.js toggles the w--open class on hover. CSS handles the
   smooth fade. Mobile uses the existing webflow nav menu (untouched).

   Note: Webflow's base CSS sets .dropdown_list to a dark background and only
   switches to white, applies min-width and a shadow when .w--open is present.
   Because we keep the list in the layout (display:block + visibility:hidden)
   to allow a fade transition, we must lock background, width and shadow in
   both states inside .nav_menu — otherwise those properties snap back to
   defaults mid-transition (causes background flash + width jump). */
@media screen and (min-width: 992px) {
  .nav_menu .w-dropdown {
    position: relative;
  }
  .nav_menu .dropdown_list.w-dropdown-list,
  .nav_menu .dropdown_list.w-dropdown-list.w--open {
    background-color: #fff;
    min-width: 200px;
    box-shadow: 0 10px .875rem #00000080;
  }
  .nav_menu .dropdown_list.w-dropdown-list {
    display: block;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
    pointer-events: none;
    visibility: hidden;
    position: absolute;
    top: 100%;
    left: 0;
  }
  .nav_menu .w-dropdown.w--open .dropdown_list.w-dropdown-list {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
    transition: opacity .18s ease, transform .18s ease, visibility 0s linear 0s;
  }
}

/* ---------- 8. Image lazy load fade-in ---------- */
img.ap-img-fade {
  opacity: 0;
  transition: opacity .35s ease;
}

img.ap-img-fade.ap-img-loaded {
  opacity: 1;
}

/* ---------- 9. Back-to-top button ---------- */
.ap-back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background-color: var(--theme);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 9000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, background-color .2s ease, visibility 0s linear .2s;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.ap-back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity .2s ease, transform .2s ease, background-color .2s ease, visibility 0s linear 0s;
}

.ap-back-to-top:hover {
  background-color: #1a5a9e;
  transform: translateY(-2px);
}

.ap-back-to-top:active {
  transform: translateY(0);
}

.ap-back-to-top svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}

@media screen and (max-width: 480px) {
  .ap-back-to-top {
    right: 14px;
    bottom: 14px;
    width: 40px;
    height: 40px;
  }
}

/* ---------- 10. Scroll reveal (opt-in via .ap-reveal class on elements) ---------- */
.ap-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .55s ease, transform .55s cubic-bezier(.2,.8,.25,1);
  will-change: opacity, transform;
}

.ap-reveal.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 11. Reduced motion: disable all the above transitions ---------- */
@media (prefers-reduced-motion: reduce) {
  .read_more_button,
  .form_button,
  .outline_btn,
  .download_button_general_2,
  .sidebar_button,
  .login-button,
  .fp_email_submit,
  .foot_link_item,
  .nav_link,
  .dropdown_link,
  .heading_and_button_2,
  .officers-stack,
  .text_field,
  .textarea,
  .login-form input,
  .fp_input_field,
  .ap-back-to-top,
  .popup_login.site_modal,
  .forgot_pass_popup,
  .dropdown_list.w-dropdown-list,
  img.ap-img-fade,
  .ap-reveal {
    transition: none !important;
    transform: none !important;
  }

  .ap-reveal {
    opacity: 1 !important;
  }

  img.ap-img-fade {
    opacity: 1 !important;
  }
}

/* ---------- 12. Misc polish ---------- */
/* Make all <a> tags transition color smoothly (catches in-content links). */
a {
  transition: color .15s ease;
}

/* Slightly improve image rendering during the fade-in. */
img {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
