/* ============================================================
   REPAG — GLOBAL WIDTH & MEASURE
   Paste ONCE, site-wide. Nothing else needs editing.

   WHERE: Elementor → Hamburger menu → Site Settings → Custom CSS
   (or Appearance → Customize → Additional CSS if that's easier).

   WHAT IT DOES
   The pasted HTML blocks already cap their own content at 1180px
   and centre it, so they hold their shape at any screen size. What
   doesn't are the Elementor containers around them — the eyebrows,
   headings and intro paragraphs added as Elementor widgets. Those
   stretch to whatever the screen gives them, which is why sentences
   ran long on the big Mac.

   This caps every Elementor container to the same 1180px and gives
   it the same side gutter the blocks use, so the whole page lines
   up on one edge at every screen size. It also holds running text
   to a readable line length, and stops full-bleed photo sections
   from flattening out on very wide screens.

   TO OPT A SECTION OUT (e.g. a deliberately full-width band):
   give that container the CSS class  repag-full
   (Elementor → Advanced → CSS Classes).

   ONE THING TO AVOID WHEN SETTING A WIDGET'S WIDTH
   In the Width control, use % or PX. Both now hold still on every screen.
   Do NOT use VW — a vw width is measured against the window itself, so it
   keeps growing no matter what this file does. (Rule 2 still stops the text
   inside it running to an unreadable length, but the box will shift.)
   ============================================================ */

:where(html){
  --repag-max: 1180px;                       /* same cap the blocks use      */
  --repag-gutter: clamp(18px, 3vw, 32px);    /* same gutter the blocks use   */
  --repag-measure: 72ch;                     /* readable line length for copy */
}

/* ---- 1. Every Elementor container lines up with the blocks ---- */
.e-con:not(.repag-full) > .e-con-inner,
.elementor-section:not(.repag-full) > .elementor-container{
  max-width: var(--repag-max);
  margin-inline: auto;
  width: 100%;      /* an auto margin on a flex item shrinks it to its text without this */
}

/* the gutter lives on the container, so it can't double up with the inner */
.e-con:not(.repag-full),
.elementor-section:not(.repag-full){
  padding-inline: var(--repag-gutter);
  box-sizing: border-box;          /* so the gutter sits inside the width, not outside */
}
.e-con:not(.repag-full) > .e-con-inner,
.elementor-section:not(.repag-full) > .elementor-container{
  padding-inline: 0;
}

/* ---- 1b. FULL-WIDTH containers — this is the one that was stretching ----
   A BOXED container was never the problem: Elementor caps it at 1140px by itself,
   so a widget you set to 60% is 60% of 1140 on every screen.

   A FULL-WIDTH container has no cap at all. A widget set to 60% there is 60% of the
   WINDOW — 864px on your laptop, 1814px on a 32" Mac — so the width you dialled in
   doesn't travel, and the copy reflows onto fewer, much longer lines.

   This pads the container in by however much it exceeds 1180, so its contents sit in
   the same column as everything else and percentages resolve against that column
   instead of the window. The background still runs edge to edge, so full-width
   bands keep looking full width. */
.e-con.e-con-full:not(.repag-full){
  padding-inline: max(var(--repag-gutter), (100% - var(--repag-max)) / 2);
  box-sizing: border-box;
}

/* ---- 1c. …but the pasted HTML blocks still run edge to edge ----
   Every pasted block paints its own background across the full screen and caps its
   OWN contents at 1180px with its own gutter. So it must not be pushed in by the
   padding rules above, or its coloured band stops short of the screen edges.

   This pulls each block back out to the full window width whatever padding its
   container has. Its contents stay capped at 1180px and centred, so it still lines
   up with the Elementor text around it — only the background runs wider.

   Margins only, deliberately: a transform here would break the pinned scroll
   sections (Big Idea, the milestones, Born an Insider), which rely on position:sticky.

   A NEW block pasted in later: give its outermost div the class  repag-bleed
   and it behaves the same, or just add its class to this list. */
.repag-bleed,
.bigidea-scroll, .diyfails-wrap, .leadership, .pains-wrap, .repag-ap2,
.repag-authority-wrap, .repag-bottom, .repag-cta-pair, .repag-dues2,
.repag-fork-wrap, .repag-infra, .repag-people, .repag-phil3,
.repag-proc-m1-scroll, .repag-proc-m2, .repag-proc-m3-scroll,
.repag-proc-m4-scroll, .repag-recon, .repag-road-scroll, .repag-stats,
.repag-strip, .repag-tech-hood, .rp-cards, .wwo-bottomline, .wwo-elements,
.wwo-repeat, .wwo-stack-wrap{
  margin-inline: calc(50% - 50vw);
}

/* 100vw counts the scrollbar, so a full-bleed band sits a few pixels wider than the
   visible page. clip trims that without turning the page into a scroll container —
   overflow:hidden here would silently kill every position:sticky section. */
html{ overflow-x: clip; }

/* ---- 2. Running text keeps a readable measure ----
   A paragraph 1180px wide is roughly 160 characters a line; the eye loses its place
   past about 75. On the big Mac these were running to 263. Headings are left alone —
   they are meant to run wide.

   The capped paragraph keeps its container's alignment, so a left-aligned block stays
   left. If a text block is CENTRED, give that widget the class  repag-center  as well
   (Elementor → Advanced → CSS Classes) so the narrower column centres with it. */
.elementor-widget-text-editor :is(p, li),
.elementor-widget-theme-post-content :is(p, li){
  max-width: var(--repag-measure);
}
.repag-center :is(p, li),
.repag-center.elementor-widget-text-editor :is(p, li){
  margin-inline: auto;
}

/* To let one paragraph run full width again, give its widget the class  repag-wide */
.repag-wide :is(p, li){ max-width: none; }

/* ---- 3. Full-bleed photo bands keep their shape ----
   A 100vw band whose height is set by its copy gets wider but not taller as the
   screen grows, so the photo behind it flattens: at 2560px the frame is over
   4:1 and most of the picture is cropped away. Tying the minimum height to the
   viewport width holds the frame at a constant ratio instead.
   The class is doubled on purpose — that outranks the block's own rule whichever
   stylesheet the browser happens to read last.
   Add any other full-bleed photo band to this list the same way. */
.wwo-bottomline.wwo-bottomline{ min-height: max(520px, 34vw); }

/* ---- 4. Optional: stop the page itself growing past a point ----
   Off by default. Uncomment to letterbox the whole site on very large displays
   — backgrounds included. Most of the time rule 1 is enough on its own. */
/*
body{ max-width: 1920px; margin-inline: auto; }
*/