/* ==========================================================================
   FN 36 — Document pages (about, accessibility statement, privacy, terms,
   links, newsletter)
   --------------------------------------------------------------------------
   ONE component for every static page that is "a title and some text":

     .fn-doc            the page (full container width, like .fn-list-page)
     .fn-doc__head      the title band, same edge and spacing as .fn-list-header
     .fn-doc__body      reading column + the legacy banner column beside it
     .fn-doc__aside     that banner column (#bnrid4 / #bnrid5)
     h1.fn-doc__title   the page H1 — the list-page title, from the
                        --fn-page-title-* tokens, so both change together
     .fn-doc__card      the reading surface (bubble card, inset hairline)
     .fn-prose          running text: h2/h3/h4/p/ul/ol/a/strong/hr
     .fn-doc__meta      the quiet line at the end (dates, "last updated")
     .fn-linkgrid       a directory of links: one card per category
     .fn-doc__embed     a frame for a third-party form (newsletter)

   WHY NOT REUSE THE ARTICLE SURFACE
   ---------------------------------
   27-article.css / 17-type-trial.css draw the same kind of surface and the
   same 18px / 1.7 / 38em reading type, but they are bound to the article
   page's IDs (#articleContentPart, #articleDesc). The values here are the
   same tokens, so the two read as one family; only the hooks differ.

   LAYOUT
   ------
   The title sits on the container's start edge, exactly where a list page
   puts its H1. The body is capped at the reading measure (38em ≈ 65 Hebrew
   characters), so the card is measure + card padding wide and starts on the
   same edge as the title — title and text share one edge, as a list title
   and its deck do. The rest of the row, on the end side, is the banner
   column the pages always had (visible-lg / visible-md, hidden on phones),
   beside the content as on fund.aspx's rail rather than under 9,000px of
   terms. Centring the card instead would leave the title hanging ~350px
   away from the text it names.

   This file is loaded by the pages themselves (like 14-list.css), never from
   a Master page. Every colour, size and radius below is a token.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Page column
   -------------------------------------------------------------------------- */

.fn-ui .fn-doc {
  /* The card's inline padding — named once because the column width is
     measure + 2 × this, so the text inside lands on exactly 38em. */
  --fn-doc-pad: var(--fn-space-8);

  /* font-size here is what the em in --fn-measure-prose resolves against,
     so the column and the prose inside it agree on what 38em is. */
  font-size: var(--fn-type-body-lg);
  margin: 0 0 var(--fn-space-8);
  padding-block-start: var(--fn-space-10);
  color: var(--fn-text-1);
  font-family: var(--fn-font-ui);
}

/* Desktop: reading column on the start edge, banner column in the rest of
   the row. The reading track tops out at measure + card padding and gives
   way first, so a wide creative narrows the text instead of pushing the
   page sideways. Below 992px the banner column is hidden by its own
   visible-lg / visible-md classes, and the card simply fills the width. */
@media (min-width: 992px) {
  .fn-ui .fn-doc__body {
    display: grid;
    grid-template-columns:
      minmax(0, calc(var(--fn-measure-prose) + 2 * var(--fn-doc-pad)))
      minmax(min-content, 1fr);
    column-gap: var(--fn-space-6);
    align-items: start;
  }

  .fn-ui .fn-doc__body > :not(.fn-doc__aside) {
    grid-column: 1;
  }

  /* Only inside the grid: Chromium now honours justify-self on a plain
     block too, which shrank a column that stays visible on phones (reg's
     btn-banner column has no visible-* class) to its empty content. */
  .fn-ui .fn-doc__aside {
    grid-column: 2;
    justify-self: end;
  }
}

/* The banner column keeps the pages' original markup and ids (#bnrid4 /
   #bnrid5 are what the banner code fills). Its Bootstrap col-* widths and
   15px gutters are percentages of a float row that no longer exists, so
   they are neutralised here, as .fn-list-page does for its legacy cols. */
.fn-ui .fn-doc__aside,
.fn-ui .fn-doc__aside [class*="col-"] {
  float: none;
  width: auto;
  min-width: 0;
  padding-inline: 0;
}

.fn-ui .fn-doc__aside {
  max-width: 100%;
}

