/* Agent card: the listing page's "who to call" block, as the listing builder brief requires it.
   Markup: .agent > figure.agent__ph (the headshot) + .agent__card (label, name, brokerage, phone + email lines, the
   showing buttons, a note). The property-page checker looks for exactly .agent__ph and .agent__card.

   On desktop the photo frame is exactly as tall as the text column: the grid row stretches both columns, and the
   headshot is absolutely positioned inside its frame, so it adds no height of its own. The row is as tall as the
   words, the frame follows, and the photo is cropped to fit (object-fit: cover) holding the face (50% 22%: the face
   sits in the top fifth of a headshot). Add a line of text and the frame grows with it.

   No headshot (5 of 37 pages had none): .agent--plate turns the frame into a solid colour plate carrying the agent's
   name set large (first / last on two lines, the last stepped in), a double hairline frame inset in it, and the role +
   brokerage in small capitals at its foot. It stretches to the text column the same way. Mark it aria-hidden: the
   card's heading already says the name.

   Phones (below 900px): one column; the headshot first at a fixed portrait shape (4:5, at most 280px wide), the plate
   full width at 240px or more, then the text. Every colour is a knob, picked from the property's photos. */

.agent {
  --agent-ink: #1e2320;                 /* name, values */
  --agent-ink-2: #5b5f58;               /* label, keys, note, address */
  --agent-line: rgb(30 35 32 / .18);    /* hairlines between the contact lines */
  --agent-accent: #2f5d50;              /* link underline on hover / focus */
  --agent-ph-bg: #d8d1c3;               /* behind the headshot while it loads */
  --agent-display: ui-serif, Georgia, "Times New Roman", serif;   /* the name's face */
  --agent-mono: ui-monospace, "SF Mono", Menlo, monospace;       /* label and keys */
  --agent-ph-w: minmax(0, 300px);       /* the photo column (boehm 300px, hartwick 280px) */
  --agent-gap: clamp(32px, 5vw, 72px);  /* between photo and text */
  --agent-focus: 50% 22%;               /* where the crop holds the face (6 pages 50% 22%; 20-30% on 13 more) */
  --agent-ph-radius: 2px;
  --agent-ph-min: 0px;                  /* a floor for the frame on desktop (it never needs one with a full card) */
  --agent-name-size: clamp(44px, 5vw, 76px);
  --agent-name-weight: 500;
  --agent-key-w: 110px;                 /* key column of the contact lines (76px on phones) */
  --agent-ph-w-m: min(280px, 72%);      /* phones: headshot width */
  --agent-ph-ratio-m: 4 / 5;            /* phones: headshot shape */
  display: grid; grid-template-columns: var(--agent-ph-w) minmax(0, 1fr); column-gap: var(--agent-gap);
  align-items: stretch; color: var(--agent-ink);
}
.agent *, .agent *::before, .agent *::after { box-sizing: border-box; }

/* the frame: it has no height of its own, the text column gives it one */
.agent__ph { position: relative; margin: 0; min-height: var(--agent-ph-min); overflow: hidden; border-radius: var(--agent-ph-radius); background: var(--agent-ph-bg); }
.agent__ph img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: var(--agent-focus); }

