/* An advocate's profile (layouts/advocate.njk).
   The door from the home page's "Our advocates", on its own: the colour
   portrait in its arch, and the name cut into the limestone plate below it.
   Then the profile, the recent news that names the person, and the other
   advocates. */

.adv-hero {
  --adv-mid: #D7BE93;                        /* limestone, as in /css/people.css */
  position: relative; isolation: isolate; overflow: hidden; overflow: clip;
  padding: calc(var(--header-h) + clamp(24px, 4.5vw, 64px)) 0 clamp(56px, 7vw, 96px);
  background:
    radial-gradient(900px 520px at 22% 38%, rgba(70, 82, 138, .30), transparent 66%),
    radial-gradient(1000px 520px at 90% 0%, rgba(70, 82, 138, .26), transparent 62%),
    var(--navy-900);
  color: var(--navy-200);
}

/* ------------------------------------------------------------ layout */
.adv-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 384px) minmax(0, 1fr);
  grid-template-rows: 1fr auto auto 1fr;
  grid-template-areas: "door ." "door crumb" "door intro" "door .";
  column-gap: clamp(56px, 8vw, 128px);
}
.adv-crumb { grid-area: crumb; margin-bottom: 14px; }
.adv-door { grid-area: door; justify-self: start; width: 100%; }
.adv-intro { grid-area: intro; min-width: 0; }

/* the eyebrow is the way back to the three advocates on the home page */
.adv-crumb a {
  display: inline-flex; align-items: center; min-height: 44px;
  color: inherit; text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 calc(100% - 12px) / 0 1px no-repeat;
  transition: background-size .45s var(--ease), color .3s ease;
}
.adv-crumb a:hover, .adv-crumb a:focus-visible { color: #fff; background-size: 100% 1px; }

/* ------------------------------------------------------------ the door */
.adv-door { padding: 12px 12px 0; }
.adv-arch { position: relative; }
/* the stone surround: one fine line, concentric with the arch */
.adv-arch::before {
  content: ""; position: absolute; inset: -12px -12px 0; pointer-events: none;
  border: 1px solid var(--adv-mid); border-bottom: 0; border-radius: 999px 999px 0 0; opacity: .6;
}
.adv-scene {
  position: relative; overflow: hidden;
  aspect-ratio: 4 / 5; border-radius: 999px 999px 0 0;
  background: var(--navy-950);
}
.adv-scene img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }

/* the plate: limestone, with the name cut into it and filled with navy */
.adv-plate {
  position: relative; overflow: hidden; margin-inline: -12px;
  padding: 20px 18px 18px; text-align: center;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .43 0 0 0 0 .33 0 0 0 0 .2 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #F7EEDB 0%, #EBDBBA 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .7),
    inset 0 -3px 0 rgba(143, 116, 80, .30),
    0 24px 36px -22px rgba(0, 0, 0, .7);
}
/* the doorway's light falls on the top of the plate */
.adv-plate::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(70% 120% at 50% 0%, rgba(255, 250, 238, .55), rgba(255, 250, 238, 0) 72%);
}
.adv-name, .adv-role { position: relative; }
.adv-name {
  font: 500 clamp(1.35rem, 1rem + .6vw, 1.5rem)/1.25 var(--serif); letter-spacing: .085em; text-transform: uppercase;
  color: var(--navy); max-width: none;
  text-shadow: 0 -1px 0 rgba(96, 74, 42, .32), 0 1px 0 rgba(255, 251, 240, .95);
}
/* the forenames on one line and the surname below, as on a nameplate, at every
   width: the same shape for every advocate (the longest, "Avv. Valentina", fits the plate) */
.adv-name-given, .adv-name-family { display: block; }
.adv-role {
  margin-top: 7px;
  font: 600 .72rem/1.45 var(--sans); letter-spacing: .16em; text-transform: uppercase;
  color: #62502F;
  text-shadow: 0 1px 0 rgba(255, 251, 240, .7);
}
.adv-role-part { white-space: nowrap; }
/* Beside the introduction the name is larger, so the page says at once whom it is about. */
@media (min-width: 960px) {
  .adv-name { font-size: 1.875rem; line-height: 1.18; letter-spacing: .08em; }
}

