/* ==========================================================================
   Contact — hero, form section and the office switcher map panel.
   ========================================================================== */

@layer pages {

  .contact-hero {
    position: relative;
    padding-block: var(--space-11);
    overflow: hidden;
    background: var(--surface-page);
    border-bottom: 1px solid var(--line);
  }

  .contact-hero__scrim {
    background: linear-gradient(90deg,
      rgba(8, 7, 4, .94) 0%,
      rgba(8, 7, 4, .78) 38%,
      rgba(8, 7, 4, .34) 66%,
      rgba(8, 7, 4, .08) 100%);
  }

  /* 22px under the eyebrow, matching the home page hero. */
  .contact-hero__title {
    margin-top: var(--space-5);
    max-width: 14ch;
    font-size: clamp(40px, 5vw, 62px);
    line-height: var(--leading-tight);
    letter-spacing: -.015em;
  }

  .contact-hero__lede {
    max-width: 60ch;
    margin-top: 24px;
    font-size: 18px;
    line-height: 1.65;
    color: var(--text-secondary);
  }

  .contact-form-section {
    padding: 104px 0 100px;
    background: var(--surface-deepest);
    border-block: 1px solid var(--line);
  }

  /* --- Offices ------------------------------------------------------------ */
  .offices {
    padding: 88px 0 110px;
    background: var(--surface-raised);
    border-top: 1px solid var(--line);
  }

  .offices__title {
    margin-bottom: 10px;
    font-size: clamp(28px, 3.4vw, 40px);
    letter-spacing: -.015em;
  }

  .offices__lede {
    max-width: 56ch;
    margin-bottom: 34px;
    font-size: 16px;
    line-height: var(--leading-normal);
    color: var(--text-muted);
  }

  .office-grid {
    display: grid;
    grid-template-columns: 1.55fr 1fr;
    gap: var(--space-6);
    align-items: stretch;
  }

  .office-map {
    position: relative;
    min-height: 460px;
    overflow: hidden;
    background: var(--surface-card-hover);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
  }

  .office-map iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    /* Inverts OpenStreetMap's light tiles into the site's dark palette. */
    filter: invert(.92) hue-rotate(180deg) brightness(.92) contrast(.92) saturate(.55);
  }

  .office-map__topfade {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: linear-gradient(180deg, rgba(8, 8, 8, .85), transparent);
    pointer-events: none;
  }

  .office-map__badge {
    position: absolute;
    top: 18px;
    left: var(--space-5);
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: var(--space-2) 15px;
    background: rgba(8, 8, 8, .66);
    backdrop-filter: blur(6px);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    pointer-events: none;
  }

  .office-map__badge span:first-child {
    width: 8px;
    height: 8px;
    background: var(--cx-green);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(51, 236, 117, .22);
  }

  .office-map__badge-label {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--text-primary);
  }

  .office-map__pin {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    transform: translate(-50%, -100%);
    pointer-events: none;
  }

  .office-map__pin span {
    display: block;
    width: 18px;
    height: 18px;
    background: var(--cx-green);
    border: 2px solid var(--line-green);
    border-radius: 50% 50% 50% 0;
    box-shadow: 0 6px 14px rgba(0, 0, 0, .5);
    transform: rotate(-45deg);
  }

  /* --- Office detail card ------------------------------------------------- */
  .office-detail {
    display: flex;
    flex-direction: column;
    padding: var(--space-7) 34px;
    background: var(--surface-card-hover);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
  }

  .office-detail__region {
    margin-bottom: var(--space-2);
    font-size: 11px;
    font-weight: var(--weight-semibold);
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  .office-detail__city {
    margin-bottom: 26px;
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: var(--weight-bold);
    letter-spacing: -.01em;
  }

  .office-detail__rows {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
  }

  .office-detail__label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: 11px;
    font-weight: var(--weight-semibold);
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--text-subtle);
  }

  .office-detail__value {
    font-size: 15.5px;
    line-height: var(--leading-normal);
    color: var(--text-primary);
  }

  .office-detail__pair {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-7);
  }

  .office-detail__directions {
    margin-top: auto;
    padding-top: var(--space-7);
  }

  @media (max-width: 1020px) {
    .office-grid { grid-template-columns: 1fr; }
  }

  @media (max-width: 680px) {
    .contact-hero { padding-block: var(--space-10); }
    .contact-form-section { padding: var(--space-10) 0; }
    .offices { padding: var(--space-10) 0 var(--space-11); }
  }
}
