/* ===========================================================================
   Mercado — layout primitives.
   Asymmetry comes from where content sits in the grid, not from tilted boxes.
   =========================================================================== */

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap--text { max-width: 900px; }

.section { padding-block: var(--section); }
.section--tight { padding-block: calc(var(--section) * 0.55); }
.section--paper2 { background: var(--paper-2); }

/* A rule above a section heading, the way a magazine opens a chapter.

   Drawn as a pseudo-element rather than a border so it can be scaled: the
   scroll choreography animates --rule-scale from 0, and the rule draws in
   from the reading edge. Borders cannot be animated that way. */
.section__open {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s5);
  flex-wrap: wrap;
  padding-block-start: var(--s5);
  margin-block-end: var(--s8);
}

.section__open::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  block-size: 1px;
  background: var(--line);
  transform: scaleX(var(--rule-scale, 1));
  transform-origin: inline-start center;
}

.section__open h2 { max-inline-size: 18ch; }

.stack { display: grid; gap: var(--s4); }

.row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s4);
  align-items: center;
}

main { min-height: 50vh; }

/* Page opener for non-homepage templates. */
.page-open {
  padding-block: calc(var(--header-h) + var(--s8)) var(--s7);
  border-block-end: 1px solid var(--line);
}

.crumbs {
  font-size: var(--t-sm);
  color: var(--ink-3);
  margin-block-end: var(--s4);
}

.crumbs a { color: var(--ink-2); }
.crumbs a:hover { color: var(--ink); }
