/* ==========================================================================
   FUNDER — Editorial feed (homepage article sections)
   ==========================================================================
   Section rhythms : anchor | split | dense      (chosen per section in .cs)
   Bands           : lead | split | duo | trio | briefs
   Items           : one uniform template at five scales

   THE STRUCTURAL RULE — read before changing any grid below.
   ---------------------------------------------------------
   Asymmetry BETWEEN bands. Symmetry WITHIN a band.

   Every cell of a band is the same width and shares one image ratio, so cell
   heights agree and the composition cannot open a hole. The previous layout
   put a tall lead beside a rail of two small thumbs: two short cards can never
   fill a tall neighbour, so the dead space was built into the geometry rather
   than being a tuning problem. Here all the editorial drama lives in the
   vertical rhythm of differently shaped bands stacked down the column.

  IMAGES
  ------
  Homepage article photography is 3:2, the ratio the files actually are
  (most originals are 1800×1200). The CDN crop matches that. 16:9 was
  slicing about 15% off the top and bottom of the same frame. Band scale
  changes SIZE, not shape.
     - 4:3 and square stay gone: the old 4:3 thumb sliced ~20% off the sides.
     - the ratio does not change with viewport, so the crop the server
       requested is the crop displayed.
     - no overlays and no gradients: they would sit on top of the image's own
       type. Depth comes from a hairline ring instead.
   Hierarchy is expressed by image SCALE, never by who gets an image at all —
   every article in this feed has one.

   WIDTH
   -----
   A feed renders in the col-lg-8 main column (~760px) and also in the col-lg-4
   sidebar (~380px, "במוקד"). The bands are therefore driven by a container
   query on .fn-feed, not by the viewport: in a narrow column every multi-up
   band resolves to the briefs presentation on its own.

   Tokens only. Scoped under .fn-ui.
   ========================================================================== */

.fn-ui .fn-feed {
  /* the feed measures itself, so it travels between columns unmodified */
  container-type: inline-size;
  container-name: fn-feed;

  /* Editorial type scale. The UI scale in 01-tokens.css tops out at 20px,
     which is a control scale, not a headline scale. Titles here run to 112
     characters, so these steps stay confident rather than poster-sized —
     a 112-character Hebrew title set huge becomes a five-line wall.

     Tuned down roughly a step from the first pass: the composition was right
     but everything in it sat too large, which on a 780px column reads as a
     handful of posters rather than as a section of a publication. Density is
     part of looking authoritative — a financial title should fit more of
     itself on a screen. */
  --fn-ed-lead: 26px;
  --fn-ed-split: 21px;
  --fn-ed-duo: 17px;
  --fn-ed-trio: 15px;
  --fn-ed-brief: 14px;

  --fn-feed-radius: var(--fn-radius-card);
  --fn-feed-gap-x: 18px;
  --fn-feed-gap-y: 20px;
  --fn-feed-band-gap: 24px;

  /* hairline that reads on both canvases without becoming a frame */
  --fn-feed-ring: inset 0 0 0 1px color-mix(in srgb, var(--fn-text-1) 9%, transparent);

  margin: 0 0 var(--fn-space-8);
  padding: 0;
  clear: both;
  color: var(--fn-text-1);
  font-family: var(--fn-font-ui);
}


/* --------------------------------------------------------------------------
   Bands
   -------------------------------------------------------------------------- */

/* A partial row starts from the RIGHT, and a lone card keeps its width.
   ----------------------------------------------------------------------
   In an RTL grid auto-placement already fills from the inline start, so
   the two justify- declarations below are a GUARANTEE rather than a
   repair: measured across four widths and three themes, a band holding
   one, two or three cards already put the first hard against the right
   edge and never stretched it.

   They are stated anyway because that is one `justify-items` or one
   inherited `direction: ltr` away from flipping, and a flipped partial row
   would only show up on the one section that month with four articles in
   it — the kind of regression that ships.

     justify-content: start    the TRACKS pack at the inline start
     justify-items: stretch    a card fills ITS OWN TRACK, never the row

   rtl-rows.js injects one- and two-card bands into a real rendered page
   and asserts both, because the server never emits a partial multi-column
   band: AppendPackedFeedBands sends every remainder to a single-column
   `briefs` band, so there is nothing on the page to look at. */
.fn-ui .fn-feed__band {
  display: grid;
  gap: var(--fn-feed-gap-y) var(--fn-feed-gap-x);
  align-items: start;
  justify-content: start;
  justify-items: stretch;
}

.fn-ui .fn-feed__band + .fn-feed__band {
  margin-top: var(--fn-feed-band-gap);
}

/* Lead — the anchor. Full column width, so it cannot leave a gap beside
   itself. This is the only band that gets the full measure. */
.fn-ui .fn-feed__band--lead {
  grid-template-columns: minmax(0, 1fr);
}

/* Split — image and headline side by side, headline optically centred against
   the picture. The text column is deliberately airy: because it is centred it
   reads as intentional whitespace instead of an unfilled corner. */
