/*
 * Luxury on the agent page. Its listing-page rules are in app/s/[slug]/site.css; this file holds only
 * the agent page's, linked there alone (LookStyles, page="agent"), every rule under
 * .site[data-template="luxury"].agent-site.
 *
 * A cinematic portrait: the agent's photograph runs tall off the screen's right edge and falls
 * away into the black on its inner side, and their name, very large in the italic, runs over
 * that faded edge like a title over a film still, on the page's one hairline in their colour.
 * Everything after it is quiet: italic numerals over small capitals, the neighbourhoods as a
 * line of names, section titles on a long rule, and the homes as stills.
 */

/* ---------- The portrait and the title over it ---------- */

/* The page's one hairline in the agent's colour sits under the name, so the header's is neutral. */
.site[data-template="luxury"].agent-site .site-header {
  border-bottom-color: var(--border);
}

/* The profile runs the full width so the photograph can leave the screen on the right. Its words
   are laid straight on the grid (display: contents), which lets the name alone reach over the
   photograph while the smaller lines keep to the black. --reach is how far the name may run
   onto the faded edge; the fade is deepest there. */
.site[data-template="luxury"].agent-site > .profile:not(.profile-solo) {
  --margin: max(var(--gutter), calc((100% - var(--page)) / 2));
  --reach: clamp(144px, 16.8vw, 264px);
  width: 100%;
  grid-template-columns:
    [edge-start] var(--margin)
    [text-start] minmax(0, 33fr)
    [photo-start] minmax(0, 67fr)
    [page-end] var(--margin)
    [edge-end];
  grid-template-rows: 1fr repeat(6, auto) clamp(40px, 7svh, 88px);
  gap: 0;
  align-items: start;
  padding-top: 0;
}
.site[data-template="luxury"].agent-site .profile:not(.profile-solo) .profile-text {
  display: contents;
}
.site[data-template="luxury"].agent-site .profile-photo {
  grid-column: photo-start / edge-end;
  grid-row: 1 / -1;
  width: 100%;
  height: clamp(600px, calc(100svh - 84px), 980px);
  aspect-ratio: auto;
  object-fit: cover;
  object-position: 50% 22%;
  border-radius: 0;
  box-shadow: none;
  /* Out of the black on its inner edge, softly at its foot and head; hard only at the screen's
     edge. Across the name's reach the photograph is at most 40% through, so the name keeps
     4.5:1 even over a white wall. */
  mask-image:
    linear-gradient(
      to right,
      transparent 0,
      rgba(0, 0, 0, 0.16) calc(var(--reach) * 0.35),
      rgba(0, 0, 0, 0.4) var(--reach),
      #000000 calc(var(--reach) * 1.9)
    ),
    linear-gradient(to top, transparent 0, #000000 clamp(140px, 26%, 260px)),
    linear-gradient(to bottom, transparent 0, #000000 64px);
  mask-composite: intersect;
}
.site[data-template="luxury"].agent-site .profile:not(.profile-solo) .profile-text > * {
  grid-column: text-start / photo-start;
}
.site[data-template="luxury"].agent-site .profile:not(.profile-solo) .profile-kicker {
  grid-row: 2;
}
.site[data-template="luxury"].agent-site .profile:not(.profile-solo) h1 {
  grid-row: 3;
  margin-right: calc(-1 * var(--reach));
}
.site[data-template="luxury"].agent-site .profile h1 {
  position: relative;
  z-index: 1;
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(64px, 10.4vw, 150px);
  line-height: 0.92;
  letter-spacing: -0.015em;
  /* A word too long for the reach breaks (at a syllable where the browser can) rather than
     running onto the lit photograph. */
  -webkit-hyphens: auto;
  hyphens: auto;
  overflow-wrap: break-word;
}
/* The hairline, as wide as the name may run: from the column's edge onto the photograph. */
.site[data-template="luxury"].agent-site .profile h1::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 0.22em;
  background: var(--brand-stroke);
}
.site[data-template="luxury"].agent-site .profile:not(.profile-solo) .profile-brokerage {
  grid-row: 4;
}
.site[data-template="luxury"].agent-site .profile:not(.profile-solo) .profile-tagline {
  grid-row: 5;
}
.site[data-template="luxury"].agent-site .profile:not(.profile-solo) .profile-stats {
  grid-row: 6;
}
.site[data-template="luxury"].agent-site .profile:not(.profile-solo) .profile-actions {
  grid-row: 7;
}

/* Small spaced capitals above and below the title, as on a poster's credits. */
.site[data-template="luxury"].agent-site
  :where(
    .profile-kicker,
    .profile-brokerage,
    .profile-stats span,
    .places-heading,
    .section-count,
    .agent-brokerage
  ) {
  color: var(--text-2);
  font-family: var(--font-ui);
  font-style: normal;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.site[data-template="luxury"].agent-site .profile-kicker {
  margin: 0 0 clamp(18px, 2vw, 28px);
}
.site[data-template="luxury"].agent-site .profile-kicker::before {
  content: none;
}
.site[data-template="luxury"].agent-site .profile-brokerage {
  margin: clamp(18px, 1.8vw, 24px) 0 0;
  color: var(--ink);
}
.site[data-template="luxury"].agent-site .profile-tagline {
  max-width: none;
  margin-top: 14px;
  text-wrap: balance;
  color: var(--text-2);
  font-size: clamp(22px, 1.9vw, 27px);
}

/* The record: italic numerals over small capitals, with air rather than rules between them. */
.site[data-template="luxury"].agent-site .profile-stats {
  column-gap: clamp(32px, 3.4vw, 52px);
  margin-top: clamp(30px, 3.4vw, 44px);
  padding: 0;
  border: 0;
}
.site[data-template="luxury"].agent-site .profile-stats li {
  gap: 10px;
  padding: 0;
  border: 0;
}
.site[data-template="luxury"].agent-site .profile-stats strong {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(44px, 4vw, 60px);
  line-height: 0.9;
  letter-spacing: 0;
}
.site[data-template="luxury"].agent-site .profile-stats span {
  font-size: 11.5px;
}
.site[data-template="luxury"].agent-site .profile-actions {
  margin-top: clamp(28px, 3vw, 40px);
}

/* ---------- No photograph: a title card under a soft light ---------- */

.site[data-template="luxury"].agent-site > .profile-solo {
  position: relative;
  padding: clamp(72px, 10vw, 150px) 0 clamp(24px, 3vw, 40px);
  text-align: center;
}
/* The light is a pool of the page's own ink at a few per cent, never the agent's colour, so
   the words under it keep the ground's contrast whatever that colour is. */
.site[data-template="luxury"].agent-site > .profile-solo::before {
  content: "";
  position: absolute;
  inset: 0 calc(-1 * var(--gutter));
  background: radial-gradient(
    ellipse 46% 50% at 50% 50%,
    rgba(244, 244, 241, 0.055),
    rgba(244, 244, 241, 0) 100%
  );
  pointer-events: none;
}
.site[data-template="luxury"].agent-site .profile-solo .profile-text {
  position: relative;
  display: grid;
  justify-items: center;
  padding: 0;
}
.site[data-template="luxury"].agent-site .profile-solo h1 {
  justify-self: stretch;
  font-size: clamp(72px, 11.5vw, 176px);
}
.site[data-template="luxury"].agent-site .profile-solo h1::after {
  margin-top: 0.26em;
}
.site[data-template="luxury"].agent-site .profile-solo .profile-tagline {
  max-width: 34ch;
}
.site[data-template="luxury"].agent-site .profile-solo :is(.profile-stats, .profile-actions) {
  justify-content: center;
}

/* ---------- Where they sell: a quiet line of names ---------- */

.site[data-template="luxury"].agent-site .places {
  --mark: 36px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 14px clamp(32px, 4vw, 64px);
  margin-top: clamp(80px, 9vw, 140px);
  padding: 0;
  border: 0;
}
/* Each name after the first opens on a thin upright mark. The list is drawn one mark's width
   to the left and clipped there, so a line that wraps never starts on one. */
.site[data-template="luxury"].agent-site .places-list {
  gap: 6px 0;
  margin-left: calc(-1 * var(--mark));
  clip-path: inset(-0.5em -1em -0.5em var(--mark));
}
.site[data-template="luxury"].agent-site .places-list li {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  font-family: var(--font-accent);
  font-style: italic;
  font-size: clamp(24px, 2.2vw, 32px);
  font-weight: 400;
  line-height: 1.25;
}
.site[data-template="luxury"].agent-site .places-list li::before {
  content: "";
  flex: none;
  width: 1px;
  height: 0.62em;
  margin-inline: calc((var(--mark) - 1px) / 2);
  background: var(--border-strong);
}

/* ---------- Section titles on a long rule ---------- */

/* The count goes under the title only when both no longer fit on one line ("The 24 most recent of
   57" on a small phone); the title itself never gives up a letter to it. */
.site[data-template="luxury"].agent-site .section-head {
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-bottom: clamp(28px, 3.4vw, 48px);
}
.site[data-template="luxury"].agent-site .section-head h2 {
  display: flex;
  flex: 1;
  align-items: baseline;
  gap: clamp(20px, 2.4vw, 36px);
  min-width: max-content;
  font-size: clamp(40px, 4.6vw, 68px);
  line-height: 1;
}
.site[data-template="luxury"].agent-site .section-head h2::after {
  content: "";
  flex: 1;
  min-width: 32px;
  height: 1px;
  background: var(--border-strong);
}
.site[data-template="luxury"].agent-site .section-count {
  flex: none;
}

/* ---------- The homes, as stills ---------- */

.site[data-template="luxury"].agent-site .lc-grid {
  gap: clamp(48px, 5vw, 76px) clamp(20px, 2.4vw, 36px);
}
.site[data-template="luxury"].agent-site .lc {
  gap: 20px;
}
/* A wider frame and a nearly square corner; the photograph sits a shade down and comes up to
   full light under the pointer. */
.site[data-template="luxury"].agent-site .lc-photo {
  aspect-ratio: 3 / 2;
  border-radius: 3px;
}
.site[data-template="luxury"].agent-site .lc-photo img {
  filter: brightness(0.88);
  transition:
    transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1),
    filter 500ms ease;
}
.site[data-template="luxury"].agent-site .lc:hover .lc-photo img {
  filter: none;
}
.site[data-template="luxury"].agent-site .lc .sold-mark {
  padding: 7px 13px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
}
.site[data-template="luxury"].agent-site .lc-text {
  gap: 4px;
  padding-inline: 0;
}
.site[data-template="luxury"].agent-site .lc-price {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(27px, 2.3vw, 34px);
  line-height: 1.05;
  letter-spacing: 0;
}
.site[data-template="luxury"].agent-site .lc-address {
  margin-top: 8px;
  font-size: 16px;
}
.site[data-template="luxury"].agent-site .lc-place {
  font-size: 14.5px;
}
.site[data-template="luxury"].agent-site .lc-rooms {
  margin-top: 10px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
/* One home alone: a widescreen still, its words at its foot beside it (above a phone's width;
   there the still stacks over its words, as the base does). */
@media (min-width: 861px) {
  .site[data-template="luxury"].agent-site .lc-grid[data-count="1"] .lc {
    grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
    column-gap: clamp(28px, 3.4vw, 56px);
  }
}
.site[data-template="luxury"].agent-site .lc-grid[data-count="1"] .lc-photo {
  aspect-ratio: 16 / 9;
}
.site[data-template="luxury"].agent-site .lc-grid[data-count="1"] .lc-price {
  font-size: clamp(36px, 3.6vw, 54px);
}

/* ---------- The close: the name signed off, beside the question ---------- */

.site[data-template="luxury"].agent-site .agent-close .agent-inner {
  align-items: end;
}
.site[data-template="luxury"].agent-site .agent-close .agent-name {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(44px, 5vw, 76px);
  line-height: 0.95;
  letter-spacing: -0.01em;
}
.site[data-template="luxury"].agent-site .agent-close .agent-brokerage {
  margin-top: 16px !important;
}
.site[data-template="luxury"].agent-site .agent-close .agent-contact {
  margin-top: 26px !important;
}
.site[data-template="luxury"].agent-site .agent-close .lead-wrap {
  padding-left: clamp(0px, 4vw, 64px);
  border-left: 1px solid var(--border);
}

/* ---------- Narrower screens ---------- */

/* On a laptop the words take a larger share of the row and the name grows with it, so the
   record stays on one line and the name still reaches the photograph. */
@media (min-width: 861px) and (max-width: 1100px) {
  .site[data-template="luxury"].agent-site > .profile:not(.profile-solo) {
    grid-template-columns:
      [edge-start] var(--margin)
      [text-start] minmax(0, 38fr)
      [photo-start] minmax(0, 62fr)
      [page-end] var(--margin)
      [edge-end];
  }
  .site[data-template="luxury"].agent-site .profile:not(.profile-solo) h1 {
    font-size: 11.4vw;
  }
  .site[data-template="luxury"].agent-site .profile-stats {
    column-gap: clamp(20px, 2.6vw, 28px);
  }
  .site[data-template="luxury"].agent-site .profile-stats span {
    letter-spacing: 0.16em;
  }
}

/* The photograph takes the screen's width under the kicker and fades at its foot, where the
   name's first line sits. The fade is measured in the name's own size (--name), so however
   large the name is set, the part of it over the photograph stays over the darkest of it. */
@media (max-width: 860px) {
  .site[data-template="luxury"].agent-site > .profile {
    --name: clamp(52px, 18vw, 120px);
  }
  .site[data-template="luxury"].agent-site > .profile:not(.profile-solo) {
    grid-template-columns:
      [edge-start] var(--gutter)
      [text-start] minmax(0, 1fr)
      [page-end] var(--gutter)
      [edge-end];
    grid-template-rows: repeat(7, auto);
  }
  .site[data-template="luxury"].agent-site .profile:not(.profile-solo) .profile-text > * {
    grid-column: text-start / page-end;
  }
  .site[data-template="luxury"].agent-site .profile:not(.profile-solo) .profile-kicker {
    grid-row: 1;
    margin: clamp(8px, 2vw, 16px) 0 18px;
  }
  .site[data-template="luxury"].agent-site .profile-photo {
    grid-column: edge-start / edge-end;
    grid-row: 2;
    height: min(118vw, 64svh);
    object-position: 50% 18%;
    mask-image:
      linear-gradient(
        to top,
        transparent 0,
        rgba(0, 0, 0, 0.16) calc(var(--name) * 0.8),
        rgba(0, 0, 0, 0.5) calc(var(--name) * 1.6),
        #000000 46%
      ),
      linear-gradient(to bottom, transparent 0, #000000 40px);
  }
  .site[data-template="luxury"].agent-site .profile h1 {
    font-size: var(--name);
  }
  .site[data-template="luxury"].agent-site .profile:not(.profile-solo) h1 {
    margin: calc(var(--name) * -0.66) 0 0;
  }
  .site[data-template="luxury"].agent-site .agent-close .lead-wrap {
    padding: 36px 0 0;
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 640px) {
  .site[data-template="luxury"].agent-site .places {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .site[data-template="luxury"].agent-site .profile-stats {
    column-gap: 28px;
  }
  .site[data-template="luxury"].agent-site > .profile-solo {
    padding-top: 56px;
  }
}
