/* Additions to site.css, which stays identical to ui-design/site.css.
   Only what the design reference does not draw: images and players inside
   page content, uploaded covers, and a few states of the ported components.
   At the end, a few corrections to site.css's own responsive rules, for
   widths where the design overflows. Same tokens and conventions as site.css; loaded after it. */

/* footer quick links: column by column (the design fills row by row), so the three portals end the left column.
   Five rows: the first five of core.navigation.QUICK_LINKS go in the right column, the other five in the left. */
.rw .ql{grid-auto-flow:column;grid-template-rows:repeat(5,auto)}

/* figures in news and event content (news/blocks/*.html) and the news image */
.rw .figure{margin:28px 0 0}
.rw .figure img{display:block;max-width:100%;height:auto;border-radius:8px;border:1px solid var(--line)}
.rw .figure figcaption{margin-top:8px;font:400 14px/1.6 var(--f-ui);color:var(--muted)}
.rw .figure.embed iframe{display:block;width:100%;max-width:100%;height:auto;aspect-ratio:16/9;border:0;border-radius:8px}
.rw .figure.audio audio{display:block;width:100%}

/* players: the play button as a link (media list, featured recording), native audio */
.rw a.play:hover{color:var(--on-dark)}
.rw .player audio{display:block;width:100%;margin-top:10px}

/* uploaded covers: library item, journal issue */
.rw .item-cover img{display:block;width:100%;height:auto;border:5px double var(--gold);box-shadow:0 18px 34px rgba(5,66,36,.22)}
.rw .item-cover .r-ico{width:120px;height:160px;font-size:18px}
.rw .cover.has-img{padding:0;overflow:hidden}
.rw .cover img{display:block;width:100%;height:100%;object-fit:cover}

/* journal: articles without the «محكّم» badge keep the two-line layout; abstracts */
.rw .toc .t,.rw .toc .a,.rw .toc .abs{grid-column:1}
.rw .toc .t a{text-decoration-color:var(--gold);text-underline-offset:6px}
.rw .toc .abs{margin:6px 0 0;font:400 16px/1.85 var(--f-text);color:var(--muted)}

/* journal side menu: a section that has no page yet */
.rw .side nav .off{display:block;padding:9px 16px;font:500 16px/1.5 var(--f-ui);color:var(--muted)}
@media (max-width:1000px){
.rw .side nav .off{padding:6px 14px;border:1px dashed var(--line);border-radius:999px;font-size:14px}
}

/* portals: «تسجيل الخروج» is a POST form; its button looks like the design's link (.who a) */
.rw .who .out{display:inline;margin:0}
.rw .who .out button{margin-inline-start:8px;padding:0;border:0;background:none;font:inherit;font-size:14px;color:var(--ink);text-decoration:underline;cursor:pointer}
.rw .who .out button:hover{color:var(--green-600)}

/* student portal: the month picker of «سجل التقييمات» is a GET form (a select and its button) */
.rw .month-pick{display:flex;align-items:center;gap:8px;margin:0}

/* sheikh's entry form: a fieldset inside a portal card is titled like the form's labels (.lbl), as the design's
   filter legends are, not like the 23px section legend of a full-page form */
.rw .pcard .fs legend{margin-bottom:8px;font:600 15px/1.5 var(--f-ui);color:var(--ink)}

/* file inputs (.file): never wider than their box, so a narrow column (the reply form of
   «رسائل هيئة التحرير» beside the inbox) does not push its form out of the message */
.rw .file input[type=file]{width:100%;min-width:0}

/* «رسائل هيئة التحرير» on a phone (one column): the open message before the list, not below a long inbox */
@media (max-width:860px){
.rw .inbox article.msg{order:-1;border-bottom:1px solid var(--line)}
}

/* ---------- responsive fixes ---------- */

/* Menu panel (.mnav, up to 1200px): site.css caps it at 100vh - 80px, but the header is 76–130px tall (the
   institute's name wraps differently at each width) and on phones 100vh counts the browser's toolbars, so the
   panel's end (the portal buttons) could sit below the screen. The panel is positioned in the header (.site-hd,
   top:100%), so 100% is the header's padding box, the same box the panel starts from: the panel ends at the bottom
   of the screen. The 100vh line is the fallback for browsers without dvh. */
.rw .mnav-panel{max-height:calc(100vh - 100%);max-height:calc(100dvh - 100%)}

