/* Contact search — Stitch mockup look, scoped to .dhgs (no framework deps) */

.dhgs {
  /* site palette: primary #0073b0 (NESTRO blue), darker step for hover */
  --dhgs-blue: #0073b0;
  --dhgs-darkblue: #005b9f;
  --dhgs-accent: #029ce6;
  --dhgs-gray: #f4f6f8;
  --dhgs-border: #dbe2e8;
  --dhgs-text: #1e293b;
  --dhgs-muted: #64748b;

  position: relative;
  /* Column flex lets the content vertically center when the section is
     stretched to the background map's height (JS sets min-height). */
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: 40px 15px;
  color: var(--dhgs-text);
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.dhgs *,
.dhgs *::before,
.dhgs *::after {
  box-sizing: border-box;
}

/* World map as background decoration only — real <img> keeps the URL out of inline style */
.dhgs__bg-map {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(1100px, 100%);
  /* JS stretches it over the team block in compact mode — contain keeps the
     map proportion instead of distorting it */
  object-fit: contain;
  opacity: 0.18;
  pointer-events: none;
}



.dhgs__inner {
  position: relative;
  width: 100%;
  max-width: 1100px;
  /* auto top+bottom margins center the block inside the flex column */
  margin: auto;
}

@media (min-width: 721px) {
  .dhgs__inner {
    margin-top: 50px;
  }
}

.dhgs__icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.12em;
  fill: currentColor;
}

/* ---------- Filter panel ---------- */

.dhgs__panel {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 28px;
  /* translucent so the map shows through; solid on interaction for contrast */
  background: rgb(255 255 255 / 80%);
  border: 1px solid var(--dhgs-border);
  border-top: 4px solid var(--dhgs-blue);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(15, 40, 60, 0.12);
  transition: background-color 0.2s ease;
}

.dhgs__panel:hover,
.dhgs__panel:focus-within {
  background: #fff;
}

.dhgs__panel-title {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #0f172a;
}

.dhgs__panel-subtitle {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--dhgs-muted);
}

.dhgs__form {
  margin-bottom: 40px;
}

.dhgs__grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 14px;
  align-items: end;
}

/* No PLZ column: center the remaining country + actions as one block. */
.dhgs__grid--no-plz {
  grid-template-columns: minmax(0, 480px) auto;
  justify-content: center;
}

.dhgs__field label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dhgs-muted);
}

.dhgs__field label .dhgs__icon {
  color: var(--dhgs-blue);
  margin-right: 4px;
}

.dhgs__field[hidden] {
  display: none;
}

.dhgs__input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--dhgs-text);
  background: var(--dhgs-gray);
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dhgs__input:focus {
  outline: none;
  border-color: var(--dhgs-blue);
  box-shadow: 0 0 0 2px rgba(0, 91, 159, 0.25);
}

/* Searchable country combobox */

.dhgs__combo {
  position: relative;
}

.dhgs__combo-toggle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dhgs-muted);
  cursor: pointer;
}

.dhgs__options {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 240px;
  margin: 0;
  padding: 4px 0;
  overflow-y: auto;
  /* touch scroll must be possible — select happens on click, not pointerdown */
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  list-style: none;
  background: #fff;
  border: 1px solid var(--dhgs-border);
  border-radius: 6px;
  box-shadow: 0 12px 28px rgba(15, 40, 60, 0.18);
}

.dhgs__options li {
  padding: 9px 12px;
  font-size: 14px;
  cursor: pointer;
}

.dhgs__options li[hidden] {
  display: none;
}

.dhgs__options li:hover,
.dhgs__options li.is-active {
  background: #eff6ff;
  color: var(--dhgs-darkblue);
}

.dhgs__options li[aria-selected="true"] {
  font-weight: 700;
}

/* Country options indent under their continent group label */
[data-cs-country-list] li {
  padding-left: 34px;
}

/* Group headers stay flush-left so the indent reads as nesting */
[data-cs-country-list] li.dhgs__optgroup {
  padding-left: 12px;
}

.dhgs__input.is-invalid {
  border-color: #dc2626;
}

/* Continent separator inside the country listbox */

.dhgs__optgroup {
  padding: 10px 12px 3px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  cursor: default;
}

/* "Nothing matched" row — status text, not an option. pointer-events:none
   also kills :hover, so no extra override needed. */
.dhgs__options li.dhgs__no-match {
  padding-left: 12px;
  color: var(--dhgs-muted);
  font-style: italic;
  cursor: default;
  pointer-events: none;
}