/* --------------------------------------------------------------------------
   2. Title — the list-page H1 (14-list.css .fn-list-header__title)
   -------------------------------------------------------------------------- */

.fn-ui .fn-doc__head {
  margin: 0 0 var(--fn-space-5);
  padding: 0;
}

/* h1.fn-doc__title, its bar and its forced-colours bar: one rule with the
   list and portfolio titles, in fn/38-page-title.css (master-loaded). */

/* --------------------------------------------------------------------------
   3. Card — the reading surface
   -------------------------------------------------------------------------- */

.fn-ui .fn-doc__card {
  position: relative;
  padding: var(--fn-space-6) var(--fn-doc-pad) var(--fn-space-8);
  background-color: var(--fn-bubble-bg, var(--fn-bg-surface));
  background-clip: padding-box;
  border-radius: var(--fn-radius-card);
  /* Hairline as an inset shadow, not a border, for the same reason as the
     article card: a border would take two more pixels off the measure. */
  box-shadow:
    inset 0 0 0 1px var(--fn-bubble-border, var(--fn-border)),
    var(--fn-shadow-sm);
}

.fn-ui .fn-doc__card + .fn-doc__card {
  margin-top: var(--fn-space-4);
}

/* --------------------------------------------------------------------------
   4. Prose
   --------------------------------------------------------------------------
   The article body's type (17-type-trial.css #articleDesc), on a class. The
   headings step down from the page title: h2 is the article subhead size,
   h3 the body size in bold, h4 a semibold run-in.
   -------------------------------------------------------------------------- */

.fn-ui .fn-prose {
  font-size: var(--fn-type-body-lg);
  font-weight: var(--fn-fw-regular);
  line-height: var(--fn-leading-prose);
  color: var(--fn-text-1);
  overflow-wrap: break-word;
}

.fn-ui .fn-prose > * {
  max-inline-size: var(--fn-measure-prose);
}

.fn-ui .fn-prose p {
  margin: 0.75em 0 0;
  font-size: inherit;
  line-height: inherit;
}

.fn-ui .fn-prose > :first-child {
  margin-top: 0;
}

/* The intro sentence of the terms page (Bootstrap's .lead, which would set
   it 21px and light). Same size as the body, a step heavier. */
.fn-ui .fn-prose .lead {
  font-size: inherit;
  font-weight: var(--fn-fw-semibold);
}

.fn-ui .fn-prose h2,
.fn-ui .fn-linkgrid h2 {
  margin: 1.15em 0 0.4em;
  font-family: var(--fn-font-display);
  font-size: var(--fn-type-h3);
  font-weight: var(--fn-fw-bold);
  line-height: var(--fn-leading-tight);
  letter-spacing: 0;
  color: var(--fn-text-1);
}

.fn-ui .fn-prose h3 {
  margin: 1.05em 0 0.35em;
  font-family: var(--fn-font-display);
  font-size: var(--fn-type-body-lg);
  font-weight: var(--fn-fw-bold);
  line-height: var(--fn-leading-base);
  letter-spacing: 0;
  color: var(--fn-text-1);
}

.fn-ui .fn-prose h4 {
  margin: 1em 0 0.3em;
  font-family: var(--fn-font-ui);
  font-size: var(--fn-type-h4);
  font-weight: var(--fn-fw-semibold);
  line-height: var(--fn-leading-base);
  letter-spacing: 0;
  color: var(--fn-text-1);
}

/* A heading straight after another heading or a rule is already separated. */
.fn-ui .fn-prose :is(h2, h3, h4) + :is(h3, h4),
.fn-ui .fn-prose hr + :is(h2, h3, h4) {
  margin-top: 0;
}

.fn-ui .fn-prose strong,
.fn-ui .fn-prose b {
  font-weight: var(--fn-fw-semibold);
}

.fn-ui .fn-prose ul,
.fn-ui .fn-prose ol {
  margin: 0.6em 0 0;
  padding-inline-start: 1.25em;
}

.fn-ui .fn-prose li {
  margin: 0.28em 0;
}

.fn-ui .fn-prose li > :is(ul, ol) {
  margin-top: 0.28em;
}

