/* ==========================================================================
   FUNDER — the article reading surface
   --------------------------------------------------------------------------
   Udi: the story sits on a clean surface inside a clear container, with no
   texture behind the running text. The texture stays on the page around it.

   This file is a surface only. Article TYPOGRAPHY — the 44px title, the
   28px dek, the 18px body, the compact size for tables inside a story —
   lives in 17-type-trial.css and is not touched here.

   WHY IT EXISTS AT ALL
   --------------------
   Partly as a feature and partly as a repair. 26-desktop.css put the FUNDER
   wallpaper behind every page served by Seo.Master, and the article page is
   one of them, so the texture had arrived behind the body copy. A pattern
   under a 2000-word story is the one place it is actively harmful: it
   competes with the letterforms at exactly the size the eye is working
   hardest. An opaque container is both the thing Udi asked for and the fix.

   WHAT SITS INSIDE THE CONTAINER
   ------------------------------
   The title, the dek and the lead image. They used to sit on the textured
   ground above the two columns; that left the top of the story unboxed.
   They now open the story card, and the sidebar stays its own card beside it.

   WHAT MUST NOT CHANGE
   --------------------
   Every child of #articleDesc — images, tables, links, embeds, the inline
   banner, the share row, the Google News callout — keeps its own behaviour.
   Nothing here selects into the body content except to stop a table's own
   background painting over a rounded corner.
   ========================================================================== */

.fn-ui #articleContentPart {
  position: relative;
  overflow-x: hidden;
  background-color: var(--fn-bubble-bg, var(--fn-bg-surface));
  background-clip: padding-box;
  border-radius: var(--fn-radius-lg);
  /* Hairline as an inset shadow, not a border: a border would add to the
     column's box and narrow the measure by two more pixels on every
     breakpoint. Same reason as the homepage modules. */
  box-shadow:
    inset 0 0 0 1px var(--fn-bubble-border, var(--fn-border)),
    var(--fn-shadow-sm);
}

/* template.css draws a left rule on .bdleftss to separate the story from
   the sidebar. The container now does that job, and a rule inside a card
   edge reads as a mistake. */
.fn-ui #articleContentPart.bdleftss {
  border-left: 0;
}

.fn-ui #articleContentPart .fn-article-head {
  margin: 0 0 18px;
  text-align: center;
}

.fn-ui #articleContentPart #articleTitle.aTit {
  margin-top: 0;
  margin-bottom: 8px;
}

.fn-ui #articleContentPart #articleSubTitle,
.fn-ui #articleContentPart #articleSubTitle.h2 {
  margin-top: 0;
  margin-bottom: 0;
}

.fn-ui #articleContentPart #articleSubTitle:empty {
  display: none;
}

/* The sidebar joins the same family — otherwise the story sits in a card
   next to three panels that do not, which looks like the card was added to
   one column by accident. Bootstrap's .panel already paints a surface; it
   is only the shape and the edge that need to agree. */
/* …and the sidebar panels. template.css paints these in the legacy cream
   palette — `.panel { background: #fefaf0 }` with a tan gradient on the
   heading and a #f2e7d1 border. Beside a white card that reads as two
   different websites on one page, and the gradient is one of the ones Udi
   asked to remove. Overridden here rather than edited there: template.css
   serves the whole old site, and `.panel` is on dozens of pages this round
   has no business touching. Scoped to the article sidebar for that reason. */
.fn-ui #articleSidbar .panel {
  border-radius: var(--fn-radius-lg);
  background-clip: padding-box;
  overflow: hidden;
  background-color: var(--fn-bubble-bg, var(--fn-bg-surface));
  border: 1px solid var(--fn-bubble-border, var(--fn-border));
  box-shadow: var(--fn-shadow-sm);
}

.fn-ui #articleSidbar .panel-default > .panel-heading,
.fn-ui #articleSidbar .panel-heading {
  background-image: none;
  background-color: transparent;
  background-clip: padding-box;
  border-radius: 0;
  border-color: var(--fn-bubble-border, var(--fn-border)) !important;
  color: var(--fn-text-1);
}

/* The rules inside the story. template.css sets `hr { border-top: 1px solid
   #f1e6ce !important }` — a cream line, which on a white card is a stain
   rather than a divider. Same !important, same specificity battle, one
   neutral token. */
.fn-ui #articleContentPart hr,
.fn-ui #articleDesc hr,
.fn-ui .articleBodyText hr {
  border-top-color: var(--fn-border) !important;
}

/* A table inside the story brings its own background from template.css; at
   the container's corner that paints a square over the curve. */
