/**
 * Contact us directory and international representatives.
 * Loaded only on Contact and its WPML translations.
 */

/**
 * Contact uses the shared 16px reading size across viewport widths.
 */
.jci-contact-page-layout {
  --jci-contact-section-space: clamp(48px, 5vw, 72px);
  --jci-contact-group-space: clamp(52px, 4.5vw, 68px);
  --jci-contact-heading-content-space: clamp(28px, 2.4vw, 34px);
  --jci-contact-row-space: clamp(44px, 3.8vw, 56px);
  font-size: 16px;
  line-height: 1.5;
}

.jci-contact-page-layout h3 {
  letter-spacing: -.5px;
}

.jci-contact-page-layout p {
  font-size: 16px;
}

/* Contact follows the tighter vertical rhythm of the approved layout rather
 * than the more generous generic institutional-page section spacing. */
.jci-contact-page-layout .jci-institutional-section {
  padding-block: var(--jci-contact-section-space);
}

.jci-contact-page-layout .jci-institutional-section--after-page-heading {
  padding-top: var(--jci-page-title-media-gap);
}

.jci-contact-directory__group + .jci-contact-directory__group {
  margin-top: var(--jci-contact-group-space);
}

.jci-contact-directory__group > h2 {
  margin: 0 0 var(--jci-contact-heading-content-space);
  padding-bottom: 12px;
  border-bottom: 8px solid #f1eff0;
  color: var(--jci-institutional-blue);
}

.jci-contact-directory__group > .jci-contact-directory__subheading {
  padding-bottom: 12px;
  border-bottom-width: 1px;
  border-bottom-color: rgba(4, 28, 64, 0.18);
  color: var(--jci-institutional-navy);
}

.jci-contact-sites__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 42px 38px;
}

.jci-contact-sites__row + .jci-contact-sites__row {
  margin-top: var(--jci-contact-row-space);
}

.jci-contact-site {
  min-width: 0;
}

.jci-contact-site__locations {
  display: grid;
  gap: 28px;
}

.jci-contact-site__location {
  min-width: 0;
}

.jci-contact-site__location-title {
  margin: 0 0 14px;
  color: var(--jci-institutional-navy);
  font-size: var(--font-size-14, 14px);
  font-weight: 700;
  line-height: 1.3;
}

.jci-contact-location__title {
  margin: 0 0 16px;
  padding: 0;
  color: #171b22;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
}

.jci-contact-location__title-main,
.jci-contact-location__title-subtitle {
  display: block;
}

.jci-contact-location__title-subtitle {
  margin-top: 2px;
}

.jci-contact-location__details {
  display: grid;
  gap: 8px;
  color: #343943;
  line-height: 1.32;
}

.jci-contact-location__detail {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  column-gap: 7px;
  min-width: 0;
}

.jci-contact-location__detail .jci-contact-location__icon,
.jci-contact-location__detail .jci-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-top: 0.08em;
  color: #487cff;
  font-size: 16px;
}

.jci-contact-location__detail .jci-contact-location__icon svg,
.jci-contact-location__detail .jci-social-icon svg {
  display: block;
  width: 16px;
  height: 16px;
  color: inherit;
}

.jci-contact-location__detail .jci-contact-location__icon svg[fill]:not([fill="none"]),
.jci-contact-location__detail .jci-contact-location__icon svg [fill]:not([fill="none"]),
.jci-contact-location__detail .jci-social-icon svg[fill]:not([fill="none"]),
.jci-contact-location__detail .jci-social-icon svg [fill]:not([fill="none"]) {
  fill: currentColor;
}

.jci-contact-location__detail .jci-contact-location__icon svg[stroke]:not([stroke="none"]),
.jci-contact-location__detail .jci-contact-location__icon svg [stroke]:not([stroke="none"]),
.jci-contact-location__detail .jci-social-icon svg[stroke]:not([stroke="none"]),
.jci-contact-location__detail .jci-social-icon svg [stroke]:not([stroke="none"]) {
  stroke: currentColor;
}