/* template.css paints every <hr> cream with !important; on the card that is
   a stain, not a divider. Same fix as the article card. */
.fn-ui .fn-prose hr {
  margin: 1.5em 0;
  border: 0;
  border-top: 1px solid var(--fn-border) !important;
}

/* In-text links. Colour alone is not an affordance inside a paragraph
   (WCAG 1.4.1), so the underline stays at rest; hover is the interaction
   ink, as in the article body. */
.fn-ui .fn-prose a {
  color: var(--fn-brand);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  overflow-wrap: anywhere;
}

.fn-ui .fn-prose a:hover,
.fn-ui .fn-prose a:focus-visible {
  color: var(--fn-interactive-ink);
  text-decoration-color: var(--fn-interactive);
}

/* --------------------------------------------------------------------------
   5. Meta line — "last updated" and the like
   -------------------------------------------------------------------------- */

/* max-inline-size: none — the 38em measure of `.fn-prose > *` resolves
   against this block's smaller type and would cut its rule short; the card
   already holds it to the column. */
.fn-ui .fn-prose > .fn-doc__meta {
  max-inline-size: none;
}

.fn-ui .fn-doc__meta {
  margin: var(--fn-space-6) 0 0;
  padding-top: var(--fn-space-3);
  border-top: 1px solid var(--fn-border);
  color: var(--fn-text-2);
  font-size: var(--fn-type-body-sm);
  line-height: var(--fn-leading-base);
}

.fn-ui .fn-doc__meta p {
  margin: 0;
}

/* --------------------------------------------------------------------------
   6. Link directory
   --------------------------------------------------------------------------
   One card per category. Two columns where a card still holds the longest
   name on one line, one column on a phone. Rows are 44px touch targets.
   -------------------------------------------------------------------------- */

.fn-ui .fn-linkgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15em), 1fr));
  gap: var(--fn-space-4);
  align-items: start;
}

.fn-ui .fn-linkgrid > .fn-doc__card + .fn-doc__card {
  margin-top: 0;
}

.fn-ui .fn-linkgrid .fn-doc__card {
  padding: var(--fn-space-5) var(--fn-space-6) var(--fn-space-4);
}

.fn-ui .fn-linkgrid h2 {
  margin-top: 0;
}

.fn-ui .fn-linkgrid ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.fn-ui .fn-linkgrid li + li {
  border-top: 1px solid var(--fn-border);
}

.fn-ui .fn-linkgrid a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-block: var(--fn-space-1);
  color: var(--fn-text-1);
  font-size: var(--fn-type-body);
  font-weight: var(--fn-fw-semibold);
  line-height: var(--fn-leading-tight);
  text-decoration: none;
  justify-content: space-between;
  gap: var(--fn-space-3);
}

/* Every row leaves the site in a new tab, and at rest a row is plain body
   text, so the row carries the external-link arrow at its far end. It is
   decoration: the empty alt keeps screen readers from announcing "north
   east arrow" (the first `content` is the fallback for browsers without
   alt text); the page says "נפתח בחלון חדש" through aria-describedby. Not
   mirrored in RTL — like Material's open_in_new, it is a symbol for
   "leaves the page", not a reading direction. */
.fn-ui .fn-linkgrid a::after {
  content: "\2197";
  content: "\2197" / "";
  flex: 0 0 auto;
  color: var(--fn-text-3);
  font-weight: var(--fn-fw-regular);
}

/* Hover and keyboard focus: brand ink on the name and the arrow, plus the
   underline, so the row reads as a link before it is followed. */
.fn-ui .fn-linkgrid a:hover,
.fn-ui .fn-linkgrid a:focus-visible {
  color: var(--fn-brand);
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 0.15em;
}

/* inherit, not --fn-brand: in the contrast modes template.css turns a
   hovered list link into white-on-black (or the reverse) with !important,
   and a brand-coloured arrow would vanish into that fill. */
.fn-ui .fn-linkgrid a:hover::after,
.fn-ui .fn-linkgrid a:focus-visible::after {
  color: inherit;
}

