/**
 * Profiles listing + single dossier.
 * Loaded only on /profiles/, /teams/, teams-cat, and vl_teams singles.
 */

/* ——— Shared atmosphere ——— */
.rm-profile-listing,
.rm-profile-identity,
.rm-profile-dossier,
.rm-profile-form,
.rm-profile-related {
  position: relative;
  overflow: clip;
}

.rm-profile-listing__gridlines,
.rm-profile-identity__gridlines,
.rm-profile-dossier__gridlines,
.rm-profile-form__gridlines,
.rm-profile-related__gridlines {
  opacity: 0.55;
  pointer-events: none;
}

.rm-profile-listing .rm-container,
.rm-profile-identity .rm-container,
.rm-profile-dossier .rm-container,
.rm-profile-form .rm-container,
.rm-profile-related .rm-container {
  position: relative;
  z-index: 1;
}

/* ——— Discipline chips ——— */
.rm-profile-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--rm-space-2);
  margin: var(--rm-space-6) 0 var(--rm-space-7);
}

.rm-profile-chip {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--rm-hairline);
  border-radius: var(--rm-radius-pill);
  background: var(--rm-surface);
  color: var(--rm-text);
  font-family: var(--rm-font-body);
  font-size: var(--rm-text-body-sm);
  font-weight: var(--rm-weight-medium);
  text-decoration: none;
  transition:
    color 160ms var(--rm-ease-expo),
    background-color 160ms var(--rm-ease-expo),
    border-color 160ms var(--rm-ease-expo),
    transform 160ms var(--rm-ease-expo);
}

.rm-ground--surface .rm-profile-chip {
  background: var(--rm-concrete);
}

.rm-profile-chip.is-active,
.rm-profile-chip[aria-current="page"] {
  background: var(--rm-signal);
  border-color: var(--rm-signal);
  color: var(--rm-signal-ink);
}

.rm-profile-chip:focus-visible {
  outline: 2px solid var(--rm-signal);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .rm-profile-chip:hover {
    border-color: var(--rm-hairline-strong);
  }

  .rm-profile-chip:not(.is-active):hover {
    color: var(--rm-signal);
  }
}

.rm-profile-chip:active {
  transform: scale(0.97);
}

/* ——— Listing grid ——— */
.rm-profile-listing__intro {
  margin-bottom: 0;
}

.rm-profile-listing__grid {
  display: grid;
  gap: var(--rm-space-7) var(--rm-space-5);
  grid-template-columns: 1fr;
  align-items: stretch;
}

.rm-profile-listing__grid > .rm-profile {
  display: flex;
  height: 100%;
}

@media (min-width: 720px) {
  .rm-profile-listing__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .rm-profile-listing__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ——— Dossier card — compact portrait, name-first density ——— */
.rm-profile--dossier .rm-profile__link {
  display: grid;
  grid-template-columns: 5.75rem minmax(0, 1fr);
  gap: var(--rm-space-4);
  align-items: stretch;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 100%;
  padding: var(--rm-space-4);
  border: 1px solid var(--rm-hairline);
  border-radius: var(--rm-radius-plate);
  background: color-mix(in srgb, var(--rm-concrete) 55%, var(--rm-surface));
  color: inherit;
  text-decoration: none;
  transition:
    transform 180ms var(--rm-ease-expo),
    border-color 180ms var(--rm-ease-expo),
    box-shadow 220ms var(--rm-ease-expo);
}

.rm-ground--concrete .rm-profile--dossier .rm-profile__link {
  background: var(--rm-surface);
}

.rm-profile--dossier .rm-profile__plate {
  display: block;
  width: 5.75rem;
  aspect-ratio: 1;
  margin: 0;
  border-radius: var(--rm-radius-plate);
  border: 1px solid var(--rm-hairline);
  overflow: hidden;
  --rm-grade: 0.28;
  transition:
    border-color 180ms var(--rm-ease-expo),
    box-shadow 220ms var(--rm-ease-expo);
}

.rm-profile--dossier .rm-profile__plate img,
.rm-profile--dossier .rm-profile__plate .rm-profile-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.06) brightness(1.02);
  transition: filter 220ms var(--rm-ease-expo);
}

