/* =========================================================================
   React Bits "Folder" component — ported to vanilla CSS (News section visual).
   Interaction (click to open) lives in folder.js; hover/open are pure CSS.
   Plus: the News feature list rendered as compact points instead of boxes.
   ========================================================================= */

/* stage that centres the (scaled) folder in the News visual column */
.mx-folder-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 360px;
  padding: 70px 0 40px;
}
.mx-folder-scale { display: inline-block; }

/* ---- folder ---- */
.folder { transition: all 0.2s ease-in; cursor: pointer; }
.folder:not(.folder--click):hover { transform: translateY(-8px); }
.folder:not(.folder--click):hover .paper { transform: translate(-50%, 0%); }
.folder:not(.folder--click):hover .folder__front { transform: skew(15deg) scaleY(0.6); }
.folder:not(.folder--click):hover .right { transform: skew(-15deg) scaleY(0.6); }

.folder.open { transform: translateY(-8px); }
.folder.open .paper:nth-child(1) { transform: translate(-120%, -70%) rotateZ(-15deg); }
.folder.open .paper:nth-child(1):hover { transform: translate(-120%, -70%) rotateZ(-15deg) scale(1.1); }
.folder.open .paper:nth-child(2) { transform: translate(10%, -70%) rotateZ(15deg); height: 80%; }
.folder.open .paper:nth-child(2):hover { transform: translate(10%, -70%) rotateZ(15deg) scale(1.1); }
.folder.open .paper:nth-child(3) { transform: translate(-50%, -100%) rotateZ(5deg); height: 80%; }
.folder.open .paper:nth-child(3):hover { transform: translate(-50%, -100%) rotateZ(5deg) scale(1.1); }
.folder.open .folder__front { transform: skew(15deg) scaleY(0.6); }
.folder.open .right { transform: skew(-15deg) scaleY(0.6); }

.folder__back {
  position: relative;
  width: 100px;
  height: 80px;
  background: var(--folder-back-color);
  border-radius: 0px 10px 10px 10px;
}
.folder__back::after {
  position: absolute;
  z-index: 0;
  bottom: 98%;
  left: 0;
  content: '';
  width: 30px;
  height: 10px;
  background: var(--folder-back-color);
  border-radius: 5px 5px 0 0;
}

.paper {
  position: absolute;
  z-index: 2;
  bottom: 10%;
  left: 50%;
  transform: translate(-50%, 10%);
  width: 70%;
  height: 80%;
  background: var(--paper-1);
  border-radius: 10px;
  transition: all 0.3s ease-in-out;
}
.paper:nth-child(2) { background: var(--paper-2); width: 80%; height: 70%; }
.paper:nth-child(3) { background: var(--paper-3); width: 90%; height: 60%; }

.folder__front {
  position: absolute;
  z-index: 3;
  width: 100%;
  height: 100%;
  background: var(--folder-color);
  border-radius: 5px 10px 10px 10px;
  transform-origin: bottom;
  transition: all 0.3s ease-in-out;
}

.folder:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 10px; }

@media (prefers-reduced-motion: reduce) {
  .folder, .paper, .folder__front { transition: none; }
}

/* =========================================================================
   News feature list → compact POINTS (no boxes) to save vertical space
   ========================================================================= */
.s-news .feat-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 18px 0 22px;
}
.s-news .feat-item {
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  padding: 9px 0;
  background: none;
  border: 0;
  border-radius: 0;
}
.s-news .feat-item .ic {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}
.s-news .feat-item .tx b { font-size: 0.98rem; }

/* =========================================================================
   Overrides (per user): restore rounded corners on the folder (the global
   sharp-corner rule zeroes all radii), shrink + tighten the News layout.
   ========================================================================= */
.folder__back        { border-radius: 0 10px 10px 10px !important; }
.folder__back::after { border-radius: 5px 5px 0 0 !important; }
.paper               { border-radius: 10px !important; }
.folder__front       { border-radius: 5px 10px 10px 10px !important; }

/* stage sized + grounded for the bigger open "Reports" folder: the pocket sits
   near the bottom and the fan of cards rises into the space above it */
.mx-folder-stage { min-height: 320px; padding: 10px 0 44px; align-items: flex-end; }

/* =========================================================================
   Insights section — the "Reports" folder: permanently OPEN, with labelled
   cards. Hovering a card lifts it and swaps a one-line blurb in below the
   folder (wired in folder.js). Cursor stays neutral (set higher up).
   ========================================================================= */

/* stack the folder + its caption, centred */
.s-news .feat__visual { display: flex; flex-direction: column; align-items: center; justify-content: center; }

/* Brand palette on the folder — theme-aware (replaces the old hard-coded
   #5227FF). Body = the deep brand indigo (same --purple token as the rotating
   pills, so it flips between light/dark); the back panel is a shade deeper,
   and the cards stay light like paper. */
