/*
 * Zoey Made — the Make workbench.
 *
 * One project, presented as a complete destination: a welcome, the activity Make is leading with,
 * and Bubble's challenge. MAKE-LANDING-PROD-001 §6 and §7 are what this lays out.
 *
 * The arrangement is one rule: **below 64rem the page is a single column in document order**, and
 * from 64rem the welcome and the feature sit side by side in §6's rough 38/62 split, with the
 * additional activities and the challenge spanning beneath. Nothing is reordered at any width, so
 * what a phone reads is what a screen reader hears.
 *
 * ## What left this file in VS-005
 *
 * Three families were consolidated out of it, and this file is now the **page** and only the page:
 *
 *   the feature and compact cards  ->  components/activity-card.css
 *   the challenge note's tint      ->  components/callout.css
 *   the welcome line's type        ->  components/page-intro.css
 *   "Let's make it"                ->  components/action.css, via zoey_made_action()
 *
 * What is left is which region goes where at which width, the Bubble cameo's own sizes, and the
 * zero state's one sentence — all of which are facts about this page rather than about a
 * component. §5: layouts own grids.
 *
 * The welcome line and the challenge note keep their class names, and that is deliberate. This
 * page's content was saved from `patterns/make-landing.php` once and has been edited since;
 * editing the pattern now would not reach it, and rewriting published content to tidy a selector
 * is not a trade this project makes. The shared stylesheets carry those names in their own rule
 * lists, so each role is declared exactly once.
 *
 * Loaded with the zoey-made/make-featured block, which renders only on the Make landing, so none
 * of this reaches the shop, the cart, checkout or an activity guide. Design values come from
 * theme.json. See docs/CSS-AND-ASSETS.md.
 */

/*
 * The same two corrections to core's generated layout rules the activity guide makes — the
 * title's cap is `var(--wp--custom--measure)` measured in the title's own type, and the group's
 * is the container's `> .alignwide`. Each selector here carries one component more than the rule
 * it corrects, and neither uses `!important`. The landing is wider than the guide, so only the
 * title is held to the reading column; the workbench itself takes the site's wide size.
 */
main > .wp-block-post-title {
  max-inline-size: var(--wp--style--global--wide-size);
  margin-inline: auto;
}

main .wp-block-post-content > .zoey-make-workbench {
  max-inline-size: var(--wp--style--global--wide-size);
  margin-inline: auto;
}

.zoey-make-workbench {
  display: grid;

  /* 1rem between regions on a phone, for the fold; roomier once there is room. */
  gap: var(--wp--preset--spacing--40);
}

/* The welcome: Bubble, and the line she is introducing. The line's type is page-intro.css's. */
.zoey-make-welcome {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--wp--preset--spacing--40);
}

/*
 * Bubble first — approved 2026-10-08, `WB-002.md` §2.1.
 *
 * The two children are a **saved core paragraph** and the `make-featured` block, in that document
 * order, inside the Make page's own content. Reordering them in the DOM would mean rewriting saved
 * editorial content, which implementation has no authority over. So the order is presentational.
 *
 * `order` desynchronises visual order from reading order, which is a real accessibility problem when
 * the moved element carries content. **This one carries none**: the cameo is `alt=""`, decoration
 * beside a sentence that already says everything it says, and the sentence keeps its own place in
 * the document. A screen reader meets the line; a sighted reader meets Bubble first. Neither is
 * missing anything.
 *
 * The art is also the item that must not be squeezed when the row runs out of width, so it keeps its
 * intrinsic size and the line takes the remainder — and wraps onto its own row beneath her when
 * there is not enough left to read, which is `flex-wrap` already on the container doing its job
 * rather than a breakpoint.
 */
.zoey-make-welcome > .zoey-make-welcome__art {
  order: -1;
  flex: 0 0 auto;

  /*
   * The second place this page needs `!important`, and the reason is the cascade again rather than a
   * preference.
   *
   * `.zoey-make-welcome` is a **constrained-layout** group, so core generates
   * `.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull))
   * { margin-left: auto !important; margin-right: auto !important }`. On a flex item that is a
   * centring instruction, and it showed the moment the row wrapped: at 200% text the cameo took a
   * line of its own and drifted to the middle of the column while the sentence stayed left —
   * measured at 390px with a 32px root, art at x=147 of 350.
   *
   * The alternative is changing the group's layout type, which lives in the **saved page content**
   * and in the registered pattern. That is editorial content this story has no authority over, and
   * `!important` against one generated declaration is much the smaller change.
   *
   * The selector carries the parent as well, and that is load-bearing rather than tidy: core's
   * `:where()` scores zero, so its rule is one class — exactly what a bare `.zoey-make-welcome__art`
   * is. Two `!important` declarations at equal specificity are settled by **stylesheet order**, and
   * core's generated styles come last. Measured: with the single-class selector the cameo was still
   * centred at 200% text. The descendant selector wins on specificity instead, which is a decision
   * rather than an accident of load order.
   */
  margin-inline: 0 auto !important;
}

