/* Intranet presentation tweaks for stock Plone 6.2 Barceloneta.
 *
 * Stored in the theming control panel's "Custom CSS" (registry record
 * IThemeSettings.custom_css). These carry over the entire customisation of the
 * old Plone 5 "intranet-barceloneta" Diazo theme: four <drop> rules in its
 * rules.xml. (See README.md in this directory for the measurement.)
 *
 * Kept as CSS rather than a Diazo theme so there is no fork of Barceloneta to
 * drift out of step with Plone again. Verified by theme_render_check.py, which
 * asserts on what is VISIBLE, not on how it was hidden.
 */

/* 1. Front page: hide the page title. The front page is a Document whose title
 *    is literally "index", so without this staff see a large "index" heading.
 *    (Old rule: on .section-index, drop h1.documentFirstHeading. In 6.2 the
 *    title is a bare <h1> inside <article id="content"><header>; it has no
 *    documentFirstHeading class, so the old selector would match nothing.) */
body.section-index #content > header > h1 {
  display: none;
}

/* 2. "Forgot password" on the login form: nothing to do. Authentication is
 *    AD/LDAP, and Plone 6.2's login form does not render the old
 *    #login-forgotten-password block at all (checked 2026-09-19). Kept as a
 *    rule so it stays gone if a later Plone version re-adds it. */
#login-forgotten-password {
  display: none;
}

/* 3. No search box for anonymous visitors: they can only see the login page,
 *    and there is nothing they may search. Logged-in staff keep search.
 *    (Old rule: drop #portal-searchbox where .userrole-anonymous.) */
body.userrole-anonymous #portal-searchbox {
  display: none;
}

/* 4. No Plone copyright/licence paragraph in the footer. The small
 *    "Powered by Plone" colophon link is deliberately left, as on the old site.
 *    (Old rule: drop #portal-footer-signature; in 6.2 that paragraph is the
 *    .copyright row of the footer viewlet.) */
#portal-footer .copyright {
  display: none;
}

/* ---- Added 2026-09-20 after the cutover, from the logged-in old-vs-new capture
 *      (page_capture.py compare). Presentation differences of stock 6.2 vs the
 *      old Plone 5 site, not lost data. See README.md section 6. ---- */

/* 5. Long unbroken strings (a Google Docs URL, a file name, a search-result
 *    title) must wrap instead of widening the page. Before: /general/intranet-user-manual
 *    overflowed by 692px on a phone and 227px on desktop; search results by 213px;
 *    /news-events/weekly-recap by 19px; a File page by 7px. min-width:0 lets flex
 *    children shrink; the pagination bar (1 2 3 ... 263 Next) must wrap. */
#content, #content-core, #search-results {
  overflow-wrap: anywhere;
}
#search-results .list-group-item > *, #content .ms-2 {
  min-width: 0;
}
#content .pagination {
  flex-wrap: wrap;
}

/* 6. No "News" tab in the main navigation. /news has "Exclude from navigation"
 *    checked (as on the old site), yet 6.2 lists it in the tab bar on pages in the
 *    News & Events and News sections only. Cause not determined; this hides the
 *    symptom so the tab bar matches the old site. */
#portal-globalnav .nav-item.news {
  display: none;
}

/* ---- Added 2026-10-17 with collective.solr (Unit 8). ---- */

/* 7. Search results: keep each result number ("1.") on one line. Rule 5's
 *    overflow-wrap:anywhere also applies to Bootstrap's list-group-numbered
 *    counter (li::before), and flexbox then shrinks it to one character, so the
 *    "." dropped onto its own line under the digit whenever a title or
 *    description was long (results 1-5 and 9 for "library", 2026-10-17). */
#search-results .list-group-numbered > .list-group-item::before {
  overflow-wrap: normal;
  white-space: nowrap;
  flex-shrink: 0;
}
