/* ==========================================================================
   FUNDER — Homepage Hero Editorial Carousel
   --------------------------------------------------------------------------
   One card, two stacked sections:
     1. Image section — photography owns this band, stays almost clean
     2. Editorial section — opaque; headline / summary / meta live here
   Default tone is LIGHT (`data-fn-hero-tone="light"`). Dark is recovered by
   flipping that attribute — only the custom properties change.
   The photo and type share one composition. The join is a 1px hairline,
   not a fogged gradient over the last strip of the photograph.
   Tokens only (layer 2). Scoped under .fn-ui.
   ========================================================================== */

.fn-ui .fn-hero-slot {
  margin-top: 0;
  margin-bottom: var(--fn-space-4);
  clear: both;
  /* Horizontal inset comes from parent .col-lg-12 (Bootstrap 15px) —
     same gutter as .panel "חדשות" and the rest of the articles column. */
  padding-left: 0;
  padding-right: 0;
}

.fn-ui .fn-hero {
  --fn-hero-radius: var(--fn-radius-hero);
  --fn-hero-nav-size: 40px;
  /* Type band sits on surface (white in Light, raised panel in Dark).
     Photo and paper share one frame. Join is a 1px rule, not a fog. */
  --fn-hero-zone: var(--fn-bg-surface);
  --fn-hero-blend-h: 0px;
  --fn-hero-blend: none;
  --fn-hero-ink: var(--fn-text-1);
  --fn-hero-ink-muted: var(--fn-text-2);
  --fn-hero-dot: color-mix(in srgb, var(--fn-text-3) 70%, transparent);
  --fn-hero-dot-active: var(--fn-accent);
  --fn-hero-nav-bg: rgba(11, 15, 12, 0.55);
  --fn-hero-nav-border: rgba(255, 255, 255, 0.28);
  --fn-hero-empty-bg: var(--fn-bg-sunken);

  position: relative;
  width: 100%;
  margin: 0;
  outline: none;
}

/* Recoverable dark editorial variant — same DOM, token swap only. */
.fn-ui .fn-hero[data-fn-hero-tone="dark"] {
  --fn-hero-zone: #0c100e;
  --fn-hero-blend-h: 0px;
  --fn-hero-blend: none;
  --fn-hero-ink: #ffffff;
  --fn-hero-ink-muted: rgba(255, 255, 255, 0.9);
}

.fn-ui .fn-hero:focus-visible {
  box-shadow: 0 0 0 var(--fn-focus-width) var(--fn-focus);
}

.fn-ui .fn-hero__frame {
  position: relative;
  container-type: inline-size;
  container-name: fn-hero-frame;
  border-radius: var(--fn-hero-radius);
  overflow: hidden;
  background: var(--fn-hero-zone);
  border: var(--fn-border-width) solid var(--fn-border);
  box-shadow: none;
  transition: border-color var(--fn-dur-fast) var(--fn-ease);
}

/* One card height for every slide — Yoav: "שהגודל של קלף יהיה קבוע".
   --------------------------------------------------------------------------
   The headline runs 1–3 lines and the summary 0–2, so a card sized by the
   ACTIVE slide alone grew and shrank on every page turn, and the dots below
   it jumped out from under the reader's pointer.

   All the slides (the server sends five) now share one grid cell (grid-area 1 / 1). A grid row is
   as tall as its tallest item, hidden ones included (visibility: hidden
   still takes space), so the card is always the height of the longest
   story in the run — no measured pixels, no magic "3 lines + 2 lines"
   number, and it holds at every breakpoint, with or without a summary, in
   every font size the reader picks. Shorter stories keep their type at the
   top and get paper below; the byline is pinned to the bottom edge so it
   sits on the same line on every slide.

   The viewport clips the stack; its height is the track's, so it follows
   the tallest slide too. */
.fn-ui .fn-hero__viewport {
  position: relative;
  width: 100%;
  height: auto;
  overflow: hidden;
}