/*
 * The line takes what is left and keeps a readable minimum, so a long word cannot push the row
 * sideways and the sentence wraps rather than clipping — the same `overflow-wrap: anywhere`
 * reasoning `page-intro.css` records from STORE-013, and the same basis-not-breakpoint arrangement
 * `components/character.css` uses for the shared composition.
 */
.zoey-make-welcome__line {
  /*
   * 8rem rather than something roomier, and the number is measured. The desktop welcome column is
   * about 340px at 1024 and 453px at 1440; the cameo takes 11rem there, so a 12rem basis made the
   * line wrap onto its own row at 1024 and put Bubble above it rather than beside it. 8rem leaves
   * her beside the words at both desktop widths and still lets the sentence take its own line on a
   * phone at 200% text, where 350px genuinely cannot hold a 96px character and readable type.
   */
  flex: 1 1 8rem;
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

/*
 * The cameo is capped by height rather than width, because §6 asks for "about 3–4rem tall" and
 * that is the measurement that matters next to a line of type. `inline-size: auto` keeps the
 * artwork's own ratio while the attributes on the element reserve its space.
 *
 * It stays here rather than joining the shared page introduction's character region: how large
 * one drawing should be beside one line of text on one page is a decision about that drawing.
 * What the shared component owns is the single declaration that keeps a character from widening
 * the readable column at large text sizes.
 */
/*
 * The two sizes that used to be declared here — 3rem, and 11rem from 64rem — moved to
 * `components/character.css` as the shared `greeting` step when WB-002 adopted the character
 * renderer on this welcome. **The numbers did not change**, and the reasoning below is still the
 * reasoning; what changed is that the `sizes` attribute is generated from the same table, so what a
 * browser is told about this slot and what it actually paints into cannot drift apart.
 */

/* --- The collection landing (SL-001) ----------------------------------------------------- */

/*
 * The arrangement, and it is shorter than the one above it because there is less to arrange: two
 * regions, stacked, in document order, at every width. The hero's own two-column composition is
 * `page-intro.css`'s `--section` variant and the card's is `activity-card.css`'s; what is left
 * for this file is the grid the cards sit in and the space above it, which is what §5 means by
 * layouts owning grids.
 *
 * `--collection` is a modifier rather than a new root class, so the page keeps the title cap, the
 * wide-region cap and the phone padding declared at the top of this file. Its one job is to keep
 * the 38/62 desktop split off this arrangement — see the bottom of the file, where that rule now
 * excludes it.
 */
/*
 * The gap between this landing's two regions is **not here** — SL-002's `D8`. It is
 * `components/section-landing.css`'s one declaration, which Learn's landing wears too, so the
 * rhythm of a section landing is one value in one place. This rule used to set a flat
 * `spacing|60`; the shared one is `--wp--custom--layout--section`, which is 48px on a desktop
 * and 32px on a phone, and is what Product preferred when they compared the two pages.
 */

/*
 * The hero's own spacing. Nothing else: the composition, the character's column and the content
 * cap all belong to `page-intro.css`, and the artwork's two sizes to `character.css`'s `section`
 * step. This is the one line that is a fact about *this page*.
 */
.zoey-make-hero {
  margin-block-end: var(--wp--preset--spacing--20);
}

/*
 * "Projects to try". Section Small, the same step the *Also on the table* heading takes, so the
 * two arrangements sound alike where they overlap.
 */
.zoey-make-collection__heading {
  margin-block: 0 var(--wp--preset--spacing--50);
  font-size: var(--wp--preset--font-size--section-small);
}

/*
 * The grid: one column, two from 720px, three from 1000px.
 *
 * Those are **this theme's existing collection ladder**, not new numbers. The homepage's
 * Collection tiles — the closest thing the site already has to a three-up grid of picture cards —
 * change at exactly 720 and 1000, and `homepage.css` is where that was measured. The v0.1 package
 * proposed 640 and 1024; neither appears anywhere in this theme's stylesheets, and 640 would have
 * left a 768px tablet on one column, which is not what the story's own evidence row asks to see.
 * Correction C7 and amendment A3 of the readiness review.
 *
 * Explicit tracks rather than `auto-fill` with a ceiling, which is what *Also on the table* uses.
 * The difference is deliberate and is about what each region is: that one is a short list of
 * further things to look at and should fill from the left and stop; this one is the page's
 * content, and three even columns across the wide region is the composition the design asks for.
 *
 * `minmax(0, 1fr)` on every track, so a long project name cannot widen its column — the other
 * half of the `overflow-wrap: anywhere` on the card's title, for the reason STORE-013 measured
 * twice.
 *
 * One project occupies **one ordinary column** and does not stretch: that is simply what explicit
 * `1fr` tracks do, and it is §9's superseded *One activity* state satisfied without a special
 * case for it.
 */
.zoey-make-collection__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--wp--preset--spacing--50);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 720px) {
  .zoey-make-collection__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1000px) {
  .zoey-make-collection__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/*
 * The preview line on a draft project's card. Plain and undecorated, exactly like the feature
 * card's, so evidence taken through `?zoey-make-preview=1` says what it actually shows.
 */
.zoey-make-collection__preview {
  margin: 0 0 var(--wp--preset--spacing--20);
  color: var(--wp--preset--color--ink-soft);
  font-size: var(--wp--preset--font-size--body-small);
  font-weight: 700;
}

/* --- The workbench arrangement (MAKE-005) ------------------------------------------------ */

/* Additional activities. Renders only when there are some — there is no empty heading here. */
.zoey-make-others__heading {
  margin-block: 0 var(--wp--preset--spacing--40);
  font-size: var(--wp--preset--font-size--section-small);
}

.zoey-make-others__list {
  display: grid;
  gap: var(--wp--preset--spacing--40);
  /*
   * auto-fill with a ceiling, not auto-fit with a fraction: one additional activity should look
   * like a card, not like a band stretched across 1240px. Cards fill from the left and stop at
   * 22rem each.
   */
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 22rem));
  margin: 0;
  padding: 0;
  list-style: none;
}

