/* The folds of the release notes page (theme release-notes-folding).

   A long bullet is a headline with its text folded under it, in the page's HTML:
   <li><details class="release-note"><summary><strong>Headline.</strong></summary><p>...</p></details></li>.
   Each release after the newest three is folded whole under a line of counts,
   details.release-fold, by assets/js/main.js, which does so only on a page that links this file.

   The rules are in a file of their own, not in tp.css, so that a page published with folds in it
   never meets an older cached stylesheet without them: Bootstrap's reset makes a summary a plain
   block, which takes the browser's own disclosure marker away, and a headline whose text is
   hidden with no marker beside it reads as the whole bullet. */

/* A summary is a block, from Bootstrap, so the whole line is the click target. */
details.release-note > summary,
details.release-fold > summary {
    position: relative;
    cursor: pointer;
}

/* Safari draws its own marker whatever the display; the one below is the same in every browser. */
details.release-note > summary::-webkit-details-marker,
details.release-fold > summary::-webkit-details-marker {
    display: none;
}

/* The marker: a triangle pointing right while the fold is closed and down once it is open. */
details.release-note > summary::before,
details.release-fold > summary::before {
    content: "";
    position: absolute;
    top: 0.5em;
    border-style: solid;
    border-width: 0.3em 0 0.3em 0.48em;
    border-color: transparent transparent transparent currentColor;
    transition: transform 0.15s;
}

details.release-note[open] > summary::before,
details.release-fold[open] > summary::before {
    transform: rotate(90deg);
}

/* A folded bullet: the marker stands where the list's disc would, so headlines and the short
   bullets between them share one left edge. */
li:has(> details.release-note) {
    list-style: none;
}

details.release-note > summary {
    padding: 2px 0;
}

details.release-note > summary::before {
    left: -1.05em;
    color: #616670;
}

/* A closed headline reads as the bullet it is, in the weight of the short bullets around it: a
   section of forty bold lines is a wall. Opened, it is bold, to stand apart from its text. */
details.release-note > summary > strong {
    font-weight: inherit;
}

details.release-note[open] > summary > strong {
    font-weight: bold;
}

/* The opened text sits indented under its headline, marked off by a rule down its left side. */
details.release-note > p,
details.release-note > ul,
details.release-note > ol {
    margin: 6px 0 10px 2px;
    padding-left: 14px;
    border-left: 2px solid #e3e6ea;
}

details.release-note > ul,
details.release-note > ol {
    padding-left: 34px;
}

/* A code sample in the text keeps its own box, with its left edge where the words start:
   the 2px margin, 2px rule and 14px padding of the paragraphs around it. */
details.release-note > pre {
    margin: 6px 0 10px 18px;
}

/* A folded release: one muted line of counts under the release's heading. */
details.release-fold > summary {
    padding: 2px 0 2px 1.2em;
    color: #616670;
}

details.release-fold > summary::before {
    left: 0.15em;
}

details.release-fold > summary:hover,
details.release-note > summary:hover::before {
    color: #40babd;
}

details.release-fold[open] > summary {
    margin-bottom: 12px;
}

/* ===== Link icons on a headline (assets/js/main.js adds them) ===== */
/* One for each page the bullet's text links to, after the headline's words, so a reader can go
   to the page without opening the bullet. Quiet at rest, so a list of headlines still reads as
   headlines, and the brand teal when pointed at or focused. The grey is 4:1 on white, over the
   3:1 an icon needs. The padding makes each a 24 px target whatever the text size, and moves no
   line: the icon is an inline box. A glyph's size and stroke are attributes of its svg, and the
   icons are kept off paper by Bootstrap's hidden-print on their element, so neither depends on
   which copy of this file a reader has. */
details.release-note > summary .rn-links {
    margin-left: 0.15em;
}

details.release-note > summary a.rn-link {
    padding: calc(12.5px - 0.5em);
    font-size: 0.82em;
    color: #7a808a;
    text-decoration: none;
}

details.release-note > summary a.rn-link:hover,
details.release-note > summary a.rn-link:focus {
    color: #40babd;
}

details.release-note > summary a.rn-link svg {
    vertical-align: -0.12em;
}

/* ===== Search box (assets/js/main.js adds it) ===== */
/* One row at the top of the notes: the box, then previous, next and clear, with the count of
   matches on a line beneath and any note about the search on a line under that (each is a div,
   so they are two lines without a rule here). With the box empty it scrolls away like the rest
   of the page.
   While a search is running it is pinned below the site's header, which is fixed to the top of
   the window (the script sets how far down), so the count and the buttons are in reach from any
   match. The background is the page's. */
form.rn-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 6px;
    margin: 0 0 20px;
    padding: 8px 0;
    background: #f9f9fb;
}

form.rn-search.rn-search-active {
    position: sticky;
    z-index: 10;
    border-bottom: 1px solid #e3e6ea;
}

/* A heading a link goes to stops below the pinned bar: the bar's height (the script measures it)
   more than the 80px the page already leaves for the header, which is also where a sidebar link
   lands it. 100px where the height is not known. */
form.rn-search.rn-search-active ~ section.doc-section,
form.rn-search.rn-search-active ~ section.doc-section [id] {
    scroll-margin-top: 100px;
    scroll-margin-top: var(--rn-search-bar, 100px);
}

/* On a phone the site's stylesheet hides what overflows the page's container, which also stops
   anything inside it from being pinned. Clipping hides the same and pins; a browser that does
   not know it keeps the site's rule, and the bar scrolls away. */
@media only screen and (max-width: 767px) {
    .doc-wrapper > .container {
        overflow: clip;
    }
}

