/*
 * Zoey Made — global footer.
 *
 * The calm end of the page: who this is, where else to go, how to get help, and the legal
 * detail. It renders on every route, so it carries no images and no JavaScript, and the
 * playful closing note is left to the scallop frame printed underneath it.
 *
 *   parts/footer.html   structure and link content
 *   this file           appearance
 *   functions.php       the copyright year, and which links have somewhere to go
 *
 * Layout comes from the block markup's own gaps and flex rows, so the columns are core's
 * layout system rather than a second one written here. What is left for this file is
 * surface, type, colour, the states, and the two widths where content decides otherwise.
 *
 * Several selectors name core's classes, because the link lists are core Navigation
 * blocks: the markup is core's and the design is ours. Each of those rules says what it
 * overrides, and is more specific than the rule it replaces so that stylesheet load order
 * cannot decide the outcome.
 */

/*
 * The footer surface.
 *
 * White against the page's warm near-white, closed with the same hairline the header
 * opens with, so the two ends of the site are recognisably a pair. The difference is
 * deliberately slight: the change in energy the footer needs comes from its content
 * being quieter, not from a band of colour, and the scallop frame below it is already
 * the loudest thing on the page.
 */
.zoey-site-footer {
  padding-block: var(--wp--preset--spacing--70);
  background-color: var(--wp--preset--color--surface);
  border-block-start: 1px solid var(--wp--preset--color--border-soft);
}

/*
 * The brand, and the link columns beside it.
 *
 * Both are sized by their content rather than stretched to fill, which is what lets the
 * row read as deliberate whether four groups are showing or one: the brand sits at the
 * start, the columns at the end, and there is no half-empty grid track in between. Below
 * roughly 800px the two wrap onto separate rows on their own.
 *
 * The wordmark is the same text wordmark as the header, at the same size, because no
 * approved logo artwork exists yet and a second one would only be a second thing to
 * replace.
 */
.zoey-site-footer__brand {
  /*
   * The blurb should read as two or three short lines rather than one long one. The
   * editorial measure (56ch) is for body copy and is far too wide for a sign-off.
   */
  --zoey-site-footer-brand-measure: 34ch;

  max-inline-size: var(--zoey-site-footer-brand-measure);
}

.zoey-site-footer__group {
  /*
   * Wide enough that a two-word label keeps its own column rather than wrapping under
   * itself, and narrow enough for four columns to fit a tablet.
   */
  min-inline-size: 9rem;
}

.zoey-site-footer__wordmark {
  margin-block: 0;
  font-size: var(--wp--preset--font-size--section-small);
  font-weight: 700;
  line-height: 1.2;
}

.zoey-site-footer__wordmark a {
  color: var(--wp--preset--color--ink);
  text-decoration: none;
}

.zoey-site-footer__wordmark a:hover {
  color: var(--wp--preset--color--zoey-purple);
}

.zoey-site-footer__message,
.zoey-site-footer__signoff {
  color: var(--wp--preset--color--ink-soft);
}

.zoey-site-footer__signoff {
  font-size: var(--wp--preset--font-size--body-small);
}

/*
 * A group with no destinations yet is not rendered at all, so the heading below always
 * has links under it.
 */
.zoey-site-footer__group-heading {
  margin-block: 0;
  color: var(--wp--preset--color--ink);
  font-weight: 700;
}

/*
 * Links are quieter than their heading and darken rather than brighten on hover. The
 * pastels are the wrong way to signal a link — purple on white is 3.4:1 and pink is lower
 * still — so hovering moves the label from Ink Soft to Ink and adds an underline, and both
 * states clear AA.
 *
 * The colour is set on the list item rather than on the link, because core forces
 * `color: inherit` onto the link itself through a deliberately doubled class. Colouring
 * what the link inherits from keeps this a flat rule instead of an escalating one.
 * :has() gives the keyboard the same treatment as the pointer; where it is unsupported
 * the focus ring below still marks the link.
 */
.zoey-site-footer__nav .wp-block-navigation-item {
  color: var(--wp--preset--color--ink-soft);
}

.zoey-site-footer__nav .wp-block-navigation-item:hover,
.zoey-site-footer__nav .wp-block-navigation-item:has(:focus-visible) {
  color: var(--wp--preset--color--ink);
}

/*
 * text-decoration-line, not the shorthand: the shorthand would also reset the decoration
 * colour and thickness that theme.json sets for links site-wide.
 */
.zoey-site-footer__nav .wp-block-navigation-item__content {
  padding-block: var(--wp--preset--spacing--10);
  text-decoration-line: none;
}

.zoey-site-footer__nav .wp-block-navigation-item__content:hover,
.zoey-site-footer__nav .wp-block-navigation-item__content:focus-visible {
  text-decoration-line: underline;
}

/*
 * Legal.
 *
 * Available but secondary: smaller type, below a hairline, and the last thing before the
 * page closes. The policy links keep a standing underline — they sit in a row of their
 * own with nothing else around them to say they are links.
 */
.zoey-site-footer__legal {
  padding-block-start: var(--wp--preset--spacing--50);
  border-block-start: 1px solid var(--wp--preset--color--border-soft);
  font-size: var(--wp--preset--font-size--body-small);
}

.zoey-site-footer__policies .wp-block-navigation-item__content {
  text-decoration-line: underline;
}

.zoey-site-footer__copyright {
  margin-block: 0;
  color: var(--wp--preset--color--ink-soft);
}

/*
 * One group per row on a phone.
 *
 * Two 144px columns do fit a 390px viewport, but the columns are the part of the footer a
 * parent scans for help, and FOUND-008 asks for them stacked there. Above this the row
 * fills naturally: two columns on a large phone, three or four as the width allows.
 */
@media (max-width: 479px) {
  .zoey-site-footer__group {
    min-inline-size: 100%;
  }
}

/*
 * More room once there is room to give. The block-level spacing steps either side of this
 * are 48px and 72px, which are the two ends of the range this footer is meant to occupy.
 */
@media (min-width: 900px) {
  .zoey-site-footer {
    padding-block: var(--wp--preset--spacing--80);
  }
}