.rm-profile--dossier .rm-profile__body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
  min-height: 100%;
  padding-top: 0.15rem;
}

.rm-profile--dossier .rm-profile__name {
  font-family: var(--rm-font-display);
  font-size: clamp(1.25rem, 1.1rem + 0.55vw, 1.55rem);
  font-weight: var(--rm-weight-heading);
  letter-spacing: var(--rm-tracking-heading);
  line-height: 1.1;
  transition: color 180ms var(--rm-ease-expo);
}

.rm-profile--dossier .rm-profile__role {
  font-family: var(--rm-font-mono);
  font-size: var(--rm-text-label);
  letter-spacing: var(--rm-tracking-label);
  text-transform: uppercase;
  color: var(--rm-ink-faint);
}

.rm-profile__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: flex-start;
  gap: 0.35rem;
  margin-top: 0.25rem;
  margin-bottom: var(--rm-space-3);
}

.rm-profile__chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  max-width: 100%;
  height: auto;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--rm-hairline);
  border-radius: var(--rm-radius-pill);
  background: var(--rm-surface);
  font-family: var(--rm-font-body);
  font-size: 0.75rem;
  line-height: 1.25;
  color: var(--rm-text-muted);
}

.rm-ground--surface .rm-profile__chip {
  background: var(--rm-concrete);
}

.rm-profile__action {
  display: inline-flex;
  align-items: center;
  align-self: start;
  gap: 0.5rem;
  margin-top: auto;
  font-family: var(--rm-font-body);
  font-size: var(--rm-text-body-sm);
  font-weight: var(--rm-weight-medium);
  color: var(--rm-text);
}

.rm-profile__action-disc {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--rm-radius-pill);
  background: color-mix(in srgb, var(--rm-signal) 18%, transparent);
  color: var(--rm-signal);
  transition: transform 180ms var(--rm-ease-expo);
}

.rm-profile--dossier[data-rm-filter-hidden="true"] {
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 180ms var(--rm-ease-expo),
    transform 180ms var(--rm-ease-expo);
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .rm-profile--dossier .rm-profile__link:hover,
  .rm-profile--dossier .rm-profile__link:focus-visible {
    transform: translateY(-3px);
    border-color: var(--rm-hairline-strong);
    box-shadow: var(--rm-shadow-2);
  }

  .rm-profile--dossier .rm-profile__link:hover .rm-profile__plate img,
  .rm-profile--dossier .rm-profile__link:focus-visible .rm-profile__plate img,
  .rm-profile--dossier .rm-profile__link:hover .rm-profile__plate .rm-profile-placeholder,
  .rm-profile--dossier .rm-profile__link:focus-visible .rm-profile__plate .rm-profile-placeholder {
    filter: contrast(1.06) brightness(1.02);
  }

  .rm-profile--dossier .rm-profile__link:hover .rm-profile__plate::after,
  .rm-profile--dossier .rm-profile__link:focus-visible .rm-profile__plate::after {
    opacity: 0.1;
  }

  .rm-profile--dossier .rm-profile__link:hover .rm-profile__name,
  .rm-profile--dossier .rm-profile__link:focus-visible .rm-profile__name {
    color: var(--rm-signal);
  }

  .rm-profile--dossier .rm-profile__link:hover .rm-profile__action-disc,
  .rm-profile--dossier .rm-profile__link:focus-visible .rm-profile__action-disc {
    transform: translate(1px, -1px);
  }
}

.rm-profile--dossier .rm-profile__link:active {
  transform: scale(0.985);
}

/* ——— Placeholder plate (shared base lives in components.css) ——— */
.rm-profile--dossier .rm-profile-placeholder__initials {
  font-size: 1.35rem;
}

/* ——— Single identity ——— */
.rm-profile-identity__grid {
  display: grid;
  gap: var(--rm-space-7);
  align-items: start;
}