.jci-contact-location__detail a {
  min-width: 0;
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.jci-contact-location__detail a:hover,
.jci-contact-location__detail a:focus-visible {
  color: #487cff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.jci-contact-location__detail a:focus-visible,
.jci-contact-representatives .aim-btn:focus-visible {
  outline: 2px solid #487cff;
  outline-offset: 3px;
}

.jci-contact-representatives-section h2 {
  margin: 0;
  color: var(--jci-institutional-blue);
}

.jci-contact-representatives__intro {
  max-width: 840px;
  margin-top: 18px;
}

.jci-contact-representatives__layout {
  margin-top: 30px;
  box-sizing: border-box;
  overflow: visible;
}

.jci-contact-representatives__layout > .col-12 {
  box-sizing: border-box;
  width: min(91vw, 1600px) !important;
  max-width: none !important;
  padding-inline: 0 !important;
}

.jci-contact-representatives .jci-agent-layout,
.jci-contact-representatives .jci-agent-list-column,
.jci-contact-representatives .jci-agent-map-column,
.jci-contact-representatives .aim-map-wrap {
  min-width: 0;
  position: relative;
}

.jci-contact-representatives .jci-agent-map-column {
  flex: 1 1 0;
}

.jci-contact-representatives .aim-map-wrap > svg {
  display: block;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
}

.jci-contact-representatives .aim-map-wrap svg :is(path, polygon) {
  transition: fill 150ms ease;
}

.jci-contact-representatives .aim-map-wrap svg :is(path, polygon).jci-has-representative:is(:hover, :focus, .hovered, .active, .jci-map-hover, .jci-map-active) {
  fill: #487cff !important;
}

.jci-contact-representatives .aim-map-wrap svg :is(path, polygon).jci-has-representative {
  cursor: pointer;
}

.jci-contact-representatives .aim-map-wrap svg :is(path, polygon).jci-no-representative {
  pointer-events: none;
  cursor: default;
}

.jci-contact-representatives .jci-agent-card {
  box-sizing: border-box;
  width: clamp(320px, 30vw, 460px);
  max-width: 100%;
  padding-right: 48px;
  border-left: 4px solid #487cff;
  background: #fff;
  overflow-wrap: anywhere;
}

.jci-contact-representatives .aim-btn.is-map-hovered {
  color: #487cff;
  font-weight: 600;
}

.jci-contact-representatives .jci-agent-card .aim-row > :is(a, span),
.jci-contact-representatives .jci-agent-card a[href^="mailto:"] {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: none;
}

.jci-agent-card__close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #07183a;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.jci-agent-card__close:hover {
  color: #487cff;
}

.jci-agent-card__close:focus-visible {
  outline: 2px solid #487cff;
  outline-offset: 2px;
}

.jci-agent-scroll-indicator {
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  width: 100%;
  height: 38px;
  background: linear-gradient(to bottom, rgba(236, 242, 255, 0), #ecf2ff 55%);
  color: #487cff;
  font-size: 24px;
  line-height: 1;
  pointer-events: none;
}

.jci-agent-scroll-indicator[hidden] {
  display: none;
}

@media (min-width: 769px) {
  .jci-contact-representatives .jci-agent-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 150px) minmax(0, 1fr);
    column-gap: 24px;
    align-items: stretch;
    width: 100% !important;
    min-height: clamp(540px, 43vw, 760px);
  }

  .jci-contact-representatives .jci-agent-list-column {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    width: 150px;
    min-height: 0;
    max-height: none;
  }

  .jci-contact-representatives .aim-list.desktop {
    display: flex !important;
    flex: 0 0 auto !important;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100% !important;
    max-width: 150px !important;
    min-height: 0;
    max-height: none !important;
    padding: 0;
    overflow: visible !important;
  }

  .jci-contact-representatives .aim-list.desktop::-webkit-scrollbar {
    display: none;
  }

  .jci-contact-representatives .aim-list.desktop > * {
    flex: 0 0 auto;
    width: 100%;
    box-sizing: border-box;
  }

  .jci-contact-representatives .aim-list.mobile,
  .jci-contact-representatives .aim-dropdown {
    display: none !important;
  }

  .jci-contact-representatives .jci-agent-map-column {
    grid-column: 2;
    width: 100%;
    min-height: clamp(540px, 43vw, 760px);
  }

  .jci-contact-representatives .aim-map-wrap {
    flex: 1 1 0 !important;
    width: 100% !important;
    min-height: clamp(540px, 43vw, 760px) !important;
    max-width: none !important;
    overflow: visible;
  }

  .jci-contact-representatives .jci-agent-card {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 5;
  }

  .jci-contact-representatives .jci-agent-card.is-position-left {
    left: 16px;
    right: auto;
  }

  .jci-contact-representatives .jci-agent-card.is-position-right {
    right: 16px;
    left: auto;
  }

  .jci-contact-representatives .jci-agent-card.is-position-top {
    top: 16px;
    bottom: auto;
  }

  .jci-contact-representatives .jci-agent-card.is-position-bottom {
    bottom: 16px;
    top: auto;
  }
}

