/*
 * Zoey Made — creator introduction.
 *
 * The canonical presentation of "here is the person behind this": a picture, a heading, a
 * few sentences and, when its destination is public, one link.
 * zoey_made_creator_intro() in functions.php builds the markup, this file gives it its
 * appearance, and the surface that renders it owns only the band around it — the same
 * division the product card, the Collection tile and the world panel use.
 *
 * The rule the design is written against is STORE-009 §21:
 *
 *   Do not design the section so that it only works with a child's face.
 *
 * So there is no portrait frame, no circular crop, no ratio and no cutout anywhere in the
 * file. The image region is a column with a maximum width; whatever is put in it keeps
 * its own shape. A landscape maker photograph, a portrait one, a drawing of a project and
 * no image at all are four states of one composition rather than four layouts, which is
 * what §75 asks to be proved and what stops the section being rebuilt the day a real
 * picture is chosen.
 *
 * Two more consequences of that, both deliberate:
 *
 *   No aspect-ratio on the image. §28 says not to lock a crop before a real image has
 *   been reviewed, and §29 would rather keep the hands, the project and the work surface
 *   than fit a shape. Geometry is still reserved before the image loads — WordPress
 *   writes width and height onto it and the browser derives the ratio from those, which
 *   is the whole of §72 — so nothing moves on load in any of the states.
 *
 *   The image is not a link and neither is the section (§62). The only interactive thing
 *   here is the optional link in the copy.
 *
 * Against its homepage neighbours: the world panels above are flat tinted surfaces with
 * drawn emblems, and this is white space, a photograph and a paragraph. It is the quiet
 * section on a loud page, which is §34 and §41 — the world section says what this place
 * is about, this says who is behind it, and the invitation after it is where the page
 * returns to commerce. Nothing here competes with that invitation.
 *
 * The component owns no band and no width of its own. See docs/CSS-AND-ASSETS.md.
 */

.zoey-creator-intro {
  display: grid;
  gap: var(--wp--preset--spacing--60);
  align-items: center;
}

/*
 * The image region.
 *
 * Held to a readable width on a phone, where it is stacked above the words, and given a
 * little more once it sits beside them. The explicit inline-size is load-bearing: an auto
 * margin on a grid item makes the item shrink to fit, which would let the picture's own
 * proportions decide the column's width instead of the layout.
 *
 * The maximum is what keeps this a picture on a page rather than a banner that grows with
 * the window (§35), and it is also what makes the `sizes` attribute in functions.php true:
 * 20rem and 24rem are the two numbers stated there.
 */
.zoey-creator-intro__media {
  inline-size: 100%;
  max-inline-size: 20rem;
  margin-inline: auto;
}

/*
 * The image itself keeps its own proportions — see the header — and max-block-size is a
 * safety valve rather than a crop: a very tall portrait would otherwise be 1.5 screens
 * high on a phone, and §34 rules out full-screen portrait treatment. object-fit only has
 * anything to do at that limit, and the centre of a maker photograph is the making.
 */
.zoey-creator-intro__image {
  display: block;
  inline-size: 100%;
  block-size: auto;
  max-block-size: 26rem;
  border-radius: var(--wp--custom--radius--large);
  object-fit: cover;
  object-position: center;
}

/*
 * Side by side once there is room for a picture and a readable column of text, and not
 * before. 900px is the hero's breakpoint and the header's, so the page changes shape at
 * one width rather than at four.
 *
 * The image takes the smaller share. §35 asks for the extra desktop width to be spent on
 * the relationship between the two rather than on stretching either, and a 4/6 split with
 * the copy still capped at the measure is that: the picture gets a column, the words get a
 * comfortable line, and what is left is the white space the section is mostly made of.
 */
@media (min-width: 900px) {
  .zoey-creator-intro {
    grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
    gap: var(--wp--preset--spacing--80);
  }

  .zoey-creator-intro__media {
    max-inline-size: 24rem;
  }

  .zoey-creator-intro__image {
    max-block-size: 30rem;
  }
}

/*
 * No image, no empty column.
 *
 * §57 allows an intentional no-image layout as one of the three ways this section can be
 * finished, and it has to look finished. The column count is the whole of it: leaving the
 * two-column rule in place puts the copy in the 4fr half and an empty 6fr half beside it,
 * which is a section that looks like its picture failed to load rather than one that was
 * never meant to have one. Measured at 1440px before the reset was written: 467px of text
 * against 700px of nothing.
 *
 * So the grid collapses, and the copy is centred and held to the measure — a deliberate
 * quiet moment between the world section and the closing invitation. The rule sits after
 * the breakpoint above so it wins on order rather than on specificity.
 */