.fn-ui .fn-hero__track {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.fn-ui .fn-hero__slide {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity var(--fn-dur-slow) var(--fn-ease),
    visibility 0s linear var(--fn-dur-slow);
  z-index: 1;
}

.fn-ui .fn-hero__slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity var(--fn-dur-slow) var(--fn-ease),
    visibility 0s linear 0s;
  z-index: 2;
}

.fn-ui .fn-hero__link {
  display: flex;
  flex-direction: column;
  /* Fill the shared grid cell, so the whole card — the extra paper under a
     short story included — is the link. */
  flex: 1 1 auto;
  position: relative;
  color: var(--fn-hero-ink);
  text-decoration: none;
  cursor: pointer;
}

.fn-ui a.fn-hero__link:hover,
.fn-ui a.fn-hero__link:focus,
.fn-ui a.fn-hero__link:visited {
  color: var(--fn-hero-ink);
  text-decoration: none;
}

/* The bubble edge and the headline answer together. The summary does not.
   ------------------------------------------------------------------------
   The hover target is the frame, not the headline. The link fills the
   frame (photo, title, summary, empty paper) and the nav buttons sit inside
   it too, so any point on the bubble — including the border itself — is
   .fn-hero__frame:hover. The dots live outside the frame and do not join.

   Colour split:

     border      --fn-interactive       the signal green, one value in
                                        every theme. It is an edge, not text.
     title       --fn-hero-ink-hover    light zone: --fn-interactive-ink
                                        (green-700 on white, 5.01:1;
                                        green-800 on the soft card).
                                        dark zone: --fn-interactive, the
                                        bright green on #0c100e.
     summary,    unchanged              they keep --fn-hero-ink-muted.
     credit, date

   Both ink tokens collapse to black or white under darkCont / brightCont,
   so high contrast keeps behaving as it did.

   Gated on a fine pointer, like 07-feed.css, so a tap does not leave the
   card green. Keyboard focus is not gated: it is never left behind. */
.fn-ui .fn-hero {
  --fn-hero-ink-hover: var(--fn-interactive-ink);
}

.fn-ui .fn-hero[data-fn-hero-tone="dark"] {
  --fn-hero-ink-hover: var(--fn-interactive);
}

@media (hover: hover) and (pointer: fine) {
  .fn-ui .fn-hero__frame:hover .fn-hero__title {
    color: var(--fn-hero-ink-hover);
  }
}

/* Keyboard parity: focus shows the same colour on every device, since it is
   never left behind by a stray pointer. The summary stays muted, as on hover. */
.fn-ui .fn-hero__link:focus-visible .fn-hero__title {
  color: var(--fn-hero-ink-hover);
}

.fn-ui .fn-hero__link:focus-visible {
  outline: none;
}

.fn-ui .fn-hero__link:focus-visible .fn-hero__zone {
  box-shadow: inset 0 0 0 var(--fn-focus-width) var(--fn-accent);
}

.fn-ui .fn-hero__media {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  /* One ratio for every picture on the homepage: 3:2, the ratio the
     editors' files are made in (1536×1024) and the ratio of every feed
     card below. At 16:9 those files were stretched flat — Udi's
     "פחוסות", with the round FUNDER badge drawn as an oval. */
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--fn-hero-empty-bg);
}

@supports not (aspect-ratio: 1 / 1) {
  .fn-ui .fn-hero__media {
    height: 0;
    padding-bottom: 66.6667%;
  }

  .fn-ui .fn-hero__img {
    position: absolute;
    inset: 0;
  }
}

/* No image on the lead story: a flat plate, not a green sunrise. The
   diagonal fade and the radial bloom that used to fill this box were the
   most visible of the decorative gradients Udi asked to remove. */
.fn-ui .fn-hero__media--empty {
  background: var(--fn-bg-sunken);
}

.fn-ui .fn-hero__img {
  display: block;
  width: 100%;
  height: 100%;
  /* Never stretched, never cropped. A 3:2 file fills the frame exactly;
     a file in another ratio is shown whole, with a thin band of the
     plate on two sides, instead of being squashed (fill) or losing its
     edges (cover). */
  object-fit: contain;
  object-position: center;
  -webkit-user-drag: none;
  /* Image zooms; type lives in the dark section below and stays still. */
  transform: scale(1);
  transition: transform var(--fn-dur-slow) var(--fn-ease);
  will-change: transform;
}