@media (min-width: 900px) {
  .rm-profile-identity__grid {
    grid-template-columns: minmax(16rem, 0.82fr) minmax(0, 1.18fr);
    gap: var(--rm-space-8);
  }
}

.rm-profile-identity__portrait {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 5;
  max-width: 28rem;
  border-radius: var(--rm-radius-plate);
  border: 1px solid var(--rm-hairline);
  overflow: hidden;
  --rm-grade: 0.22;
  opacity: 1;
  transform: none;
}

@media (min-width: 900px) {
  .rm-profile-identity__portrait {
    position: sticky;
    top: 6.25rem;
    width: 100%;
    max-width: none;
  }
}

.rm-profile-identity__frame {
  position: absolute;
  inset: 0.75rem;
  z-index: 2;
  border: 1px solid rgba(244, 245, 243, 0.28);
  pointer-events: none;
}

.rm-js .rm-profile-identity__portrait:not(.is-revealed) {
  opacity: 0.01;
  transform: translateY(18px);
}

.rm-profile-identity__portrait.is-revealed {
  opacity: 1;
  transform: none;
  transition:
    opacity 640ms var(--rm-ease-expo),
    transform 640ms var(--rm-ease-expo);
}

.rm-profile-identity__portrait img,
.rm-profile-identity__portrait .rm-profile-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.2) contrast(1.05);
}

.rm-profile-identity__measures {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--rm-space-3);
  margin: 0 0 var(--rm-space-6);
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .rm-profile-identity__measures {
    grid-template-columns: minmax(0, 1.4fr) auto minmax(0, 1fr);
    align-items: stretch;
  }
}

.rm-profile-measure {
  display: grid;
  gap: 0.35rem;
  padding: var(--rm-space-4);
  border: 1px solid var(--rm-hairline);
  border-radius: var(--rm-radius-plate);
  background: var(--rm-concrete);
}

.rm-profile-measure__label {
  font-family: var(--rm-font-mono);
  font-size: var(--rm-text-label);
  letter-spacing: var(--rm-tracking-label);
  text-transform: uppercase;
  color: var(--rm-text-faint);
}

.rm-profile-measure__value {
  font-family: var(--rm-font-display);
  font-size: var(--rm-text-h4);
  font-weight: var(--rm-weight-heading);
  letter-spacing: var(--rm-tracking-heading);
  line-height: 1.15;
  color: var(--rm-text);
}

.rm-profile-measure--years {
  background: var(--rm-ink-800);
  border-color: var(--rm-ink-700);
  color: var(--rm-text-invert);
}

.rm-profile-measure--years .rm-profile-measure__label {
  color: var(--rm-text-invert-faint);
}

.rm-profile-measure--years .rm-profile-measure__value {
  font-family: var(--rm-font-mono);
  font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.5rem);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--rm-signal);
}

.rm-profile-identity__prose {
  display: grid;
  gap: var(--rm-space-4);
  margin: 0 0 var(--rm-space-6);
  max-width: 62ch;
}

.rm-profile-identity__heading {
  margin: var(--rm-space-3) 0 0;
  font-family: var(--rm-font-display);
  font-size: var(--rm-text-h3);
  font-weight: var(--rm-weight-heading);
  letter-spacing: var(--rm-tracking-heading);
  line-height: 1.1;
}

.rm-profile-identity__intro {
  margin: 0;
  font-size: var(--rm-text-body-lg);
  line-height: 1.55;
  color: var(--rm-text);
}

.rm-profile-identity__prose p {
  margin: 0;
  font-size: var(--rm-text-body);
  line-height: 1.62;
  color: var(--rm-text-muted);
}

.rm-profile-identity__prose .rm-profile-identity__intro {
  color: var(--rm-text);
}

.rm-profile-socials {
  display: flex;
  flex-wrap: wrap;
  gap: var(--rm-space-2);
  margin: 0 0 var(--rm-space-6);
  padding: 0;
  list-style: none;
}

.rm-profile-socials__link {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--rm-hairline);
  border-radius: var(--rm-radius-pill);
  color: var(--rm-text);
  transition:
    color 160ms var(--rm-ease-expo),
    border-color 160ms var(--rm-ease-expo),
    transform 160ms var(--rm-ease-expo);
}

