/* ============================================================
   grid.css — page grid (vertical rails + horizontal section breaks)

   Ported from opus.com so both sites share one visual skeleton.
   Loaded LAST, after sections.css. Scoped under <body class="page-grid">.

     1. Vertical rails on .container
     2. Section padding migrated onto the direct .container
     3. Grid closure at the top and bottom
     4. Phone: drop the rails at ≤767px

   Terminology (keep it consistent):
     - Rails            the two vertical 1px borders on .page-grid .container
     - Section break    full-bleed top border on a major section
     - Rail-to-rail     a line pulled through the gutter via
                        margin-inline: calc(-1 * var(--gutter))
   ============================================================ */

/* 1. Vertical rails ---------------------------------------- */

.page-grid .container {
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

/* 2. Migrate section padding onto the direct .container ------
   This is the load-bearing part of the system: with padding on the
   <section>, consecutive containers are separated by dead space and the
   rails render as disconnected stubs. Moving it inside means stacked
   containers abut and the rails read as two continuous lines down the
   page. Section padding therefore belongs HERE, not in sections.css. */

.page-grid .hero,
.page-grid .spread,
.page-grid .values,
.page-grid .leadership,
.page-grid .news,
.page-grid .outro,
.page-grid .footer {
  padding-block: 0;
}

.page-grid .hero > .container            { padding-block: 44px 64px; }

/* Vision 72/36 and Mission 36/72 read as one paired spread. */
.page-grid .spread--vision > .container  { padding-block: var(--section-y) 36px; }
.page-grid .spread--mission > .container { padding-block: 36px var(--section-y); }

.page-grid .values > .container          { padding-block: var(--section-y); }
.page-grid .leadership > .container      { padding-block: var(--section-y); }

/* The rows deck butts the container's bottom edge so its final hairline
   lands on the next section break, making the rails connect through it.
   Breathing room lives inside the rows, not below the deck. */
.page-grid .news > .container            { padding-block: var(--section-y) 0; }

.page-grid .outro > .container           { padding-block: var(--section-y); }
.page-grid .footer > .container          { padding-block: 80px 0; }

/* 3. Close the grid ----------------------------------------
   Top: the nav's bottom border is already the first horizontal, so the
   rails start from a corner. Bottom: the dark footer IS the closure, as on
   opus.com — the rails simply end where the light surface does. No extra
   hairline at the boundary (the colour change is the boundary) and no
   rails inside the dark zone, where they would be invisible and would
   clash with the footer's own inset content. */

.page-grid .footer .container {
  border-left: 0;
  border-right: 0;
}

/* The full-bleed momentum band spans edge to edge and deliberately
   interrupts the rails, the way opus.com's full-bleed media does. Its own
   top and bottom borders keep the horizontal rhythm unbroken. */

/* 4. Phone: drop the rails --------------------------------
   At ≤767px --outer-gutter is 0, so rails would sit hard against the
   viewport edges and read as a border around the page rather than as a
   grid. Horizontal section breaks stay. */

@media (max-width: 767px) {
  .page-grid .container {
    border-left: 0;
    border-right: 0;
  }

  .page-grid .footer > .container {
    padding-block: 44px 0;
  }
}
