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

.jci-contact-directory__group + .jci-contact-directory__group {
  margin-top: clamp(56px, 6vw, 78px);
}

.jci-contact-directory__group > h2 {
  margin: 0 0 28px;
  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__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 42px 38px;
}

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

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

.jci-contact-location__details {
  display: grid;
  gap: 8px;
  color: #343943;
  font-size: 13px;
  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 .ico-contact,
.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-social-icon svg {
  display: block;
  width: 16px;
  height: 16px;
  color: inherit;
}

.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-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: 20px;
}

.jci-contact-representatives__intro :where(p, li, strong, em, a) {
  color: inherit;
}

.jci-contact-representatives__layout {
  position: relative;
  min-width: 0;
  margin-top: 28px;
}

.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 {
  position: relative;
  min-width: 0;
}

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

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

.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 {
  cursor: pointer;
}

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

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

.jci-contact-representatives .jci-agent-card {
  box-sizing: border-box;
  width: clamp(300px, 29vw, 430px);
  max-width: 100%;
  padding-right: 44px;
  overflow-wrap: anywhere;
}

.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;
}

.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;
  pointer-events: none;
}

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

.jci-agent-connector {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.jci-agent-connector polyline {
  fill: none;
  stroke: #487cff;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

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

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

  .jci-contact-directory__group--institute .jci-contact-sites__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .jci-contact-representatives .jci-agent-layout {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    column-gap: 28px;
    align-items: stretch;
    width: 100%;
    min-height: clamp(400px, 33vw, 540px);
  }

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

  .jci-contact-representatives .aim-list.desktop {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 140px;
    padding: 0;
    overflow: visible;
  }

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

  .jci-contact-representatives .jci-agent-map-column {
    grid-column: 2;
    min-height: clamp(400px, 33vw, 540px);
  }

  .jci-contact-representatives .aim-map-wrap {
    width: 100%;
    min-height: clamp(400px, 33vw, 540px);
    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: 959px) {
  .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; width: 100%; }
  .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-y: auto;
    scrollbar-width: none;
  }
  .jci-contact-representatives .aim-options::-webkit-scrollbar { display: none; }
  .jci-contact-representatives .aim-options .aim-btn {
    display: block;
    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; }
  .jci-contact-representatives .jci-agent-card { position: relative; width: 100%; }
  .jci-agent-scroll-indicator,
  .jci-agent-connector { display: none; }
}

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