/* ============================================================
   Capital Mortgages — team & contact page styles
   ============================================================ */

/* ---------- contact hero ---------- */
.contact-hero { padding: 76px 0 0; }
.contact-grid { display: grid; grid-template-columns: 1fr .9fr; gap: 72px; align-items: start; }
.contact-hero h1 { font-size: 58px; line-height: 1.06; }
.contact-copy { display: grid; gap: 24px; }
.contact-copy .sub { font-size: 18.5px; color: var(--ink-soft); max-width: 44ch; }
.contact-methods { display: grid; gap: 0; margin-top: 12px; }
.cmethod { display: grid; grid-template-columns: 120px 1fr; gap: 18px; align-items: baseline; padding: 18px 0; border-top: 1px solid var(--line-soft); }
.cmethod .k { font-size: 12.5px; font-weight: 640; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.cmethod .v { font-family: var(--serif); font-size: 22px; font-weight: 560; letter-spacing: -0.01em; }
.cmethod .v a:hover { color: var(--accent); }
.cmethod .d { font-size: 16px; color: var(--ink-soft); margin-top: 2px; }

/* form */
/* Landing on #contact-form used to slice the headline under the sticky bar.
   The margin is larger than the form's distance from the page top, so the
   scroll clamps to 0 and the whole hero — headline included — stays framed.
   Once the layout stacks, the form is far down the page and only needs
   clearance for the bar. */
#contact-form { scroll-margin-top: calc(var(--bar-h) + 100px); }
@media (max-width: 900px) { #contact-form { scroll-margin-top: calc(var(--bar-h) + 16px); } }
.form-card { padding: 34px 32px 32px; display: grid; gap: 16px; }
.form-card h2 { font-size: 24px; }
.form-card .hint { font-size: 16px; color: var(--ink-soft); margin-top: -8px; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 620; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  /* 17px, not 15: iOS Safari zooms the page on focus for any input under
     16px, and the old 15 sat just under that line. */
  font-family: var(--sans); font-size: 17px; color: var(--ink);
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-mid);
}
.form-card .btn { justify-self: start; margin-top: 4px; }
.form-note { font-size: 12.5px; color: var(--ink-faint); }

/* ---------- team ---------- */
.team-section { padding-top: 96px; }
.team-group { margin-top: 56px; }
.team-group:first-of-type { margin-top: 0; }
.tg-head { display: flex; align-items: baseline; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 26px; }
.tg-head h3 { font-size: 26px; }
.tg-head .count { font-size: 13px; color: var(--ink-faint); font-weight: 560; }
.team-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

.tcard { overflow: hidden; display: grid; align-content: start; }
.tphoto { position: relative; aspect-ratio: 1 / 1.05; background: var(--accent-mid); overflow: hidden; }
.tphoto img { position: relative; width: 100%; height: 100%; object-fit: cover; object-position: top center; filter: saturate(.92); }
.tphoto .initials {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--serif); font-size: 52px; font-weight: 560; color: var(--accent-deep);
  background: repeating-linear-gradient(-45deg, var(--accent-soft), var(--accent-soft) 12px, color-mix(in oklab, var(--accent-soft), var(--accent) 7%) 12px, color-mix(in oklab, var(--accent-soft), var(--accent) 7%) 24px);
}
.tinfo { padding: 18px 20px 20px; display: grid; gap: 3px; }
.tinfo .name { font-family: var(--serif); font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.tinfo .role { font-size: 13.5px; color: var(--ink-soft); }
.tinfo .lic { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11px; color: var(--ink-faint); margin-top: 4px; letter-spacing: .03em; }
.tlinks { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; }
.tlinks a { font-size: 13px; font-weight: 620; color: var(--accent); }
.tlinks a:hover { text-decoration: underline; text-underline-offset: 3px; }
/* the broker's own practice site — brand-red so it reads as the primary action */
.tlinks a.weblink { color: var(--brand-ink); }
.tlinks a.weblink::after { content: " ↗"; font-size: 11px; }

/* operations cards: no photo, email only (client display rules) */
.tcard-plain .tinfo { padding: 20px 20px 22px; }

@media (max-width: 1080px) { .team-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; gap: 48px; }
  .contact-hero h1 { font-size: 40px; }
  .team-grid, .team-grid.mgmt { grid-template-columns: 1fr 1fr; }
}

/* A form field must be allowed to SHRINK. An <input> carries an intrinsic
   width from its default size attribute (~20 characters), and in a grid the
   item's automatic minimum is that intrinsic width — so the field could not
   go below roughly 208px, two of them in a .frow could not go below 431px,
   and the form card's min-content pinned the whole .contact-grid track to
   497px inside a 375px phone. The page scrolled sideways by 144px because of
   an input's default size attribute. min-width:0 removes the automatic
   minimum; width:100% then ties the control to whatever the track gives it. */
.field { min-width: 0; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; }
/* Two fields side by side stop being two fields at phone widths — the pair is
   ~431px of min-content before either can shrink. */
@media (max-width: 620px) { .frow { grid-template-columns: 1fr; } }

/* The second half of the same bug. With the form card fixed, the widest thing
   left in the .contact-grid track was the EMAIL row: .cmethod is a fixed
   120px label column + an 18px gap + "info@capitalmortgages.com", which at
   22px serif is 239px of text with no break opportunity in it — 410px of
   min-content in a 331px column. Stacking the label above the value on
   phones returns the 138px, and overflow-wrap lets the address itself break
   if the frame is narrower still.

   Worth noting for anyone re-checking this: fixing the form alone LOOKED
   like it did nothing, because the form's 497px was masking this row's 410.
   Both had to go before the page stopped scrolling sideways. */
.cmethod .v { overflow-wrap: anywhere; }
@media (max-width: 620px) {
  .cmethod { grid-template-columns: 1fr; gap: 2px; }
}