@media (hover: hover) and (pointer: fine) {
  .fn-ui .fn-hero__link:hover .fn-hero__img {
    transform: scale(1.035);
  }
}

/* Touch: a brief inward press rather than a zoom, since there is no hover to
   resolve it. */
.fn-ui .fn-hero__link:active .fn-hero__img {
  transform: scale(0.995);
  transition-duration: 110ms;
}

@media (prefers-reduced-motion: reduce) {
  .fn-ui .fn-hero__img,
  .fn-ui .fn-hero__link:hover .fn-hero__img,
  .fn-ui .fn-hero__link:active .fn-hero__img {
    transform: none;
    transition: none;
  }
}

.fn-ui .fn-hero__wm {
  position: absolute;
  top: var(--fn-space-3);
  right: var(--fn-space-3);
  max-width: 72px;
  height: auto;
  opacity: 0.9;
  z-index: 3;
  pointer-events: none;
}

.fn-ui .fn-hero__scrim {
  display: none;
}

/* Editorial section — opaque surface under the photo. One component:
   photography above, paper below, a hairline at the join. */
.fn-ui .fn-hero__zone {
  position: relative;
  /* Takes the paper left over when this story is shorter than the longest
     one in the run (see .fn-hero__track). */
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  z-index: 2;
  background: var(--fn-hero-zone);
  color: var(--fn-hero-ink);
}

.fn-ui .fn-hero__zone::before {
  content: none;
}

.fn-ui .fn-hero__zone::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: color-mix(in srgb, var(--fn-border) 70%, transparent);
  pointer-events: none;
}

.fn-ui .fn-hero__content {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
  /* No room kept for the arrows: they sit on the photo's midline, never
     beside the type, so the title runs to the card's own inset. */
  padding: var(--fn-space-5) var(--fn-space-6);
  color: var(--fn-hero-ink);
  text-align: right;
  max-width: 100%;
  margin-right: 0;
  margin-left: auto;
}

.fn-ui .fn-hero__title {
  margin: 0 0 var(--fn-space-2);
  font-family: var(--fn-font-display);
  font-size: clamp(20px, 2.35vw, 30px);
  font-weight: var(--fn-fw-bold);
  font-synthesis: none;
  line-height: 1.28;
  letter-spacing: 0;
  color: var(--fn-hero-ink);
  /* A flex item with overflow:hidden may shrink to 0 by default; a
     subpixel or late-font rounding must never shave the third line. */
  flex-shrink: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  overflow-wrap: normal;
  word-break: keep-all;
  hyphens: none;
  text-wrap: balance;
  transition: color var(--fn-dur-fast) var(--fn-ease);
  padding-block: var(--fn-ink-pad);
  margin-top: calc(0px - var(--fn-ink-pad));
  margin-bottom: calc(var(--fn-space-2) - var(--fn-ink-pad));
}

.fn-ui .fn-hero__subtitle {
  margin: 0 0 var(--fn-space-3);
  font-size: clamp(13px, 1.15vw, 16px);
  font-weight: var(--fn-fw-regular);
  line-height: var(--fn-leading-base);
  color: var(--fn-hero-ink-muted);
  flex-shrink: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  max-width: 42em;
}

.fn-ui .fn-hero__meta {
  /* Byline on the bottom edge, on the same line on every slide. */
  margin-top: auto;
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: var(--fn-space-2);
  font-size: var(--fn-fs-sm);
  color: var(--fn-hero-ink-muted);
  letter-spacing: 0.01em;
}

.fn-ui .fn-hero__author {
  font-weight: var(--fn-fw-medium);
  color: var(--fn-hero-ink-muted);
}

.fn-ui .fn-hero__meta-sep {
  opacity: 0.7;
  color: var(--fn-hero-ink-muted);
}

.fn-ui .fn-hero__date {
  font-variant-numeric: tabular-nums;
  color: var(--fn-hero-ink-muted);
}

