/* Shared composition header: document page frame, title/subtitle/description fields and their alignment controls. */

.documentPage {
    width: min(1500px, calc(100% - 28px));
    margin: 20px auto 42px;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.compositionHeader {
    margin-bottom: 18px;
}

.headerFieldContainer {
    position: relative;
    width: 100%;
}

.fieldAlignControls {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 2px;
    background: rgba(255, 255, 255, 0.95);
    padding: 2px;
    border-radius: 4px;
    border: 1px solid var(--border);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.headerFieldContainer:hover .fieldAlignControls,
.headerFieldContainer:focus-within .fieldAlignControls {
    opacity: 1;
}

.fieldAlignBtn,
.textRowAlignBtn {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    width: 20px;
    height: 20px;
    font-size: 10px;
    font-weight: bold;
    color: #4b5563;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.1s ease;
}

.fieldAlignBtn:hover,
.textRowAlignBtn:hover {
    background: #e5e7eb;
    color: #111827;
}

.fieldAlignBtn.active,
.textRowAlignBtn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.editableTitle,
.editableSubtitle,
.editableDescription {
    width: 100%;
    min-height: 1.4em;
    border-radius: 6px;
    padding: 3px 7px;
}

.editableTitle {
    font-size: 29px;
    line-height: 1.2;
    font-weight: 750;
}

.editableSubtitle {
    margin-top: 4px;
    color: #344054;
    font-size: 15px;
    font-weight: 600;
}

.editableDescription {
    margin-top: 7px;
    color: var(--muted);
    font-size: 13px;
    white-space: pre-wrap;
}

[contenteditable="true"]:hover,
[contenteditable="true"]:focus {
    background: var(--surface-soft);
}

[contenteditable="true"]:empty::before {
    content: attr(data-placeholder);
    color: #98a2b3;
    pointer-events: none;
}

