/*
 * The notes body is editor-authored markup from the wysiwyg field, so it
 * carries no classes of its own and utility classes cannot reach it. These
 * rules reach it by descent from the wrappers the module's views emit.
 *
 * They deliberately do not hang off the theme's wrappers: those differ by
 * display type - "content-item release" on Detail, "content content-patch"
 * on Summary - so they are not a stable hook.
 *
 * Colours come from Bootstrap 5.3 custom properties so the rules follow the
 * viewer's light or dark choice rather than pinning one.
 */

.release-notes,
.patch-notes {
    /* Unbroken strings in the body - UNC paths, URLs - would otherwise widen
       the page rather than wrap. */
    overflow-wrap: anywhere;
}

/* A table pasted by an editor has no wrapper to scroll inside, so the table
   itself becomes the scroll container. */
.release-notes table,
.patch-notes table {
    display: block;
    width: max-content;
    max-width: 100%;
    overflow-x: auto;
    margin-bottom: 1rem;
    border-collapse: collapse;
}

.release-notes th,
.release-notes td,
.patch-notes th,
.patch-notes td {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--bs-border-color);
    vertical-align: top;
}

.release-notes thead th,
.patch-notes thead th {
    background-color: var(--bs-secondary-bg);
    white-space: nowrap;
}

/* Editors use a blockquote for upgrade warnings, which otherwise reads as
   an ordinary paragraph. */
.release-notes blockquote,
.patch-notes blockquote {
    margin: 1.5rem 0;
    padding: 0.75rem 1rem;
    border-left: 0.25rem solid var(--bs-warning-border-subtle, var(--bs-border-color));
    background-color: var(--bs-secondary-bg);
}

.release-notes blockquote > :last-child,
.patch-notes blockquote > :last-child {
    margin-bottom: 0;
}

.release-notes img,
.patch-notes img {
    max-width: 100%;
    height: auto;
}

.release-notes pre,
.patch-notes pre {
    padding: 0.75rem 1rem;
    overflow-x: auto;
    background-color: var(--bs-secondary-bg);
    border-radius: 0.25rem;
}

.release-notes h2,
.patch-notes h2 {
    margin-top: 2rem;
}

.release-notes h3,
.patch-notes h3 {
    margin-top: 1.5rem;
    font-size: 1.15rem;
}

/* Last, so it wins over the generic heading rule when the version renders as
   a heading in Summary. */
.release-version {
    margin: 0 0 1rem;
    font-size: 1.1rem;
    color: var(--bs-secondary-color);
    font-variant-numeric: tabular-nums;
}