/* --------------------------------------------------------------------------
   7. Third-party embed (newsletter form)
   --------------------------------------------------------------------------
   The ravpage script writes its own form and its own stylesheet into the
   card, AFTER this file. Its layout is left alone. What is restyled:
     - the three controls a reader touches — the email field, the consent
       checkbox and the submit button — so they match the site's own forms
       (19-account.css .fn-auth) in every theme;
     - the COLOUR of its text, and nothing else about it. The vendor paints
       navy, black and #0000FF for a white page; on the dark card that is
       dark type on a dark surface.

   Specificity: the vendor's rules are `!important` and up to five classes
   deep (`.RMFORM_2017.color4 .inner_bodyarea_multyelements
   .name_xform_formelement .submitButton`), and its sheet loads later, so a
   tie goes to the vendor. Every selector below is one class deeper than the
   vendor rule it answers. That is the only reason for the long chains.
   `.RMFORM_2017 *` also resets every border, outline and background to
   none with !important, which is why borders and radii here carry it too.
   -------------------------------------------------------------------------- */

.fn-ui .fn-doc__embed {
  display: flex;
  justify-content: center;
  overflow-x: auto;
}

/* Text: heading, consent label, terms line, links. Colour only. */
.fn-ui .fn-doc__embed .RMFORM_2017 .inner_bodyarea_multyelements :is(p, span, label, .text) {
  color: var(--fn-text-1) !important;
}