/* 16px, so a phone does not zoom the page when the box takes the focus. The bar has its own
   clear button, so the one some browsers draw inside the box is off. */
form.rn-search input[type="search"] {
    flex: 1 1 8em;
    min-width: 0;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #c5cad1;
    border-radius: 4px;
    background: #fff;
    color: inherit;
    font-size: 16px;
}

form.rn-search input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

form.rn-search button {
    flex: none;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #c5cad1;
    border-radius: 4px;
    background: #fff;
    color: #494d55;
    line-height: 0;
}

form.rn-search button:hover,
form.rn-search button:focus {
    border-color: #40babd;
    color: #2b8d90;
}

form.rn-search button:disabled {
    border-color: #e3e6ea;
    color: #b4b9c1;
    cursor: default;
}

form.rn-search .rn-search-status {
    flex: 1 0 100%;
    margin: 4px 0 0;
    color: #616670;
    font-size: 0.93em;
}

/* An empty count takes no room. It is still on the page, because a screen reader announces a
   change only in a live region it already knows, and does not know one that is not displayed. */
form.rn-search:not(.rn-search-active) .rn-search-status {
    height: 0;
    margin: 0;
    overflow: hidden;
}

/* A match, and the one the count names, which is told apart by its outline as well as its
   colour. Dark text on either is over 7:1. */
mark.rn-hit {
    padding: 0;
    background: #ffe58a;
    color: #22252a;
}

mark.rn-hit.rn-hit-current {
    background: #ffa64d;
    outline: 2px solid #b85c00;
}

/* ===== The Upgrade label ===== */
/* A bullet that changes what an existing install does, or asks the upgrader to act, is
   <li class="upgrade-note"> in the page. Its label is drawn here, after the headline's words
   and before its link icons, so the notes gain no word: a screen reader reads the label with
   the headline, and it prints. The brown on cream is 7:1. The sentence above the first release
   that says what the label means shows the word the same way. */
li.upgrade-note > details.release-note > summary > strong::after {
    content: "Upgrade";
    margin-left: 0.5em;
}

li.upgrade-note > details.release-note > summary > strong::after,
.release-notes-legend .upgrade-label {
    padding: 0.1em 0.45em;
    border: 1px solid #e0b872;
    border-radius: 3px;
    background: #fff6e5;
    color: #7a4a00;
    font-size: 0.72em;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    vertical-align: 0.12em;
}

/* A marked note that tells the upgrader to do something before or when upgrading is also class
   "action-needed". Its second label stands right after the first, and is read and printed as
   the first is. A headline with link icons draws it ahead of them, in their element. That
   element is not on paper, and is not there without JavaScript or on a headline whose text
   links nowhere: there the summary's own generated content draws it. The dark red on pale red
   is 8:1. */
li.upgrade-note.action-needed > details.release-note > summary > .rn-links::before {
    content: "Action needed";
    margin: 0 0.25em 0 0.3em;
}

li.upgrade-note.action-needed > details.release-note > summary:not(:has(> .rn-links))::after {
    content: "Action needed";
    margin-left: 0.5em;
}

@media print {
    li.upgrade-note.action-needed > details.release-note > summary::after {
        content: "Action needed";
        margin-left: 0.5em;
    }
}

li.upgrade-note.action-needed > details.release-note > summary > .rn-links::before,
li.upgrade-note.action-needed > details.release-note > summary::after,
.release-notes-legend .action-label {
    padding: 0.1em 0.45em;
    border: 1px solid #e3a59d;
    border-radius: 3px;
    background: #fdecea;
    color: #8a1f11;
    font-size: 0.72em;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    vertical-align: 0.12em;
}

p.release-notes-legend {
    margin: 0 0 20px;
    color: #616670;
    font-size: 0.93em;
}

/* ===== The upgrade view (assets/js/main.js adds its list and hides what it leaves out) ===== */
/* Under the search box: a list of the page's releases, and a line that says what the view
   shows. The line is always on the page, so a screen reader announces it when it changes, and
   it prints with the notes; the list and the button do not. */
form.rn-upgrade {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    margin: 0 0 16px;
}

form.rn-upgrade label {
    margin: 0;
    color: #494d55;
    font-weight: normal;
}

/* 16px, so a phone does not zoom the page when the list takes the focus. */
form.rn-upgrade select,
form.rn-upgrade button {
    height: 36px;
    max-width: 100%;
    padding: 0 10px;
    border: 1px solid #c5cad1;
    border-radius: 4px;
    background: #fff;
    color: #494d55;
    font-size: 16px;
}

form.rn-upgrade button:hover,
form.rn-upgrade button:focus,
form.rn-search button.rn-search-all:hover,
form.rn-search button.rn-search-all:focus {
    border-color: #40babd;
    color: #2b8d90;
}

form.rn-upgrade .rn-upgrade-status {
    flex: 1 0 100%;
    margin: 0;
    color: #616670;
    font-size: 0.93em;
}

/* The search's offer to look in every note, when the view shows none with the words: a button
   with words, where the bar's other buttons are icons. */
form.rn-search button.rn-search-all {
    width: auto;
    height: auto;
    margin-left: 6px;
    padding: 2px 8px;
    line-height: inherit;
}

/* Before the releases nobody read for upgrade notes, which the view leaves whole. */
p.rn-upgrade-unreviewed {
    margin: 24px 0;
    padding: 10px 14px;
    border-left: 3px solid #e0b872;
    background: #fff6e5;
    color: #5c3900;
}

/* What the view hides is hidden by the attribute, which Bootstrap honours without this file.
   This makes sure of it against any rule that gives one of those elements a display. */
.content-inner [hidden] {
    display: none !important;
}
