/* ==========================================================================
   Homepage content modes — ראשי | פיד | מבט מהיר | גליונות
   Text tabs with an underline — one row, ~30px of vertical chrome.
   Active state keys off html[data-fn-home-view] (set by the head script
   before paint and kept in sync by fn-chrono-feed.js), so no flash.
   Editorial (the ראשי tab) is the missing attribute: it is the default view.
   ========================================================================== */

/* Indices strip above already leaves 12px (6px mobile); the next row adds 5px. */
.fn-ui .fn-view-switch-row {
  margin-top: -4px;
  padding-top: 0;
  padding-bottom: 0;
}

/* The homepage used to repeat the header rail here. That second strip is
   gone; the phone keeps one bubble bar, .fn-rail-mob in the header. */

/* Category jump row — same underline-tab language as ראשי/פיד, sitting
   under the hero so a tap lands on that section's heading. */
.fn-ui .fn-view-switch.fn-cat-jump {
  display: flex;
  width: 100%;
  max-width: 100%;
  margin: 10px 0 22px;
  padding: 0 2px;
}

.fn-ui .fn-cat-jump .fn-view-switch__opt {
  flex: 0 0 auto;
  padding-inline: 16px;
}

.fn-ui .fn-cat-jump .fn-view-switch__opt.is-active,
.fn-ui .fn-cat-jump .fn-view-switch__opt[aria-current="true"] {
  color: var(--fn-interactive-ink);
  font-weight: 700;
}

.fn-ui .fn-cat-jump .fn-view-switch__opt.is-active::after,
.fn-ui .fn-cat-jump .fn-view-switch__opt[aria-current="true"]::after {
  transform: scaleX(1);
}

.fn-ui .fn-cat-target {
  scroll-margin-top: 16px;
}

.fn-ui .fn-view-switch {
  display: inline-flex;
  max-width: 100%;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0;
  margin: 0 0 4px;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid var(--fn-border);
  background: transparent;
  box-shadow: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.fn-ui .fn-view-switch::-webkit-scrollbar {
  height: 0;
}

/* The נצפו לאחרונה jump stays out until there is something to jump to;
   the option's own display would otherwise beat the hidden attribute. */
.fn-ui .fn-view-switch__opt[hidden] {
  display: none;
}

.fn-ui .fn-view-switch__opt {
  appearance: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  border: 0;
  margin: 0 0 -1px;
  padding: 6px 13px 7px;
  background: transparent;
  color: var(--fn-text-3, var(--fn-text-2));
  font-family: var(--fn-font-ui);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex: 0 0 auto;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
  transition: color var(--fn-dur-fast, 120ms) var(--fn-ease, ease);
}

.fn-ui .fn-view-switch__opt + .fn-view-switch__opt::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 8px;
  bottom: 10px;
  width: 1px;
  background: color-mix(in srgb, var(--fn-text-3, var(--fn-text-2)) 32%, transparent);
}

.fn-ui .fn-view-switch__opt::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 2.5px;
  border-radius: 2px 2px 0 0;
  background: var(--fn-interactive, #67cb35);
  transform: scaleX(0);
  transition: transform var(--fn-dur-fast, 120ms) var(--fn-ease, ease);
}

/* Hover is temporary and must not be mistakable for the selection: it only
   darkens the label towards the interaction ink. The selection additionally
   goes bold and carries the green underline. */
.fn-ui .fn-view-switch__opt:hover {
  color: var(--fn-interactive-ink);
  text-decoration: none;
  background: transparent;
}

.fn-ui .fn-view-switch__opt:focus {
  outline: none;
  box-shadow: none;
}

