/*
    #1038 — inbound attachments in a message thread (Client/Components/MessageAttachments.razor).

    A global stylesheet rather than a scoped .razor.css: scoped CSS is not wired up in this
    application (the isolation bundle is not linked, so a .razor.css file silently never loads), and
    a <style> block inside the component would be duplicated into the DOM once per message bubble.
*/

.inbound-media {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 6px;
}

.inbound-media-item {
    display: inline-flex;
}

/* The chip shape the #960 marker introduced, kept so a thread with attachments in both states does
   not look like two different features. */
.inbound-media-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: inherit;
    font-size: 12px;
    font-style: italic;
    cursor: default;
}

.inbound-media-chip-action {
    cursor: pointer;
    font-style: normal;
}

.inbound-media-chip-action:hover {
    background: rgba(0, 0, 0, 0.14);
}

/* A message received before #942 stored attachments: there is nothing to open, so it must not look
   like there is. */
.inbound-media-chip-legacy {
    cursor: default;
}

.inbound-media-thumb {
    padding: 0;
    border: 0;
    background: none;
    line-height: 0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

.inbound-media-thumb img {
    display: block;
    /* Bounded in both directions: an MMS photograph can be any aspect ratio, and a portrait one
       sized only by width pushes the rest of the conversation off the screen. */
    max-width: 220px;
    max-height: 220px;
    object-fit: cover;
    border-radius: 8px;
}

.inbound-media-video {
    max-width: 260px;
    max-height: 260px;
    border-radius: 8px;
}

.inbound-media-thumb:focus-visible,
.inbound-media-chip-action:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* On a saturated bubble (the patient thread's gradients) the ink is light, so the chip has to be a
   light-on-dark translucency instead — the same values the #960 chip uses there. */
.inbound-media-on-colour .inbound-media-chip {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.35);
}

.inbound-media-on-colour .inbound-media-chip-action:hover {
    background: rgba(255, 255, 255, 0.32);
}
