/* ASY Legal theme repairs. Load after home-echo.css. */

/* Nested links own their colours. The page palettes still own the primary navigation. */
@media (min-width: 1025px) {
  #site-header .asy-nav-list > li > .sub-menu {
    --asy-menu-surface: #182737;
    --asy-menu-text: #f6f2eb;
    --asy-menu-over: #32495a;
    --asy-menu-focus: #f1d1a2;
    background: var(--asy-menu-surface);
    border-color: #52606b;
  }

  #site-header .asy-nav-list > li > .sub-menu > li > a {
    color: var(--asy-menu-text);
    /* The theme forces every desktop nav link onto one line. Submenu labels may wrap. */
    white-space: normal !important;
    overflow-wrap: anywhere;
    text-align: start;
    transition: none;
  }

  @media (hover: hover) {
    #site-header .asy-nav-list > li > .sub-menu > li > a:hover {
      background: var(--asy-menu-over);
      color: var(--asy-menu-text);
    }
  }

  #site-header .asy-nav-list > li > .sub-menu > li > a:focus-visible,
  #site-header .asy-nav-list > li > .sub-menu > li > a:active {
    background: var(--asy-menu-over);
    color: var(--asy-menu-text);
    outline: 2px solid var(--asy-menu-focus);
    outline-offset: -3px;
  }
}

#site-header .asy-lang-option__abbr {
  color: #485e69;
}
@media (prefers-reduced-motion: reduce) {
  #site-header .asy-nav-list .menu-item-has-children > .sub-menu,
  #site-header .asy-header-lang .asy-lang-trigger__chevron {
    transition: none;
  }
}

/* Keep the photograph visible, and shade the band occupied by navigation at the top. */
body:is(.page-template-page-about, .page-template-page-practices, .post-type-archive-insight, .tax-insight_category, .page-template-page-contact)
#site-header.asy-site-header--transparent:not(.scrolled):not(:has(#main-nav.open))::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0 0 -24px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(14, 30, 41, .73) 0%, rgba(14, 30, 41, .70) calc(100% - 24px), transparent);
}

#site-header.asy-site-header--transparent:not(.scrolled) .asy-lang-trigger {
  background: #233843;
  color: #fff8ed;
  border-color: #80939a;
}

#site-header.asy-site-header--transparent:not(.scrolled) .asy-header-cta {
  /* The template-specific photo headers force the CTA fill, border and text. */
  background: #233843 !important;
  color: #fff8ed !important;
  border-color: #80939a !important;
}

@media (hover: hover) {
  #site-header.asy-site-header--transparent:not(.scrolled) :is(.asy-header-cta, .asy-lang-trigger):hover {
    text-decoration: underline;
    text-underline-offset: .22em;
  }
}
#site-header.asy-site-header--transparent:not(.scrolled) :is(.asy-header-cta, .asy-lang-trigger):focus-visible {
  outline: 2px solid #fff8ed;
  outline-offset: 2px;
  box-shadow: 0 0 0 6px #223842;
}

#site-header .asy-sub-toggle {
  display: none;
}

/* Escape dismisses a keyboard or pointer disclosure even while its trigger retains focus. */
@media (min-width: 1025px) {
  #site-header .menu-item-has-children[data-asy-dismissed] > .sub-menu {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }
}

@media (max-width: 1024px) {
  /* The existing drawer declares its geometry and row spacing with !important. */
  #main-nav.open {
    justify-content: flex-start !important;
    padding: max(88px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left)) !important;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  #main-nav .asy-nav-list {
    flex: none;
    max-width: 24rem !important;
  }

  #main-nav .asy-nav-list > li > a {
    min-height: 46px;
    padding: 11px 12px !important;
    line-height: 1.3;
  }

  #main-nav .menu-item-has-children {
    position: relative;
  }

  #main-nav .menu-item-has-children > a {
    margin-inline-end: 48px;
    padding-inline-start: 52px !important;
  }

  #main-nav .menu-item-has-children > a::before {
    display: none;
  }

  /* Until the repair script binds it, the arrow is not shown (the submenu links stay open and reachable). */
  html:not([data-asy-nav-ready]) #site-header .asy-sub-toggle {
    display: none !important;
  }

  #site-header .asy-sub-toggle {
    position: absolute;
    inset-block-start: 0;
    inset-inline-end: 0;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    color: #f1d1a2;
    border: 1px solid #687885;
    border-radius: 5px;
    cursor: pointer;
  }

  #site-header .asy-sub-toggle::before {
    content: '';
    width: 9px;
    height: 9px;
    border: solid currentColor;
    border-width: 0 1.5px 1.5px 0;
    transform: translateY(-2px) rotate(45deg);
  }

  #site-header .asy-sub-toggle[aria-expanded="true"]::before {
    transform: translateY(2px) rotate(225deg);
  }

  /* Hidden only once the repair script has bound the toggle, so the links stay reachable if the script fails. */
  html[data-asy-nav-ready] #main-nav .asy-sub-toggle[aria-expanded="false"] + .sub-menu {
    display: none !important;
  }

  #main-nav .sub-menu > li > a {
    padding: 9px 14px !important;
    min-height: 40px;
    font-family: var(--font-sans) !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    line-height: 1.45;
    text-align: start !important;
    border-bottom: 0 !important;
  }

  #main-nav :is(button, a):focus-visible,
  #site-header .asy-menu-toggle:focus-visible {
    outline: 2px solid #ffddab;
    outline-offset: -3px;
  }

  body:has(#main-nav.open) .asy-whatsapp-float {
    visibility: hidden;
  }
}

