/* ==========================================================================
   Fund page — the advanced chart inside the chart stage (fund.aspx).

   "גרפים מתקדמים" used to leave the fund page for fundo. The stage now
   switches between the yield chart and fundo's AnyChart chart with its
   drawing tools, the way the stock page carries both in one place. The
   advanced chart is fundo itself in embedded mode (?embed=1), framed, so its
   scripts and Bootstrap widgets never meet this page's c3 / jQuery-UI stack.
   Behaviour: assets/js/fn-pd-advanced.js.
   ========================================================================== */

/* The switch sits at the end of the stage head, after the title. */
.fn-ui .fn-pd-chart-stage > .fn-pd-section__head .fn-pd-chartmode {
  margin-inline-start: auto;
  min-width: 0;
  max-width: 100%;
}

/* Advanced: the tools and the plot need the whole width, so the stage drops
   to one column and the figures card follows the chart, as it already does
   below 1100px. */
.fn-ui .fn-pd-stage.is-adv {
  grid-template-columns: minmax(0, 1fr);
}

.fn-ui .fn-pd-stage.is-adv > .fn-pd-chart-stage {
  order: -1;
}

/* Everything of the yield chart steps aside: plot, period pills, the
   replay HUD and its launcher. Only the head (title + switch) and the
   frame remain. */
.fn-ui .fn-pd-chart-stage.is-adv > :not(.fn-pd-section__head):not(.fn-pd-adv),
.fn-ui .fn-pd-chart-stage.is-adv .fn-pd-replay-launch {
  display: none !important;
}

/* The frame runs edge to edge in the bubble, like the yield plot does
   (.fn-pd-chart-stage .fn-pd-chart in 15-product.css). */
.fn-ui .fn-pd-adv {
  position: relative;
  margin-inline: calc(var(--fnp-bubble-pad, 16px) * -1);
}

.fn-ui .fn-pd-adv[hidden] {
  display: none;
}

.fn-ui .fn-pd-adv__frame {
  display: block;
  width: 100%;
  /* Until the page inside has measured itself (fn-pd-advanced.js sets the
     real height), hold roughly the chart's room so the page below does not
     jump twice. */
  height: 560px;
  border: 0;
  background: transparent;
  color-scheme: normal;
}

.fn-ui .fn-pd-adv.is-loading .fn-pd-adv__frame {
  visibility: hidden;
}

.fn-ui .fn-pd-adv__status {
  position: absolute;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  padding: 24px 16px;
  color: var(--fn-text-2);
  font-family: var(--fn-font-ui);
  font-size: 14px;
  text-align: center;
}

.fn-ui .fn-pd-adv:not(.is-loading):not(.is-failed) .fn-pd-adv__status {
  display: none;
}

.fn-ui .fn-pd-adv.is-failed .fn-pd-adv__status {
  position: static;
}

.fn-ui .fn-pd-adv.is-failed .fn-pd-adv__frame {
  display: none;
}

.fn-ui .fn-pd-adv__status a {
  color: var(--fn-text-1);
  font-weight: 700;
  text-decoration: underline;
}

/* Phone: the title and the switch share one row while they fit, and the
   switch takes its own row when they do not. */
@media (max-width: 480px) {
  .fn-ui .fn-pd-chart-stage > .fn-pd-section__head .fn-pd-chartmode {
    margin-inline-start: 0;
  }
}
