/* ==========================================================================
   FN 38 — The page title (one rule for every page H1 of the same kind)
   --------------------------------------------------------------------------
   Three heads share one title: the list pages (14-list.css,
   .fn-list-header__title), the document pages (36-doc.css, .fn-doc__title)
   and the personal-portfolio head (19-account.css, .fn-port-head__title).
   They used to restate the same declarations in three files, which drifted.
   This file is the only place they are styled; the values are the
   --fn-page-title-* tokens in 01-tokens.css.

   Why a file of its own: the masters load it, so a document page and the
   portfolio get it without 14-list.css; 00-page.css would be the other
   master-loaded home, but its charter is page frame only, no components.
   Load order does NOT protect these rules. The masters link this file in
   the body, and the page stylesheets (14-list, 36-doc) are linked inside
   ContentPlaceHolder1, so they load AFTER it and would win any tie;
   19-account loads before it. Correctness relies on those files no longer
   declaring these properties at equal specificity: a title rule there
   must out-rank these on purpose (stock / stockmng wrapping, article-list
   children do) or not exist. The selectors keep the specificity each
   family had before, so those deliberate overrides still win.

   What each family gets is what it had (proved computed-style identical):
     - typography: all three;
     - the brand bar, inline layout, padding, font-synthesis, text-align:
       list and document titles (the portfolio head has never had a bar);
     - the compact size under 769px: list titles that are not an h1 and the
       legacy h1#LookForTitle2. An h1.fn-list-header__title stays at the
       full size there: the old mobile rule was outranked by the h1 base
       rule, and the list pages were tuned at that size.
   ========================================================================== */

.fn-ui .fn-list-page .fn-list-header__title,
.fn-ui .fn-list-page h1#LookForTitle2,
.fn-ui .fn-list-page h1.fn-list-header__title,
.fn-ui .fn-doc__title,
.fn-ui .fn-port-head__title {
  margin: 0;
  font-family: var(--fn-font-display);
  font-size: var(--fn-page-title-size);
  line-height: var(--fn-page-title-leading);
  font-weight: var(--fn-page-title-weight);
  letter-spacing: 0;
  color: var(--fn-page-title-color);
}

/* The barred titles. */
.fn-ui .fn-list-page .fn-list-header__title,
.fn-ui .fn-list-page h1#LookForTitle2,
.fn-ui .fn-list-page h1.fn-list-header__title,
.fn-ui .fn-doc__title {
  padding: 0;
  font-synthesis: none;
  text-align: start;
}

/* A list title sits in a row with its count and links, so it is only as
   wide as its text; a document title owns its band. */
.fn-ui .fn-list-page .fn-list-header__title,
.fn-ui .fn-list-page h1.fn-list-header__title,
.fn-ui .fn-doc__title {
  display: inline-flex;
  align-items: center;
  gap: var(--fn-page-title-bar-gap);
}

.fn-ui .fn-doc__title {
  display: flex;
}

/* The bar is composed here, from colour tokens only, so a theme or a
   high-contrast bridge changes a colour and never restates the gradient. */
.fn-ui .fn-list-page .fn-list-header__title::before,
.fn-ui .fn-doc__title::before {
  content: "";
  flex: 0 0 auto;
  width: var(--fn-page-title-bar-w);
  height: var(--fn-page-title-bar-h);
  border-radius: var(--fn-radius-pill);
  background: linear-gradient(180deg, var(--fn-page-title-bar-top), var(--fn-page-title-bar-color));
}

@media (max-width: 768px) {
  .fn-ui .fn-list-page .fn-list-header__title:not(h1),
  .fn-ui .fn-list-page h1#LookForTitle2 {
    font-size: var(--fn-page-title-size-compact);
  }
}

/* Forced colours drop a gradient, which would leave the bar as an empty
   gap; paint it in the system text colour instead. */
@media (forced-colors: active) {
  .fn-ui .fn-list-page .fn-list-header__title::before,
  .fn-ui .fn-doc__title::before {
    forced-color-adjust: none;
    background: CanvasText;
  }
}
