/* ==========================================================================
   FUNDER — banner view (באנר)
   --------------------------------------------------------------------------
   A sixth state of the homepage view switch that gives the existing
   homepage banner a view of its own.

   WHICH BANNER
   ------------
   The one already on the homepage: `.index_bnrid3`, server-rendered from
   Session["_banHtml3"], which Site1.Master fills from GetPJson's `300_1`
   creative. It is the only ad slot index.aspx places. Nothing here invents
   a second one, and nothing here reaches into the creative.

   WHY THERE IS NO JAVASCRIPT IN THIS FEATURE
   ------------------------------------------
   The obvious implementation moves the banner node into a view container.
   That is the implementation to avoid, and the reason is measurement:

     - re-rendering the markup fires a second impression;
     - MOVING the live node avoids that for an <img> creative, but per spec
       an <iframe> re-loads when it is re-inserted into the document, so a
       creative delivered in a frame would have counted twice — and the
       creative HTML lives in the database, where this code cannot see it.

   So the node is never touched. The banner stays exactly where it is, in
   the sidebar, in the DOM order it has always had, and this view is nothing
   but `display` on its NEIGHBOURS. Toggling an ancestor's display does not
   re-request an image and does not reload a frame, so:

     - the banner is fetched once per page load, as before;
     - impressions and clicks count exactly as they did before;
     - the creative's own tracking pixel fires on page load as before,
       whether or not the reader ever opens this view;
     - no other ad slot on any other page is affected.

   The practical consequence is that this view cannot break the ad. It can
   only show or hide what is around it.

   ONE OBSERVATION FOR UDI
   -----------------------
   The slot is a 300x250 creative in a 255px-tall box. A whole view for one
   small rectangle leaves a lot of canvas around it. It is centred and given
   a heading here rather than stretched — scaling a fixed-size creative
   distorts artwork that an advertiser supplied at a fixed size, and that is
   not a decision a stylesheet should take.
   ========================================================================== */

/* Which blocks this mode shows is decided in 29-views.css, with every
   other mode, under one default-deny rule. All that is left here is how the
   advert is PRESENTED once it is the only thing on the page. */

/* The slot itself. Its inline `height: 255px` is left alone — it is what
   reserves space for the creative and removing it would introduce a layout
   shift on every page load, in every view. */
html[data-fn-home-view="banner"] .fn-ui .index_bnrid3 {
  position: relative;
  float: none;
  display: block;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  text-align: center;

  /* The slot carries an inline `height: 255px` from the server. That is a
     space RESERVATION so a late-arriving advert does not shift the page,
     and under border-box it is a hard ceiling: adding 112px of padding
     inside it left 143px for a 250px creative, and the advert spilled out
     of its own box and over whatever was underneath. That is what "מלבן
     אפור עם תמונה שבורה" was.

     In this mode the advert is the only thing on the page, so there is
     nothing to shift and nothing to reserve against. The height becomes
     automatic and the reservation becomes a floor. !important is required
     and is the narrowest tool available: an inline style cannot be beaten
     any other way, and the override is scoped to this one mode. */
  height: auto !important;
  min-height: 255px;
  padding: var(--fn-space-10) 0 var(--fn-space-12);
}

/* A heading, so the mode is not a lone rectangle with no explanation.
   Generated content, so it needs no markup in index.aspx and cannot be read
   as editorial by a crawler. */
html[data-fn-home-view="banner"] .fn-ui .index_bnrid3::before {
  content: "פרסומת";
  display: block;
  margin-bottom: var(--fn-space-5);
  color: var(--fn-text-3);
  font-family: var(--fn-font-ui);
  font-size: var(--fn-fs-xs);
  font-weight: var(--fn-fw-medium);
  letter-spacing: 0.08em;
}

/* The creative keeps its own dimensions. It is centred, never scaled: the
   artwork was supplied at a fixed size and stretching it is not a decision
   a stylesheet gets to take. */
html[data-fn-home-view="banner"] .fn-ui .index_bnrid3 iframe,
html[data-fn-home-view="banner"] .fn-ui .index_bnrid3 img {
  display: inline-block;
  max-width: 100%;
  vertical-align: top;
}

/* An empty slot — no campaign running, or the session value was never
   filled — must say so rather than render a blank screen that looks like a
   bug. :empty only matches when there is genuinely nothing inside. */
html[data-fn-home-view="banner"] .fn-ui .index_bnrid3:empty::after {
  content: "אין כרגע באנר להצגה";
  color: var(--fn-text-3);
  font-family: var(--fn-font-ui);
  font-size: var(--fn-fs-base);
}

/* The creative keeps its own dimensions; it is only stopped from running
   past the page on a narrow screen. */
html[data-fn-home-view="banner"] .fn-ui .index_bnrid3 img {
  max-width: 100%;
  height: auto;
}