.rm-profile-socials__link:active {
  transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
  .rm-profile-socials__link:hover,
  .rm-profile-socials__link:focus-visible {
    color: var(--rm-signal);
    border-color: var(--rm-hairline-strong);
  }
}

.rm-profile-identity__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--rm-space-3);
}

/* ——— Highlighted facts ——— */
.rm-profile-dossier__intro {
  margin-bottom: var(--rm-space-7);
}

.rm-profile-facts {
  display: grid;
  gap: var(--rm-space-4);
}

@media (min-width: 768px) {
  .rm-profile-facts {
    grid-template-columns: 1.35fr 1fr;
  }
}

.rm-profile-fact {
  display: grid;
  align-content: start;
  gap: var(--rm-space-4);
  padding: var(--rm-space-5);
  border: 1px solid var(--rm-hairline);
  border-radius: var(--rm-radius-plate);
  background: var(--rm-surface);
  box-shadow: var(--rm-shadow-1);
}

.rm-profile-fact--wide,
.rm-profile-fact--tags {
  grid-column: 1 / -1;
}

.rm-profile-fact__label {
  margin: 0;
  font-family: var(--rm-font-mono);
  font-size: var(--rm-text-label);
  font-weight: var(--rm-weight-medium);
  letter-spacing: var(--rm-tracking-label);
  text-transform: uppercase;
  color: var(--rm-text-faint);
}

.rm-profile-fact__body {
  margin: 0;
  font-size: var(--rm-text-body);
  line-height: 1.55;
  color: var(--rm-text);
}

.rm-profile-fact__body--display {
  font-family: var(--rm-font-display);
  font-size: var(--rm-text-h3);
  font-weight: var(--rm-weight-heading);
  letter-spacing: var(--rm-tracking-heading);
  line-height: 1.15;
  max-width: 18ch;
}

.rm-profile-fact__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rm-profile-fact__chips li {
  display: inline-flex;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--rm-hairline);
  border-radius: var(--rm-radius-pill);
  background: var(--rm-concrete);
  font-family: var(--rm-font-body);
  font-size: var(--rm-text-body-sm);
  font-weight: var(--rm-weight-medium);
  line-height: 1.3;
  color: var(--rm-text);
}

.rm-profile-fact__chips--signal li {
  background: color-mix(in srgb, var(--rm-signal) 14%, var(--rm-surface));
  border-color: color-mix(in srgb, var(--rm-signal) 32%, var(--rm-hairline));
}

.rm-profile-fact--cert {
  background: var(--rm-ink-800);
  border-color: var(--rm-ink-700);
}

.rm-profile-fact--cert .rm-profile-fact__label {
  color: var(--rm-text-invert-faint);
}

.rm-profile-fact--cert .rm-profile-fact__body {
  color: var(--rm-text-invert);
}

/* ——— Contact form ——— */
.rm-profile-form__grid {
  display: grid;
  gap: var(--rm-space-7);
}

@media (min-width: 900px) {
  .rm-profile-form__grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: stretch;
    gap: var(--rm-space-8);
  }
}

.rm-profile-form__intro {
  position: relative;
  display: grid;
  align-content: start;
  gap: var(--rm-space-5);
}

.rm-profile-form__contact {
  margin: 0;
  max-width: 28rem;
}

.rm-profile-form__contact a {
  color: inherit;
  text-decoration: none;
}

.rm-profile-form__contact a:hover,
.rm-profile-form__contact a:focus-visible {
  color: var(--rm-signal);
}

.rm-profile-form__social {
  display: grid;
  gap: var(--rm-space-3);
  margin-top: var(--rm-space-2);
}

.rm-profile-form__social-label {
  margin: 0;
  font-family: var(--rm-font-mono);
  font-size: var(--rm-text-label);
  letter-spacing: var(--rm-tracking-label);
  text-transform: uppercase;
  color: var(--rm-text-faint);
}

