
.text-editor {

    & > .page {
        text-align: left;
        user-select: text;
        margin: 3em max(2em, 20%);
        margin-bottom: 0px;
        gap: 0.6em;

        @media (width <= 800px) { margin: 8%; }
        
        &[contenteditable="true"] {outline: none;}
        
        & > .page-title {
            font-size: 1.5em;
            font-weight: bold;
            padding: 0.4rem 0.6rem;
            padding-left: calc(1.2rem + 0.4rem + 0.6rem);
            @media (width <= 800px) { padding-left: 0.6rem; }
                
            &:hover, &:focus {
                background-color: hsl(0 0 10);
                border-radius: 0.2rem;
            }
        }

        & > .page-margin-bottom {
            flex-grow: 1;
            min-height: 12em;
            caret-color: black;

            @media (width <= 800px) { min-height: 60vh; }
        }
        
        & > .page-content {
            
            gap: 0.2em;
            
            & .block {
                padding: 0.4em 0.6em;
                display: flex;
                flex-direction: row;
                align-items: center;
                gap: 0.4em;
                
                &:hover, &:focus {
                    background-color: hsl(0 0 100 / 0.1);
                    border-radius: 0.2em;
                }

                & > .block-content {
                    min-height: 1lh;
                    flex-grow: 1;
                    overflow-wrap: anywhere;
                    /*white-space: pre-wrap;*/
                    white-space-collapse: break-spaces;

                    & > .block-text:has(+ .block) {
                        margin-bottom: 0.4em;
                    }
                }
                
                & > .block-handle {
                    opacity: 0;
                    color: hsl(0 0 60);
                    cursor: -moz-grab;
                    flex-shrink: 0;
                    align-self: first baseline;
                    width: 1lh;
                    height: 1lh;
                    user-select: none;

                    & > svg {
                        width: 100%;
                        height: 100%;
                    }

                    &:active { cursor: -moz-grabbing; }

                    @media (width <= 800px) { display: none; }
                }
                
                &:hover > .block-handle {
                    opacity: 1;
                }
            }
        }
    }
}

#selection-area {
    fill: hsl(210 100 50 / 0.15);
    /*stroke: hsl(210 100 50 / 0.85);*/
    stroke-width: 2px;
    stroke-linecap: round;
    stroke-linejoin: round;

	display: none;
	position: absolute;
	top: 0px;
    left: 0px;
    width: 100vw;
    height: 100vh;
	pointer-events: none;
	z-index: 5000;

    &.active {
        display: block;
    }
}