.fn-ui #articleContentPart .table-responsive {
  border-radius: 0;
}

/* Media pasted into the story by the CMS carries its own intrinsic width
   and no `img-responsive` class. At the sm breakpoint the column is 500px
   and a 760px photo ran straight out past the container's rounded edge —
   measured, not guessed. This is the "images, tables, links and embeds stay
   inside the article" requirement, and it was true before the container
   existed; the container is just what made it visible.

   height:auto only on the elements that have an intrinsic ratio. An iframe
   does not, and setting it there collapses an embed to nothing. */
.fn-ui #articleDesc img,
.fn-ui #articleDesc video,
.fn-ui #articleDesc figure {
  max-width: 100%;
  height: auto;
}

.fn-ui #articleDesc iframe,
.fn-ui #articleDesc embed,
.fn-ui #articleDesc object {
  max-width: 100%;
}

.fn-ui #articleDesc figure {
  margin-inline: 0;
}

/* The legacy zebra is #f9f1e1 cream. Inside the reading surface it has to
   be a neutral tint of the surface it sits on, or every other row of a fund
   table glows. */
.fn-ui #articleContentPart .table-striped > tbody > tr:nth-of-type(odd),
.fn-ui #articleContentPart .table-striped > tbody > tr:nth-of-type(odd) > td {
  background-color: var(--fn-bg-sunken);
}


/* --------------------------------------------------------------------------
   Reading margins
   --------------------------------------------------------------------------
   The column already carries Bootstrap's 15px. These values REPLACE it
   rather than adding to it, so the measure loses 15px a side on desktop and
   nothing at all on a phone, where 15px was already the whole gutter.

   The body is 21px on desktop with a 1.7 leading and takes the whole column
   (17-type-trial.css lifts the 38em cap on this page). The padding here is
   only the EDGE, to stop text from touching the container.
   -------------------------------------------------------------------------- */

@media (min-width: 768px) {
  .fn-ui #articleContentPart {
    padding: 28px 30px 24px;
    margin-bottom: var(--fn-space-6);
  }
}


/* --------------------------------------------------------------------------
   Lead image — centred under the title
   --------------------------------------------------------------------------
   The image sat in a col-lg-8 between two col-lg-2 spacers (.imgSdPart),
   but article.aspx redefines col-lg-8 as 71.67% for the sidebar split, so
   the three add up to more than the row and the image column was pushed
   off centre; the image was also flush to the right of its column, and in
   a story with a table (.newarticlesec) template.css floats the caption
   left at 85%. With a 590px image in the full-width column the image was
   about 140px right of the title's centre. The spacers go, and the image
   and its caption are centred on the column. */
.fn-ui #articleContentPart .imgSdPart {
  display: none !important;
}

.fn-ui #articleContentPart .aImagePart {
  float: none;
  width: 100%;
  text-align: center;
}

.fn-ui #articleContentPart .aImagePart #articleImage {
  margin-inline: auto;
}

.fn-ui #articleContentPart .aImagePart .artImgtitle {
  float: none;
  width: auto;
  text-align: center;
}


/* --------------------------------------------------------------------------
   Share row — ready-made circular logos (assets/img/share)
   -------------------------------------------------------------------------- */

.fn-ui #articleContentPart .articleBodyText.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-left: 0;
  margin-right: 0;
}

.fn-ui #articleContentPart .articleBodyText.row > [class*="col-"] {
  float: none;
  padding-left: 0;
  padding-right: 0;
}

.fn-ui #articleContentPart .articleBodyText.row > .catNameDiv {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: auto !important;
  flex: 1 1 auto;
  min-width: 0;
}

.fn-ui #articleContentPart .articleBodyText.row > .text-left {
  width: auto !important;
  flex: 0 0 auto;
  margin-inline-start: auto;
}

.fn-ui #articleContentPart #articleIcon {
  display: flex !important;
  align-items: center;
  justify-content: center;
  float: none;
  clear: both;
  flex: 1 0 100%;
  order: 5;
  width: 100% !important;
  max-width: 100%;
  padding: 8px 0 6px;
}

.fn-ui #articleContentPart .aSocialIcons {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  width: fit-content !important;
  max-width: 100%;
  float: none;
  margin: 0 auto;
  padding: 0 !important;
  text-align: center;
}

.fn-ui #articleContentPart .aSocialIcons a,
.fn-ui #articleContentPart .aSocialIcons a.greenIcon,
.fn-ui #articleContentPart .aSocialIcons a.text-warning {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
  line-height: 0;
  text-decoration: none;
  vertical-align: middle;
  -webkit-tap-highlight-color: transparent;
}