.rm-profile-form__social .rm-profile-socials {
  margin: 0;
}

.rm-profile-form__panel {
  padding: var(--rm-space-6);
  border: 1px solid var(--rm-hairline);
  border-radius: var(--rm-radius-plate);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--rm-concrete) 70%, var(--rm-surface)), var(--rm-surface));
  box-shadow: var(--rm-shadow-2);
}

.rm-form--profile .wpcf7 {
  margin: 0;
}

.rm-form--profile .wpcf7-form {
  display: grid;
  gap: var(--rm-space-4);
}

.rm-form--profile .quote-form,
.rm-form--profile .single-input {
  display: grid;
  gap: var(--rm-space-4);
}

.rm-form--profile label {
  display: grid;
  gap: 0.4rem;
  font-family: var(--rm-font-body);
  font-size: var(--rm-text-body-sm);
  font-weight: var(--rm-weight-medium);
  color: var(--rm-text-muted);
}

.rm-form--profile input[type="text"],
.rm-form--profile input[type="email"],
.rm-form--profile input[type="tel"],
.rm-form--profile input[type="number"],
.rm-form--profile textarea,
.rm-form--profile select {
  width: 100%;
  min-height: 3.125rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--rm-hairline);
  border-radius: var(--rm-radius-plate);
  background: var(--rm-surface);
  color: var(--rm-text);
  font-family: var(--rm-font-body);
  font-size: var(--rm-text-body);
  transition:
    border-color 160ms var(--rm-ease-expo),
    box-shadow 160ms var(--rm-ease-expo);
}

.rm-form--profile textarea {
  min-height: 8rem;
  resize: vertical;
}

.rm-form--profile input:focus,
.rm-form--profile textarea:focus,
.rm-form--profile select:focus {
  outline: none;
  border-color: var(--rm-signal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--rm-signal) 22%, transparent);
}

.rm-form--profile .wpcf7-not-valid {
  border-color: #b42318;
}

.rm-form--profile .wpcf7-not-valid-tip {
  margin-top: 0.35rem;
  font-size: var(--rm-text-body-sm);
  color: #b42318;
}

.rm-form--profile .wpcf7-response-output {
  margin: var(--rm-space-3) 0 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--rm-hairline);
  border-radius: var(--rm-radius-plate);
  font-size: var(--rm-text-body-sm);
}

.rm-form--profile .wpcf7-mail-sent-ok {
  border-color: color-mix(in srgb, var(--rm-signal) 40%, var(--rm-hairline));
}

.rm-form--profile button,
.rm-form--profile input[type="submit"],
.rm-form--profile .vl-btn,
.rm-form--profile .vl-btn1 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3.125rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--rm-radius-pill);
  background: var(--rm-signal);
  color: var(--rm-signal-ink);
  font-family: var(--rm-font-body);
  font-size: var(--rm-text-btn);
  font-weight: var(--rm-weight-medium);
  cursor: pointer;
  transition:
    background-color 160ms var(--rm-ease-expo),
    transform 160ms var(--rm-ease-expo);
}

.rm-form--profile button:hover,
.rm-form--profile input[type="submit"]:hover,
.rm-form--profile .vl-btn:hover,
.rm-form--profile .vl-btn1:hover {
  background: var(--rm-signal-hover);
}

.rm-form--profile button:active,
.rm-form--profile input[type="submit"]:active {
  transform: scale(0.97);
}

.rm-form--profile button i,
.rm-form--profile .vl-btn i,
.rm-form--profile .fa-solid {
  display: none;
}

.rm-form--profile .wpcf7-spinner {
  margin-left: 0.75rem;
}

/* ——— Related ——— */
.rm-profile-related__grid {
  margin-top: var(--rm-space-7);
}

@media (prefers-reduced-motion: reduce) {
  .rm-js .rm-profile-identity__portrait:not(.is-revealed),
  .rm-profile-identity__portrait.is-revealed {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .rm-profile--dossier .rm-profile__link,
  .rm-profile-chip,
  .rm-profile-socials__link {
    transition: none;
  }
}
