/*
 * The attachments widget (@KiopstudioUpload/_attachments.html.twig): a box to
 * drop files on, the uploads under way, and the list - a preview on the
 * left, name and size in the middle, the buttons on the right. Bootstrap's
 * custom properties for colours and corners.
 */
.attachments__drop {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
    padding: 1.25rem 1rem;
    margin-bottom: 1rem;
    text-align: center;
    cursor: pointer;
    border: 2px dashed var(--bs-gray-400);
    border-radius: var(--bs-border-radius);
    transition: background-color 0.15s, border-color 0.15s;
}

.attachments__drop:hover,
.attachments__drop:focus-within,
.attachments__drop--over {
    background-color: var(--bs-gray-100);
    border-color: var(--bs-primary);
}

.attachments__drop-icon {
    font-size: 1.75rem;
    color: var(--bs-gray-600);
}

.attachments__choose {
    color: var(--bs-primary);
    text-decoration: underline;
}

.attachments__upload {
    display: grid;
    grid-template-columns: minmax(0, 12rem) 1fr auto;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.attachments__upload .progress {
    height: 0.5rem;
}

.attachments__upload-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachments__item {
    display: grid;
    grid-template-columns: 6rem minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: start;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--bs-gray-200);
}

.attachments__item:last-child {
    border-bottom: 0;
}

.attachments__preview img,
.attachments__preview video {
    width: 6rem;
    max-height: 6rem;
    object-fit: contain;
    background-color: var(--bs-gray-100);
    border-radius: var(--bs-border-radius-sm);
}

.attachments__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 6rem;
    height: 4.5rem;
    font-size: 2rem;
    color: var(--bs-gray-600);
    background-color: var(--bs-gray-100);
    border-radius: var(--bs-border-radius-sm);
}

.attachments__name {
    overflow-wrap: anywhere;
}

.attachments__text {
    max-height: 20rem;
    padding: 0.5rem;
    margin: 0.5rem 0 0;
    overflow: auto;
    font-size: 0.8125rem;
    white-space: pre-wrap;
    background-color: var(--bs-gray-100);
    border-radius: var(--bs-border-radius-sm);
}

/* Markdown rendered: flowing text, not the lines of a file */
.attachments__text--markdown {
    font-size: 0.875rem;
    white-space: normal;
}

/* Markdown as text, by the bundle's own markdown_template */
.attachments__markdown {
    margin: 0;
    white-space: pre-wrap;
}

.attachments__actions {
    display: flex;
    gap: 0.25rem;
}

.attachments__trash {
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--bs-gray-300);
}

.attachments__trash-title {
    font-size: 1rem;
    font-weight: 700;
}
