/* docs-css - the Platform Admin's document shelf: the upload template, the paper on screen,
   and the row that has not been read yet. */

/* the template is a form, not prose: six short fields - document, the school it goes to, term,
   year, class, subject - with the three lines that need room, the title, the note to teachers and
   the file, across the whole card.
   The column count is written out instead of left to auto-fit, because auto-fit answered five
   tracks on the 1082px card and four at 1280, and six fields on five tracks leaves one field alone
   on a row of its own. One, two and three each divide six, so the last row is always full, and
   three tracks is the narrowest desktop row whose box still holds a school's whole name: the
   longest string this field is asked to show is a school, and a select can neither wrap its words
   nor be scrolled through. Measured at 1440: six tracks give 169px, and a school of 41 characters
   needs 270px of that before the browser's own arrow; three tracks give 351px, which holds it. */
.docform{display:grid;grid-template-columns:minmax(0,1fr);gap:13px 14px}
@media (min-width:620px){.docform{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (min-width:1040px){.docform{grid-template-columns:repeat(3,minmax(0,1fr))}}
.docform>div{display:flex;flex-direction:column;gap:5px;min-width:0}
.docform .wide{grid-column:1/-1}
.docform label{font-size:10.5px;font-weight:800;letter-spacing:.11em;text-transform:uppercase;color:var(--mu)}

/* nothing else in the app takes a file, so the picker arrives with the browser's own paint -
   which puts its label in a colour that vanishes on the dark card */
.docup input[type=file]{font:inherit;color:var(--tx);background:var(--field);border:1px solid var(--bd);border-radius:12px;padding:9px 12px;width:100%}
.docup input[type=file]::file-selector-button{font:inherit;font-weight:700;font-size:12.5px;color:var(--tx);background:var(--sf);border:1px solid var(--bd);border-radius:999px;padding:6px 13px;margin-right:10px;cursor:pointer}
.docup input[type=file]:focus-visible{outline:3px solid var(--ac);outline-offset:2px}

/* a document this account has not opened yet is the one to read, so the whole row says so and
   not only the tag inside it. The marker is on the tag, because every other table in the app
   is built by the same helper and would otherwise pick this treatment up too.
   The wash alone is not the mark - measured against a read row it is 1.21 in the dark theme and
   only 1.09 in the light one, where the card is white - so the row carries a bar of the accent
   itself on the edge of the cell. Inset, because a border would move the columns. */
tbody tr:has([data-xdoc]){background:color-mix(in srgb,var(--accent) 8%,transparent)}
tbody tr:has([data-xdoc]) td{border-bottom-color:color-mix(in srgb,var(--accent) 20%,var(--bd))}
tbody tr:has([data-xdoc]) td:first-child{box-shadow:inset 3px 0 0 var(--accent)}

/* the on-screen paper gets the room a reader needs; the list behind it stays where it was */
.docprev{margin-top:14px}
.docprev iframe{display:block;width:100%;height:min(74vh,860px);border:1px solid var(--bd);border-radius:12px;background:var(--sf)}
/* a picture is shown at its own size, centred, and only scaled down when the card is narrower -
   an iframe would stretch a timetable screenshot across a field of nothing */
.docprev img{display:block;max-width:100%;max-height:min(74vh,860px);margin:0 auto;border-radius:12px;background:var(--sf)}
@media (max-width:560px){.docprev iframe{height:60vh}.docprev img{max-height:60vh}}

/* the shelf is one table and each category name is a row across it, so the columns are named once,
   at the top, and every group's papers sit in the same tracks. A band is not a row of data: it takes
   the cell padding into its own hands, keeps the bottom border off because the heading underlines
   itself, and does not pick up the hover wash the data rows get. Sentence case at the size of the
   table's own text, a hairline under it the full width of the shelf, and the unread count of THAT
   heading riding beside it in the app's New chip, so a teacher sees at a glance which kind has news
   in it. The first heading needs less room than the rest: the column header row above it already
   ends in its own hairline, and at 17px the two lines read as one band with nothing in it. */
tr.dockind>td{padding:0;border-bottom:0}
.docband{padding:17px 12px 0}
tr.dockind:first-child .docband{padding-top:10px}
tbody tr.dockind:hover>td{background:transparent}
.doccat{display:flex;align-items:baseline;margin:0;padding-bottom:6px;
 font-size:14px;font-weight:750;letter-spacing:-.012em;color:var(--tx);border-bottom:1px solid var(--bd)}
/* the heading fills the width so its hairline does too, and only the name with its count rides
   inside a sticky box: on a phone the shelf is scrolled sideways to reach the buttons, and a
   heading that scrolled away would leave the rows under it belonging to nothing */
.dockin{position:sticky;left:0;display:inline-flex;align-items:baseline}

/* five columns of sentences do not fit a phone. The app already answers this for its wide tables
   by letting them run past the screen inside .tw, which is what the class cards do; the shelf's
   own table is wrapped so the same rule cannot be picked up anywhere else */
@media (max-width:640px){.docshelf .tw table{min-width:640px}}

/* The categories are rail rows now, and a rail is 232px with the indented ones narrower still.
   The chip that rides comfortably after a row of page text would push "Timetables & circulars" -
   the longest name here - past the sidebar at the rail's own 12.5px, so inside the rail it is
   trimmed by a step and stays on the line it belongs to instead of hanging one below it. */
.side .grp .bd.xnew,.side .sub .bd.xnew{font-size:10px;padding:1px 6px;margin-left:6px;letter-spacing:.2px}

/* Both School Documents doors are the headings a reader can open, so they show the headings and
   not a mixed list of papers - the papers are what a category is for. Two columns, written out rather
   than left to auto-fit: three would leave the fourth card alone on a row of its own, and with an
   Other present five cards in three columns orphan two of them, while two columns answers four as
   two pairs and five as two pairs plus one full-width card. Each card is a button, so the name is the
   label and the count and this account's own unread ride under it.
   They are called .catcard and not .doccard because 27-plum-theme.css already owns that name for the
   Help page's prose cards, and its #pg:has(.doccard) rule would re-grid this whole page and shrink
   every card to its own words. */
.catcards{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;margin-top:14px}
@media (min-width:640px){.catcards{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* the fifth card takes the whole last row: left at one track it stops short and the pair beside it
   is a hole, and a shelf of headings is the one place an empty box reads as a missing heading */
@media (min-width:640px){.catcards>.catcard:last-child:nth-child(odd){grid-column:1/-1}}
.catcard{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px;text-align:left;min-height:78px;
 font:inherit;color:var(--tx);background:var(--sf);border:1px solid var(--bd);border-radius:16px;
 padding:14px 16px;cursor:pointer}
.catcard:hover{border-color:color-mix(in srgb,var(--accent) 45%,var(--bd))}
.catcard:focus-visible{outline:3px solid var(--ac);outline-offset:2px}
.dcname{flex:1 0 100%;font-size:15px;font-weight:750;letter-spacing:-.012em}
.dcmeta{flex:0 1 auto;font-size:12.5px;color:var(--mu)}
.catcard .bd.xnew{margin-left:auto}

/* The search bar sits between the prose and the papers, on every shelf page. The box takes the
   room the row has left it and stops at 340px, because a search field that stretches across a
   1440px page invites a sentence rather than the two or three words that actually find a paper;
   the term select and Clear keep to their own widths beside it. The label is the app's own small
   caps, the same one the select has always carried. */
.docbar{flex-wrap:wrap;gap:10px 12px}
.docbar label{margin:0;white-space:nowrap}
.docbar #dsearch{flex:1 1 200px;width:auto;max-width:340px;padding:7px 10px}
.docbar .btn.sm{margin-left:2px}
/* the tail that holds Clear is an empty flex item until something is in hand, and an empty one
   would still be paid the row's gap - so it is taken out of the layout rather than left as space */
.docbar #dbarx:empty{display:none}
/* how much of the page is left standing, written above the rows it describes */
.doccount{margin:0 0 8px}

/* A shelf that fills up should not fill the screen, so the rows give up height in two steps -
   past ten papers, and past twenty-four. The saving is the meta line: on its own it carries the
   base .crumb's 14px bottom margin inside the cell, which is what makes a tall row tall, so the
   first step moves it up onto the name's line and the second takes a point off both. It stops
   there on purpose - at 11.5px the name and its two buttons are still readable, and below that
   the row would be cramped rather than dense, which is the difference between a list a headteacher
   scans and one they zoom. The heading band tightens with its rows, or a shelf of four headings
   would spend more room saying what it contains than containing it. */
.docshelf.d1 td{padding:7px 10px}
.docshelf.d1 .docmeta{display:inline;margin:0 0 0 8px}
.docshelf.d1 tr.dockind .docband{padding-top:13px}
.docshelf.d2 td{padding:5px 9px}
.docshelf.d2 b{font-size:13px}
.docshelf.d2 .docmeta{display:inline;margin:0 0 0 7px;font-size:11.5px}
.docshelf.d2 tr.dockind .docband{padding-top:11px}
/* The buttons give up a point of size too - but only above the phone breakpoint. A dense row on a
   phone already costs its reader the second line, and a button smaller than the app's own is the one
   saving that turns a shelf into a hunt: a thumb aims at what every other screen in the app gave it,
   so below the breakpoint the cell tightens and the buttons are left exactly as they are painted. */
@media (min-width:641px){.docshelf.d2 .btn.sm{padding:3px 9px;font-size:12px}}
