/* =================================================
   Latest Science (Clean Layout) — title wraps before sidebar
   Match the main layout grid exactly: 1fr + 320px, gap 28px
   ================================================= */
   
   /* =========================================
   YFP Article Layout (clean, consistent)
   ========================================= */

body.yfp-style-latest-science-article {
  --yfp-max: 1100px;
  --yfp-border: #e5e7eb;
  --yfp-muted: #475569;
}

body.yfp-style-latest-science-article .container {
  max-width: var(--yfp-max);
  margin-inline: auto;
  padding-inline: 1rem;
}

@media (min-width: 981px){
  body.yfp-style-latest-science-article .yfp-titleband__grid{
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    align-items: start;
  }

  /* Prevent long title from forcing overflow */
  body.yfp-style-latest-science-article .yfp-titleband__main{
    min-width: 0;
  }
}

/* On mobile/tablet keep the title band single-column */
@media (max-width: 980px){
  body.yfp-style-latest-science-article .yfp-titleband__side{
    display: none;
  }
}

/* ==============================
   References: compact appendix
   ============================== */

body.yfp-style-latest-science-article section.reference{
  margin-top: 24px;
  padding: 14px 16px;
  border: 1px solid var(--yfp-border, #e5e7eb);
  border-radius: 16px;
  background: #f8fafc;
}

body.yfp-style-latest-science-article section.reference p{
  margin: 0 0 8px;          /* tighter spacing between refs */
  font-size: 0.9rem;        /* smaller text */
  line-height: 1.35;        /* compact but readable */
  color: #334155;           /* slate-700 */
}

/* last item no extra space */
body.yfp-style-latest-science-article section.reference p:last-child{
  margin-bottom: 0;
}

/* links: compact + don’t dominate */
body.yfp-style-latest-science-article section.reference a{
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Long URLs: allow wrap without huge height */
body.yfp-style-latest-science-article section.reference a{
  overflow-wrap: anywhere;  /* breaks long links nicely */
  word-break: break-word;
}

body.yfp-style-latest-science-article section.reference::before{
  content: "References";
  display: block;
  margin-bottom: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: .08em;
  /*text-transform: uppercase;*/
  color: #0f172a;
}


/* Sidebar: remove the "All →" link */
body.yfp-style-latest-science-article .yfp-sideblock__all{
  display: none !important;
}

/* Pull sidebar upward on desktop so it starts near the title area */
@media (min-width: 981px){
  body.yfp-style-latest-science-article .yfp-sidebar{
    margin-top: -110px;  /* tune: -40, -60, -72, -90 */
  }
}