.fn-ui .fn-feed__band--split {
  grid-template-columns: minmax(0, 1fr);
}

.fn-ui .fn-feed__band--duo {
  grid-template-columns: minmax(0, 1fr);
}

.fn-ui .fn-feed__band--trio {
  grid-template-columns: minmax(0, 1fr);
}

.fn-ui .fn-feed__band--briefs {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}


/* --------------------------------------------------------------------------
   Item — one template, five scales
   -------------------------------------------------------------------------- */

.fn-ui .fn-feed__item {
  min-width: 0;
  margin: 0;
  /* no card: no surface, no border, no shadow. The image is the object. */
  background: none;
  border: 0;
}

.fn-ui .fn-feed__link {
  display: grid;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.fn-ui .fn-feed__link:hover,
.fn-ui .fn-feed__link:focus {
  text-decoration: none;
  color: inherit;
}

.fn-ui .fn-feed__link:focus-visible {
  outline: var(--fn-focus-width) solid var(--fn-focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.fn-ui .fn-feed__media {
  position: relative;
  overflow: hidden;
  margin: 0;
  border-radius: var(--fn-feed-radius);
  background: var(--fn-bg-sunken);
  box-shadow: var(--fn-feed-ring);
  aspect-ratio: 3 / 2;
}

.fn-ui .fn-feed__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain; /* 3:2 files fill the 3:2 frame; others are shown whole, never stretched */
  object-position: center;
  transition: transform var(--fn-dur-slow) var(--fn-ease);
}

@media (hover: hover) and (pointer: fine) {
  .fn-ui .fn-feed__link:hover .fn-feed__media img {
    transform: scale(1.03);
  }

  .fn-ui .fn-feed__link:hover .fn-feed__headline {
    color: var(--fn-interactive-ink);
  }
}

/* Video / media badge that ships with some articles. */
.fn-ui .fn-feed__wm {
  position: absolute;
  inset-inline-start: 10px;
  inset-block-end: 10px;
  width: 34px;
  height: auto;
  pointer-events: none;
}

.fn-ui .fn-feed__body {
  min-width: 0;
  display: grid;
  gap: 6px;
  align-content: start;
}

.fn-ui .fn-feed__headline {
  margin: 0;
  color: var(--fn-text-1);
  font-family: var(--fn-font-display);
  font-size: var(--fn-ed-trio);
  font-weight: var(--fn-fw-semibold);
  font-synthesis: none;
  line-height: 1.38;
  letter-spacing: 0;
  transition: color var(--fn-dur-fast) var(--fn-ease);
  text-wrap: balance;
  overflow-wrap: normal;
  word-break: keep-all;
  hyphens: none;
}

.fn-ui .fn-feed__subtitle {
  margin: 0;
  max-width: 62ch;
  color: var(--fn-text-2);
  font-size: var(--fn-fs-base);
  font-weight: var(--fn-fw-regular);
  line-height: 1.55;
}

.fn-ui .fn-feed__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--fn-text-3);
  font-size: var(--fn-fs-xs);
  line-height: 1.2;
}

.fn-ui .fn-feed__author {
  font-weight: var(--fn-fw-medium);
  color: var(--fn-text-2);
}

