/*
 * RECORD DETAIL VIEWS (news, events: plugin templates; funding types, funding programs, funding projects, artist
 * groups, members: page templates Records/*, starting with the partial Record/Intro; contact persons: page template
 * Records/ContactPerson, starting with the profile)
 * Proposal without design, built from the elements of the design: label bar (C4), lead, rich text (cb_text),
 * E2 buttons, framed modules (G1-G5).
 *
 * Mobile first, one column. From 64rem element width (container "record-detail") the content takes 8 and the facts
 * 4 of 12 columns, like main column and aside of the sidebar layout. Without facts the content keeps the 8 columns,
 * so the line length stays readable. Artist groups use the aside of the page for their facts instead.
 * News have no facts and no aside: their content takes the full width, without the line length limit.
 *
 * Accessibility
 * - White text on orange only as large text (label bar in --font-size--label, bold)
 * - Facts as description list, sections with headings, the facts box is a labelled landmark (aside)
 */

.record-detail {
    --record-detail--gap: var(--layout--gap--large);
    /* Line length of the rich text (cb_text), also outside of content elements (artist group page) */
    --content-element--measure: 70ch;

    container: record-detail / inline-size;

    display: flex;
    flex-direction: column;
    gap: var(--record-detail--gap);
}


/* HEADER: label bar, h1, meta line, lead */

.record-detail__header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--layout--gap--default);
}

.record-detail__label {
    padding: var(--space--s) var(--padding--default);
    border-radius: var(--border-radius--round);
    font-size: var(--font-size--label);
    font-weight: var(--font-weight--bold);
    line-height: var(--line-height--single);
}

.record-detail__meta {
    font-size: var(--font-size--text-small);
    font-weight: var(--font-weight--bold);
    line-height: var(--line-height--text-small);
}

/* Stretch: the header is a flex column with align-items: flex-start, so the teaser would keep its min-content width
   (e.g. words joined by pasted no-break spaces) and overflow narrow viewports. The measure is "none" for news, so
   min(measure, 100%) is no option. */
.record-detail__teaser {
    align-self: stretch;
    max-width: var(--content-element--measure);
}


/* COLUMNS: content and facts */

.record-detail__columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--record-detail--gap);
}

.record-detail__content {
    display: flex;
    flex-direction: column;
    gap: var(--record-detail--gap);
    min-width: 0;
}

@container record-detail (min-width: 64rem) {
    .record-detail__columns {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        column-gap: var(--grid--gap);
        align-items: start;
    }

    .record-detail__content {
        grid-row: 1;
        grid-column: 1 / span 8;
    }

    .record-detail__facts {
        grid-row: 1;
        grid-column: 9 / span 4;
    }
}


/* NEWS: full width (no facts, no aside), also the text and content elements of the news without line length limit */

.record-detail--news,
.record-detail--news .content-element {
    --content-element--measure: none;
}

@container record-detail (min-width: 64rem) {
    .record-detail--news .record-detail__content {
        grid-column: 1 / -1;
    }
}


/* FACTS: framed box like the modules of the aside (G1-G5) with a description list */

.record-detail__facts {
    display: flex;
    flex-direction: column;
    gap: var(--layout--gap--default);
    padding: var(--padding--default);
    border: var(--border-width--default) solid currentColor;
    border-radius: var(--border-radius--default);
}

.record-detail__facts-title {
    font-family: var(--font-family--text);
    font-size: var(--font-size--h3);
    font-weight: var(--font-weight--bold);
    line-height: var(--line-height--sub-headline);
}

.record-detail__facts-list {
    display: flex;
    flex-direction: column;
    gap: var(--layout--gap--default);
    font-size: var(--font-size--text-small);
    line-height: var(--line-height--text-small);
}

.record-detail__fact dt {
    font-weight: var(--font-weight--bold);
}

/* Paragraphs of RTE values without extra spacing */
.record-detail__fact dd :is(p, ul, ol) {
    margin: 0;
}

/* Free text below the facts list (e.g. booking period): heading and RTE text in the style of a fact */
.record-detail__fact-text {
    font-size: var(--font-size--text-small);
    line-height: var(--line-height--text-small);
}