/* Buttons */

.dhgs__actions {
  display: flex;
  gap: 8px;
}

.dhgs__btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 0;
  border-radius: 6px;
  background: var(--dhgs-blue);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 91, 159, 0.3);
  transition: background 0.15s ease;
  white-space: nowrap;
}

.dhgs__btn-primary:hover {
  background: var(--dhgs-darkblue);
}

/* First visit: soft expanding ring nudges the user to click once. Removed
   by JS after the first successful search (.is-armed). */
.dhgs__btn-primary.is-armed {
  animation: dhgs-btn-pulse 2s ease-out infinite;
}

@keyframes dhgs-btn-pulse {
  0% {
    box-shadow: 0 4px 10px rgba(0, 115, 176, 0.3), 0 0 0 0 rgba(0, 115, 176, 0.45);
  }
  70% {
    box-shadow: 0 4px 10px rgba(0, 115, 176, 0.3), 0 0 0 12px rgba(0, 115, 176, 0);
  }
  100% {
    box-shadow: 0 4px 10px rgba(0, 115, 176, 0.3), 0 0 0 0 rgba(0, 115, 176, 0);
  }
}


.dhgs__btn-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f1f5f9;
  color: var(--dhgs-muted);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.dhgs__btn-reset:hover {
  background: #e2e8f0;
}

/* Result pagination dots */

.dhgs__pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 24px 0 8px;
}

.dhgs__pager[hidden] {
  display: none;
}

.dhgs__dot {
  width: 12px;
  height: 12px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #cbd5e1;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.dhgs__dot:hover {
  background: #94a3b8;
}

.dhgs__dot.is-active {
  background: var(--dhgs-blue);
  transform: scale(1.25);
}

/* ---------- Status bar ---------- */

.dhgs__status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  /* carries the panel→results gap: it's hidden until the first search, so
     the empty panel no longer pays for spacing it doesn't need */
  margin: 40px 0 24px;
  padding: 10px 16px;
  font-size: 14px;
  background: var(--dhgs-gray);
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.dhgs__status[hidden] {
  display: none;
}

.dhgs__status-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  /* padding cancels via negative margin — flash bg needs room without
     shifting the layout */
  margin: -2px -8px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

/* Brief flash when the status first appears after a search. */
.dhgs__status.is-new .dhgs__status-text {
  animation: dhgs-status-flash 1.4s ease;
}

@keyframes dhgs-status-flash {
  0% {
    background-color: rgba(0, 115, 176, 0.25);
  }
  100% {
    background-color: rgba(0, 115, 176, 0);
  }
}

.dhgs__status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
}

.dhgs__status-count {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dhgs-muted);
}

.dhgs__hint {
  margin: 20px;
  padding: 10px 14px;
  text-align: center;
  font-size: 13px;
  color: var(--dhgs-muted);
  background: rgba(0, 115, 176, 0.08);
  border-radius: 8px;
}

.dhgs__hint:empty {
  display: none;
}

/* ---------- Cards ---------- */

.dhgs__cards {
  /* Flex-wrap (not grid) so a lone last-row card centers, not left-aligns. */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px;
  align-items: stretch;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

/* Without this the author display:grid would override the hidden attribute. */
.dhgs__cards[hidden] {
  display: none;
}

/* Plays whenever the grid re-appears (display:none restarts animations). */
.dhgs__cards:not([hidden]) {
  animation: dhgs-cards-in 0.28s ease;
}

.dhgs__cards.is-fading {
  opacity: 0;
  transform: translateY(6px);
}

/* Selection changed after a search: old cards dim and a light band sweeps
   across — the brief debounced refetch still reads as progress. */
.dhgs__cards {
  position: relative;
}

.dhgs__cards.is-stale {
  opacity: 0.45;
  /* Keep the sweeping band inside the grid so it can't cause overflow. */
  overflow: hidden;
}

.dhgs__cards.is-stale::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.75) 50%,
    transparent 60%
  );
  transform: translateX(-100%);
  animation: dhgs-sweep 1.1s ease-in-out infinite;
}

@keyframes dhgs-sweep {
  to {
    transform: translateX(100%);
  }
}

@keyframes dhgs-cards-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* Wrap stretches so every card in a row matches the tallest one. */
.dhgs__card-wrap {
  display: flex;
  /* Up to three cards per row; fewer stay centered instead of stretching. */
  flex: 0 1 calc((100% - 56px) / 3);
  min-width: 280px;
}