.mx-reports {
  --folder-color: var(--purple);
  --folder-back-color: color-mix(in srgb, var(--purple) 80%, #000);
  --paper-1: #eef0ff;
  --paper-2: #f5f6ff;
  --paper-3: #ffffff;
}

/* The folder is open for good — hovering it (or a card) must NOT collapse the
   fan. Re-assert the open paper transforms above the generic `:hover` reset. */
.s-news .folder.open:hover .paper:nth-child(1),
.s-news .folder.open .paper:nth-child(1) { transform: translate(-120%, -70%) rotateZ(-15deg); }
.s-news .folder.open:hover .paper:nth-child(2),
.s-news .folder.open .paper:nth-child(2) { transform: translate(10%, -70%) rotateZ(15deg); height: 80%; }
.s-news .folder.open:hover .paper:nth-child(3),
.s-news .folder.open .paper:nth-child(3) { transform: translate(-50%, -100%) rotateZ(5deg); height: 80%; }
.s-news .folder.open:hover .folder__front { transform: skew(15deg) scaleY(0.6); }
.s-news .folder.open:hover .right { transform: skew(-15deg) scaleY(0.6); }

/* per-card hover: lift the hovered card a touch (declared AFTER, so it wins
   for the specific card under the cursor / keyboard focus). */
.s-news .folder.open .paper:nth-child(1).is-hover,
.s-news .folder.open .paper:nth-child(1):hover { transform: translate(-120%, -80%) rotateZ(-15deg) scale(1.06); }
.s-news .folder.open .paper:nth-child(2).is-hover,
.s-news .folder.open .paper:nth-child(2):hover { transform: translate(10%, -80%) rotateZ(15deg) scale(1.06); height: 80%; }
.s-news .folder.open .paper:nth-child(3).is-hover,
.s-news .folder.open .paper:nth-child(3):hover { transform: translate(-50%, -110%) rotateZ(5deg) scale(1.06); height: 80%; }

/* card labels (rendered inside the scaled folder, so px are ~2× on screen) */
.mx-reports .paper { display: flex; align-items: flex-start; justify-content: center; padding: 6px 6px 0; overflow: hidden; box-shadow: 0 1px 3px rgba(20,10,60,.16); }
.mx-reports .paper:nth-child(1) { justify-content: flex-start; }  /* Weekly Macro → the card's visible outer-left */
.mx-reports .paper:nth-child(2) { justify-content: flex-end; }    /* Sector Brief → the card's visible outer-right */
.mx-reports .paper:nth-child(3) { width: 62%; }                   /* narrow the top card so it stops covering the side labels */
.mx-reports .paper:focus-visible { outline: none; }
/* the folder is a graphic — nothing inside it is selectable, so no text caret
   (blinking cursor) or text I-beam can ever land over the cards or the pocket */
.mx-reports, .mx-reports * { -webkit-user-select: none; user-select: none; }
.mx-card-label {
  font-family: var(--font-sans, inherit);
  font-size: 6.2px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--purple-ink);  /* brand indigo — theme-aware; light theme brightens to blue */
  text-align: center;
  line-height: 1.1;
  white-space: nowrap;
}

/* mini report graphics on the card faces — invisible while the folder is closed,
   fading in as the fan opens (inside the 2.05× stage, so the tiny px render ~2×;
   same theme vars as the labels: brand indigo + gold, green/red candles) */
.mx-card-art {
  position: absolute;
  left: 50%;
  bottom: 9%;
  transform: translateX(-50%);
  width: 62%;
  height: auto;
  opacity: 0;
  transition: opacity 0.25s ease 0.12s;
  pointer-events: none;
}
.mx-reports.open .paper .mx-card-art { opacity: 1; }

/* "REPORTS" wordmark on the folder pocket */
.mx-folder-name {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 7px;
  transform: translateX(-50%);
  font-family: var(--font-sans, inherit);
  font-size: 6px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: #fff;
  opacity: 0.9;
  pointer-events: none;
}

/* the caption that swaps in below the folder on card hover */
.mx-report-desc {
  margin-top: 24px;
  max-width: 340px;
  min-height: 60px;
  text-align: center;
}
.mx-report-desc__name {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink, currentColor);
  margin-bottom: 3px;
  transition: color .2s ease;
}
/* default (no report hovered) carries no name — hide the empty line so only the prompt shows */
.mx-report-desc__name:empty { display: none; }
.mx-report-desc__text {
  display: block;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--muted, #7B7B7B);
}
.mx-report-desc.is-on .mx-report-desc__name { color: var(--accent, #2708A0); }

/* pull the copy and the folder closer: cap each column and centre the pair */
.s-news .feat {
  grid-template-columns: minmax(0, 500px) 320px;
  justify-content: center;
  column-gap: 70px;
  align-items: center;
}
/* nudge the folder down a touch */
.s-news .mx-folder-stage { transform: translateY(15px); }
@media (max-width: 639px) { .s-news .feat { grid-template-columns: 1fr; } }

/* CTA closer to the bullet points */
.s-news .feat-list { margin-bottom: 6px; }
.s-news .feat__copy .btn { margin-top: 16px; }

/* =========================================================================
   PHONE — Insights section
   Tighter feature list, a smaller folder sitting higher in its stage.
   Scoped to <=760px so the desktop composition is untouched.
   ========================================================================= */
@media (max-width: 639px) {
  /* the three bullets were reading as widely-spaced cards */
  .s-news .feat-list { gap: 6px; }
  .s-news .feat-item { padding: 10px 12px; gap: 6px; }
  .s-news .feat-item .ic { width: 30px; height: 30px; }
  .s-news .feat-item .tx { gap: 1px; }
  .s-news .feat-item .tx b { font-size: .9rem; }
  .s-news .feat-item .tx span { font-size: .78rem; line-height: 1.45; }

  /* 20% smaller: the inline style on .mx-folder-scale is scale(2.05), and an
     inline transform can only be beaten with !important */
  .s-news .mx-folder-scale { transform: scale(1.64) !important; }
  /* was translateY(15px) — nudged DOWN; lift it instead and reclaim the
     stage padding the smaller folder no longer needs */
  .s-news .mx-folder-stage {
    transform: translateY(-18px);
    min-height: 240px; padding: 0 0 20px;
  }
}
