/*
 * RangeXT landing: Insights listing (/insights/) and articles (/insights/<slug>/).
 * Loaded after css/site.css. Page-specific rules go here.
 *
 *  1. Listing: heading, post grid, cards, the "View" cursor (js/insights.js)
 *  2. Article: header (title only: the old posts hid the category, date and featured image), body
 *  3. Share button (js/insights.js fills the links and shows it)
 *
 * Measurements follow the old theme's blog grid and single-post layout.
 */

/* ── 1. Listing ── */

/* "Insights": 150px from the top of the page (the header overlays it), 7% side padding. */
.rx-insights-head { padding: 35px 7% 0; }
.rx-insights-title {
  max-width: 50%;
  font-size: 3vw;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: -0.03em;
}
.rx-insights-grid-wrap { padding: 32px 60px 107px; }

.rx-post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 50px;
  align-items: start;
  /* The old grid stopped at 1530px and centred on wider screens. */
  max-width: 1530px;
}
.rx-insights-grid-wrap > .rx-post-grid { margin-inline: auto; } /* beats the ul[class] reset */
.rx-post-card { position: relative; }
.rx-post-card-media {
  position: relative;
  height: clamp(220px, 30vh, 360px);
  overflow: hidden;
  border-radius: 5px;
  background: var(--rx-green-soft);
}
.rx-post-card-media picture { display: block; height: 100%; }
.rx-post-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s cubic-bezier(0.15, 0.75, 0.5, 1);
}
.rx-post-card:hover .rx-post-card-media img { transform: scale(1.1); }
.rx-post-card-body { padding-top: 25px; }
.rx-post-card-title {
  font-size: 22px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.03em;
}
/* The title link covers the whole card, as before (image and text all open the article). */
.rx-post-card-link { color: inherit; text-decoration: none; }
.rx-post-card-link:hover { color: inherit; }
.rx-post-card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 5px; }
.rx-post-card-link:focus-visible { outline: none; }
.rx-post-card-link:focus-visible::after { outline: 2px solid var(--rx-blue); outline-offset: 6px; }
.rx-post-card-excerpt { max-width: 90%; margin-top: 10px; font-size: 17px; line-height: 1.6; }
.rx-post-card-date { margin-top: 9px; font-size: 17px; line-height: 1.1; }

/* "View": the black disc that follows the pointer over a card (mouse only, added by js/insights.js). */
.rx-view-cursor {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  pointer-events: none;
  transform: translate3d(var(--x, -200px), var(--y, -200px), 0);
}
.rx-view-cursor-disc {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 94px;
  height: 94px;
  margin: -47px 0 0 -47px;
  border-radius: 50%;
  background: #000;
  color: #fff;
  font-size: 17px;
  line-height: 1;
  font-weight: 600;
  transform: scale(0);
  transition: transform 0.35s cubic-bezier(0.15, 0.75, 0.5, 1);
}
.rx-view-cursor.is-active .rx-view-cursor-disc { transform: scale(1); }

@media (max-width: 1300px) {
  .rx-post-card-title { font-size: 19px; }
}
@media (max-width: 999px) {
  /* Below the desktop header the heading sits 150px + 8% of its column from the top. */
  .rx-insights-head { padding-top: calc(86px + 6.88vw); }
  .rx-insights-title { max-width: none; font-size: 33px; line-height: 1.3; }
  /* 10% of the 88vw column, plus 32px, between the heading and the grid (as before). */
  .rx-insights-grid-wrap { padding: calc(8.8vw + 32px) 6vw 107px; }
  .rx-post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rx-post-card-title { font-size: 16px; }
}
@media (max-width: 690px) {
  .rx-insights-title { font-size: 28px; }
  .rx-post-grid { grid-template-columns: minmax(0, 1fr); row-gap: 56px; }
  .rx-post-card-title { font-size: 15px; }
  .rx-post-card-excerpt { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rx-post-card-media img,
  .rx-view-cursor-disc { transition: none; }
  .rx-post-card:hover .rx-post-card-media img { transform: none; }
}
/* Parallax: each cover runs 16% taller than its frame and pans down inside it as the card crosses
   the window, so the picture moves more slowly than the page (scroll-driven; at rest elsewhere).
   The timeline is named on the frame: the frame clips, so it would be the image's own scroller. */
@keyframes rx-card-pan { from { translate: 0 -13.8%; } to { translate: 0 0; } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .rx-post-card-media { view-timeline: --rx-card block; }
    .rx-post-card-media img { height: 116%; animation: rx-card-pan linear both; animation-timeline: --rx-card; animation-range: cover; }
  }
}

/* ── 2. Article ── */
.rx-article {
  width: min(1000px, 100% - 12vw);
  margin: 0 auto;
  padding-bottom: 115px;
}
@media (min-width: 1000px) {
  .rx-article { width: min(1000px, 100% - 120px); padding-bottom: 139px; }
}
@media (min-width: 1025px) {
  .rx-article { padding-bottom: 184px; }
}

.rx-article-header { padding: min(6vw, 90px) 0; }
.rx-article-title {
  margin: 25px 0;
  font-family: var(--rx-font-display);
  font-size: 45px;
  line-height: 60px;
  font-weight: 300;
  letter-spacing: -0.03em;
  overflow-wrap: break-word;
}