/* ------------------------------------------------------------ introduction and contact */
.adv-lead { max-width: 34em; font-size: clamp(1.06rem, .98rem + .35vw, 1.22rem); line-height: 1.62; color: var(--navy-100); }

.adv-contact {
  margin: 30px 0 0; display: grid; grid-template-columns: max-content minmax(0, 1fr);
  border-top: 1px solid var(--line-light); max-width: 40rem;
}
.adv-contact-row { display: contents; }
.adv-contact dt, .adv-contact dd { padding-block: 6px; border-bottom: 1px solid var(--line-light); }
/* the label lines up with the first line of its links (the phones may take two lines) */
.adv-contact dt {
  display: flex; align-items: flex-start; padding-top: 20px; padding-right: 28px;
  font: 600 .68rem/1.4 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--navy-300);
}
.adv-contact dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0 22px; min-width: 0; }
.adv-contact a {
  display: inline-flex; align-items: center; min-height: 44px;
  color: #fff; text-decoration: none; font-weight: 500; overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) 0 calc(100% - 10px) / 0 1px no-repeat;
  transition: background-size .45s var(--ease);
}
.adv-contact a:hover, .adv-contact a:focus-visible { background-size: 100% 1px; }
.adv-phones a { white-space: nowrap; font-variant-numeric: tabular-nums; }

.adv-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* the QR code: the same vCard, to scan with a phone (larger screens only) */
.adv-qr { display: none; }
.adv-qr-title { display: block; margin-bottom: 3px; font-weight: 600; }
.adv-qr-text { display: block; max-width: 24em; }
@media (min-width: 960px) {
  .adv-qr {
    margin: 32px 0 0; display: flex; align-items: center; gap: 22px; max-width: 30rem;
  }
  /* the code keeps its own size (config/people.js: 3 px per module), so every module is whole pixels */
  .adv-qr-code {
    flex: none; border-radius: 4px; overflow: hidden; background: #fff;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .5), 0 18px 30px -18px rgba(0, 0, 0, .8);
  }
  .adv-qr-svg { max-width: none; }
  .adv-qr figcaption { font-size: .88rem; line-height: 1.55; color: var(--navy-300); }
  .adv-qr-title { color: #fff; }
}

/* ------------------------------------------------------------ profile */
.adv-body { padding-block: clamp(64px, 8vw, 120px); }
.adv-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(48px, 7vw, 112px); align-items: start; }
.adv-h { font-size: var(--h2-inner); line-height: 1.1; }
.adv-prose { margin-top: 22px; }
.adv-prose p { color: var(--text); }

