/* The witness view (pages/overview.html), small additions in both looks, in the classic colours (bblue-500 brown
   rgb(155 115 58), bred-500 maroon); hand-written, like next.css: no Tailwind rebuild. */

/* fix bundle: the note Annotate gives when there is nothing to annotate (overview.js toggleAnnoBar), and the About
   window of a collection without an About text */
.annotate-note { margin-left: .5rem; font-size: .75rem; line-height: 1rem; color: #830B0C; }
.annotate-note[hidden] { display: none; }
/* #455: a save of the annotations that did not go through is said there until one does (overview.js). The legacy
   look's image toolbar wraps meanwhile, as the new look's does (next.css), instead of squeezing the drawing tools
   out of reach */
html:not([data-ui="next"]) .bg-bgray-500.h-8:has(#annotate-note:not([hidden])) {
    height: auto; min-height: 2rem; flex-wrap: wrap; flex-shrink: 0;
}
html:not([data-ui="next"]) .bg-bgray-500.h-8:has(#annotate-note:not([hidden])) :is(#showrl, #hiderl) { white-space: nowrap; }
.about-empty { color: #4b5563; }

/* roadmap idea 11, image follows the text (js/image_follow.js): its switch at the end of the image toolbar */
.image-follow {
    display: inline-flex; align-items: center; gap: .375rem; margin-left: auto; margin-right: .75rem;
    padding: .125rem 0; font-size: .875rem; line-height: 1.25rem; color: rgb(155 115 58); white-space: nowrap;
    cursor: pointer; user-select: none; -webkit-user-select: none;
}
.image-follow[hidden] { display: none; }
.image-follow input { width: 1rem; height: 1rem; margin: 0; accent-color: rgb(155 115 58); cursor: pointer; }
.image-follow input:focus-visible { outline: 2px solid #830B0C; outline-offset: 2px; }
/* the new look: its toolbar type, and a target a finger can hit */
html[data-ui="next"] .image-follow { font-family: var(--font-ui); }
@media (pointer: coarse) {
    .image-follow { min-height: 2.25rem; padding: 0 .25rem; }
    .image-follow input { width: 1.25rem; height: 1.25rem; }
}
/* phones (the toolbar wraps there): the switch keeps to the right of its line */
@media (max-width: 767px) {
    html[data-ui="next"] .image-follow { margin-right: .5rem; }
}
/* the legacy look on phones (its page is not responsive): the image toolbar wraps as the new look's does
   (next.css), instead of pushing the switch past its right edge; only on pages that have the switch. It grows to
   hold its lines (flex-shrink: 0: the column it is in would squeeze it back to one line, and the second line would
   lie under the text panel) */
@media (max-width: 639px) {
    html:not([data-ui="next"]) .bg-bgray-500.h-8:has(#image-follow-label) {
        height: auto; min-height: 2rem; flex-wrap: wrap; flex-shrink: 0;
    }
    html:not([data-ui="next"]) .bg-bgray-500.h-8:has(#image-follow-label) :is(#showrl, #hiderl) { white-space: nowrap; }
}
/* #448: on phones the legacy look's transcription toolbar (A buttons, keyboard, History, Highlight Lemma, Hyphenate,
   Edit) wraps as the new look's does (next.css). Its panel cuts off what overflows (overflow: hidden), and the
   toolbar is about 590 px wide, so on a 390 px phone Edit lay past the panel's right edge, where no sideways scroll
   of the page could bring it. Phones only, as the image toolbar above: a wider window keeps its toolbar as it was */
@media (max-width: 639px) {
    html:not([data-ui="next"]) #tab-transcription form > div.bg-bgray-500.flex-row { flex-wrap: wrap; }
}

/* Philipp (24 Nov 2026): the Passage picker as wide as the longest passage name of the witness, so that each name
   shows whole (collection 129's run to 58 characters, "1.4. Introduction: Contents, purpose, and their connection").
   A select is as wide as its widest option: the 6rem it was held to (Tailwind max-w-24) showed "1.1. Preli". It
   keeps that width through the witness's passages, so the arrows beside it stay where they are as one steps
   through them. Never narrower than the 6rem it was; capped for a name of a whole paragraph (none so long yet: 30rem
   holds 129's longest). The toolbar wraps where it has no room, in the legacy look too (it ran past the window's right edge, where
   All Folios could not be reached); a toolbar that fits stays one line, as it was. On phones (new look, next.css)
   each picker is its column's width */
#witness-toolbar #passage { min-width: 6rem; max-width: 30rem; }
html:not([data-ui="next"]) #witness-toolbar { flex-wrap: wrap; flex-shrink: 0; }
/* a window narrower than the picker with its arrows (the legacy look, which has no phone layout): the picker gives
   way, down to its 6rem, on the line it has to itself; its label and arrows keep their size. The arrows lay past the
   window's edge, where no scrolling brings them back */
#witness-toolbar > .passage-group { min-width: 0; }
#witness-toolbar > .passage-group > :not(select) { flex-shrink: 0; }
/* the legacy look on phones (its page has a fixed height): one line that can be swiped sideways, rather than five
   lines that left the image and the transcription no room at all (375 x 667), and on a phone held sideways, short
   and touched, where four lines left them 29px (667 x 375) */
@media (max-width: 639px), (max-height: 500px) and (pointer: coarse) {
    html:not([data-ui="next"]) #witness-toolbar { flex-wrap: nowrap; overflow-x: auto; }
    html:not([data-ui="next"]) #witness-toolbar > * { flex-shrink: 0; }
    /* there, and on any short touch screen, the closed picker stays within 10rem: whole, 129's names pushed the
       next and last arrows and Compare off a phone held sideways (each step reloads the page, the strip back at
       its start), or the new look's toolbar to a third line in a window 375px tall. The phone's own list shows
       the names whole. New-look phones (767px and less) keep each picker to its column (next.css) */
    #witness-toolbar #passage { max-width: 10rem; }
}