.fn-ui .fn-view-switch__opt:focus-visible {
  color: var(--fn-interactive-ink);
  outline: 2px solid var(--fn-interactive);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Selected: green ink + bold + the underline. The underline here is the
   no-JS fallback; once fn-motion.js attaches, the travelling thumb takes
   over and 22-motion.css hides this one. */
html:not([data-fn-home-view]) .fn-ui .fn-view-switch__opt[data-fn-view="editorial"],
html[data-fn-home-view="editorial"] .fn-ui .fn-view-switch__opt[data-fn-view="editorial"],
html[data-fn-home-view="feed"] .fn-ui .fn-view-switch__opt[data-fn-view="feed"],
html[data-fn-home-view="quick"] .fn-ui .fn-view-switch__opt[data-fn-view="quick"],
html[data-fn-home-view="gallery"] .fn-ui .fn-view-switch__opt[data-fn-view="gallery"],
html[data-fn-home-view="banner"] .fn-ui .fn-view-switch__opt[data-fn-view="banner"] {
  color: var(--fn-interactive-ink);
  font-weight: 700;
}

html:not([data-fn-home-view]) .fn-ui .fn-view-switch__opt[data-fn-view="editorial"]::after,
html[data-fn-home-view="editorial"] .fn-ui .fn-view-switch__opt[data-fn-view="editorial"]::after,
html[data-fn-home-view="feed"] .fn-ui .fn-view-switch__opt[data-fn-view="feed"]::after,
html[data-fn-home-view="quick"] .fn-ui .fn-view-switch__opt[data-fn-view="quick"]::after,
html[data-fn-home-view="gallery"] .fn-ui .fn-view-switch__opt[data-fn-view="gallery"]::after,
html[data-fn-home-view="banner"] .fn-ui .fn-view-switch__opt[data-fn-view="banner"]::after {
  transform: scaleX(1);
}

@media (max-width: 767px) {
  /* The document scroller's scroll-padding (13-header-sticky.css) is the
     offset. A margin here as well would stack on top of it. */
  .fn-ui .fn-cat-target {
    scroll-margin-top: 0;
  }

  .fn-ui .fn-view-switch-row {
    margin-top: 0;
  }

  .fn-ui .fn-view-switch {
    gap: 0;
    margin: 0 0 4px;
    margin-inline-start: 6px;
    margin-inline-end: 6px;
  }

  .fn-ui .fn-view-switch__opt {
    padding: 5px 10px 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fn-ui .fn-view-switch__opt,
  .fn-ui .fn-view-switch__opt::after {
    transition: none;
  }
}

/* Chronological stream */
.fn-ui .fn-chrono {
  margin: 0 0 var(--fn-space-8);
}

.fn-ui .fn-chrono__list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.fn-ui .fn-chrono__item {
  border-bottom: 1px solid var(--fn-border);
}

.fn-ui .fn-chrono__item:last-child {
  border-bottom: 0;
}

.fn-ui .fn-chrono__link {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px 0;
  text-decoration: none;
  color: inherit;
}

.fn-ui .fn-chrono__link:hover,
.fn-ui .fn-chrono__link:focus {
  text-decoration: none;
  color: inherit;
}

.fn-ui .fn-chrono__media {
  aspect-ratio: 3 / 2;
  border-radius: var(--fn-radius-card);
  overflow: hidden;
  background: var(--fn-bg-muted, rgba(14, 20, 16, 0.04));
}

.fn-ui .fn-chrono__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;
}

.fn-ui .fn-chrono__media--empty {
  background: var(--fn-bubble-skeleton, var(--fn-bg-sunken));
}

.fn-ui .fn-chrono__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 1px;
}

.fn-ui .fn-chrono__meta {
  margin: 0;
  color: var(--fn-text-3, var(--fn-text-2));
  font-size: 12px;
  line-height: 1.3;
}

/* Same size as every card headline in the editorial feed — the two streams
   are the same object seen through two different orderings, so a reader
   switching ראשי ⇄ פיד must not feel the type change under them. */
.fn-ui .fn-chrono__title {
  margin: 0;
  padding-block: var(--fn-ink-pad);
  margin-block: calc(var(--fn-ink-pad) * -1);
  color: var(--fn-text-1);
  font-family: var(--fn-font-display);
  font-size: var(--fn-type-card-phone);
  font-weight: var(--fn-fw-semibold);
  font-synthesis: none;
  line-height: var(--fn-leading-card-phone);
  /* A 110-character title next to a 108px thumb is five lines of rag. */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  overflow-wrap: normal;
  word-break: keep-all;
  hyphens: none;
}

.fn-ui .fn-chrono__link:hover .fn-chrono__title {
  color: var(--fn-interactive-ink);
}

.fn-ui .fn-chrono__foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  margin: 4px 0 0;
  padding: 8px 0 4px;
}

.fn-ui .fn-chrono__sentinel {
  width: 100%;
  height: 1px;
  pointer-events: none;
}

.fn-ui .fn-chrono__loading,
.fn-ui .fn-chrono__end,
.fn-ui .fn-chrono__status {
  margin: 0;
  color: var(--fn-text-3, var(--fn-text-2));
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
}