/* Portal tables (.tbl) are stacked cards up to 760px and keep their columns above. There their headers never
   wrapped, so a table wider than its card scrolled sideways inside .tbl-wrap and hid its last column: in the
   design, «سجل التقييمات» at 765–810px and 1005–1115px (from 1001px the side menu is beside the content again),
   the researcher's dashboard at 765–775px and 1005–1080px. Headers may now wrap at any width above 760px, and
   cells are 8px narrower up to 1120px. */
@media (width > 760px){
.rw .tbl th{white-space:normal}
}
@media (760px < width <= 1120px){
.rw .tbl th,.rw .tbl td{padding-inline:12px}
}

/* From 1101px the 7/12 cards (.s7) stand beside another card and the table box inside them (.tbl-wrap) is 348–438px
   wide, narrower than a table of five columns or more (requests: 481–521px, the sheikh's roster: 424–464px), which
   then hid its status or its «سجّل العرض» button. A table with five header cells or more in a box under 520px is
   drawn as the stacked cards of a phone (site.css, max-width:760px; same rules, roster included). Above 760px every
   other table box is 548px or wider, and a table of fewer columns (the student's latest evaluations) fits a 7/12
   card and keeps its columns. :where() keeps these rules at site.css's specificity, so the roster's own rules still
   win over the generic ones. @supports: without :has() (Firefox before 121) only the roster rules would apply, and
   the roster would break; there the table keeps its columns and scrolls, as before. */
.rw .tbl-wrap{container-type:inline-size}
@supports selector(:has(a)){
@container (width < 520px){
.rw .tbl:where(:has(th:nth-child(5))) thead{display:none}
.rw .tbl:where(:has(th:nth-child(5))) tr{display:block;padding:12px 16px;border-bottom:1px solid var(--line-soft)}
.rw .tbl:where(:has(th:nth-child(5))) tr:last-child{border-bottom:0}
.rw .tbl:where(:has(th:nth-child(5))) td{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:5px 0;border:0;text-align:end}
.rw .tbl:where(:has(th:nth-child(5))) td::before{content:attr(data-label);flex:none;font:600 13px/1.5 var(--f-ui);color:var(--muted);text-align:start}
.rw .tbl.roster tr{display:grid;grid-template-columns:auto auto minmax(0,1fr) auto;grid-template-areas:"n n n b" "s p . a";gap:6px 12px;align-items:center}
.rw .tbl.roster td{display:block;padding:0}
.rw .tbl.roster td::before{content:none}
.rw .tbl.roster td:nth-child(1){grid-area:n}
.rw .tbl.roster td:nth-child(2){grid-area:s;font-size:13px;color:var(--muted)}
.rw .tbl.roster td:nth-child(3){grid-area:p;font-size:13px;color:var(--muted)}
.rw .tbl.roster td:nth-child(4){grid-area:b}
.rw .tbl.roster td:nth-child(5){grid-area:a;font-size:14px}
}
}

/* The sheikh's roster as cards (phone, and the 7/12 card from 1101px): site.css tints only the selected row's cells,
   which the grid's gaps split into patches, so the whole card is tinted. Same colour as its cells in a table. */
.rw .tbl.roster tr.sel{background:var(--cream-2)}

/* The show/hide button of password fields (static/js/password-toggle.js wraps each field in .pw-toggle). The
   button sits at the field's end, inside its border; the field leaves room for it on that side. */
.rw .pw-toggle{position:relative;display:block}
/* The site is RTL only, so the button (inset-inline-end of the RTL wrapper) is always on the left. Physical padding:
   the portals' password inputs are dir="ltr", where padding-inline-end would pad the other side. */
.rw .pw-toggle input{padding-left:48px}
.rw .pw-toggle-btn{position:absolute;inset-block:0;inset-inline-end:2px;display:inline-flex;align-items:center;justify-content:center;width:44px;padding:0;border:0;background:none;color:var(--muted);cursor:pointer}
.rw .pw-toggle-btn:hover,.rw .pw-toggle-btn[aria-pressed=true]{color:var(--ink)}
.rw .pw-toggle-btn:focus-visible{outline-offset:-4px;border-radius:8px}

/* Head of a body (/bodies/, .head) up to 760px: site.css gives every .mono grid-area:m and every .role grid-area:r
   there, for the homepage's people cards (.person, which name those areas). .head names neither, so its monogram
   and role went into extra implicit columns and squeezed the name and bio into narrow columns (the bio into 50px).
   Both are placed automatically again, as above 760px; the monogram keeps site.css's .head .mono grid-row:span 3. */
@media (max-width:760px){
.rw .head .mono{grid-column:auto}
.rw .head .role{grid-area:auto}
}
