/* ==========================================================================
   FUNDER — Section header / divider
   --------------------------------------------------------------------------
   Reusable signature for homepage chapters (editorial + financial).
   Tokens only. Scoped under .fn-ui.

   Anatomy (RTL):
     [Title]                              [optional CTA]
     ━━━●──────────────────────────────────────────────
         ^ short accent segment, then hairline to the end

   That green segment is the FUNDER marker — not a full green bar,
   not a left/right border stripe, not a panel heading.
   ========================================================================== */

.fn-ui .fn-section-header {
  --fn-section-accent-w: 22px;
  margin: 0 0 var(--fn-space-5);
  padding: 0;
  font-family: var(--fn-font-ui);
}

.fn-ui .fn-section-header__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--fn-space-3);
  margin: 0 0 var(--fn-space-2);
}

.fn-ui .fn-section-header__lead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  min-width: 0;
  flex: 1 1 auto;
}

.fn-ui .fn-section-header__title {
  margin: 0;
  font-family: var(--fn-font-display);
  font-size: var(--fn-fs-lg);
  font-weight: 700;
  font-synthesis: none;
  line-height: 1.32;
  letter-spacing: 0;
  color: var(--fn-text-1);
}

.fn-ui .fn-section-header__cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  font-size: var(--fn-fs-xs);
  font-weight: var(--fn-fw-regular);
  line-height: var(--fn-leading-base);
  letter-spacing: 0.01em;
  color: var(--fn-text-3);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--fn-dur-fast) var(--fn-ease);
}

.fn-ui .fn-section-header__cta::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-top: 1px;
  border-top: 1.5px solid currentColor;
  border-left: 1.5px solid currentColor;
  transform: rotate(-45deg); /* RTL: chevron points left */
  opacity: 0.55;
  transition: opacity var(--fn-dur-fast) var(--fn-ease), transform var(--fn-dur-fast) var(--fn-ease);
}

.fn-ui .fn-section-header__cta:hover,
.fn-ui .fn-section-header__cta:focus {
  color: var(--fn-brand);
  text-decoration: none;
}

.fn-ui .fn-section-header__cta:hover::after,
.fn-ui .fn-section-header__cta:focus::after {
  opacity: 1;
  transform: rotate(-45deg) translate(-1px, -1px);
}

.fn-ui .fn-section-header__cta:focus-visible {
  outline: var(--fn-focus-width) solid var(--fn-focus);
  outline-offset: var(--fn-focus-offset);
}

/* Rule: accent segment + flexible hairline, vertically centered as one unit */
.fn-ui .fn-section-header__rule {
  display: flex;
  align-items: center;
  width: 100%;
  height: 2px;
  pointer-events: none;
}

.fn-ui .fn-section-header__rule-accent {
  flex: 0 0 var(--fn-section-accent-w);
  height: 2px;
  background: var(--fn-accent);
  border-radius: 1px;
}

.fn-ui .fn-section-header__rule-line {
  flex: 1 1 auto;
  height: 1px;
  background: var(--fn-border);
  /* Sits flush against accent — shared horizontal rule language */
}

/* Dense variant — slightly tighter for finance modules */
.fn-ui .fn-section-header--dense {
  margin-bottom: var(--fn-space-3);
}

.fn-ui .fn-section-header--dense .fn-section-header__title {
  font-size: var(--fn-fs-md);
}

/* Sister-site pills next to a matching article category
   (FUNDER גמל / פנסיה / פוליסה). */
.fn-ui .fn-site-links {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-inline-start: 2px;
}

.fn-ui .fn-site-link {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--fn-accent);
  border-radius: var(--fn-radius-pill);
  background: var(--fn-accent);
  color: var(--fn-on-accent);
  font-family: var(--fn-font-ui);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.fn-ui .fn-site-link:hover,
.fn-ui .fn-site-link:focus {
  color: var(--fn-on-accent);
  text-decoration: none;
  filter: brightness(0.96);
}

.fn-ui .fn-site-link:focus-visible {
  outline: var(--fn-focus-width) solid var(--fn-focus);
  outline-offset: var(--fn-focus-offset);
  filter: none;
}

.fn-ui .fn-site-links--list {
  display: flex;
  justify-content: center;
  margin: 0 0 14px;
}

.fn-ui .fn-section-header--dense .fn-section-header__cta {
  min-height: 36px;
  font-size: var(--fn-fs-xs);
}

.fn-ui .fn-section-header--dense .fn-section-header__cta::after {
  width: 4px;
  height: 4px;
}

@media (min-width: 768px) {
  .fn-ui .fn-section-header {
    --fn-section-accent-w: 28px;
    margin-bottom: var(--fn-space-5);
  }

  .fn-ui .fn-section-header__title {
    font-size: var(--fn-fs-xl);
  }

  .fn-ui .fn-section-header__cta {
    min-height: 0;
    padding: var(--fn-space-1) 0;
  }
}


/* ==========================================================================
   PHONES — the header organises the feed, it does not stop it
   ==========================================================================
   On a phone the full-width accent rule plus an 17px bold title reads as a
   chapter break, which is the wrong signal inside a continuous scroll: it
   keeps announcing that a new thing has started rather than quietly labelling
   what follows. Here the rule collapses to a short brand tick against the
   label, the whole unit sits on one line with the CTA, and it takes about a
   third of the vertical space it used to.
   ========================================================================== */

@media (max-width: 767px) {
  .fn-ui .fn-section-header {
    margin-bottom: var(--fn-space-4);
  }

  .fn-ui .fn-section-header__row {
    align-items: center;
    gap: var(--fn-space-2);
    margin-bottom: 0;
  }

  .fn-ui .fn-section-header__lead {
    gap: 8px 10px;
  }

  .fn-ui .fn-site-link {
    height: 26px;
    padding: 0 8px;
    font-size: 10px;
  }

  .fn-ui .fn-section-header__title {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 15px;
    letter-spacing: 0;
  }

  /* the signature: a short green tick, not a rule across the viewport */
  .fn-ui .fn-section-header__title::before {
    content: "";
    flex: 0 0 auto;
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: var(--fn-accent);
  }

  /* Quietening this header dropped the CTA to a 32px box, which is under the
     touch minimum — a visual decision that quietly became an accessibility
     one. The tap area goes back to 44px while the negative block margin keeps
     the header row as short as it looks, so the target is bigger than the ink
     rather than the other way round. */
  .fn-ui .fn-section-header__cta {
    min-height: 44px;
    margin-block: -7px;
    font-size: var(--fn-fs-xs);
  }

  /* the full-width rule is what made this a chapter break — the tick replaces it */
  .fn-ui .fn-section-header__rule {
    display: none;
  }
}
