/* ============================================================
   Staff Contact — single-node display (/node/{nid}/staff_contact)
   ============================================================ */

/* ── Business-card layout: photo left, details right ─────────── */
/* Own class (NOT bare .staff-contact) — the inline staff-contact paragraph chip
   in layout.css also uses .staff-contact with white-space:nowrap, which was
   stopping this profile's bio from wrapping. */
.staff-profile {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 2rem;
  align-items: start;
  max-width: 760px;
  margin: 2rem auto;
  padding: 0 var(--space-6, 1.5rem);
}

.staff-profile__body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;            /* let long bios wrap instead of overflowing */
}

/* Job title — sits directly under the name. */
.staff-profile__title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text-muted, #5a5a5a);
  margin: 0 0 0.4rem;
}

/* Site / Department lines. */
.staff-profile__meta {
  font-size: 0.95rem;
  margin: 0;
  color: var(--color-text, #3a3a3a);
}

.staff-profile__meta-label {
  font-weight: 700;
  color: var(--color-text-muted, #5a5a5a);
  margin-right: 0.35rem;
}

/* Linked site/department — underline (always) + colour shift on hover = two
   non-colour-only indicators (a11y: see dual-link-indicators rule). */
.staff-profile__link {
  color: var(--color-primary, #01491f);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--color-primary) 40%, transparent);
  text-underline-offset: 2px;
  transition: color 150ms ease, text-decoration-color 150ms ease;
}
.staff-profile__link:hover,
.staff-profile__link:focus-visible {
  color: color-mix(in srgb, var(--color-primary) 80%, #000);
  text-decoration-color: currentColor;
}

/* Bio / "About". */
.staff-profile__bio {
  margin: 0.9rem 0 0;
  line-height: 1.7;
  color: var(--color-text, #3a3a3a);
}
.staff-profile__bio > :first-child { margin-top: 0; }
.staff-profile__bio > :last-child { margin-bottom: 0; }

.staff-profile__photo {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  background: var(--color-bg-subtle, #f5f5f7);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.staff-profile__photo--placeholder {
  background-color: color-mix(in srgb, var(--color-primary) 14%, #fff);
  background-repeat: no-repeat;
  background-position: center 55%;
  background-size: 55%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2301491f' stroke-width='1.5'%3E%3Ccircle cx='12' cy='8' r='4' fill='%2301491f' fill-opacity='0.55' stroke='none'/%3E%3Cpath d='M4 21v-1a8 8 0 0 1 16 0v1' fill='%2301491f' fill-opacity='0.55' stroke='none'/%3E%3C/svg%3E");
}

.staff-profile__heading {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.staff-profile__eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-tracked);
  color: var(--color-accent-deep, #8a6d00);
}

.staff-profile__name {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800;
  line-height: 1.15;
  margin: 0;
  color: var(--color-primary, #01491f);
  letter-spacing: var(--ls-tight);
}

.staff-profile__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
  margin-top: 1rem;
}

.staff-profile__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  padding: 0.7rem 1.3rem;
  background: var(--color-primary, #01491f);
  color: #fff;
  border-radius: var(--radius-sm, 4px);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  position: relative;
  transition: background 200ms ease;
}
/* Growing underline — mirrors the site-wide .mvsd-link-anim pattern, but
   uses ::after with scaleX so the line sits directly under the text (the
   button's padding would otherwise push a background-gradient underline
   below the text by ~0.7rem). Pairs with the bg darken below as the two
   hover indicators. No transform / font-weight on hover, so the button
   never resizes. */
.staff-profile__button::after {
  content: '';
  position: absolute;
  left: 1.3rem;
  right: 1.3rem;
  bottom: calc(0.7rem - 2px);
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 320ms cubic-bezier(.2, .8, .2, 1);
}
.staff-profile__button:hover,
.staff-profile__button:focus-visible {
  background: color-mix(in srgb, var(--color-primary) 85%, #000);
  color: #fff;
}
.staff-profile__button:hover::after,
.staff-profile__button:focus-visible::after {
  transform: scaleX(1);
}
.staff-profile__button:focus-visible {
  outline: 2px solid var(--color-focus-ring-on-dark, #ffbf47);
  outline-offset: 2px;
}

.staff-profile__email-verify {
  font-size: 0.82rem;
  color: var(--color-text-muted, #5a5a5a);
  background: var(--color-bg-subtle, #fafafb);
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm, 4px);
  border: 1px dashed var(--color-border, #e0e0e0);
}
.staff-profile__channel-note {
  font-style: italic;
  color: var(--color-text-muted, #5a5a5a);
}

/* ── Locations / per-assignment blocks ──────────────────────── */
.staff-profile__locations {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.staff-profile__location {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.06);
  border-left: 3px solid var(--color-accent, #c5a000);
  border-radius: var(--radius-sm, 4px);
  padding: 1.1rem 1.2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.staff-profile__location-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary, #01491f);
  margin: 0 0 0.7rem;
  text-transform: none;
  letter-spacing: var(--ls-normal);
}

.staff-profile__details {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--color-text, #333);
}

.staff-profile__detail {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.5rem;
  margin: 0;
}

.staff-profile__detail dt {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-loose);
  color: var(--color-text-muted, #5a5a5a);
  align-self: center;
}

.staff-profile__detail dd {
  margin: 0;
  color: var(--color-text, #333);
}

.staff-profile__detail dd a {
  color: var(--color-text, #333);
  text-decoration: none;
  border-bottom: 1px dotted color-mix(in srgb, var(--color-primary) 50%, transparent);
}
.staff-profile__detail dd a:hover {
  color: var(--color-primary, #01491f);
  border-bottom-style: solid;
}

.staff-profile__ext {
  color: var(--color-text-muted, #5a5a5a);
  font-size: 0.88rem;
}

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .staff-profile {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .staff-profile__photo {
    width: 140px;
    height: 140px;
    margin: 0 auto;
  }
  .staff-profile__body { align-items: center; }
  .staff-profile__actions { align-items: center; }
  .staff-profile__button { align-self: center; }
}

/* ============================================================
   Staff Contact — admin form read-only display chip
   (used by the synced-record edit form)
   ============================================================ */

.staff-contact-readonly {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: var(--color-bg-subtle, #fafafb);
  border: 1px solid var(--color-border, #e0e0e0);
  border-radius: var(--radius-sm, 4px);
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-size: 0.88rem;
  color: var(--color-text, #333);
}

/* ============================================================
   Contact-form link adornment
   Any <a> whose href points at the staff-contact form route
   (/contact-staff/{nid}) gets a small envelope glyph prefixed,
   so visitors recognize that the link opens a contact form
   rather than an in-page anchor or external site.
   ============================================================ */
a[href*="/contact-staff/"]::before {
  content: "";
  display: inline-block;
  width: 0.95em;
  height: 0.95em;
  margin-right: 0.4em;
  vertical-align: -0.12em;
  /* mask-image lets the icon inherit currentColor so it tints with the
     surrounding link text (works against light dept sidebars and dark
     footer alike). */
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3 7l9 6 9-6'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3 7l9 6 9-6'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-size: contain;
          mask-size: contain;
  opacity: 0.85;
}
a[href*="/contact-staff/"]:hover::before {
  opacity: 1;
}
