/* ==========================================================================
   Cane Agency — layout.css
   GLOBAL BODY-CONTAINER POLICY. Single source of truth for how wide the body
   context of a screen page is, and how much air sits at its edges. Every
   surface in the project (root landing, registers, tools, apis service pages,
   wireframes, drafts exhibits, docs chrome) obeys this one file — never a
   second max-width in a page's own <style>.

   Established by PROP-086, applied as spec v0.61.0 (A-104).

   THE RULE — one container, fluid to a cap:

     Device class            Container
     ---------------------   ----------------------------------------------
     Phone (≤600px)          full width, 16px edge padding
     Touch tablet (p / l)    FULL WIDTH of the reading box, 16px padding
     Desktop                 full width up to --page-max (1440px), centred,
                             24px padding
     Print                   uncapped; the print engine owns the page box

   Tablet does not get its own width: the reading box (shared/reading-scale.js
   lays a tablet out in ~640 CSS px portrait / ~860 landscape) is already
   narrower than the cap, so a fluid container fills the glass edge to edge.
   That is the whole fix — a fixed 880/1040/1080px container was WIDER than the
   box in portrait and NARROWER than it in landscape, so a tablet read as a
   letterboxed desktop page instead of a tablet page.

   How to use it:
     · link this file in <head> (after the design-system stylesheet, alongside
       shared/reading-scale.css), then
     · give the page's own containers `max-width: var(--page-max)` and
       `padding-inline: var(--page-pad)`, or just put class="page-wrap" on them.
     · A4 documents (doc-page) are NOT covered — the sheet owns its own
       geometry. Slide decks (deck-stage), device-frame prototypes and
       fixed-size export canvases are out of scope for the same reason.

   Never restate 1440 / 24 / 16 anywhere else; read the tokens.
   ========================================================================== */

:root { --page-max: 1440px; --page-pad: 24px; }

/* Reading-box classes written by shared/reading-scale.js on <html>. */
html[data-rs="phone"], html[data-rs^="tablet"] { --page-pad: 16px; }

/* JS-off fallback: a narrow viewport still gets the tighter edge. */
@media screen and (max-width: 600px) { :root { --page-pad: 16px; } }

.page-wrap {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-pad);
  box-sizing: border-box;
}

@media print { :root { --page-max: none; --page-pad: 0; } }