.dhgs__card {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(15, 40, 60, 0.08);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.dhgs__card:hover {
  box-shadow: 0 10px 26px rgba(15, 40, 60, 0.16);
}

.dhgs__card-bar {
  height: 6px;
  background: var(--dhgs-blue);
}

.dhgs__card-head {
  display: flex;
  gap: 16px;
  /* Reserve space for a two-line name + position so the info block below
     starts at the same height on every card. */
  min-height: 140px;
  padding: 22px 22px 0;
}

.dhgs__avatar {
  position: relative;
  flex: 0 0 88px;
  height: 104px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  overflow: hidden;
}

.dhgs__avatar b {
  font-size: 26px;
  font-weight: 800;
  color: #64748b;
}

.dhgs__avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dhgs__avatar span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2px 0;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
  color: #fff;
  background: rgba(15, 23, 42, 0.6);
}

.dhgs__tag {
  display: inline-block;
  margin-bottom: 5px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dhgs-blue);
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 4px;
}

.dhgs__card-id h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
  color: #0f172a;
}

.dhgs__position {
  margin: 3px 0 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--dhgs-muted);
}

.dhgs__card-contact {
  margin: 18px 22px 0;
  padding: 14px 0 0;
  border-top: 1px solid #eef2f6;
  font-size: 12px;
  /* Room for the max three contact rows keeps Informationen aligned. */
  min-height: 90px;
}

.dhgs__contact-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.dhgs__contact-row dt {
  flex: 0 0 52px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}

.dhgs__contact-row dd {
  margin: 0;
  font-weight: 600;
  color: #1e293b;
  text-align: right;
}

.dhgs__contact-row a {
  color: inherit;
  text-decoration: none;
}

.dhgs__contact-row a:hover {
  color: var(--dhgs-blue);
  text-decoration: underline;
}

.dhgs__territory {
  margin: 4px 22px 0;
  padding-top: 10px;
  border-top: 1px solid #eef2f6;
}

.dhgs__territory span {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}

.dhgs__territory p {
  margin: 0;
  padding: 8px;
  font-size: 11px;
  line-height: 1.5;
  color: #334155;
  background: var(--dhgs-gray);
  border: 1px solid #e2e8f0;
  border-radius: 4px;
}

.dhgs__card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding: 18px 22px 22px;
}

.dhgs__btn-mail {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  background: var(--dhgs-blue);
  border-radius: 4px;
  transition: background 0.15s ease;
}

.dhgs__btn-mail:hover {
  color: #fff;
  background: var(--dhgs-darkblue);
}

.dhgs__btn-vcard {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease;
}

.dhgs__btn-vcard:hover {
  background: #e2e8f0;
}

/* ---------- Help box ---------- */

.dhgs__help {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 48px;
  padding: 20px 24px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
}

.dhgs__help-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  color: var(--dhgs-blue);
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 91, 159, 0.15);
}

.dhgs__help-icon .dhgs__icon {
  width: 22px;
  height: 22px;
}

.dhgs__help-body {
  flex: 1 1 300px;
}

.dhgs__help-body strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--dhgs-darkblue);
}

.dhgs__help-body p {
  margin: 3px 0 0;
  font-size: 13px;
  color: #475569;
}

.dhgs__help-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dhgs__btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  background: var(--dhgs-darkblue);
  border-radius: 4px;
}

.dhgs__btn-ghost:hover {
  background: var(--dhgs-blue);
}

.dhgs__btn-plain {
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--dhgs-darkblue);
  text-decoration: none;
  background: #fff;
  border: 1px solid #93c5fd;
  border-radius: 4px;
}

.dhgs__btn-plain:hover {
  background: #eff6ff;
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  .dhgs__grid,
  .dhgs__grid--no-plz {
    grid-template-columns: 1fr;
  }

  .dhgs__card-wrap {
    flex-basis: 100%;
  }

  .dhgs__actions {
    justify-content: stretch;
  }

  .dhgs__btn-primary {
    flex: 1;
    justify-content: center;
  }

  .dhgs__help {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Finger-sized tap targets; 16px font also stops iOS focus-zoom. */
  .dhgs__input {
    min-height: 44px;
    font-size: 16px;
  }

  .dhgs__options li {
    padding-top: 12px;
    padding-bottom: 12px;
    font-size: 15px;
  }

  .dhgs__btn-primary,
  .dhgs__btn-reset {
    min-height: 44px;
  }

  .dhgs__btn-mail,
  .dhgs__btn-vcard {
    min-height: 40px;
  }

  .dhgs__status {
    justify-content: center;
  }
}