/* ---- Nav arrows ---- */
.fn-ui .fn-hero__nav {
  position: absolute;
  /* Midline of the 3:2 photo, not of the whole card (photo + type). */
  top: 213px;
  transform: translateY(-50%);
  z-index: 6;
  width: var(--fn-hero-nav-size);
  height: var(--fn-hero-nav-size);
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: var(--fn-radius-pill);
  border: var(--fn-border-width) solid var(--fn-hero-nav-border);
  background: var(--fn-hero-nav-bg);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color var(--fn-dur-fast) var(--fn-ease),
    border-color var(--fn-dur-fast) var(--fn-ease),
    transform var(--fn-dur-fast) var(--fn-ease);
}

@supports (top: 1cqw) {
  .fn-ui .fn-hero__nav {
    top: calc(100cqw * 2 / 3 / 2);
  }
}

/* At either end of the five lead stories, the arrow that has nowhere to go
   is not shown. Udi asked for "only the arrow that moves you forward" at
   the start and the mirror of that at the end, so this hides rather than
   dims: a greyed-out control still invites a press.

   It is `visibility`, not `display`, so the button keeps its box and the
   OTHER arrow never moves — the two sit at opposite edges and a reader's
   pointer stays where it was. `disabled` is what fn-hero.js sets, which
   also takes the button out of the tab order and out of the accessibility
   tree, so the state is told to every reader and not only to the sighted
   one. */
