/* ============================================
   xm-textarea — multi-line concrete control for XmField (Story 2.2).

   The chrome (surface, border, radius, focus ring, label, helper/error row,
   disabled/readonly) is owned by the XmField base — see field/index.css. The
   only delta from xm-text-field is the multi-line <textarea>: it is taller
   than one control row, so the control wrapper must stop vertically centering
   its child and let the textarea own its own block size.

   The native <textarea> rendered here is already styled transparent /
   borderless / full-bleed / inherits-ink by the base's `.field__control
   textarea` rule. So THIS file only:
     • un-centers the control wrapper for a multi-row box,
     • sets the textarea's own vertical padding + resize behavior,
     • caps the auto-grow height.

   Surface/ink: rides the inverse-surface card tier — ink is inverse-on-surface,
   placeholder is on-surface-variant (matching the host surface, AD-13). No
   error color — severity is the base's icon + copy (AD-11). Tokens only (AD-1).

   BEM block: `textarea`. Registered in scripts/check-bem.sh STRICT_BLOCKS.
   ============================================ */

/* The control wrapper centers a single-line input; a textarea needs the box to
   start at the top and stretch, so the field-level control wrapper is realigned
   when it hosts this block. Scoped under the block so it never leaks to other
   fields. */
.textarea {
  display: block;
  width: 100%;
}

/* The native <textarea> — already transparent/borderless/inheriting via the
   base rule. Here we own the multi-line geometry: top-aligned text, vertical
   pad on the --s-N scale, and the resize affordance. */
.textarea__control {
  display: block;
  width: 100%;
  min-width: 0;
  /* Override the base `.field__control textarea { height: 100% }` rule — a
     textarea owns its own block size from `rows` / scrollHeight, not the
     single-line wrapper height. */
  height: auto;
  align-self: stretch;
  padding: var(--s-2) var(--s-3);
  resize: vertical;
  line-height: var(--md-sys-typescale-body-large-line-height);
}

/* Auto-grow disables the manual resize handle — the box tracks its content up
   to the capped max-height instead. */
.textarea__control--auto-grow {
  resize: none;
  overflow-y: auto;
}
