/*
 * Layout correction for the current-role section.
 * Loaded after styles.css and brand.css so these rules take precedence.
 */

.current-role {
  display: grid;
  /*
   * Both tracks can shrink inside the card. The previous hard 560px
   * minimum forced the summary beyond the right edge on some screens.
   */
  grid-template-columns: minmax(350px, 0.82fr) minmax(0, 1.18fr);
  column-gap: clamp(3.5rem, 5vw, 5.5rem);
  row-gap: 2.75rem;
  align-items: start;
  padding: clamp(3rem, 5vw, 5rem);
}

.role-heading,
.role-facts,
.role-summary {
  min-width: 0;
}

.role-heading {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.current-role h2 {
  max-width: 440px;
  margin: 0.9rem 0 3.5rem;
  font-size: clamp(3rem, 4.2vw, 4.25rem);
  line-height: 0.98;
}

/* The previous inherited light colour made this text almost invisible. */
.current-role .role-heading > p:last-child {
  max-width: 390px;
  margin: 0;
  padding-top: 1rem;
  color: var(--text) !important;
  border-top: 1px solid var(--hairline);
  font-family: var(--humanist);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.6;
}

.role-facts {
  display: grid;
  grid-column: 2;
  grid-row: 1;
  grid-template-columns: 1fr;
  width: 100%;
  gap: 0;
  border-top: 1px solid var(--hairline);
}

.role-facts > div {
  display: grid;
  grid-template-columns: minmax(125px, 0.28fr) minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--hairline);
}

.role-facts .fact-label {
  margin: 0;
  padding-top: 0.12rem;
}

.role-facts strong {
  display: block;
  min-width: 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.5;
}


.company-focus strong {
  max-width: 36rem;
  white-space: normal !important;
  text-wrap: balance;
}

/* Keep the short contract period together on desktop. */
.role-facts > div:first-child strong {
  white-space: nowrap;
}

.role-summary {
  grid-column: 2;
  grid-row: 2;
  width: auto;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding-right: 0.25rem;
  overflow-wrap: break-word;
  font-size: 1rem;
  line-height: 1.75;
}


.role-fact-main {
  /*
   * Unlike Appointment and Programs, the role list uses the full width
   * of the right-hand panel. This prevents phrases such as
   * “Multi-omics lead” and “Patient stratification” from splitting.
   */
  display: block !important;
  min-height: 0;
  padding: 1.25rem 0 1.5rem;
}

.role-fact-main .fact-label {
  display: block;
  margin: 0 0 0.7rem;
  padding: 0;
}

.role-list {
  display: flex !important;
  flex-direction: column;
  gap: 0.34rem;
  width: 100%;
}

.role-list .role-item {
  display: block !important;
  width: max-content;
  max-width: none;
  white-space: nowrap !important;
  line-height: 1.42;
}

.role-list .role-separator {
  color: var(--signal);
  font-weight: 700;
}

/* Keep the summary inside the available grid track. */
.role-summary {
  max-width: 100%;
}


.current-role .role-facts,
.current-role .role-summary {
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Stack before the two columns become cramped. */
@media (max-width: 1100px) {
  .current-role {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 2.75rem;
  }

  .role-heading,
  .role-facts,
  .role-summary {
    grid-column: 1;
    grid-row: auto;
  }

  .current-role h2 {
    max-width: 760px;
    margin-bottom: 2rem;
  }
}

@media (max-width: 620px) {
  .role-facts > div:first-child strong {
    white-space: normal;
  }

  /*
   * Role phrases remain intact. The font is reduced slightly only on
   * very narrow screens instead of breaking a phrase across two lines.
   */
  .role-list {
    font-size: 0.92rem;
  }

  .role-list .role-item {
    white-space: nowrap !important;
  }
}

/* Updated portrait photograph. */
.portrait-photo {
  background-image: url("assets/Rafael_Soler_Ortuno_portrait.webp") !important;
  background-position: center center !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
}