.fn-ui .fn-feed__date {
  font-family: var(--fn-font-num);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

/* No image. The media box is dropped rather than faked, the headline takes a
   step up, and a short accent rule holds the cell's top edge so the band still
   aligns. Rare in practice — every article currently ships an image.

   In a multi-up band such a cell is much shorter than its picture-bearing
   neighbour, which would reopen exactly the hole this layout exists to avoid.
   So it stretches to the row and centres its type: the space then reads as a
   deliberate typographic panel rather than as a cell someone forgot to fill. */
.fn-ui .fn-feed__item--noimg {
  align-self: stretch;
}

.fn-ui .fn-feed__item--noimg .fn-feed__link {
  height: 100%;
  align-content: center;
}

.fn-ui .fn-feed__item--noimg .fn-feed__body {
  padding-top: 14px;
  border-top: 2px solid var(--fn-brand);
}

.fn-ui .fn-feed__item--noimg .fn-feed__headline {
  font-size: calc(var(--fn-ed-duo) * 1.05);
  font-weight: var(--fn-fw-bold);
  line-height: 1.28;
}


/* --------------------------------------------------------------------------
   Scales — set by the band the item was rendered into
   -------------------------------------------------------------------------- */

/* Same 3:2 as the Hero — scale differs, crop does not. */
.fn-ui .fn-feed__item--lead .fn-feed__media,
.fn-ui .fn-feed__item--split .fn-feed__media,
.fn-ui .fn-feed__item--duo .fn-feed__media,
.fn-ui .fn-feed__item--trio .fn-feed__media,
.fn-ui .fn-feed__item--briefs .fn-feed__media {
  aspect-ratio: 3 / 2;
}

.fn-ui .fn-feed__item--lead .fn-feed__headline {
  font-size: var(--fn-ed-lead);
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: 0;
  max-width: 20em;
  text-wrap: pretty;
}

.fn-ui .fn-feed__item--split .fn-feed__headline {
  font-size: var(--fn-ed-split);
  font-weight: 700;
  line-height: 1.34;
  letter-spacing: 0;
}

.fn-ui .fn-feed__item--duo .fn-feed__headline {
  font-size: var(--fn-ed-duo);
  font-weight: var(--fn-fw-semibold);
  line-height: 1.36;
}

.fn-ui .fn-feed__item--trio .fn-feed__headline {
  font-size: var(--fn-ed-trio);
}

.fn-ui .fn-feed__item--briefs .fn-feed__headline {
  font-size: var(--fn-ed-brief);
  line-height: 1.4;
  letter-spacing: 0;
}

.fn-ui .fn-feed__item--lead .fn-feed__link { gap: 13px; }


/* --------------------------------------------------------------------------
   Briefs — thumb beside headline, the densest scale
   --------------------------------------------------------------------------
   Still carries a picture. The old "headline" variant was text only, which
   threw away an image that exists on every single article.
   -------------------------------------------------------------------------- */

/* This is also the form every multi-up band falls back to in a container too
   narrow to hold it — the sidebar "במוקד" at ~380px, and phones. A stack of
   full-width pictures would be a lot of scrolling for very few stories; a thumb
   beside its headline stays dense and still shows the picture. The thumb is
   still 3:2 — same crop as the Hero and the wide bands. */
.fn-ui .fn-feed__band--briefs .fn-feed__item + .fn-feed__item,
.fn-ui .fn-feed__band--duo .fn-feed__item + .fn-feed__item,
.fn-ui .fn-feed__band--trio .fn-feed__item + .fn-feed__item {
  margin-top: 0;
  border-top: 1px solid color-mix(in srgb, var(--fn-border) 75%, transparent);
}

.fn-ui .fn-feed__band--briefs .fn-feed__item,
.fn-ui .fn-feed__band--duo .fn-feed__item,
.fn-ui .fn-feed__band--trio .fn-feed__item {
  padding: 11px 0;
}

/* Spacing lives on the item padding itself — do NOT zero first/last.
   Mobile bands are often a single item (both :first-child and :last-child),
   so those resets collapsed story air and forced a mobile margin workaround. */

.fn-ui .fn-feed__band--briefs .fn-feed__link,
.fn-ui .fn-feed__band--duo .fn-feed__link,
.fn-ui .fn-feed__band--trio .fn-feed__link {
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.fn-ui .fn-feed__band--duo .fn-feed__headline,
.fn-ui .fn-feed__band--trio .fn-feed__headline {
  font-size: var(--fn-ed-brief);
  line-height: 1.4;
  letter-spacing: 0;
}

.fn-ui .fn-feed__item--noimg .fn-feed__link {
  grid-template-columns: minmax(0, 1fr);
}

.fn-ui .fn-feed__band--briefs .fn-feed__item--noimg .fn-feed__body {
  padding-top: 0;
  border-top: 0;
}

.fn-ui .fn-feed__band--briefs .fn-feed__item--noimg .fn-feed__headline {
  font-size: var(--fn-ed-brief);
  font-weight: var(--fn-fw-semibold);
  line-height: 1.4;
}


/* --------------------------------------------------------------------------
   Wide container — the col-lg-8 main column (~760px)
   --------------------------------------------------------------------------
   Everything above is the narrow-column form. These queries open the bands up
   once the feed actually has the width for them, so the same markup serves the
   main column and the sidebar.
   -------------------------------------------------------------------------- */

/* Two-up becomes possible. */
@container fn-feed (min-width: 560px) {

  /* The section lead is not full-bleed.
     It used to be a full-width picture with its headline underneath, which is
     the same silhouette the hero already uses — so each section opened looking
     like another hero, differing only in size, and size alone could not rank
     two objects of the same kind. Full-bleed belongs to the hero.
     The lead takes an asymmetric composition instead: the picture leads, the
     headline holds the opposite column and is optically centred against it. A
     different shape rather than a smaller copy, a better use of the 780px
     column than an image with a caption under it, and because the text column
     is centred the band cannot open the hole the old rail used to. */
  .fn-ui .fn-feed__band--lead .fn-feed__link {
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    align-items: center;
    gap: 24px;
  }

  .fn-ui .fn-feed__band--lead .fn-feed__body {
    gap: 10px;
  }

  .fn-ui .fn-feed__band--duo {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* back out of the compact row form: picture above its headline again */
  .fn-ui .fn-feed__band--duo .fn-feed__item {
    padding: 0;
    border-top: 0;
  }

  .fn-ui .fn-feed__band--duo .fn-feed__link {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 10px;
  }

  .fn-ui .fn-feed__band--duo .fn-feed__headline {
    font-size: var(--fn-ed-duo);
    font-weight: var(--fn-fw-semibold);
    line-height: 1.36;
  }

  /* Split: picture leads, headline holds the opposite column, optically
     centred against it. The split band holds exactly one item, so the LINK is
     the two-column grid — an earlier version put the columns on the band and
     used display:contents on the link, which silently did nothing because the
     <article> sits between them, and which would have cost the anchor its
     semantics in older engines. Centring the text is what keeps this
     asymmetric band free of the hole the old rail always opened: a short
     headline beside a tall picture reads as deliberate space, not a gap. */
  .fn-ui .fn-feed__band--split .fn-feed__link {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    align-items: center;
    gap: 22px;
  }

  .fn-ui .fn-feed__band--split .fn-feed__body {
    gap: 10px;
  }
}

/* Three-up. Below this the trio would be narrower than its own headline wants. */
@container fn-feed (min-width: 680px) {
  .fn-ui .fn-feed__band--trio {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .fn-ui .fn-feed__band--trio .fn-feed__item {
    padding: 0;
    border-top: 0;
  }

  .fn-ui .fn-feed__band--trio .fn-feed__link {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 10px;
  }

  .fn-ui .fn-feed__band--trio .fn-feed__headline {
    font-size: var(--fn-ed-trio);
    line-height: 1.35;
    letter-spacing: 0;
  }
}

/* Full main-column measure: the lead can afford its largest voice.
   The custom properties are set on the BAND, not on .fn-feed: a container
   query can only style descendants of its container, and .fn-feed is the
   container — setting them there silently does nothing. */
@container fn-feed (min-width: 700px) {
  .fn-ui .fn-feed__band {
    --fn-ed-lead: 30px;
    --fn-ed-split: 23px;
  }

  .fn-ui .fn-feed__band--briefs .fn-feed__link {
    grid-template-columns: 116px minmax(0, 1fr);
    gap: 16px;
  }
}

/* No container-query support: fall back to the viewport. The main column is
   past 680px from the lg breakpoint up. */
@supports not (container-type: inline-size) {
  @media (min-width: 992px) {
    .fn-ui .indexArticles .fn-feed__band--duo {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fn-ui .indexArticles .fn-feed__band--trio {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .fn-ui .indexArticles .fn-feed__band--split .fn-feed__link {
      grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
      align-items: center;
      gap: 22px;
    }

    .fn-ui .indexArticles .fn-feed__band--duo .fn-feed__item,
    .fn-ui .indexArticles .fn-feed__band--trio .fn-feed__item {
      padding: 0;
      border-top: 0;
    }

    .fn-ui .indexArticles .fn-feed__band--duo .fn-feed__link,
    .fn-ui .indexArticles .fn-feed__band--trio .fn-feed__link {
      grid-template-columns: minmax(0, 1fr);
      align-items: stretch;
      gap: 10px;
    }

    .fn-ui .indexArticles .fn-feed__band {
      --fn-ed-lead: 30px;
      --fn-ed-split: 23px;
    }

    .fn-ui .indexArticles .fn-feed__band--duo .fn-feed__headline { font-size: var(--fn-ed-duo); line-height: 1.3; }
    .fn-ui .indexArticles .fn-feed__band--trio .fn-feed__headline { font-size: var(--fn-ed-trio); line-height: 1.35; }
  }
}


/* --------------------------------------------------------------------------
   Real-estate section page (/nadlan) — layout "realestate"
   --------------------------------------------------------------------------
   The old site's structure in this system's style: a lead with its headline
   over the photo beside a rail of up to three compact items, then a trio,
   then fours to the end. Rendered only by nadlan.aspx.cs; nothing below
   matches any other layout. The server never emits a band with an empty
   cell (AppendRealEstateBands), and picks a lead that has a photo.

   The rail never opens a hole beside the lead. On a wide container the
   column widths are DERIVED so that three 3:2 thumbnails stacked with two
   gaps are exactly as tall as the 3:2 lead:
       W = lead + gap + thumb + text,  thumb = lead/3 - gap
       => lead = (W - text) * 3/4      (the gap cancels out)
   The LEAD owns the band height: the rail has height:0 / min-height:100%,
   so it contributes nothing to the row and is then sized to it. A rail
   headline longer than its row is cut by the line clamp (fewer lines in
   narrower containers) and by overflow:hidden on the body; it can never
   grow the band and crop the lead. With one or two rail items the rows
   grow and the photos crop (cover) instead of leaving dead space.

   Selectors carry .fn-feed.fn-feed--realestate (0,3,0 prefix) because
   21-mobile.css and 26-desktop.css load after this file and their
   :first-of-type / :first-child feed rules reach 0,6,0.
   -------------------------------------------------------------------------- */

.fn-ui .fn-feed.fn-feed--realestate {
  --fn-re-gap: var(--fn-bubble-gap, 14px);
  /* height of the scrim fade above the headline block */
  --fn-re-fade: 72px;
}

.fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--leadrail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--fn-re-gap);
  align-items: stretch;
}

/* ---- the lead: headline over the photo -------------------------------- */
/* Every overlay rule is limited to a lead that HAS a photo. A lead without
   one (only when no item in the feed has a photo) falls back to the plain
   no-image card the rest of the feed already uses. */
.fn-ui .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__link {
  position: relative;
  display: block;
  height: 100%;
  isolation: isolate;
}

.fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--leadrail .fn-feed__item--lead .fn-feed__media {
  aspect-ratio: 3 / 2;
  width: 100%;
  height: auto;
  min-height: 100%;
  max-height: none;
}

.fn-ui .fn-feed.fn-feed--realestate .fn-feed__item--lead .fn-feed__media img:not(.fn-feed__wm),
.fn-ui .fn-feed.fn-feed--realestate .fn-feed__item--rail .fn-feed__media img:not(.fn-feed__wm) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The badge moves to the top so the headline never sits on it. */
.fn-ui .fn-feed.fn-feed--realestate .fn-feed__item--lead .fn-feed__wm {
  inset-block-start: 12px;
  inset-block-end: auto;
  z-index: 2;
}

/* The scrim is built from the fixed ends of the palette, not from theme
   tokens: the photo is the same in every theme, so the ink over it must be
   too — light text on a dark fade, in Light and in Dark alike. It is at
   least 75% opaque under the WHOLE text block and fades only in the
   padding above it, so even a pure-white photo stays above 7:1. */
.fn-ui .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__body {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  z-index: 1;
  gap: 8px;
  padding: var(--fn-re-fade) 26px 22px;
  background: linear-gradient(
    to top,
    color-mix(in srgb, var(--fn-gray-950) 90%, transparent) 0%,
    color-mix(in srgb, var(--fn-gray-950) 75%, transparent) calc(100% - var(--fn-re-fade)),
    color-mix(in srgb, var(--fn-gray-950) 0%, transparent) 100%);
  color: var(--fn-gray-0);
  pointer-events: none;
}

.fn-ui .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__headline {
  max-width: 34em;
  color: var(--fn-gray-0);
  font-size: var(--fn-ed-lead);
  font-weight: 700;
  line-height: 1.3;
  text-shadow: 0 1px 2px color-mix(in srgb, var(--fn-gray-950) 55%, transparent);
  /* safety: a very long title can never climb off the top of the photo */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.fn-ui .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__subtitle {
  color: color-mix(in srgb, var(--fn-gray-0) 88%, transparent);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.fn-ui .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__meta,
.fn-ui .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__author,
.fn-ui .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__date {
  color: color-mix(in srgb, var(--fn-gray-0) 82%, transparent);
}

/* Hover/press keep the ink light; the cue is an underline instead of the
   green the other cards take, which would not read on the scrim. */
.fn-ui .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__link:hover .fn-feed__headline,
.fn-ui .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__link:active .fn-feed__headline,
.fn-ui .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__link:focus-visible .fn-feed__headline {
  color: var(--fn-gray-0);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

/* Lead without a photo: a plain text card at lead scale. */
.fn-ui .fn-feed.fn-feed--realestate .fn-feed__item--lead.fn-feed__item--noimg .fn-feed__body {
  position: static;
  background: none;
  padding: 24px 26px;
  color: var(--fn-text-1);
}

.fn-ui .fn-feed.fn-feed--realestate .fn-feed__item--lead.fn-feed__item--noimg .fn-feed__headline {
  color: var(--fn-text-1);
  font-size: var(--fn-ed-lead);
  text-shadow: none;
}

/* ---- the rail ---------------------------------------------------------- */
.fn-ui .fn-feed.fn-feed--realestate .fn-feed__rail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--fn-re-gap);
  min-width: 0;
}

.fn-ui .fn-feed.fn-feed--realestate .fn-feed__rail .fn-feed__item--rail {
  padding: 0;
  border-top: 0;
}

/* Narrow (phone column): compact rows, thumbnail beside the headline. */
.fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--leadrail .fn-feed__rail .fn-feed__item--rail .fn-feed__link {
  grid-template-columns: minmax(0, 40%) minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
}

.fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--leadrail .fn-feed__rail .fn-feed__item--rail .fn-feed__media {
  aspect-ratio: 3 / 2;
  width: 100%;
  height: auto;
  border-radius: 0;
  align-self: stretch;
}

.fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--leadrail .fn-feed__rail .fn-feed__item--rail .fn-feed__body {
  align-self: center;
  gap: 6px;
  padding: 10px 14px;
}

.fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--leadrail .fn-feed__rail .fn-feed__item--rail .fn-feed__headline {
  font-size: var(--fn-ed-brief);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--leadrail .fn-feed__rail .fn-feed__item--rail.fn-feed__item--noimg .fn-feed__link {
  grid-template-columns: minmax(0, 1fr);
}

/* ---- quad: four-up cards, the same card as the trio -------------------- */
.fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--quad {
  grid-template-columns: minmax(0, 1fr);
}

/* Mid container (tablet): lead full width, the rail becomes a row of
   cards under it, the fours run two by two (four in three columns would
   leave two empty cells). */
@container fn-feed (min-width: 560px) {
  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__rail--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__rail--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--leadrail .fn-feed__rail--2 .fn-feed__item--rail .fn-feed__link,
  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--leadrail .fn-feed__rail--3 .fn-feed__item--rail .fn-feed__link {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--leadrail .fn-feed__rail--2 .fn-feed__item--rail .fn-feed__body,
  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--leadrail .fn-feed__rail--3 .fn-feed__item--rail .fn-feed__body {
    align-self: start;
    padding: 12px 14px 14px;
  }

  /* A lead with nothing beside it would be a 3:2 poster the full width of
     the page; it is capped to a banner instead. */
  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--solo .fn-feed__item--lead .fn-feed__media {
    aspect-ratio: 2 / 1;
    min-height: 0;
    max-height: 520px;
  }

  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--quad {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--quad .fn-feed__link {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    align-items: stretch;
    gap: 0;
  }

  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--quad .fn-feed__body {
    padding: 14px 16px 16px;
    gap: 8px;
  }

  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--quad .fn-feed__meta {
    margin-top: auto;
    padding-top: 8px;
  }
}

/* Wide container (desktop): lead beside the rail, fours four across. */
@container fn-feed (min-width: 900px) {
  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--leadrail {
    --fn-re-text: clamp(190px, 19cqi, 260px);
    --fn-re-lead: calc((100cqi - var(--fn-re-text)) * 0.75);
    grid-template-columns: var(--fn-re-lead) minmax(0, 1fr);
  }

  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--leadrail.fn-feed__band--solo {
    grid-template-columns: minmax(0, 1fr);
  }

  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--leadrail .fn-feed__rail {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: minmax(0, 1fr);
  }

  /* The lead owns the band height (see the header of this block). */
  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--leadrail:not(.fn-feed__band--textlead) .fn-feed__rail {
    height: 0;
    min-height: 100%;
  }

  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--leadrail .fn-feed__rail .fn-feed__item--rail .fn-feed__link {
    grid-template-columns: calc(var(--fn-re-lead) / 3 - var(--fn-re-gap)) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }

  /* The thumbnail takes the row's height; at three rows that is exactly
     3:2, at one or two it crops rather than leaving a gap. */
  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--leadrail .fn-feed__rail .fn-feed__item--rail .fn-feed__media {
    aspect-ratio: auto;
    height: 100%;
    min-height: 0;
  }

  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--leadrail .fn-feed__rail .fn-feed__item--rail .fn-feed__body {
    align-self: center;
    max-height: 100%;
    overflow: hidden;
    padding: 10px 16px;
  }

  /* Lines per rail headline follow the row height the container allows:
     3 below 1100px, 4 to 1200px, 5 from there. */
  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--leadrail .fn-feed__rail .fn-feed__item--rail .fn-feed__headline {
    font-size: var(--fn-ed-trio);
    line-height: 1.38;
    -webkit-line-clamp: 3;
  }

  /* A single rail item is half the lead's height or more: as a thumb
     beside text it would be a tall sliver of photo, so it becomes a card —
     photo on top taking the leftover height, headline under it. */
  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--leadrail .fn-feed__rail--1 .fn-feed__item--rail .fn-feed__link {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--quad {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@container fn-feed (min-width: 1100px) {
  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--leadrail .fn-feed__rail .fn-feed__item--rail .fn-feed__headline {
    -webkit-line-clamp: 4;
  }

  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--leadrail .fn-feed__rail .fn-feed__item--rail .fn-feed__body {
    padding: 12px 18px;
  }
}

@container fn-feed (min-width: 1200px) {
  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--leadrail .fn-feed__rail .fn-feed__item--rail .fn-feed__headline {
    -webkit-line-clamp: 5;
  }
}

/* High-contrast modes. acc_box.js puts .brightCont / .darkCont on <body>
   AND on every <div>, and template.css then paints every div white/black
   and forces every <a>/<span> to black/white with !important, so text
   over a photo cannot be trusted there. Windows forced colours likewise
   drop the gradient and the text shadow. In all three the lead's body
   leaves the overlay and sits under the photo, in the colour those modes
   force on the link. */
body.brightCont .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__link,
body.darkCont .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__link {
  height: auto;
}

body.brightCont .fn-feed.fn-feed--realestate .fn-feed__band--leadrail .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__media,
body.darkCont .fn-feed.fn-feed--realestate .fn-feed__band--leadrail .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__media {
  min-height: 0;
}

body.brightCont .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__body,
body.darkCont .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__body {
  position: static;
  background-image: none !important;
  padding: 12px 16px 14px;
}

body.brightCont .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__body,
body.darkCont .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__body,
body.brightCont .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__headline,
body.brightCont .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__subtitle,
body.brightCont .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__meta,
body.brightCont .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__author,
body.brightCont .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__date,
body.darkCont .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__headline,
body.darkCont .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__subtitle,
body.darkCont .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__meta,
body.darkCont .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__author,
body.darkCont .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__date {
  color: inherit !important;
  text-shadow: none;
}

@media (forced-colors: active) {
  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__link {
    height: auto;
  }

  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--leadrail .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__media {
    min-height: 0;
  }

  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__body {
    position: static;
    background: none;
    padding: 12px 16px 14px;
  }

  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__headline,
  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__subtitle,
  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__meta,
  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__author,
  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__date {
    color: CanvasText;
    text-shadow: none;
  }
}


/* --------------------------------------------------------------------------
   Dark — native, through tokens
   --------------------------------------------------------------------------
   Nothing here restyles the feed for dark: every colour already resolves
   through a token that flips. The one adjustment is the image ring, which has
   to lighten rather than darken so a photo still detaches from a near-black
   canvas instead of dissolving into it.
   -------------------------------------------------------------------------- */

:root[data-fn-theme="dark"] .fn-feed {
  --fn-feed-ring: inset 0 0 0 1px color-mix(in srgb, var(--fn-text-1) 14%, transparent);
}


/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .fn-ui .fn-feed__media img,
  .fn-ui .fn-feed__headline {
    transition: none;
  }

  .fn-ui .fn-feed__link:hover .fn-feed__media img {
    transform: none;
  }
}


/* ==========================================================================
   PHONES — Discover stack (calm editorial plate)
   ==========================================================================
   Image → headline → meta. Small uniform radius on all four corners —
   restrained, not app-bubble. Brand-green tick on the meta row keeps the
   Funder signature. Hierarchy stays soft: first story gets a larger title.
   ========================================================================== */

@media (max-width: 767px) {

  .fn-ui .fn-feed {
    /* Every card headline on a phone is --fn-type-card-phone. The five
       desktop scales (lead / split / duo / trio / brief) collapse to one
       here on purpose: on a 390px column they sat within a few pixels of
       each other, which reads as inconsistency rather than as hierarchy.
       Rank is carried by order on the page, not by type size. */
    --fn-feed-gutter: 16px;
    /* Band-owned story rhythm — replaces per-item margin-bottom workaround. */
    --fn-feed-story-gap: 28px;
    --fn-feed-feature-follow: 34px;
    padding-inline: var(--fn-feed-gutter);
    margin-bottom: var(--fn-space-10);
  }

  /* ---- every band becomes a vertical stack; gap owns story spacing ------ */
  .fn-ui .fn-feed__band,
  .fn-ui .fn-feed__band--lead,
  .fn-ui .fn-feed__band--split,
  .fn-ui .fn-feed__band--duo,
  .fn-ui .fn-feed__band--trio,
  .fn-ui .fn-feed__band--briefs {
    display: flex;
    flex-direction: column;
    /* The desktop band is a grid with `align-items: start`, which on the grid
       is a BLOCK-axis instruction. Switching to a column flexbox turns the
       same property into an INLINE-axis one, so every card shrank to its own
       content width and the column ragged out — two cards in a row almost
       never ended up the same width. */
    align-items: stretch;
    gap: var(--fn-feed-story-gap);
    margin-top: 0;
  }

  .fn-ui .fn-feed__band + .fn-feed__band {
    margin-top: var(--fn-feed-story-gap);
  }

  /* Slightly more air after the feature plate before the next story. */
  .fn-ui .fn-feed__band:first-of-type + .fn-feed__band {
    margin-top: var(--fn-feed-feature-follow);
  }

  .fn-ui .fn-feed .fn-feed__band .fn-feed__item {
    padding: 0;
    margin: 0;
  }

  .fn-ui .fn-feed .fn-feed__band .fn-feed__item,
  .fn-ui .fn-feed .fn-feed__band--briefs .fn-feed__item + .fn-feed__item,
  .fn-ui .fn-feed .fn-feed__band--duo .fn-feed__item + .fn-feed__item,
  .fn-ui .fn-feed .fn-feed__band--trio .fn-feed__item + .fn-feed__item {
    border-top: 0;
  }

  /* ---- bonded card: photo seals onto the type --------------------------- */
  .fn-ui .fn-feed__link,
  .fn-ui .fn-feed__band--duo .fn-feed__link,
  .fn-ui .fn-feed__band--trio .fn-feed__link,
  .fn-ui .fn-feed__band--briefs .fn-feed__link {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    /* tight gap is the twist — photo and headline read as one unit */
    gap: 10px;
  }

  .fn-ui .fn-feed__item .fn-feed__media,
  .fn-ui .fn-feed__item--lead .fn-feed__media,
  .fn-ui .fn-feed__item--split .fn-feed__media,
  .fn-ui .fn-feed__item--duo .fn-feed__media,
  .fn-ui .fn-feed__item--trio .fn-feed__media,
  .fn-ui .fn-feed__item--briefs .fn-feed__media {
    aspect-ratio: 3 / 2;
    /* Uniform small radius — calmer than top-only “trapezoid” plates. */
    border-radius: var(--fn-radius-card);
    box-shadow: none;
  }

  .fn-ui .fn-feed__wm {
    inset-inline-start: 12px;
    inset-block-end: 12px;
    width: 36px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
  }

  .fn-ui .fn-feed__body {
    gap: 7px;
    padding-inline: 1px;
  }

  /* One size, one weight, one leading, three lines maximum — for EVERY
     variant the server can emit, including the item that has no photo and
     the brief inside a no-photo band. Those two carried their own size
     above (0,3,0 and 0,4,0 specificity) and were the two headlines on the
     phone feed that did not match their neighbours. */
  .fn-ui .fn-feed__headline,
  .fn-ui .fn-feed__band--duo .fn-feed__headline,
  .fn-ui .fn-feed__band--trio .fn-feed__headline,
  .fn-ui .fn-feed__item--lead .fn-feed__headline,
  .fn-ui .fn-feed__item--split .fn-feed__headline,
  .fn-ui .fn-feed__item--duo .fn-feed__headline,
  .fn-ui .fn-feed__item--trio .fn-feed__headline,
  .fn-ui .fn-feed__item--briefs .fn-feed__headline,
  .fn-ui .fn-feed__item--noimg .fn-feed__headline,
  .fn-ui .fn-feed__band--briefs .fn-feed__item--noimg .fn-feed__headline,
  .fn-ui .fn-feed__band:first-of-type .fn-feed__item:first-child .fn-feed__headline {
    max-width: none;
    font-size: var(--fn-type-card-phone);
    font-weight: var(--fn-fw-semibold);
    line-height: var(--fn-leading-card-phone);
    letter-spacing: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    /* Hebrew must not be hyphenated or broken mid-word in a clamped box. */
    overflow-wrap: normal;
    word-break: keep-all;
    hyphens: none;
    text-wrap: initial;
    padding-block: var(--fn-ink-pad);
    margin-block: calc(var(--fn-ink-pad) * -1);
  }

  .fn-ui .fn-feed__subtitle { display: none; }

  /* Brand tick before the source — same quiet signature as section labels. */
  .fn-ui .fn-feed__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 1px;
    font-size: 12px;
    line-height: 1.25;
    color: var(--fn-text-3);
  }

  .fn-ui .fn-feed__meta::before {
    content: "";
    flex: 0 0 auto;
    width: 2px;
    height: 11px;
    border-radius: 1px;
    background: var(--fn-accent);
    opacity: 0.9;
  }

  .fn-ui .fn-feed__author {
    font-weight: var(--fn-fw-medium);
    color: var(--fn-text-2);
  }

  .fn-ui .fn-feed__date {
    margin-top: 0;
    color: var(--fn-text-3);
  }

  .fn-ui .fn-feed__meta-sep {
    opacity: 0.5;
  }

  /* The first story of a section is no longer typographically larger than
     the ones under it. It is still first, which is the whole of the claim
     it is entitled to make — and on a phone, where only one card is on
     screen at a time, a size step between cards that are never seen
     together cannot communicate rank anyway. */
  .fn-ui .fn-feed .fn-feed__band:first-of-type .fn-feed__item:first-child {
    padding-top: 0;
    border-top: 0;
  }

  /* ---- no-image fallback ----------------------------------------------- */
  .fn-ui .fn-feed__item--noimg .fn-feed__link {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .fn-ui .fn-feed__item--noimg {
    align-self: auto;
  }

  .fn-ui .fn-feed__item--noimg .fn-feed__body {
    padding-top: 12px;
    border-top: 2px solid var(--fn-brand);
  }

  .fn-ui .fn-feed__item--noimg .fn-feed__meta::before {
    display: none;
  }

  /* ---- touch ------------------------------------------------------------ */
  .fn-ui .fn-feed__link:active .fn-feed__media {
    transform: scale(0.985);
    transition: transform 90ms var(--fn-ease);
  }

  .fn-ui .fn-feed__link:active .fn-feed__headline {
    color: var(--fn-brand);
  }
}

/* No type block at 412px any more: with a single card size there is nothing
   left for that breakpoint to re-state. The small-phone step now lives on
   --fn-type-card-phone (fn/21-mobile.css) so it applies to the chronological
   stream too, instead of only to this file's feed. */
@media (max-width: 359px) {
  .fn-ui .fn-feed {
    --fn-feed-gutter: 13px;
    --fn-feed-story-gap: 24px;
    --fn-feed-feature-follow: 28px;
  }
}

/* Real-estate page (/nadlan) on a phone: the lead keeps its headline on the
   photo with a tighter scrim, the rail stays compact rows (thumbnail beside
   headline) so the opening screen holds four stories instead of one. */
@media (max-width: 767px) {
  .fn-ui .fn-feed.fn-feed--realestate {
    --fn-re-fade: 56px;
  }

  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__item--lead:not(.fn-feed__item--noimg) .fn-feed__body {
    gap: 6px;
    padding: var(--fn-re-fade) 16px 14px;
  }

  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--leadrail .fn-feed__rail .fn-feed__item--rail .fn-feed__headline {
    font-size: var(--fn-ed-trio);
    -webkit-line-clamp: 3;
  }

  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--leadrail .fn-feed__rail .fn-feed__item--rail .fn-feed__body {
    padding: 8px 12px;
  }

  .fn-ui .fn-feed.fn-feed--realestate .fn-feed__band--leadrail .fn-feed__rail .fn-feed__item--rail .fn-feed__meta::before {
    display: none;
  }
}
