@layer payload-default { .field-type { display: flex; flex-direction: column; gap: var(--spacer-2); flex-grow: 1; } .field-type__wrap { position: relative; } .render-fields { /* Reset per nesting level so an ancestor's zeroed value (e.g. a row) does not leak into nested fields. */ --spacing-field: var(--spacer-4); & > .field-type { margin-bottom: var(--spacing-field); position: relative; &[type='hidden'] { margin-bottom: 0; } &:first-child { margin-top: 0; } &:last-of-type { margin-bottom: 0; } &.blocks-field, &.array-field, &.collapsible-field, &.rich-text { &:first-child { margin-top: 0; } &:last-of-type { margin-bottom: 0; } } &.group-field { margin-top: calc(var(--spacing-field) * 3); margin-bottom: calc(var(--spacing-field) * 3); &:first-child { margin-top: 0; } &:last-of-type { margin-bottom: 0; } } &.group-field--within-group { margin-top: var(--spacing-field); } } } /* stylelint-disable-next-line plugin/no-max-width-media-query -- TODO: pre-existing; migrate to a mobile-first min-width query */ @media (max-width: 768px) { .render-fields { --spacing-field: var(--spacer-2-5); } } }