/*
 * CONTACT PERSONS (plugins nrwkulturcontactpersons_contactpersons and _contactpersonsselectedlist, design G1, G2)
 * Contact person card (see Partials/ContactPerson/Card), in the aside as module of the selected contact person (frame
 * and title of the content element) and as cards of the base list grouped by category (.list__wrapper, .list--cards,
 * see base.css).
 * Name (bold) and position, phone and e-mail below with a small spacing, then the availability one blank line below. With
 * profile picture (G1) the picture 96 × 96 is left of the text, without (G2) the text only.
 * The linked name has an arrow, phone and e-mail are regular links, all underlined on hover only.
 */

.contact-person {
    --contact-person--image-size: 6rem;
    --contact-person--gap       : var(--space--s);
    --contact-person--spacing   : var(--layout--gap--small);

    font-size: var(--font-size--text-small);
    line-height: var(--line-height--text-small);
}

.contact-person p {
    margin: 0;
}


/* WITH PROFILE PICTURE (G1) */

.contact-person--image {
    display: flex;
    align-items: flex-start;
    gap: var(--contact-person--gap);
}

/* Grey placeholder, if the contact person has no picture */
.contact-person__media {
    flex: 0 0 auto;
    width: var(--contact-person--image-size);
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--border-radius--default);
    background-color: var(--color--light-grey);
}

/* Format square (see ImageViewHelper) */
.contact-person__image {
    height: 100%;
}

.contact-person__content {
    min-width: 0;
    overflow-wrap: break-word;
    hyphens: auto;
}


/* TEXT */

.contact-person__name {
    font-weight: var(--font-weight--bold);
}

/*
 * Name linked to the detail view of the contact person: not underlined, the arrow after the name marks the link
 * independent of color (decorative, not read by screen readers), underlined on hover, focus by base.css (a:focus-visible)
 */
.contact-person__link {
    color: inherit;
    text-decoration: none;
}

.contact-person__link::after {
    content: "";
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-left: .35em;
    vertical-align: -.15em;
    background-color: currentColor;
    mask: var(--icon--arrow-right) center / contain no-repeat;
}

.contact-person__link:hover {
    text-decoration: underline;
    text-decoration-thickness: var(--text-decoration-thickness--regular);
    text-underline-offset: .2em;
}

/* Backgrounds are replaced in forced colors mode, keep the arrow in the link color */
@media (forced-colors: active) {
    .contact-person__link::after {
        forced-color-adjust: none;
        background-color: LinkText;
    }
}

.contact-person .contact-person__contact {
    margin-top: var(--contact-person--spacing);
}

/* Availability one blank line below the contact data (more specific than the reset of the paragraphs) */
.contact-person .contact-person__availability {
    margin-top: 1lh;
}

/* Without name and position (options of the selected contact person plugin) the contact data starts at the top */
.contact-person .contact-person__content > :first-child {
    margin-top: 0;
}

/* Phone and e-mail links regular, underlined on hover only */
:is(.contact-person__phone-link, .contact-person__email-link) {
    color: inherit;
    text-decoration: none;
}

:is(.contact-person__phone-link, .contact-person__email-link):hover {
    text-decoration: underline;
    text-decoration-thickness: var(--text-decoration-thickness--regular);
    text-underline-offset: .2em;
}

/* The abbreviation is hidden from screen readers (the link names the number type), no dotted underline as in the design */
.contact-person__phone abbr[title] {
    text-decoration: none;
}

.contact-person__availability-title {
    display: block;
}


/* SELECTED: several contact persons of the aside module one below the other, like the contacts of a member */

.contact-persons__selected {
    display: flex;
    flex-direction: column;
    gap: var(--layout--gap--default);
    list-style: none;
}


/* LIST: cards grouped by category */

.contact-persons__category + .contact-persons__category {
    margin-top: var(--layout--gap--large);
}

.contact-persons__category-title {
    margin-bottom: var(--layout--gap--default);
}

/* Same specificity as the card of the base list, the content starts at the top */
.list__wrapper.list--cards .list__item--contactperson {
    justify-content: flex-start;
}
