/*
 * ef11 team teaser: dark surface with the fish of the logo as a faint motif,
 * portrait with inner spacing, badges over the right edge of the image.
 */
.ef-person {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 2rem 2rem 2.25rem;
  background-color: var(--ef-person-bg, var(--color-base-100));
  text-decoration: none;
}

/* The fish lies as a layer over the card, the photo under it: with its own
   transparency it shines faintly over the lower part of the portrait (design
   feedback 10.11.2026). Last in the paint order, so above the positioned
   media; clicks pass through. */
.ef-person::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../../../images/motifs/fish.svg");
  background-repeat: no-repeat;
  background-position: left -4rem bottom -3rem;
  background-size: 20rem auto;
  pointer-events: none;
}

/*
 * Surfaces in the order of the design for 3 columns, so neighbours differ
 * in rows and columns: Cool Grey 50, Navy 80 (theme dark), Petrol 50.
 * Counted on the grid items, not the cards: logged in, each card sits in a
 * contextual-region div, in the builder in a dropzone. The colour reaches the
 * card as the inherited --ef-person-bg.
 * ponytail: tuned for 3 columns; with 2 or 4 some neighbours share a colour.
 */
:where([data-component-id$=":teaser_grid"], [data-component-id$=":teaser_grid"] > .db-dropzone) > :is(:nth-child(9n + 1), :nth-child(9n + 5), :nth-child(9n + 9)) {
  --ef-person-bg: #617087;
}

:where([data-component-id$=":teaser_grid"], [data-component-id$=":teaser_grid"] > .db-dropzone) > :is(:nth-child(9n + 3), :nth-child(9n + 4), :nth-child(9n + 8)) {
  --ef-person-bg: #004d59;
}

/* One column (teaser_grid below @cq-md): plain order, no equal colours stacked. */
@container (max-width: 47.99rem) {
  :where([data-component-id$=":teaser_grid"], [data-component-id$=":teaser_grid"] > .db-dropzone) > :nth-child(3n + 1) {
    --ef-person-bg: #617087;
  }

  :where([data-component-id$=":teaser_grid"], [data-component-id$=":teaser_grid"] > .db-dropzone) > :nth-child(3n + 2) {
    --ef-person-bg: var(--color-base-100);
  }

  :where([data-component-id$=":teaser_grid"], [data-component-id$=":teaser_grid"] > .db-dropzone) > :nth-child(3n + 3) {
    --ef-person-bg: #004d59;
  }
}

.ef-person:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
}

.ef-person__media {
  position: relative;
  margin-bottom: 2.5rem;
}

.ef-person__media img {
  display: block;
  width: 100%;
  height: auto;
}

/* Badges: a column over the right edge of the image. */
.ef-person__badges {
  position: absolute;
  top: -1rem;
  right: -2.75rem;
  display: grid;
  gap: 0.5rem;
}

.ef-person__badges :where(div) {
  display: contents;
}

/* Badges in their original look (Acquia certificates, Drupal Association,
   Drupal e.V.; design feedback 10.11.2026): square PNGs with transparent
   edges, no plaque, no filter. The image title is the hover text. */
.ef-person__badges img {
  width: 5.5rem;
  height: 5.5rem;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgb(0 0 0 / 0.35));
}

.ef-person__name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1.625rem;
  color: var(--color-heading);
}

a.ef-person:hover .ef-person__name {
  text-decoration: underline;
}

.ef-person__meta {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  line-height: 1.375rem;
}

.ef-person__text {
  margin-top: 1rem;
  font-size: 0.875rem;
  line-height: 1.375rem;
}

/* Contact person (Figma "Ansprechpartner", 04.11.2026): a small grey kicker
   above the name, e-mail and phone below the function. */
.ef-person__kicker {
  margin: 0;
  color: #8190a9;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.75rem;
  line-height: 1.5625rem;
}

.ef-person__contact {
  margin-top: 1.5rem;
  font-size: 0.875rem;
  line-height: 1.375rem;
}

/* The contact person stands alone, always on Navy (not the grid's colour
   sequence). Figma "Ansprechpartner" (Examples, 11/2026): 24px inside and
   between the blocks, a square photo, no fish; name 18/25, "seit" 13/19
   right below; links in the link colour (Rust 20 on Navy, css/ef11.pcss). */
.ef-person:has(> .ef-person__kicker) {
  --ef-person-bg: var(--color-base-100);
  padding: 1.5rem;

  &::after {
    content: none;
  }

  & .ef-person__media {
    margin-bottom: 1.5rem;
  }

  & .ef-person__media img {
    aspect-ratio: 1;
    object-fit: cover;
  }

  & .ef-person__name {
    font-size: 1.125rem;
    line-height: 1.5625rem;
    margin-top: 0.25rem;
  }

  & .ef-person__meta {
    margin-top: 0;
    font-size: 0.8125rem;
    line-height: 1.1875rem;
  }

  & .ef-person__text {
    margin-top: 1.5rem;
  }
}