.fn-ui .fn-chrono__status {
  margin: 0 0 10px;
}

.fn-ui .fn-chrono__end {
  font-weight: 500;
}

.fn-ui .fn-chrono__retry {
  appearance: none;
  margin: 4px 0 0;
  padding: 6px 4px;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--fn-text-2) 35%, transparent);
  border-radius: 0;
  background: transparent;
  color: var(--fn-text-2);
  font-family: var(--fn-font-ui);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.fn-ui .fn-chrono__retry:hover,
.fn-ui .fn-chrono__retry:focus-visible {
  color: var(--fn-text-1);
  border-bottom-color: var(--fn-text-1);
}

.fn-ui .fn-chrono__retry:focus-visible {
  outline: 2px solid var(--fn-focus);
  outline-offset: 2px;
}

@media (min-width: 768px) {
  .fn-ui .fn-chrono__link {
    grid-template-columns: 168px minmax(0, 1fr);
    gap: 16px;
    padding: 16px 0;
  }

  .fn-ui .fn-chrono__title {
    font-size: 18px;
    font-weight: var(--fn-fw-bold);
    line-height: 1.38;
  }
}

/* The small-phone step is on --fn-type-card-phone (fn/21-mobile.css); the
   thumb geometry below 360px is set with the rest of the card there too. */

/* --------------------------------------------------------------------------
   The ranking board — TA-125 shares by the day's change, in מבט מהיר.
   Whether it is on screen is fn/29-views.css's decision, not this file's.
   -------------------------------------------------------------------------- */

.fn-ui .fn-board {
  margin: 0 0 var(--fn-space-8);
  padding: 16px 18px 12px;
  max-width: 100%;
  color: var(--fn-text-1);
  font-family: var(--fn-font-ui);
}

.fn-ui .fn-board__bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 100%;
  margin: 0 0 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--fn-border);
}

.fn-ui .fn-board__sort {
  appearance: none;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--fn-text-3, var(--fn-text-2));
  font-family: inherit;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
}

/* The search box.
   --------------------------------------------------------------------
   This was `flex: 0 0 auto` and nothing else — the <input type="search">
   inside it had no box at all, so it rendered as placeholder text sitting
   on whatever underline the browser or template.css gave it, and read as a
   broken control rather than a field.

   It takes the same field tokens as every other input in the product. */
.fn-ui .fn-board__search {
  flex: 1 1 200px;
  min-width: 160px;
  max-width: 320px;
  display: flex;
  align-items: center;
}

.fn-ui .fn-board__search input,
.fn-ui .fn-board__search input[type="search"] {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-width: 0;
  height: 40px;
  margin: 0;
  padding: 0 16px;
  border: 1px solid var(--fn-field-border);
  border-radius: var(--fn-radius-pill, 999px);
  background: var(--fn-field-bg);
  color: var(--fn-field-text);
  font-family: var(--fn-font-ui);
  font-size: 13px;
  line-height: 1.2;
  box-shadow: none;
  transition: border-color var(--fn-dur-fast) var(--fn-ease),
              box-shadow var(--fn-dur-fast) var(--fn-ease);
}

.fn-ui .fn-board__search input::placeholder {
  color: var(--fn-field-placeholder);
  opacity: 1;
}

.fn-ui .fn-board__search input:hover {
  border-color: var(--fn-interactive-line);
}

.fn-ui .fn-board__search input:focus {
  outline: none;
  border-color: var(--fn-interactive);
  box-shadow: 0 0 0 3px var(--fn-interactive-wash);
}

/* Chrome draws its own clear button on type=search and it fights the
   rounded field. */
.fn-ui .fn-board__search input::-webkit-search-decoration,
.fn-ui .fn-board__search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* The rows scroll inside the board, under a cap set with the view's other
   values (--fn-quick-table-max, 29-views.css). The search field is outside
   this box, so it stays put.

   The box is a scrolling pane for the shared sticky header
   (fn-sticky-head.js, 37-sticky-head.css): the copy sticks to the pane's
   own top edge. --fn-sticky-stack is zero because nothing is pinned inside
   the pane.

   overscroll-behavior is left at auto on purpose. At either end of the
   list the wheel or the finger carries on to the page, so the pane can
   never hold a phone reader who wants what is under it. */
.fn-ui .fn-board__pane {
  max-height: var(--fn-quick-table-max);
  overflow-y: auto;
  scrollbar-width: thin;
  --fn-sticky-stack: 0px;
}

