/* Release note media — hero, gallery grid and the authoring editor rows.
   Global stylesheet: this project has no Blazor scoped CSS (*.razor.css files are dead). */

/* ---------- Reader: hero ---------- */

.rnm-hero {
    margin: 0 0 12px 0;
}

.rnm-hero-img {
    display: block;
    /* Sized to the image itself, bounded on both axes, rather than forced to fill a fixed box:
       - the height cap stops a portrait or square screenshot filling the dialog and burying the
         note body, which is the text the note exists to deliver;
       - letting width/height stay auto means no object-fit letterboxing, so an image whose
         aspect ratio differs from the container gets no dead grey bars beside it;
       - never cropped (no object-fit: cover) — these are screenshots, and cropping one would cut
         off the very UI the note is pointing at.
       Wide screenshots therefore fill the width; tall ones cap and centre. */
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    margin-inline: auto;
    border-radius: 8px;
    border: 1px solid var(--mud-palette-lines-default);
    background-color: var(--mud-palette-background-gray);
}

.rnm-caption {
    margin: 6px 0 0 0;
    font-size: 0.78rem;
    font-style: italic;
    color: var(--mud-palette-text-secondary);
}

/* ---------- Reader: rich-text body ---------- */

/* Rendering rules for a BodyHtml authored in RichTextField. The equivalent rules inside the
   editor live in RichTextField.razor and are scoped to .rtf-editor, so they do NOT apply out
   here — every reader surface needs its own copy. Deliberate differences from the editor:
   tables render BORDERLESS (the editor's dashed guide is an authoring aid), and images are not
   height-capped as hard, since a note body is read at leisure rather than scanned in a toolbar. */

.rn-body {
    font-size: 0.875rem;
    line-height: 1.6;
    /* A pasted wide table or long code line must scroll itself, never the dialog. */
    overflow-x: auto;
}

.rn-body img {
    max-width: 100%;
    max-height: 420px;
    width: auto;
    height: auto;
    border-radius: 6px;
    margin: 8px 0;
}

.rn-body a {
    color: var(--mud-palette-primary);
    text-decoration: underline;
}

.rn-body table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin: 8px 0;
}

.rn-body table td {
    vertical-align: top;
    padding: 4px 8px;
}

.rn-body ul,
.rn-body ol {
    padding-left: 28px;
    margin: 8px 0;
}

.rn-body li {
    margin: 2px 0;
}

.rn-body h1,
.rn-body h2,
.rn-body h3 {
    margin: 12px 0 6px 0;
    line-height: 1.3;
}

.rn-body p {
    margin: 0 0 8px 0;
}

.rn-body blockquote {
    border-left: 3px solid var(--mud-palette-lines-default);
    padding-left: 12px;
    margin: 8px 0;
    color: var(--mud-palette-text-secondary);
}

.rn-body .e-mention-chip {
    display: inline-block;
    padding: 0 4px;
    border-radius: 3px;
    background-color: var(--mud-palette-primary-hover);
    color: var(--mud-palette-primary);
}

.rn-body .e-mention-chip a {
    color: inherit;
    text-decoration: none;
}

/* ---------- Authoring: editor rows ---------- */

.rnm-editor-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.rnm-editor-thumb {
    position: relative;
    flex: 0 0 96px;
    width: 96px;
    height: 72px;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--mud-palette-background-gray);
    border: 1px solid var(--mud-palette-lines-default);
}

.rnm-editor-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rnm-editor-hero-badge {
    position: absolute;
    left: 4px;
    bottom: 4px;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.65);
}

.rnm-editor-fields {
    flex: 1 1 auto;
    min-width: 0;
}

.rnm-editor-filename {
    display: block;
    margin-top: 2px;
    color: var(--mud-palette-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rnm-editor-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}
