.page-richtext .page-content-columns,
.ql-editor .page-content-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    width: 100%;
    margin-block: 2rem;
}

.page-richtext .page-content-columns[data-columns='3'],
.ql-editor .page-content-columns[data-columns='3'] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.page-richtext .page-content-column,
.ql-editor .page-content-column {
    min-width: 0;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--page-border, #d7dce3) 82%, transparent);
    border-radius: 0.875rem;
    background: var(--page-surface, #ffffff);
}

.page-richtext .page-content-column > :not(img, iframe),
.ql-editor .page-content-column > :not(img, iframe) {
    margin-inline: 1.5rem;
}

.page-richtext .page-content-column > :first-child:not(img, iframe),
.ql-editor .page-content-column > :first-child:not(img, iframe) {
    margin-top: 1.5rem;
}

.page-richtext .page-content-column > :last-child,
.ql-editor .page-content-column > :last-child {
    margin-bottom: 1.5rem;
}

.page-richtext .page-content-column h3,
.ql-editor .page-content-column h3 {
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
    line-height: 1.25;
}

.page-richtext .page-content-column p,
.ql-editor .page-content-column p {
    margin-top: 0;
    white-space: pre-line;
}

.page-richtext .page-content-column img,
.page-richtext .page-content-column iframe,
.ql-editor .page-content-column img,
.ql-editor .page-content-column iframe {
    display: block;
    width: 100%;
    border: 0;
}

.page-richtext .page-content-column img,
.ql-editor .page-content-column img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.page-richtext .page-content-column iframe,
.ql-editor .page-content-column iframe,
.page-richtext iframe.ql-video,
.ql-editor iframe.ql-video {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
}

.page-richtext .page-content-stepper,
.ql-editor .page-content-stepper {
    display: grid;
    gap: 0;
    width: 100%;
    margin-block: 2rem;
    padding: 0;
    list-style: none;
}

.page-richtext .page-content-stepper > li,
.ql-editor .page-content-stepper > li {
    position: relative;
    display: grid;
    grid-template-columns: 2.5rem minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
    padding-block: 1.5rem;
    border-bottom: 1px solid color-mix(in srgb, var(--page-border, #d7dce3) 82%, transparent);
}

.page-richtext .page-content-stepper > li:first-child,
.ql-editor .page-content-stepper > li:first-child {
    padding-top: 0;
}

.page-richtext .page-content-stepper > li:last-child,
.ql-editor .page-content-stepper > li:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.page-richtext .page-content-stepper__number,
.ql-editor .page-content-stepper__number {
    display: grid;
    place-items: center;
    min-height: 2.5rem;
    color: var(--color-brand-magenta, #ec168c);
    font-family: var(--font-sovaz-display, sans-serif);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

.page-richtext .page-content-stepper__content,
.ql-editor .page-content-stepper__content {
    min-width: 0;
}

.page-richtext .page-content-stepper__content h3,
.ql-editor .page-content-stepper__content h3 {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
    line-height: 1.25;
    text-transform: uppercase;
}

.page-richtext .page-content-stepper__content p,
.ql-editor .page-content-stepper__content p {
    max-width: 70ch;
    margin: 0;
    white-space: pre-line;
}

.ql-editor .page-content-columns,
.ql-editor .page-content-stepper {
    cursor: pointer;
    outline: 2px solid transparent;
    outline-offset: 0.25rem;
    transition: outline-color 180ms ease-out;
}

.ql-editor .page-content-columns:hover,
.ql-editor .page-content-stepper:hover {
    outline-color: #0ea5e9;
}

.page-content-block-dialog {
    width: min(52rem, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    margin: auto;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 1rem;
    background: #ffffff;
    color: #18202b;
    box-shadow: 0 1.5rem 4rem rgba(15, 23, 42, 0.28);
}

.page-content-block-dialog::backdrop {
    background: rgba(15, 23, 42, 0.62);
}

.page-content-block-dialog__form {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    max-height: calc(100vh - 2rem);
}

.page-content-block-dialog__form > header {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.page-content-block-dialog__form > header h2 {
    margin: 0 0 0.5rem;
    color: #111827;
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.2;
}

.page-content-block-dialog__form > header p {
    max-width: 65ch;
    margin: 0;
    color: #4b5563;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.page-content-block-dialog__body {
    display: grid;
    gap: 1.5rem;
    padding: 1.5rem;
    overflow-y: auto;
}

.page-content-block-dialog__repeater {
    display: grid;
    gap: 1rem;
}

.page-content-block-dialog__group {
    display: grid;
    gap: 1rem;
    min-width: 0;
    margin: 0;
    padding: 1rem;
    border: 1px solid #d8dee8;
    border-radius: 0.75rem;
}

.page-content-block-dialog__group > legend {
    padding-inline: 0.375rem;
    color: #111827;
    font-size: 0.875rem;
    font-weight: 700;
}

.page-content-block-dialog__group-header {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.page-content-block-dialog__group-header h3 {
    margin: 0;
    color: #111827;
    font-size: 0.875rem;
    font-weight: 700;
}

.page-content-block-dialog__group-actions {
    display: flex;
    gap: 0.5rem;
}

.page-content-block-dialog__field {
    display: grid;
    gap: 0.5rem;
    min-width: 0;
    color: #273244;
    font-size: 0.875rem;
    font-weight: 600;
}

.page-content-block-dialog__field--compact {
    max-width: 16rem;
}

.page-content-block-dialog__field input,
.page-content-block-dialog__field textarea,
.page-content-block-dialog__field select {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid #cbd2dc;
    border-radius: 0.5rem;
    background: #ffffff;
    color: #111827;
    font: inherit;
    font-weight: 400;
}

.page-content-block-dialog__field textarea {
    min-height: 7rem;
    resize: vertical;
}

.page-content-block-dialog__field input:focus-visible,
.page-content-block-dialog__field textarea:focus-visible,
.page-content-block-dialog__field select:focus-visible,
.page-content-block-dialog__button:focus-visible,
.page-content-block-dialog__icon-button:focus-visible {
    outline: 3px solid #0ea5e9;
    outline-offset: 2px;
}

.page-content-block-dialog__error {
    margin: 0 1.5rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    background: #fee2e2;
    color: #991b1b;
    font-size: 0.875rem;
    font-weight: 600;
}

.page-content-block-dialog__footer {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
}

.page-content-block-dialog__actions {
    display: flex;
    gap: 0.75rem;
    margin-left: auto;
}

.page-content-block-dialog__button,
.page-content-block-dialog__icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.page-content-block-dialog__button {
    min-height: 2.75rem;
    gap: 0.5rem;
    padding-inline: 1rem;
    border-radius: 0.5rem;
}

.page-content-block-dialog__button--primary {
    background: #111827;
    color: #ffffff;
}

.page-content-block-dialog__button--secondary {
    border: 1px solid #cbd2dc;
    background: #ffffff;
    color: #273244;
}

.page-content-block-dialog__button--danger {
    background: #fee2e2;
    color: #991b1b;
}

.page-content-block-dialog__icon-button {
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border-radius: 0.5rem;
    background: transparent;
    color: #4b5563;
}

.page-content-block-dialog__icon-button svg,
.page-content-block-dialog__button svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.page-content-block-dialog__icon-button:hover,
.page-content-block-dialog__button--secondary:hover {
    background: #eef2f7;
}

.page-content-block-dialog__button--primary:hover {
    background: #273244;
}

.page-content-block-dialog__button--danger:hover {
    background: #fecaca;
}

.page-content-block-dialog__button:disabled,
.page-content-block-dialog__icon-button:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.page-content-block-dialog__add {
    justify-self: start;
}

@media (max-width: 48rem) {
    .page-richtext .page-content-columns,
    .page-richtext .page-content-columns[data-columns='3'],
    .ql-editor .page-content-columns,
    .ql-editor .page-content-columns[data-columns='3'] {
        grid-template-columns: minmax(0, 1fr);
    }

    .page-content-block-dialog__footer {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .page-content-block-dialog__actions {
        width: 100%;
        margin-left: 0;
    }

    .page-content-block-dialog__actions > * {
        flex: 1;
    }

    .page-content-block-dialog__button--danger {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ql-editor .page-content-columns,
    .ql-editor .page-content-stepper {
        transition: none;
    }
}