.zoey-creator-intro--no-media {
  grid-template-columns: minmax(0, 1fr);
}

.zoey-creator-intro--no-media .zoey-creator-intro__content {
  margin-inline: auto;
  text-align: center;
}

.zoey-creator-intro--no-media .zoey-creator-intro__actions {
  justify-content: center;
}

.zoey-creator-intro__content {
  max-inline-size: var(--wp--custom--measure);
}

/*
 * The accent, and the only brand colour in the section.
 *
 * §37 spends colour on a small detail and leaves the picture to carry the personality, and
 * lists a small Pink rule as one of the ways to do it. A pseudo-element rather than markup
 * because it says nothing: it is a mark above a heading, and there is no element in the
 * document that exists only to be pink.
 *
 * This is the one line to delete if the reviewer's visual gate would rather the section
 * had no accent at all.
 */
.zoey-creator-intro__content::before {
  content: "";
  display: block;
  inline-size: 2.5rem;
  block-size: 4px;
  margin-block-end: var(--wp--preset--spacing--30);
  border-radius: var(--wp--custom--radius--pill);
  background-color: var(--wp--preset--color--zoey-pink);
}

.zoey-creator-intro--no-media .zoey-creator-intro__content::before {
  margin-inline: auto;
}

.zoey-creator-intro__heading {
  margin: 0;
  /* Keeps a two-line heading from leaving one word on the second line. Progressive: an
     engine without it simply wraps as it always did. */
  text-wrap: balance;
}

/*
 * The copy.
 *
 * The opening paragraph is Section Small — the size the homepage's other supporting lines
 * use, so this section sounds like the rest of the page rather than like a pull quote.
 * §34 rules out oversized quote typography and §12 rules out a quote at all, and neither
 * this rule nor the markup it styles contains a quotation mark.
 *
 * Ink on Surface, which is 12.5:1. §65 rules out pastel text for this copy explicitly.
 */
.zoey-creator-intro__text {
  margin-block-start: var(--wp--preset--spacing--40);
  color: var(--wp--preset--color--ink);
  font-size: var(--wp--preset--font-size--section-small);
}

/*
 * A second paragraph steps down rather than repeating the first at the same weight: §10
 * offers one extra line and §11 caps the whole section at a few short sentences, so the
 * hierarchy has to do the work that length is not allowed to. Ink Soft on Surface is
 * 5.9:1 and is a Surface colour and nothing else — docs/ACCESSIBILITY.md.
 */
.zoey-creator-intro__text + .zoey-creator-intro__text {
  margin-block-start: var(--wp--preset--spacing--30);
  color: var(--wp--preset--color--ink-soft);
  font-size: var(--wp--preset--font-size--body);
}

/*
 * The optional link, and the reason it is a link rather than a button.
 *
 * §41 keeps this section from ending in a second sales CTA — the page returns to commerce
 * one section later, and two buttons a screen apart would compete. So this is a text link
 * with a standing underline, the treatment theme.json gives links site-wide.
 *
 * The target is not the text. §66 asks for something comfortably tappable on a phone, so
 * the anchor is a flex box with a 44px minimum height, which is the WCAG 2.5.5 target
 * size around a line of 16px text. The site's focus ring in base.css marks it, and there
 * is exactly one tab stop here when there is one at all.
 */
.zoey-creator-intro__actions {
  display: flex;
  margin-block-start: var(--wp--preset--spacing--40);
}

.zoey-creator-intro__link {
  display: inline-flex;
  gap: var(--wp--preset--spacing--20);
  align-items: center;
  min-block-size: 2.75rem;
  color: var(--wp--preset--color--ink);
  font-weight: 600;
}

/*
 * The arrow.
 *
 * Two borders rotated 45 degrees: a chevron with no file, no request and no icon system,
 * the same one the Collection tile and the world panel use. It is decoration marked
 * aria-hidden in the markup — the link already says where it goes.
 */
.zoey-creator-intro__go {
  flex: none;
  inline-size: 0.45rem;
  block-size: 0.45rem;
  border-block-start: 2px solid var(--wp--preset--color--ink);
  border-inline-end: 2px solid var(--wp--preset--color--ink);
  rotate: 45deg;
  transition: translate 150ms ease;
}

/*
 * Hover moves the arrow a little way towards where it points, and nothing else: this is a
 * line of text in a paragraph, not a card. Behind a hover query so a touch device does not
 * hold the state after a tap; the reduced-motion preference is honoured site-wide in
 * base.css, which collapses the travel rather than the state.
 */
@media (hover: hover) {
  .zoey-creator-intro__link:hover .zoey-creator-intro__go {
    translate: 3px 0;
  }
}