.fn-ui #articleContentPart .aSocialIcons a.articleFacebookShare,
.fn-ui #articleContentPart .aSocialIcons a.articleWhtappShare,
.fn-ui #articleContentPart .aSocialIcons a.articleLinkedinShare,
.fn-ui #articleContentPart .aSocialIcons a.articleTwitterShare,
.fn-ui #articleContentPart .aSocialIcons a.greenIcon,
.fn-ui #articleContentPart .aSocialIcons a.text-warning {
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
}

.fn-ui #articleContentPart .aSocialIcons a.articleFacebookShare {
  background-image: url("../../img/share/facebook.png");
}

.fn-ui #articleContentPart .aSocialIcons a.articleWhtappShare {
  background-image: url("../../img/share/whatsapp.png?v=2");
  border-radius: 0;
  overflow: visible;
}

.fn-ui #articleContentPart .aSocialIcons a.articleLinkedinShare {
  background-image: url("../../img/share/linkedin.png");
}

.fn-ui #articleContentPart .aSocialIcons a.articleTwitterShare {
  background-image: url("../../img/share/x.png");
}

.fn-ui #articleContentPart .aSocialIcons a.greenIcon {
  background-image: url("../../img/share/printer.png?v=2");
}

.fn-ui #articleContentPart .aSocialIcons a.text-warning {
  background-image: url("../../img/share/mail.png?v=2");
}

.fn-ui #articleContentPart .aSocialIcons a.articleFacebookShare img,
.fn-ui #articleContentPart .aSocialIcons a.articleWhtappShare img,
.fn-ui #articleContentPart .aSocialIcons a.articleLinkedinShare img,
.fn-ui #articleContentPart .aSocialIcons a.articleTwitterShare img,
.fn-ui #articleContentPart .aSocialIcons a .glyphicon,
.fn-ui #articleContentPart .aSocialIcons a i {
  display: none !important;
}

.fn-ui #articleContentPart .aSocialIcons a:hover,
.fn-ui #articleContentPart .aSocialIcons a:active {
  opacity: 0.85;
}

.fn-ui #articleContentPart .aSocialIcons a:focus-visible {
  outline: var(--fn-focus-width, 2px) solid var(--fn-focus);
  outline-offset: 2px;
}

/* The listen control sits in the share row so the player card does not
   spend a row of the article before anyone presses it. Only the play
   button is here at rest. The ±15 skips are the buttons articleAudio.js
   moves in beside it; they stay hidden until play is pressed. Direction
   is LTR so skip-back stays on the left of play. */
.fn-ui #articleContentPart .fa-aud-dock {
  display: inline-flex;
  align-items: center;
  direction: ltr;
  gap: 2px;
  flex: 0 0 auto;
}

.fn-ui #articleContentPart .fa-aud-dock .fa-aud-play,
.fn-ui #articleContentPart .fa-aud-dock .fa-aud-skip {
  width: 32px;
  height: 32px;
}

.fn-ui #articleContentPart .fa-aud-dock .fa-aud-play svg {
  width: 14px;
  height: 14px;
}

.fn-ui #articleContentPart .fa-aud-dock .fa-aud-skip svg {
  width: 28px;
  height: 28px;
}

.fn-ui #articleContentPart .fa-aud-dock:not(.is-open) .fa-aud-skip {
  display: none;
}

/* The phone used to dump a second copy of these icons under the lead image
   and hide the byline row. One centred row is the whole point. */
.fn-ui #articleContentPart div:has(> a.articleWhtappShare):not(.aSocialIcons) {
  display: none !important;
}

.fn-ui .fn-article-home,
.fn-ui .fn-article-close {
  display: none;
}

