/*
  JR Content Backgrounds – Paper vs Modern
  Targets common theme wrappers including:
  .entry-content-wrap (your screenshot), .entry-content.single-content,
  and some generic wrappers used across themes.
*/

:root{
  /* You can tweak these two quickly if needed */
  --jr-paper-base: #f6f1e6;
  --jr-modern-base: #f8fafc;
}

/*
  IMPORTANT:
  Keep selectors *tight*.
  If we skin outer wrappers like .site-content / .site-main, it can make the
  content look “full width” even when the layout hasn’t changed.

  So we only target the inner, width-managed wrappers.
*/
body :where(
  .entry-content-wrap,
  .entry-content.single-content,
  .content-wrap
){
  background-clip: padding-box !important;
}

/* Aged paper (default) */
body.jr-paper-bg:not(.jr-modern-bg) :where(
  .entry-content-wrap,
  .entry-content.single-content,
  .content-wrap
){
  background-color: var(--jr-paper-base) !important;
  background-image:
    radial-gradient(circle at 18% 12%, rgba(255,255,255,.70), rgba(255,255,255,0) 55%),
    radial-gradient(circle at 82% 6%, rgba(255,255,255,.35), rgba(255,255,255,0) 62%),
    radial-gradient(circle at 6% 92%, rgba(0,0,0,.03), rgba(0,0,0,0) 56%),
    radial-gradient(circle at 96% 88%, rgba(0,0,0,.02), rgba(0,0,0,0) 58%),
    repeating-linear-gradient(
      0deg,
      rgba(0,0,0,.012),
      rgba(0,0,0,.012) 1px,
      rgba(0,0,0,0) 3px,
      rgba(0,0,0,0) 10px
    );
  background-size: auto !important;
  background-repeat: repeat !important;
}

/* Modern variant (private/hidden groups + folder pages) */
body.jr-modern-bg :where(
  .entry-content-wrap,
  .entry-content.single-content,
  .content-wrap
){
  background-color: var(--jr-modern-base) !important;
  background-image:
    linear-gradient(135deg, rgba(15,23,42,.045), rgba(15,23,42,0) 50%),
    radial-gradient(circle at 10% 0%, rgba(15,23,42,.03), rgba(15,23,42,0) 52%),
    repeating-linear-gradient(
      90deg,
      rgba(15,23,42,.028),
      rgba(15,23,42,.028) 1px,
      rgba(15,23,42,0) 1px,
      rgba(15,23,42,0) 14px
    );
  background-repeat: repeat !important;
}

/* Optional: keep inner “white cards” readable if theme already uses them */
body.jr-paper-bg:not(.jr-modern-bg) :where(
  .entry-content-wrap,
  .entry-content.single-content
) :where(
  .post,
  article,
  .page,
  .type-page,
  .type-post
){
  /* Do NOT force a background here — themes often already do.
     This rule is intentionally empty but keeps scope ready for tweaks. */
}