/* These are paper sections. Hero captions and dark feature cards have their own palette. */
body.home #why-asy .asy-section-eyebrow,
body.page-template-page-about :is(.asy-abt-method__header, .asy-abt-affiliations__header) .asy-section-eyebrow,
body.single-practice :is(.asy-practice-single__services, .asy-practice-single__insights) .asy-section-eyebrow {
  color: #765a34;
}

body.page-template-page-about :is(.asy-abt-metric__label, .asy-expmap__role),
body.post-type-archive-partner .asy-partner-card__info :is(.asy-partner-card__role, .asy-partner-card__languages),
body.single-insight :is(.asy-side-author-label, .asy-side-author-role, .asy-related-insights > .asy-section-eyebrow),
body.search .asy-search-result :is(.asy-search-result__type, .asy-search-result__meta) {
  color: #4d6069;
}

body.page-template-page-about .asy-expmap__area--shared,
body.home .asy-partner-card__info .asy-partner-card__link,
body.single-insight :is(.asy-article-content .asy-prose a, .asy-side-author-link, .asy-related-grid .asy-insight-card__read-more) {
  color: #76562d;
}

body.single-insight .asy-prose :is(p, li) a {
  text-decoration: underline;
  text-underline-offset: .16em;
}

body.single-insight .asy-article-hero :is(.asy-breadcrumb a, .asy-article-meta, .asy-article-meta span, .asy-article-meta a, .asy-article-meta time),
body.single-partner .asy-breadcrumb a,
body.single-practice .asy-breadcrumb a,
body.error404 .asy-404 :is(.asy-404__nav-label, .asy-404__nav-link) {
  color: #f3eee7;
}

body.single-practice .asy-partner-cta__inner p {
  color: #e0e7e9;
}

body.single-practice .asy-article-side-card a > span {
  color: #536b77;
}

body.single-practice .asy-partner-cta__inner .asy-btn-primary,
body.error404 .asy-404__actions .asy-btn-primary,
body.search .asy-search-empty .asy-btn-primary {
  color: #1c2932;
  background: #dfc398;
}

body:is(.single-practice, .error404, .search) :is(.asy-partner-cta__inner, .asy-404__actions, .asy-search-empty) .asy-btn-primary:is(:hover, :focus-visible, :active) {
  color: #16212a;
  background: #efdab7;
}

@media (hover: hover) {
  /* The template header buttons set both of these properties with !important. */
  #site-header.scrolled .asy-header-cta:hover {
    background: #405d6a !important;
    color: #fff !important;
  }
}

body.single-insight .asy-prose a:focus-visible,
body:is(.error404, .single-practice) .asy-btn-primary:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 6px #243e4b;
}
@media (hover: hover) {
  body.page-template-page-practices .asy-pd-card__cta:hover {
    color: #355969;
  }
}

body.home .asy-home-contact .asy-form,
body.page-template-page-contact .asy-contact-concierge .asy-form {
  --asy-error: #8a302b;
  --asy-error-edge: #963b33;
  --asy-field-ring: #28536a;
}

body.page-template-page-contact .asy-contact-concierge .asy-form {
  --asy-error: #ffe1d5;
  --asy-error-edge: #ffb59f;
  --asy-field-ring: #f4d7ab;
}