@media (max-width: 767px) {
  .fn-ui #articleContentPart {
    /* One radius smaller on a phone, matching the homepage bubble rather
       than the desktop module — the two are seen on the same screen when a
       reader comes from the feed. */
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    border-radius: var(--fn-bubble-radius, 14px);
    padding: 12px 14px 18px;
    /* A 10px inset, so the rounded corners are unmistakably corners. Flush
       to the viewport the card still has them, but nothing to show them
       against. The measure pays 20px for that and keeps ~340px, which is
       still past the point where Hebrew at 18px reads comfortably.

       The width has to come off with the margin: this is a Bootstrap
       `col-xs-12`, so it is `width: 100%` under border-box, and a margin
       alone made the document 20px wider than the viewport. */
    margin-inline: 10px;
    width: calc(100% - 20px);
    margin-bottom: var(--fn-bubble-group-gap, 22px);
  }

  .fn-ui #articleSidbar .panel {
    border-radius: var(--fn-bubble-radius, 14px);
  }

  /* Title → image → dek → body. The head wrapper is unpacked so the
     two headings can sit on either side of the lead image. */
  .fn-ui #articleContentPart .fn-article-head {
    display: contents;
  }

  .fn-ui #articleContentPart #articleTitle.aTit {
    grid-column: 1 / -1;
    grid-row: 2;
    text-align: right !important;
    max-width: 100%;
    margin: 0 0 12px;
    padding: 0;
  }

  .fn-ui #articleContentPart .fn-article-head + .col-lg-12 {
    grid-column: 1 / -1;
    grid-row: 3;
    width: 100%;
    margin: 0 0 12px;
    padding: 0;
    float: none;
  }

  .fn-ui #articleContentPart #articleSubTitle,
  .fn-ui #articleContentPart #articleSubTitle.h2 {
    grid-column: 1 / -1;
    grid-row: 4;
    text-align: right !important;
    max-width: 100%;
    margin: 0 0 12px;
    padding: 0;
  }

  .fn-ui #articleContentPart > .col-lg-12.col-md-12 {
    grid-column: 1 / -1;
    grid-row: 5;
    width: 100%;
    float: none;
  }

  .fn-ui .fn-article-home,
  .fn-ui .fn-article-close {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background-color: var(--fn-bubble-bg, var(--fn-bg-surface));
    background-clip: padding-box;
    box-shadow:
      inset 0 0 0 1px var(--fn-bubble-border, var(--fn-border)),
      var(--fn-shadow-sm);
    color: var(--fn-text-2);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }

  .fn-ui .fn-article-home {
    grid-column: 1;
    grid-row: 1;
    justify-self: left;
    margin-bottom: 10px;
  }

  .fn-ui .fn-article-close {
    grid-column: 1;
    grid-row: 1;
    justify-self: right;
    margin-bottom: 10px;
  }

  .fn-ui .fn-article-home__icon {
    display: block;
    width: 10px;
    height: 10px;
    border-style: solid;
    border-width: 0 2px 2px 0;
    border-color: currentColor;
    transform: rotate(135deg);
    margin-right: -2px;
  }

  .fn-ui .fn-article-close__icon {
    position: relative;
    display: block;
    width: 12px;
    height: 12px;
  }

  .fn-ui .fn-article-close__icon::before,
  .fn-ui .fn-article-close__icon::after {
    content: "";
    position: absolute;
    top: 0;
    left: 5px;
    width: 2px;
    height: 12px;
    border-radius: 1px;
    background: currentColor;
  }

  .fn-ui .fn-article-close__icon::before {
    transform: rotate(45deg);
  }

  .fn-ui .fn-article-close__icon::after {
    transform: rotate(-45deg);
  }

  .fn-ui .fn-article-home:active,
  .fn-ui .fn-article-close:active {
    background-color: var(--fn-bubble-bg-press, var(--fn-bg-sunken));
  }

  .fn-ui .fn-article-home:focus-visible,
  .fn-ui .fn-article-close:focus-visible {
    outline: var(--fn-focus-width, 2px) solid var(--fn-focus);
    outline-offset: 2px;
  }

  .fn-ui #articleContentPart .fn-article-head {
    padding-inline: 0;
  }

  .fn-ui #articleContentPart #articleIcon {
    display: flex !important;
    float: none;
    width: 100%;
    clear: both;
    justify-content: center;
    padding: 10px 0 4px;
  }

  .fn-ui #articleContentPart .aSocialIcons a,
  .fn-ui #articleContentPart .aSocialIcons a.greenIcon,
  .fn-ui #articleContentPart .aSocialIcons a.text-warning {
    width: 36px;
    height: 36px;
  }

  .fn-ui #articleContentPart .fa-aud-dock .fa-aud-play,
  .fn-ui #articleContentPart .fa-aud-dock .fa-aud-skip {
    width: 36px;
    height: 36px;
  }
}


/* --------------------------------------------------------------------------
   The three themes
   --------------------------------------------------------------------------
   Nothing below changes a colour by hand. --fn-bubble-bg is already the
   per-theme card surface — pure white in Light, #151B16 in Dark, #FBFDF9 in
   Soft — so the container is opaque in all three and the wallpaper cannot
   show through the copy in any of them. The only per-theme decision is how
   much lift a card needs to separate from its own canvas.
   -------------------------------------------------------------------------- */

:root[data-fn-theme="dark"] .fn-ui #articleContentPart {
  box-shadow:
    inset 0 0 0 1px var(--fn-bubble-border),
    0 2px 10px rgba(0, 0, 0, 0.45);
}