.adv-facts { display: grid; gap: 36px; padding-top: 10px; }
.adv-label {
  font: 600 .72rem/1.4 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.adv-list { list-style: none; margin-top: 12px; border-top: 1px solid var(--line); }
.adv-list li { padding: 11px 0 12px; border-bottom: 1px solid var(--line); font-size: .98rem; line-height: 1.5; color: var(--ink); }
.adv-fact-text { margin-top: 12px; padding: 11px 0 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: .98rem; line-height: 1.5; color: var(--ink); }

/* ------------------------------------------------------------ recent events and news */
.adv-news { padding-block: clamp(64px, 8vw, 112px); }
.adv-news .section-head { margin-bottom: clamp(32px, 4vw, 48px); }
/* all of them, also where the home page shows two */
.adv-news-grid > li:nth-child(3) { display: flex; }

/* ------------------------------------------------------------ the other advocates */
.adv-others { padding-block: clamp(48px, 6vw, 80px); border-top: 1px solid var(--line); }
.adv-others-list { list-style: none; margin-top: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px clamp(24px, 4vw, 56px); }
.adv-other {
  display: inline-flex; align-items: center; gap: 20px; padding: 10px 0; max-width: 100%;
  text-decoration: none; color: var(--ink);
}
.adv-other-arch {
  position: relative; flex: none; width: 64px; aspect-ratio: 4 / 5; overflow: hidden;
  border-radius: 999px 999px 0 0; background: var(--navy-950);
}
.adv-other-arch img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.adv-other-text { display: grid; gap: 3px; min-width: 0; }
.adv-other-name { font: 500 1.3rem/1.2 var(--serif); color: var(--ink); }
.adv-other-name {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .45s var(--ease); justify-self: start;
}
.adv-other:hover .adv-other-name, .adv-other:focus-visible .adv-other-name { background-size: 100% 1px; }
.adv-other-role { font-size: .88rem; color: var(--muted); }
.adv-other .icon { margin-left: 4px; color: var(--orange-ink); transition: transform .35s var(--ease); }
.adv-other:hover .icon { transform: translateX(4px); }

/* ------------------------------------------------------------ tablet and phone */
@media (max-width: 959px) {
  .adv-hero-grid {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: none;
    grid-template-areas: "crumb" "door" "intro";
  }
  .adv-crumb { margin-bottom: 10px; }
  .adv-door { justify-self: center; width: min(100%, 320px); }
  .adv-intro { margin-top: 40px; }
  .adv-grid { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .adv-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 40px; padding-top: 0; }
}
@media (max-width: 639px) {
  .adv-door { width: min(76%, 300px); }
  .adv-plate { padding: 14px 12px 13px; }
  /* the size comes from the clamp above (21.6px, as at 640px), larger than the summary below */
  .adv-name { letter-spacing: .06em; line-height: 1.2; }
  .adv-role { margin-top: 4px; font-size: .6875rem; letter-spacing: .12em; }
  /* each part of the role on its own line; the dot is kept for screen readers */
  .adv-role-sep { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .adv-role-part { display: block; }
  .adv-intro { margin-top: 32px; }
  .adv-contact { grid-template-columns: minmax(0, 1fr); }
  .adv-contact dt { padding-bottom: 0; border-bottom: 0; padding-top: 14px; }
  .adv-contact dd { padding-top: 0; }
  .adv-contact dd { gap: 0 18px; }
  .adv-actions .btn { flex: 1 1 100%; }
  .adv-facts { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .adv-others-list { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .adv-other-name { font-size: 1.2rem; }
}
@media (max-width: 359px) {
  .adv-name { font-size: 1.15rem; letter-spacing: .05em; }
  .adv-role { letter-spacing: .08em; }
}

/* ------------------------------------------------------------ preferences */
@media (forced-colors: active) {
  .adv-plate { border: 1px solid CanvasText; }
}
@media print {
  .adv-hero { padding: calc(var(--header-h) + 8px) 0 24px; color: #000; background: none; }
  .adv-hero-grid {
    grid-template-columns: 170px minmax(0, 1fr); grid-template-rows: auto;
    grid-template-areas: "door intro"; column-gap: 32px; align-items: start;
  }
  .adv-crumb, .adv-actions, .adv-others { display: none; }
  .adv-door { width: 100%; }
  .adv-intro { margin-top: 0; }
  .adv-plate::before { display: none; }
  .adv-plate { box-shadow: none; border: 1px solid #999; padding-inline: 10px; }
  /* the longest forenames, "Avv. Valentina", stay inside the narrow plate */
  .adv-name { font-size: .95rem; letter-spacing: .06em; }
  /* the role's parts on their own lines in the narrow plate, as on phones, and never wider than it */
  .adv-role { font-size: .6rem; letter-spacing: .1em; }
  .adv-role-sep { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .adv-role-part { display: block; white-space: normal; }
  .adv-lead, .adv-contact a, .adv-contact dt, .adv-qr figcaption, .adv-qr-title { color: #000 !important; }
  .adv-contact { grid-template-columns: max-content minmax(0, 1fr); }
  .adv-contact dt, .adv-contact dd { border-color: #ccc; }
  .adv-contact a { min-height: 0; padding-block: 4px; }
  .adv-qr { display: flex; align-items: center; gap: 16px; margin: 20px 0 0; }
  .adv-qr-code { flex: none; }
  .adv-body, .adv-news { padding-block: 32px; }
  .adv-bio, .adv-fact, .news-card { break-inside: avoid; }
}

/* Desktop: the bio runs across the page and the facts sit below it in even
   columns, so a short bio never leaves the Profile column lopsided. */
@media (min-width: 960px) {
  .adv-grid { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .adv-prose { max-width: 40rem; }
  .adv-facts { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 40px clamp(32px, 4vw, 64px); padding-top: 0; }
}