body.page-template-page-contact .asy-contact-concierge__form-panel .asy-form-group :is(input, textarea)::placeholder {
  color: #d5ddde;
  opacity: 1;
}

body.page-template-page-contact .asy-contact-concierge__form-panel .asy-form-group :is(input, select, textarea) {
  border-color: #9eacb2;
}

body.page-template-page-contact .asy-contact-concierge__form-panel .asy-form-group select {
  color: #f5efe6;
}

body:is(.home, .page-template-page-contact) .asy-form .asy-form-group :is(input, select, textarea):focus-visible {
  outline: 2px solid var(--asy-field-ring);
  outline-offset: 2px;
}

body:is(.home, .page-template-page-contact) .asy-form .asy-form-group [aria-invalid="true"] {
  border: 2px solid var(--asy-error-edge);
}

body:is(.home, .page-template-page-contact) .asy-form .asy-field-error {
  display: block;
  margin: 5px 0 0;
  color: var(--asy-error);
  font: 600 .875rem/1.45 var(--font-sans);
  text-transform: none;
  letter-spacing: normal;
}

body:is(.home, .page-template-page-contact) .asy-form .asy-field-error[hidden] {
  display: none;
}

/* Keep the live region in the accessibility tree before the first status message. */
form[data-asy-contact-form] .asy-form-status[role="status"]:empty {
  display: block;
  height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
}

body:is(.home, .single-practice) a.asy-insight-card__read-more {
  width: fit-content;
  text-decoration: underline;
  text-underline-offset: .2em;
}

body:is(.home, .single-practice) a.asy-insight-card__read-more:focus-visible,
body.post-type-archive-partner a.asy-partner-card__portrait:focus-visible {
  outline: 3px solid #31596a;
  outline-offset: -3px;
  box-shadow: inset 0 0 0 6px #fff8e9;
}

/* The previous right-edge mask washed out the final item even at the end of the list. */
.asy-insights-body .asy-hub-filters {
  mask-image: none;
  -webkit-mask-image: none;
  padding: 10px 3px 8px;
  scroll-padding-inline: 3px;
  scrollbar-width: thin;
  scrollbar-color: #6a7e84 #e0dbd2;
}

.asy-insights-body .asy-hub-filters::-webkit-scrollbar {
  display: block;
  height: 6px;
}

.asy-insights-body .asy-hub-filter:focus-visible {
  outline: 2px solid #244857;
  outline-offset: 1px;
}

@media (min-width: 1025px) {
  .asy-insights-body .asy-hub-filters {
    flex-wrap: wrap;
    row-gap: 6px;
    overflow: visible;
  }
}

@media (max-width: 1024px) {
  body.home .asy-slider-dots {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding-top: 4px;
  }
  body.home .asy-slider-dots .asy-slider-dot {
    display: grid;
    place-items: center;
    width: 24px;
    height: 26px;
    padding: 0;
    flex: 0 0 24px;
    border-radius: 4px;
    opacity: 1;
    transform: none;
    background: transparent;
    transition: none;
  }
  body.home .asy-slider-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #51646c;
    border: 1px solid #fffaf0;
    border-radius: 8px;
  }
  body.home .asy-slider-dot.active::before {
    width: 15px;
    height: 7px;
    background: #1f3642;
    box-shadow: 0 0 0 1px #506670;
  }
  body.home .asy-slider-dot:focus-visible {
    outline: 2px solid #23414e;
    outline-offset: -2px;
    box-shadow: inset 0 0 0 4px #fffaf0;
  }
}

/* Keep the editorial size and permit a compound word to break inside its own card. */
html:lang(de) .asy-insight-card .asy-insight-card__title,
html:lang(de) .asy-insight-card .asy-insight-card__title a {
  min-inline-size: 0;
  hyphens: auto;
  overflow-wrap: anywhere;
}
/* Keep the date on the same baseline in Chinese articles. A floated 2 breaks the year 2026. */
html:lang(zh) body.single-insight .asy-prose > p:first-of-type {
  font-style: normal;
  letter-spacing: normal;
}

html:lang(zh) body.single-insight .asy-prose > p:first-of-type::first-letter {
  float: none;
  padding: 0;
  font: inherit;
  color: inherit;
}

html:lang(zh) body.single-insight .asy-article-hero h1 {
  text-wrap: balance;
}

/* A rail taller than the available window cannot keep its lower controls in view while pinned. */
body.single-insight .asy-article-side[data-asy-too-tall] {
  position: static;
}