/* the text column */
.agent__card { min-width: 0; }
.agent__k { margin: 0; font: 600 11.5px/1.4 var(--agent-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--agent-ink-2); }
.agent__name { margin: 14px 0 0; font-family: var(--agent-display); font-size: var(--agent-name-size); font-weight: var(--agent-name-weight); line-height: .98; letter-spacing: -.02em; text-wrap: balance; }
.agent__firm { margin: 16px 0 0; font-size: 18px; font-weight: 600; line-height: 1.4; text-wrap: balance; }
.agent__firm span { display: block; margin-top: 2px; font-size: 16px; font-weight: 400; color: var(--agent-ink-2); }
.agent__lines { margin: 26px 0 0; border-top: 1px solid var(--agent-line); }
.agent__lines > div { display: grid; grid-template-columns: var(--agent-key-w) minmax(0, 1fr); gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--agent-line); }
.agent__lines dt { font: 600 11.5px/1.75 var(--agent-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--agent-ink-2); }
.agent__lines dd { margin: 0; min-width: 0; font-size: 18px; line-height: 1.35; overflow-wrap: anywhere; }   /* a long email breaks, never overflows */
.agent__lines a { color: inherit; text-decoration: none; background: linear-gradient(var(--agent-accent), var(--agent-accent)) 0 100% / 0 1px no-repeat; transition: background-size .35s cubic-bezier(.16, 1, .3, 1); }
.agent__lines a:hover, .agent__lines a:focus-visible { background-size: 100% 1px; }
.agent__lines a:focus-visible { outline: 2px solid var(--agent-accent); outline-offset: 3px; }
.agent__act { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.agent__note { margin: 16px 0 0; max-width: 52ch; font-size: 15px; line-height: 1.5; color: var(--agent-ink-2); text-wrap: balance; }

/* ---- no headshot: a colour plate with the name on it ---- */
.agent--plate {
  --agent-ph-w: minmax(0, .72fr);       /* 5 : 7 against the text (margi-barrie, cliff-meredith) */
  --agent-plate-bg: #2f5d50;            /* the property's deepest colour */
  --agent-plate-ink: #f3efe4;
  --agent-plate-ink-2: rgb(243 239 228 / .8);
  --agent-plate-rule: rgb(243 239 228 / .45);    /* inner hairline of the double frame */
  --agent-plate-rule-2: rgb(243 239 228 / .22);  /* outer hairline, 4px further out */
  --agent-plate-inset: 14px;            /* frame distance from the plate's edge (transparent rules = no frame) */
  --agent-plate-size: clamp(40px, 15cqi, 104px); /* name size, a share of the plate's own width */
  --agent-plate-step: .6em;             /* the last name stepped in */
  --agent-plate-min-m: 240px;           /* phones: plate height floor */
}
.agent--plate .agent__ph {
  display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
  padding: calc(var(--agent-plate-inset) + clamp(18px, 2.4vw, 30px));
  background: var(--agent-plate-bg); color: var(--agent-plate-ink); container-type: inline-size;
}
.agent--plate .agent__ph::before {
  content: ""; position: absolute; inset: var(--agent-plate-inset); pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--agent-plate-rule), inset 0 0 0 5px var(--agent-plate-bg), inset 0 0 0 6px var(--agent-plate-rule-2);
}
.agent__plate-name { position: relative; margin: 0; font-family: var(--agent-display); font-size: var(--agent-plate-size); font-weight: 400; line-height: .94; letter-spacing: -.015em; }
/* no container query units (Safari < 16, Firefox < 110): the cqi clamp would be invalid and the name would drop to
   the inherited body size, so size it from the window instead */
@supports not (font-size: 1cqi) { .agent--plate { --agent-plate-size: clamp(40px, 3.6vw, 72px); } }
.agent__plate-name span { display: block; white-space: nowrap; }
.agent__plate-name span + span { padding-left: var(--agent-plate-step); }
.agent__plate-small { position: relative; margin: 0; display: flex; flex-direction: column; gap: 4px; font: 600 11px/1.4 var(--agent-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--agent-plate-ink-2); }

@media (max-width: 899.98px) {
  .agent { grid-template-columns: minmax(0, 1fr); row-gap: 28px; --agent-key-w: 76px; }
  .agent__ph { width: var(--agent-ph-w-m); aspect-ratio: var(--agent-ph-ratio-m); }
  .agent--plate .agent__ph { width: auto; aspect-ratio: auto; min-height: var(--agent-plate-min-m); }
  .agent__lines dd { font-size: 16.5px; }
  .agent__act > * { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { .agent__lines a { transition: none; } }