.fn-ui .fn-board__scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  outline: none;
}

.fn-ui .fn-board__table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

@media (min-width: 768px) {
  .fn-ui .fn-board__table { min-width: 560px; }
}

.fn-ui .fn-board__table th,
.fn-ui .fn-board__table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--fn-border);
  vertical-align: middle;
}

.fn-ui .fn-board__table th {
  background: var(--fn-bg-canvas);
  color: var(--fn-text-3, var(--fn-text-2));
  font-size: 11px;
  font-weight: 600;
  text-align: start;
}

.fn-ui .fn-board__sort {
  padding: 0;
  font-size: 11px;
  font-weight: 600;
  text-align: inherit;
}

.fn-ui .fn-board__table th[aria-sort="descending"] .fn-board__sort::after {
  content: " \2193";
}

.fn-ui .fn-board__table th[aria-sort="ascending"] .fn-board__sort::after {
  content: " \2191";
}

.fn-ui .fn-board__rankcol {
  width: 42px;
  text-align: center;
}

.fn-ui .fn-board__numcol {
  width: 92px;
  text-align: end;
}

.fn-ui .fn-board__num {
  direction: ltr;
  text-align: end;
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  font-weight: 600;
}

/* A price, not a return. It carries no direction, so it takes none of the
   market colour and steps back from the figure the table is ranked by. */
.fn-ui .fn-board__num--plain {
  color: var(--fn-text-2);
  font-weight: var(--fn-fw-emphasis);
}

.fn-ui .fn-board__table td.is-focus,
.fn-ui .fn-board__table th.is-focus {
  background: color-mix(in srgb, var(--fn-brand, #67cb35) 8%, var(--fn-bg-canvas));
}

.fn-ui .fn-board__name {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  background: var(--fn-bg-canvas);
  text-align: start;
}

.fn-ui .fn-board__table th.fn-board__name {
  z-index: 2;
}

.fn-ui .fn-board__name a {
  display: block;
  overflow: hidden;
  color: var(--fn-text-1);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fn-ui .fn-board__name a:hover,
.fn-ui .fn-board__name a:focus-visible {
  color: var(--fn-interactive-ink);
  text-decoration: none;
}

.fn-ui .fn-board__place {
  display: inline-block;
  min-width: 1.4em;
  color: var(--fn-text-2);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.fn-ui .fn-board__table tr.is-top .fn-board__place {
  color: var(--fn-text-1);
}

.fn-ui .fn-board__table tbody tr:hover td {
  background: color-mix(in srgb, var(--fn-text-1) 4%, transparent);
}

.fn-ui .fn-board__table tbody tr:hover .fn-board__name {
  background: color-mix(in srgb, var(--fn-text-1) 4%, var(--fn-bg-canvas));
}

.fn-ui .fn-board__status {
  margin: 10px 0 0;
  color: var(--fn-text-2);
  font-size: 13px;
}

.fn-ui .fn-board__sort:focus-visible,
.fn-ui .fn-board__pane:focus-visible {
  outline: 2px solid var(--fn-border-brand, var(--fn-brand, #67cb35));
  outline-offset: 2px;
}

/* Drawn inside the pane: on a phone it runs to the bubble's edge, where an
   outline outside it would be cut off. */
.fn-ui .fn-board__pane:focus-visible {
  outline-offset: -2px;
}

@media (max-width: 767px) {
  .fn-ui .fn-board {
    padding-inline: 8px;
  }

  .fn-ui .fn-board__bar {
    flex-wrap: wrap;
  }

  .fn-ui .fn-board__search {
    flex: 1 1 100%;
    max-width: none;
  }

  .fn-ui .fn-board__search input {
    width: 100%;
    max-width: none;
    text-align: right;
  }

  .fn-ui .fn-board__scroll {
    overflow-x: hidden;
  }

  /* Both figures stay on a phone: the day's change and the price beside
     it. There are only two and they fit next to the name. */
  .fn-ui .fn-board__numcol {
    width: 76px;
  }

  /* The turnover column is the third figure and does not fit beside the name
     here (the scroller clips instead of scrolling): desktop and tablet only. */
  .fn-ui .fn-board__turncol {
    display: none;
  }
}

/* "2.35 מיליארד" stays on one line. */
.fn-ui .fn-board__turncol {
  width: 118px;
  white-space: nowrap;
}