/* Body: 17/30 black text, 1.5em between blocks (site .rx-prose), plain underlined black links. */
.rx-article-body { overflow-wrap: break-word; }
.rx-article-body ul:not([class]) { padding-left: 30px; }
.rx-article-body li + li { margin-top: 0; }
.rx-article-body a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.rx-article-body a:hover { color: var(--rx-blue); }
/* Bold run-in subheads, styled as the bold paragraphs they were. */
.rx-article-subhead { font-size: 17px; line-height: 30px; font-weight: 700; letter-spacing: -0.02em; }
.rx-prose > .rx-article-subhead--spaced { margin-top: calc(1.5em + 30px); }
/* "About RangeXT": a bold first line with its paragraph straight underneath (one block before). */
.rx-prose > .rx-article-subhead--runin + p { margin-top: 0; }
/* Press-release standfirst: grey panel in a monospaced face, as before; now wraps instead of scrolling. */
.rx-article-standfirst {
  padding: 24px;
  background: #f0f0f0;
  font-family: "Andale Mono", Courier, "Courier New", monospace;
  font-size: 15px;
  line-height: 24px;
}

@media (max-width: 1300px) {
  .rx-article-title { font-size: 39px; line-height: 51px; }
}
@media (max-width: 999px) {
  .rx-article-title { font-size: 44px; line-height: 48px; }
}
@media (max-width: 690px) {
  .rx-article-title { font-size: 41px; line-height: 45px; }
  .rx-article-standfirst { padding: 18px; }
}

/* ── 3. Share: blue disc fixed bottom right; Facebook, X, LinkedIn and Pinterest rise above it
   on hover, or on click/Enter for touch and keyboard. ── */
.rx-share {
  position: fixed;
  z-index: 800;
  right: 34px;
  bottom: 34px;
  width: 50px;
  height: 50px;
}
.rx-share:hover { height: 260px; } /* keeps the hover alive while the pointer moves up the stack */
.rx-share-toggle {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
}
.rx-share-toggle::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: 50%;
  background: var(--rx-blue);
  transition: transform 0.45s cubic-bezier(0.15, 0.2, 0.1, 1), box-shadow 0.45s cubic-bezier(0.15, 0.2, 0.1, 1);
}
.rx-share:hover .rx-share-toggle::before,
.rx-share.is-open .rx-share-toggle::before {
  box-shadow: 0 7px 15px rgba(0, 0, 0, 0.2);
  transform: scale(1.23);
}
.rx-share-toggle svg { width: 16px; height: 16px; }
.rx-share-toggle:focus-visible { outline: 2px solid var(--rx-navy); outline-offset: 8px; }

.rx-share-list li { position: absolute; right: 7px; bottom: 14px; }
.rx-share-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--rx-blue);
  box-shadow: 0 7px 15px rgba(0, 0, 0, 0.2);
  color: #fff;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0) scale(0);
  transition: transform 0.45s cubic-bezier(0.15, 0.2, 0.1, 1), opacity 0.45s cubic-bezier(0.15, 0.2, 0.1, 1), visibility 0s linear 0.45s, background-color 0.25s ease;
}
.rx-share-link:hover { background: var(--rx-blue-dark); color: #fff; }
.rx-share-link:focus-visible { outline: 2px solid var(--rx-navy); outline-offset: 3px; }
.rx-share:hover .rx-share-link,
.rx-share.is-open .rx-share-link {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
.rx-share:hover li:nth-child(1) .rx-share-link,
.rx-share.is-open li:nth-child(1) .rx-share-link { transform: translateY(-56px); }
.rx-share:hover li:nth-child(2) .rx-share-link,
.rx-share.is-open li:nth-child(2) .rx-share-link { transform: translateY(-106px); }
.rx-share:hover li:nth-child(3) .rx-share-link,
.rx-share.is-open li:nth-child(3) .rx-share-link { transform: translateY(-156px); }
.rx-share:hover li:nth-child(4) .rx-share-link,
.rx-share.is-open li:nth-child(4) .rx-share-link { transform: translateY(-206px); }

@media (hover: none) {
  .rx-share:hover:not(.is-open) { height: 50px; }
  .rx-share:hover:not(.is-open) .rx-share-link { opacity: 0; visibility: hidden; }
  .rx-share:hover:not(.is-open) .rx-share-toggle::before { box-shadow: none; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rx-share-toggle::before,
  .rx-share-link { transition: none; }
}
@media (forced-colors: active) {
  .rx-share-toggle,
  .rx-share-link { border: 1px solid ButtonText; }
}
@media print {
  .rx-share,
  .rx-view-cursor { display: none !important; }
}

/* Phones (below 600px): an article headline that leaves room for the article on the first screen
   (41px ran to 13 lines at 360px); the listing heading on the cards' left edge; card titles larger
   than their excerpts; and, at the end of an article, the © line clear of the floating share button. */
@media (max-width: 599px) {
  .rx-article-title { font-size: 32px; line-height: 38px; text-wrap: pretty; }
  .rx-insights-head { padding-inline: 6vw; }
  .rx-post-card-title { font-size: 18px; text-wrap: balance; }
  .rx-main:has(.rx-share) ~ .rx-footer .rx-copyright { padding-bottom: 100px; }
}