.record-detail__fact-text h3 {
    margin: 0;
    font-family: var(--font-family--text);
    font-size: inherit;
    font-weight: var(--font-weight--bold);
    line-height: inherit;
}

/* Paragraphs and list items as well, the rich text sets them to the normal text size (see Text.css) */
.record-detail__fact-text .cb-text,
.record-detail__fact-text .cb-text :is(p, li) {
    font-size: inherit;
    line-height: inherit;
}

.record-detail__module {
    display: flex;
    flex-direction: column;
    gap: var(--layout--gap--default);
}

/* The gap of the module is the spacing, not the header margin of content elements (see BaseContentElement.css) */
.content-element.record-detail__module > .content-element__header {
    margin-bottom: 0;
}


/* CONTACTS of a member (aside module): contact person cards one below the other (see ContactPersons.css) */

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


/*
 * BOOKING CONTACT of an artist group (aside module): contact person card without picture (G2, see ContactPersons.css),
 * the contact text is rich text: in the text size of the card without paragraph spacing, the first paragraph bold like
 * the name of a contact person
 */

.record-detail__booking-contact .cb-text,
.record-detail__booking-contact .cb-text :is(p, li) {
    margin: 0;
    font-size: inherit;
    line-height: inherit;
}

/*
 * Title without hyphenation (base.css hyphenates headlines): "Buchungsanfragen" stays one word, so the balanced title
 * is one line or "Kontakt für" / "Buchungsanfragen". Long words still break on very small screens (overflow-wrap).
 */
.record-detail__booking-contact-title {
    hyphens: manual;
}

.record-detail__booking-contact .cb-text > :first-child {
    font-weight: var(--font-weight--bold);
}


/* PROFILE of a contact person as hero of the page (no record hero): square picture (grey placeholder without picture)
   and the base information with the h1. Mobile the picture above the text, from 40rem element width at the left of it
   (1/3 of the width, at most 24rem), the text vertically centered next to it. */

.record-detail__profile {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--record-detail--gap);
    align-items: start;
}

.record-detail__profile-media {
    width: 100%;
    max-width: 24rem;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--border-radius--default);
    background-color: var(--color--light-grey);
}

/* Format square (see ImageViewHelper) */
.record-detail__profile-image {
    display: block;
    width: 100%;
    height: 100%;
}

.record-detail__profile-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--layout--gap--default);
    min-width: 0;
    overflow-wrap: break-word;
}

/* Long names wrap instead of overflowing the column */
.record-detail__profile .record-detail__title {
    hyphens: auto;
}

@container record-detail (min-width: 40rem) {
    .record-detail__profile {
        grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
        column-gap: var(--grid--gap);
        align-items: center;
    }
}


/* SECTIONS of the content: heading and text, downloads, links */

.record-detail__section {
    display: flex;
    flex-direction: column;
    gap: var(--layout--gap--default);
}

.record-detail__section-title {
    font-family: var(--font-family--text);
    font-size: var(--font-size--h3);
    font-weight: var(--font-weight--bold);
    line-height: var(--line-height--sub-headline);
}

.record-detail__buttons {
    display: flex;
    flex-direction: column;
    gap: var(--layout--gap--small);
    list-style: none;
}

/* Social media links as round icon buttons in a row (see .btn--social in base.css) */
.record-detail__social {
    display: flex;
    flex-wrap: wrap;
    gap: var(--layout--gap--small);
    list-style: none;
}

/* Type and size of downloads, the label keeps one line (see .btn--wide) */
.record-detail__file-info {
    font-weight: var(--font-weight--regular);
}


/* GALLERY: images after the hero image, two columns from 30rem element width, rounded like the media (cb_media) */

.record-detail__gallery {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--grid--gap);
    list-style: none;
}

@container record-detail (min-width: 30rem) {
    .record-detail__gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.record-detail__figure {
    margin: 0;
}

.record-detail__image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--border-radius--default);
}

.record-detail__caption {
    margin-top: var(--layout--gap--small);
    font-size: var(--font-size--text-small);
    line-height: var(--line-height--text-small);
}


/* FOOTER: back to the list */

.record-detail__footer {
    padding-top: var(--layout--gap--default);
    border-top: var(--border-width--default) solid currentColor;
}