/*
 * Bubble's challenge: a yellow note, and nothing else.
 *
 * Not a control — no link, no cursor change, no score, no badge, nothing to click (§8). The whole
 * of its appearance is now `components/callout.css`'s `challenge` role, including the pale yellow
 * and the slight tilt, and the block renders it through `zoey_made_callout()`. The only thing this
 * page still decides about it is where it sits on the workbench grid, which is at the bottom of
 * this file.
 */

/* The zero state. A sentence, and the shell's navigation around it. No card, no dead button. */
.zoey-make-empty__line {
  margin: 0;
  font-size: var(--wp--preset--font-size--section-small);
  color: var(--wp--preset--color--ink);
}

/*
 * **This page needs no `!important` any more, and the reason it needed one is gone** — SL-002's
 * `D8`.
 *
 * `page-make-landing.html` used to set the main group's padding inline, as a block style, which a
 * stylesheet cannot reach without `!important`. So a rule lived here halving that padding below
 * 48rem — half of MAKE-009's two fixes for the call to action sitting below a real phone's fold,
 * with the other half in `activity-card.css`.
 *
 * Product compared this landing with Learn's on 2026-10-10 and preferred Learn's opening, which
 * has **no** template padding at all. The inline style went with that decision, and with nothing
 * left to beat, the override went too rather than being left behind as an `!important` that
 * overrides nothing. The fold itself is measured by `library.mjs` and is unaffected — removing
 * the opening moves the content **up**.
 */

/*
 * §6's desktop composition, and the only place anything sits beside anything else. Below this
 * width the grid is a single column in document order, which is the default above.
 */
/*
 * SL-001 scopes this to the workbench arrangement. The collection landing has two full-width
 * regions and must not be split into columns; `:not()` is how an accepted composition keeps
 * working for a page that still carries it while a new one sits beside it in the same file.
 */
@media (min-width: 64rem) {
  .zoey-make-workbench:not(.zoey-make-workbench--collection) {
    grid-template-columns: 38fr 62fr;
    align-items: start;
    column-gap: var(--wp--preset--spacing--70);
    row-gap: var(--wp--preset--spacing--60);
  }

  /*
   * The welcome stays a row on desktop — amended 2026-10-08, `WB-002.md` §2.1.
   *
   * It used to become `display: block` here, which stacked the line above the cameo and, incidentally,
   * switched `order` off: §6's desktop composition gave Bubble "the whole lower half of that column",
   * at 11rem, so the 38% column would not read as an empty margin beside the feature.
   *
   * Product reviewed that on desktop and mobile and asked for her **beside the line instead**, to its
   * left. So the row persists at every width and only its scale changes: still 11rem here, still 3rem
   * below, which is what the amendment preserves. The column is about 453px at 1440 and 340px at
   * 1024, so the line takes what is left of it and wraps — which is the arrangement, not a symptom.
   */
  .zoey-make-welcome__bubble {
    display: block;
  }

  .zoey-make-others,
  .zoey-make-challenge {
    grid-column: 1 / -1;
  }
}

/*
 * SL-010: the containing block for the Make hero's decorative layer.
 *
 * `position: relative` paints nothing and moves nothing, and the container declaration paints
 * nothing either — it lets `components/decoration.css` ask how wide this hero is **in the
 * reader's own text size**, which a media query cannot do because `rem` and `em` in a media
 * query resolve against the initial font size rather than the current one. The Shop hero is a
 * named container for the same reason. It exists so the group
 * `blocks/make-featured/render.php` prints into this hero resolves its corner against **this
 * box** rather than against whichever ancestor happened to be positioned — the failure mode
 * `components/decoration.css` opens by describing, and the same one-line job
 * `components/shop-archive.css` does for the Shop hero.
 */
.zoey-make-hero {
  position: relative;
  container-type: inline-size;
  container-name: zoey-section-hero;
}