.fn-ui .fn-doc__embed .RMFORM_2017 .inner_bodyarea_multyelements .bullettext a {
  color: var(--fn-brand) !important;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* Email field */
.fn-ui .fn-doc__embed .RMFORM_2017 .inner_bodyarea_multyelements .name_xform_formelement .field input[type="email"] {
  box-sizing: border-box;
  height: 48px !important;
  padding: 0 14px !important;
  border: 1px solid var(--fn-field-border) !important;
  border-radius: var(--fn-radius-field) !important;
  background-color: var(--fn-field-bg) !important;
  color: var(--fn-field-text) !important;
  font-family: var(--fn-font-ui);
  font-size: 16px !important; /* iOS zoom guard, as in .fn-auth */
  box-shadow: none;
}

.fn-ui .fn-doc__embed .RMFORM_2017 .field input[type="email"]::placeholder {
  color: var(--fn-field-placeholder);
  opacity: 1;
}

.fn-ui .fn-doc__embed .RMFORM_2017 .inner_bodyarea_multyelements .name_xform_formelement .field input[type="email"]:hover {
  background-color: var(--fn-field-bg-hover) !important;
}

/* The vendor replaces the focus state with a faint inset shadow (!important)
   and no outline, so the keyboard ring is restated here. */
.fn-ui .fn-doc__embed .RMFORM_2017 .inner_bodyarea_multyelements .name_xform_formelement .field input[type="email"]:focus {
  border-color: var(--fn-border-brand) !important;
  box-shadow: 0 0 0 3px var(--fn-brand-soft) !important;
}

.fn-ui .fn-doc__embed .RMFORM_2017 .inner_bodyarea_multyelements .name_xform_formelement .field input:focus-visible,
.fn-ui .fn-doc__embed .RMFORM_2017 .inner_bodyarea_multyelements .name_xform_formelement .submitbuttonbox input:focus-visible,
.fn-ui .fn-doc__embed .RMFORM_2017 .inner_bodyarea_multyelements .bullettext a:focus-visible {
  outline: var(--fn-focus-width) solid var(--fn-focus) !important;
  outline-offset: var(--fn-focus-offset) !important;
}

/* Consent checkbox. The real input is display:none; the vendor draws a
   19px sprite on div.checkbox and toggles `.checked` on it. The sprite
   becomes a token box, and the tick is drawn with borders so it takes a
   token colour (an SVG data-URI would freeze one colour per theme). */
.fn-ui .fn-doc__embed .RMFORM_2017 .formBody .confirmation .checkbox.ownevent {
  position: relative;
  box-sizing: border-box;
  border: 1.5px solid var(--fn-field-border) !important;
  border-radius: var(--fn-radius-sm) !important;
  background-color: var(--fn-field-bg) !important;
  background-image: none !important;
  cursor: pointer;
}

.fn-ui .fn-doc__embed .RMFORM_2017 .formBody .confirmation .checkbox.ownevent.checked {
  border-color: var(--fn-accent) !important;
  background-color: var(--fn-accent) !important;
}

.fn-ui .fn-doc__embed .RMFORM_2017 .formBody .confirmation .checkbox.ownevent.checked::after {
  content: "";
  position: absolute;
  inset-block-start: 2px;
  inset-inline-start: 5px;
  width: 5px;
  height: 10px;
  border: solid var(--fn-on-accent) !important;
  border-width: 0 2px 2px 0 !important;
  transform: rotate(45deg);
}

/* Submit. The vendor sets `background-color: #99ca3b !important` INLINE,
   which no stylesheet can override, with white text on it (≈2:1). The fill
   is therefore painted as a one-colour background-image layer over it, and
   the label takes the on-accent ink. */
.fn-ui .fn-doc__embed .RMFORM_2017 .inner_bodyarea_multyelements .name_xform_formelement .submitbuttonbox .submitButton {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 48px !important;
  padding: 0 var(--fn-space-4) !important;
  border-width: 0 !important;
  border-radius: var(--fn-radius-pill) !important;
  background-image: linear-gradient(var(--fn-accent), var(--fn-accent)) !important;
  color: var(--fn-on-accent) !important;
  text-decoration: none;
}

.fn-ui .fn-doc__embed .RMFORM_2017 .inner_bodyarea_multyelements .name_xform_formelement .submitbuttonbox .submitButton:is(:hover, :focus-within) {
  background-image: linear-gradient(var(--fn-accent-hover), var(--fn-accent-hover)) !important;
}

.fn-ui .fn-doc__embed .RMFORM_2017 .submitbuttonbox .submitButton :is(.rightPart, .leftPart) {
  display: none !important;
}

.fn-ui .fn-doc__embed .RMFORM_2017 .inner_bodyarea_multyelements > .name_xform_formelement .submitbuttonbox .submitButton .textPart {
  width: 100% !important;
  color: var(--fn-on-accent) !important;
  font-family: var(--fn-font-ui);
  font-size: var(--fn-type-body) !important;
  font-weight: var(--fn-fw-bold);
  text-shadow: none;
}

/* --------------------------------------------------------------------------
   8. Phones
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
  .fn-ui .fn-doc {
    --fn-doc-pad: var(--fn-space-4);
    padding-block-start: var(--fn-space-6);
  }

  .fn-ui .fn-doc__card {
    padding-block: var(--fn-space-4) var(--fn-space-6);
  }

  .fn-ui .fn-linkgrid .fn-doc__card {
    padding: var(--fn-space-4) var(--fn-doc-pad) var(--fn-space-2);
  }
}

/* --------------------------------------------------------------------------
   9. Accessibility contrast modes
   --------------------------------------------------------------------------
   body.darkCont / body.brightCont restate the tokens (01-tokens.css), so the
   colours already follow. As on the article card, the surface becomes a
   flat outline on a flat ground: no shadow, a real border.
   -------------------------------------------------------------------------- */

body.fn-ui.darkCont .fn-doc__card,
body.fn-ui.brightCont .fn-doc__card {
  box-shadow: none;
  border: 1px solid var(--fn-bubble-border);
  background-color: var(--fn-bubble-bg);
}

/* --------------------------------------------------------------------------
   10. Forced colours (Windows High Contrast)
   --------------------------------------------------------------------------
   Box-shadows are dropped, so the card needs a real border; a gradient
   background is dropped too, so the title bar is painted in the system text
   colour instead of disappearing.
   -------------------------------------------------------------------------- */

@media (forced-colors: active) {
  .fn-ui .fn-doc__card {
    border: 1px solid CanvasText;
  }

  /* The title bar's CanvasText fill: fn/38-page-title.css. */

  .fn-ui .fn-linkgrid a {
    text-decoration: underline;
  }

  /* The newsletter button is a filled pill with no border; with the fill
     forced away it would be bare text. Same chain as section 7. */
  .fn-ui .fn-doc__embed .RMFORM_2017 .inner_bodyarea_multyelements .name_xform_formelement .submitbuttonbox .submitButton {
    border: 1px solid ButtonText !important;
  }
}
