/* ==========================================================================
   base.css — reset + page shell
   --------------------------------------------------------------------------
   Identical to demos/home-series-rails/css/base.css, which is the point: the
   shell these screens sit in has to be the shell the product already has.
   The only addition is .shell, the centred reading column the shelf screens
   use — see the note on it below.
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--color-background);
  color: var(--color-on-surface);
  font-family: var(--type-family);
  font-size: var(--type-body-m-size);
  line-height: var(--type-line-height);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

p,
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

/* --------------------------------------------------------------------------
   Page frame
   -------------------------------------------------------------------------- */

/* THE FOOTER SITS AT THE BOTTOM OF THE WINDOW, NOT AT THE BOTTOM OF THE
   CONTENT. On a short page — the account flow's forms, the picker, a one-
   rail profile — a footer that follows the content lands halfway up the
   screen with the ground running on below it, which reads as a page that
   has failed to load the rest of itself. A column at the viewport's height
   with the main content allowed to grow puts it where a footer belongs on
   every page, long or short, and costs nothing on the long ones.

   `min-height: 100dvh` rather than `100vh` so a mobile browser's
   disappearing chrome does not leave a strip of ground under it. */
/* THE FLOOR WAS 1200 AND THE WINDOW IS OFTEN NARROWER THAN THAT. Below
   it the page simply stayed 1200 wide and the viewport scrolled
   sideways — which does not read as "this prototype wants a wide
   window", it reads as the layout having come apart: the app bar runs
   off, a centred hero is centred on a box you cannot see all of, and a
   poster grid disappears past the right edge. Every page in the set was
   doing it; the collection page only showed it worst, because its hero
   is the one composition that is centred rather than left-aligned.

   960 is the real floor — below that the two-column forms genuinely
   have nowhere to go — and everything between 960 and 1440 now holds
   together on its own: the gutter already clamps, the poster grids
   already auto-fill, the rails already scroll, and the three fixed
   widths that did not flex are named where they are set. */
.page {
  width: 100%;
  min-width: 960px;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--color-background);
  overflow-x: clip;         /* clip, not hidden: hidden breaks sticky        */
}

/* The one that grows. Everything else in the column — the bar, the footer —
   keeps its own height. */
.page > .main-content { flex: 1 0 auto; }
.page > .app-bar,
.page > .footer { flex: 0 0 auto; }

/* The reading column. A reason set 1300px wide is a reason nobody
   finishes, so the text screens are held to 1208px — the footer's own
   max-width, already in the design rather than a number invented here.

   IT IS LEFT-ALIGNED TO THE GUTTER, not centred. Centred, the headings sat
   180px in while the rails underneath them started at the 64px gutter, and
   two different left edges on one page is the kind of thing that reads as
   a different product rather than as this one. */
.shell {
  width: 100%;
  max-width: calc(1208px + 2 * var(--frame-gutter));
  margin: 0;
  padding: 0 var(--frame-gutter);
}

/* --------------------------------------------------------------------------
   Shared primitives — carried over verbatim
   -------------------------------------------------------------------------- */

.dot-divider {
  width: 4px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--color-white-80);
  flex: 0 0 auto;
}

.dot-divider--on-surface { background: var(--color-on-surface); }

.icon {
  display: block;
  flex: 0 0 auto;
}

.icon--xs { width: var(--icon-xs); height: var(--icon-xs); }
.icon--s  { width: var(--icon-s);  height: var(--icon-s);  }
.icon--m  { width: var(--icon-m);  height: var(--icon-m);  }
.icon--l  { width: var(--icon-l);  height: var(--icon-l);  }
.icon--xl { width: var(--icon-xl); height: var(--icon-xl); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