@media (max-width: 768px) {
  .jci-contact-page-layout {
    font-size: 16px;
  }

  .jci-contact-page-layout .jci-contact-location__title {
    font-size: 16px;
  }

  .jci-contact-page-layout p {
    font-size: 16px;
  }

  /* The [agents_map] plugin uses a column flex layout on mobile. Its
     flex: 1 map column otherwise collapses when legacy CSS removes the
     minimum height. Size the column from the SVG's native 900:500 ratio. */
  .jci-contact-representatives .aim-right {
    display: block;
    flex: none;
    width: 100%;
    overflow: visible;
  }

  .jci-contact-representatives .aim-map-wrap {
    display: block;
    flex: none;
    width: calc(100% + 32px);
    margin-inline: -16px;
    aspect-ratio: 9 / 5;
  }

  .jci-contact-representatives .aim-map-wrap > svg {
    width: 100%;
    height: auto !important;
  }

  .jci-contact-representatives__layout {
    width: 100%;
    margin-top: 14px;
  }

  .jci-contact-representatives__layout > .col-12 {
    width: 100% !important;
  }

  .jci-contact-representatives .jci-agent-layout {
    display: flex;
    flex-direction: column;
  }

  .jci-contact-representatives .jci-agent-list-column {
    display: none;
  }

  .jci-contact-representatives .aim-list.mobile {
    display: block !important;
    width: 100%;
    max-width: 100%;
    padding: 0;
  }

  .jci-contact-representatives .aim-dropdown {
    display: block;
  }

  .jci-contact-representatives .aim-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 8px;
    background: #eaf0ff;
    color: #487cff;
    font-weight: 500;
    list-style: none;
    cursor: pointer;
  }

  .jci-contact-representatives .aim-dropdown-toggle::-webkit-details-marker {
    display: none;
  }

  .jci-contact-representatives .aim-chevron {
    transition: transform 200ms ease;
  }

  .jci-contact-representatives .aim-dropdown[open] .aim-chevron {
    transform: rotate(180deg);
  }

  .jci-contact-representatives .aim-options {
    display: flex;
    flex-direction: column;
    max-height: min(50vh, 420px);
    margin-top: 4px;
    border: 1px solid #e0e6f5;
    border-radius: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  .jci-contact-representatives .aim-options::-webkit-scrollbar {
    display: none;
  }

  .jci-contact-representatives .aim-options .aim-btn {
    display: block;
    flex: 0 0 auto;
    width: 100%;
    padding: 12px 16px;
    border: 0;
    border-bottom: 1px solid #f0f3fa;
    background: #fff;
    text-align: left;
    cursor: pointer;
  }

  .jci-contact-representatives .aim-options .aim-btn:last-child {
    border-bottom: 0;
  }

  .jci-contact-representatives .aim-options .aim-btn:hover,
  .jci-contact-representatives .aim-options .aim-btn:focus-visible {
    background: #f5f8ff;
  }

  /* Keep the panel inside the plugin wrapper's rounded, clipped edges.
     The previous full-width panel placed its left border outside the paint area. */
  .jci-contact-representatives .aim-right > .aim-panel {
    position: relative;
    box-sizing: border-box;
    width: calc(100% - 24px);
    max-width: 100%;
    margin-inline: 12px;
    margin-block: 0;
    padding: 20px 48px 20px 20px;
    border: 0;
    border-left: 8px solid #487cff;
    border-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    background: #fff;
    box-shadow: none;
    overflow: hidden;
    clip-path: inset(0 round 0);
    font-size: 16px;
    line-height: 1.5;
  }

  .jci-contact-representatives .aim-right > .aim-panel .aim-panel-title,
  .jci-contact-representatives .aim-right > .aim-panel .aim-row,
  .jci-contact-representatives .aim-right > .aim-panel .aim-row > :is(a, span) {
    font-size: 16px;
    line-height: 1.5;
  }

  .jci-agent-scroll-indicator {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .jci-contact-representatives .aim-map-wrap svg :is(path, polygon),
  .jci-contact-representatives .aim-chevron {
    transition: none;
  }
}

@media (min-width: 640px) {
  .jci-contact-sites__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 960px) {
  .jci-contact-sites__row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .jci-contact-directory__group--institute .jci-contact-sites__row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