.fn-ui .fn-hero__nav:disabled {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.fn-ui .fn-hero__nav:hover:not(:disabled) {
  background: rgba(11, 15, 12, 0.78);
  border-color: rgba(255, 255, 255, 0.45);
}

.fn-ui .fn-hero__nav:focus-visible {
  outline: var(--fn-focus-width) solid var(--fn-accent);
  outline-offset: var(--fn-focus-offset);
}

.fn-ui .fn-hero__nav:active:not(:disabled) {
  transform: translateY(-50%) scale(0.96);
}

/* RTL: next (forward chronologically in carousel) sits on the left */
.fn-ui .fn-hero__nav--next {
  left: var(--fn-space-3);
  right: auto;
}

.fn-ui .fn-hero__nav--prev {
  right: var(--fn-space-3);
  left: auto;
}

.fn-ui .fn-hero__nav-icon {
  display: block;
  width: 10px;
  height: 10px;
  border-style: solid;
  border-width: 0 2px 2px 0;
  border-color: currentColor;
}

.fn-ui .fn-hero__nav--next .fn-hero__nav-icon {
  transform: rotate(135deg);
  margin-right: -2px;
}

.fn-ui .fn-hero__nav--prev .fn-hero__nav-icon {
  transform: rotate(-45deg);
  margin-left: -2px;
}

/* ---- Dots — BELOW the photography (sibling of .fn-hero__frame) ----------
   Parent .fn-hero has dir="rtl", so flex row places slide 0 (newest) on the RIGHT.
   Do NOT use row-reverse here — it would cancel RTL and put the first dot on the left. */
.fn-ui .fn-hero__dots {
  position: static;
  z-index: auto;
  left: auto;
  bottom: auto;
  transform: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  margin: 10px 0 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.fn-ui .fn-hero__dot {
  width: 7px;
  height: 7px;
  min-width: 7px;
  min-height: 7px;
  padding: 0;
  border: 0;
  border-radius: var(--fn-radius-pill);
  background: var(--fn-hero-dot);
  cursor: pointer;
  transition:
    background-color var(--fn-dur-fast) var(--fn-ease),
    transform var(--fn-dur-fast) var(--fn-ease),
    width var(--fn-dur-fast) var(--fn-ease);
}

/* Expand hit area without changing visual size */
.fn-ui .fn-hero__dot::before {
  content: "";
  position: absolute;
  top: -10px;
  right: -10px;
  bottom: -10px;
  left: -10px;
}

.fn-ui .fn-hero__dot {
  position: relative;
}

.fn-ui .fn-hero__dot.is-active {
  width: 18px;
  background: var(--fn-hero-dot-active);
}

/* Not on the active dot: the card no longer moves, so after a click the
   pointer is still resting on the dot it pressed, and a plain :hover (same
   specificity, later in the file) would paint it grey over the green. */
.fn-ui .fn-hero__dot:not(.is-active):hover {
  background: color-mix(in srgb, var(--fn-text-2) 55%, transparent);
}

.fn-ui .fn-hero__dot:focus-visible {
  outline: var(--fn-focus-width) solid var(--fn-accent);
  outline-offset: 3px;
}

.fn-ui .fn-hero__live {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Keep the editorial zone + type even if a11y brightCont paints every div. */
body.brightCont .fn-ui .fn-hero__zone {
  background: var(--fn-hero-zone) !important;
  background-color: var(--fn-hero-zone) !important;
}

body.brightCont .fn-ui a.fn-hero__link,
body.brightCont .fn-ui .fn-hero__title,
body.brightCont .fn-ui .fn-hero__subtitle,
body.brightCont .fn-ui .fn-hero span.fn-hero__author,
body.brightCont .fn-ui .fn-hero span.fn-hero__meta-sep,
body.brightCont .fn-ui .fn-hero .fn-hero__date,
body.brightCont .fn-ui .fn-hero__content {
  color: var(--fn-hero-ink) !important;
  background: transparent !important;
  background-color: transparent !important;
}

/* ---- Dark theme: light-tone zone follows --fn-bg-surface automatically ---- */
[data-fn-theme="dark"] .fn-ui .fn-hero__frame {
  border-color: var(--fn-border);
  box-shadow: none;
}

/* After the dark-theme border pin above. That rule and a plain
   .fn-hero__frame:hover share specificity (0, 3, 0); the theme prefix
   here makes the hover win in every theme, including dark. */
@media (hover: hover) and (pointer: fine) {
  .fn-ui .fn-hero__frame:hover,
  [data-fn-theme="dark"] .fn-ui .fn-hero__frame:hover,
  [data-fn-theme="soft"] .fn-ui .fn-hero__frame:hover {
    border-color: var(--fn-interactive);
  }
}

.fn-ui .fn-hero__frame:has(.fn-hero__link:focus-visible),
[data-fn-theme="dark"] .fn-ui .fn-hero__frame:has(.fn-hero__link:focus-visible),
[data-fn-theme="soft"] .fn-ui .fn-hero__frame:has(.fn-hero__link:focus-visible) {
  border-color: var(--fn-interactive);
}

[data-fn-theme="dark"] .fn-ui .fn-hero {
  --fn-hero-empty-bg: var(--fn-bg-raised);
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .fn-ui .fn-hero__slide,
  .fn-ui .fn-hero__slide.is-active,
  .fn-ui .fn-hero__nav,
  .fn-ui .fn-hero__dot,
  .fn-ui .fn-hero__frame,
  .fn-ui .fn-hero__title {
    transition: none !important;
  }
}

/* ---- Responsive ---- */
@media (max-width: 991px) {
  .fn-ui .fn-hero {
    --fn-hero-blend-h: 0px;
  }

  .fn-ui .fn-hero__content {
    padding: var(--fn-space-4);
  }
}

@media (max-width: 767px) {
  /*
    Mobile: same 3:2 stage as desktop. Copy lives in the paper band
    below, so the editorial section grows with the type instead of
    covering the photograph.
  */
  .fn-ui .fn-hero {
    --fn-hero-blend-h: 0px;
  }

  .fn-ui .fn-hero-slot {
    margin-bottom: var(--fn-space-4);
    padding-left: 0;
    padding-right: 0;
  }

  .fn-ui .fn-hero__frame {
    border-radius: var(--fn-radius-compact);
  }

  .fn-ui .fn-hero__nav {
    display: none;
  }

  .fn-ui .fn-hero__content {
    padding: var(--fn-space-4);
  }

  .fn-ui .fn-hero__subtitle {
    display: none;
  }

  .fn-ui .fn-hero__title {
    font-size: clamp(21px, 6vw, 27px);
    line-height: 1.28;
    font-weight: var(--fn-fw-bold);
    -webkit-line-clamp: 3;
    margin-bottom: var(--fn-space-2);
  }

  .fn-ui .fn-hero__wm {
    max-width: 48px;
  }
}