:root[data-fn-theme="soft"] .fn-ui #articleContentPart {
  box-shadow:
    inset 0 0 0 1px var(--fn-bubble-border),
    0 1px 2px rgba(31, 66, 16, 0.06),
    0 8px 24px -20px rgba(31, 66, 16, 0.25);
}

/* The accessibility high-contrast modes own the surface completely: a flat
   outline on a flat ground, no shadow, no tint. */
body.fn-ui.darkCont #articleContentPart,
body.fn-ui.brightCont #articleContentPart,
body.fn-ui.darkCont #articleSidbar .panel,
body.fn-ui.brightCont #articleSidbar .panel {
  box-shadow: none;
  border: 1px solid var(--fn-bubble-border);
  background-color: var(--fn-bubble-bg);
}


/* --------------------------------------------------------------------------
   Links inside the story
   --------------------------------------------------------------------------
   An in-story link is one of the "קישורים מרכזיים" in Udi's list, so it
   takes the interaction green like everything else. It keeps its underline
   at rest: inside a paragraph, colour alone is not an affordance, and the
   green is not readable enough on white to be one on its own.
   -------------------------------------------------------------------------- */

.fn-ui #articleDesc a:hover,
.fn-ui #articleDesc a:focus-visible,
.fn-ui .articleBotmDesc a:hover,
.fn-ui .articleBotmDesc a:focus-visible {
  color: var(--fn-interactive-ink);
  text-decoration-color: var(--fn-interactive);
}

.fn-ui #articleSidbar a:hover,
.fn-ui #articleSidbar a:focus-visible {
  color: var(--fn-interactive-ink);
}


/* --------------------------------------------------------------------------
   Google News + the legal line
   --------------------------------------------------------------------------
   template.css paints this block in the old palette: body text is #000 and
   the callout link is underlined #0000ff. On the dark card that is black
   type on a near-black surface. The callout is a sunken row in every theme;
   the disclaimer is quiet secondary type, not a second headline.
   -------------------------------------------------------------------------- */

.fn-ui .articleBotmDesc {
  color: var(--fn-text-2);
}

.fn-ui .google-news-callout {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px auto 0;
  padding: 12px 16px;
  background: var(--fn-bg-sunken);
  color: var(--fn-text-1);
  border: 1px solid var(--fn-border);
  border-radius: var(--fn-radius-md);
  font-size: var(--fn-fs-md);
  font-weight: var(--fn-fw-semibold);
  line-height: 1.4;
  text-align: center;
}

.fn-ui .google-news-callout img {
  flex: 0 0 auto;
}

.fn-ui .google-news-callout a,
.fn-ui .google-news-callout a.text {
  color: var(--fn-text-1);
  border-bottom: 0;
  text-decoration: none;
  font-weight: var(--fn-fw-semibold);
}

.fn-ui .google-news-callout a:hover,
.fn-ui .google-news-callout a:focus-visible {
  color: var(--fn-interactive-ink);
  text-decoration: underline;
  text-decoration-color: var(--fn-interactive);
  border-bottom: 0;
}

.fn-ui .articleBotmDesc > p {
  color: var(--fn-text-2);
  font-size: var(--fn-fs-sm);
  line-height: 1.55;
}

.fn-ui .articleBotmDesc > p a:not(.btn) {
  color: var(--fn-text-2);
  text-decoration: none;
  border-bottom: 0;
  font-size: inherit;
  font-weight: var(--fn-fw-regular);
}

.fn-ui .articleBotmDesc > p a:not(.btn):hover,
.fn-ui .articleBotmDesc > p a:not(.btn):focus-visible {
  color: var(--fn-interactive-ink);
  text-decoration: underline;
  text-decoration-color: var(--fn-interactive);
}

:root[data-fn-theme="dark"] .fn-ui .google-news-callout {
  background: var(--fn-bg-raised);
  color: var(--fn-text-1);
  border-color: var(--fn-border-strong);
}

:root[data-fn-theme="soft"] .fn-ui .google-news-callout {
  background: var(--fn-bg-sunken);
  color: var(--fn-text-1);
}

body.fn-ui.darkCont .google-news-callout,
body.fn-ui.brightCont .google-news-callout {
  background-color: var(--fn-bubble-bg);
  color: var(--fn-text-1);
  border-color: var(--fn-border);
}

body.fn-ui.darkCont .articleBotmDesc,
body.fn-ui.brightCont .articleBotmDesc,
body.fn-ui.darkCont .articleBotmDesc a:not(.btn),
body.fn-ui.brightCont .articleBotmDesc a:not(.btn) {
  color: var(--fn-text-1);
}
