/* The brand page (`marketing_pages/brand`): the marks to download, the
   colours and the faces. It sits on the marketing pages' own section, card
   and closing call; only what is new to it is here — the preview a mark is
   shown on, the colour chip, the type sample. */

@layer components {
  /* The other marketing pages centre a section's heading on a wide display;
     this one reads as a reference sheet, so its headings line up on the left
     with the hero and the cards under them. */
  .brand-page .mpage-section__head {
    @media (width >= 768px) {
      margin-inline: 0;
      text-align: start;
    }
  }

  .brand-page .mpage-section__title {
    margin-inline: 0;
  }

  /* `auto-fit`, so a pair of marks spans the column rather than leaving a
     third of it empty beside them. */
  .brand-kit {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(17.5rem, 1fr));
  }

  /* Four colours fit side by side on a wide display, two on a tablet. */
  .brand-kit--colors {
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  }

  /* ─── A mark to download ──────────────────── */

  .brand-asset {
    border: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
  }

  /* The ground the mark is meant for. The light one stays white in both
     themes: the full-colour logo draws its name in black. */
  .brand-asset__preview {
    align-items: center;
    aspect-ratio: 16 / 9;
    border-block-end: 1px solid var(--color-border);
    display: flex;
    justify-content: center;
    padding: 2rem;
  }

  .brand-asset__preview--light {
    background: var(--color-logo-surface);
  }

  .brand-asset__preview--dark {
    background: var(--color-surface-inverted);
  }

  .brand-asset__preview--brand {
    background: var(--color-brand-fill);
  }

  .brand-asset__image--wide {
    inline-size: min(100%, 15rem);
  }

  .brand-asset__image--square {
    inline-size: 5.5rem;
  }

  .brand-asset__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.25rem 1.375rem 1.375rem;
  }

  .brand-asset__title,
  .brand-swatch__name,
  .brand-type__name {
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
  }

  .brand-asset__text,
  .brand-swatch__use,
  .brand-type__use {
    color: var(--color-ink-secondary);
    font-size: 0.90625rem;
    line-height: 1.6;
    margin: 0;
  }

  .brand-asset__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-block-start: auto;
    padding-block-start: 0.5rem;
  }

  /* ─── A colour ────────────────────────────── */

  .brand-swatch {
    border: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
  }

  /* The colour arrives from the template; the hairline keeps the lightest
     one from melting into the card. */
  .brand-swatch__chip {
    background: var(--brand-swatch-color, var(--color-brand-fill));
    block-size: 6.5rem;
    border-block-end: 1px solid var(--color-border);
  }

  .brand-swatch__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.125rem 1.25rem 1.25rem;
  }

  .brand-swatch__codes {
    column-gap: 0.75rem;
    display: grid;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    grid-template-columns: auto 1fr;
    margin: 0.25rem 0 0;
    row-gap: 0.25rem;

    dt {
      color: var(--color-ink-muted);
    }

    dd {
      margin: 0;
    }
  }

  .brand-swatch__copy {
    align-self: flex-start;
    margin-block-start: auto;
  }

  /* ─── A face ──────────────────────────────── */

  .brand-type {
    border: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .brand-type__sample {
    color: var(--color-brand);
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    margin: 0 0 0.5rem;
  }

  .brand-type__sample--sans {
    font-family: var(--font-sans);
  }

  .brand-type__sample--mono {
    font-family: var(--font-mono);
  }
}
