/* Règle d'éditeur (graduations + poignées de marge).
 * v11 : sélecteurs alignés sur TinyMCE 5/6 (.tox-*) et compatibles legacy 4 (.mce-*).
 */

.itf-editor-ruler {
    width: 100%;
    background: #f8fafc;
    border-bottom: 1px solid #d0d7de;
    border-top-left-radius: var(--itf-radius-sm);
    border-top-right-radius: var(--itf-radius-sm);
}

.itf-editor-ruler__chrome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--itf-space-3);
    padding: var(--itf-space-2) var(--itf-space-4) var(--itf-space-1);
}

.itf-editor-ruler__label {
    font-size: var(--itf-font-size-sm);
    font-weight: 600;
    color: #64748b;
    line-height: 1;
}

.itf-editor-ruler__toggle {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: var(--itf-radius-sm);
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
    position: relative;
}

.itf-editor-ruler__toggle:hover {
    background: #eef4ff;
    border-color: #93c5fd;
}

.itf-editor-ruler__toggle::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 9px;
    width: 16px;
    height: 10px;
    border: 2px solid #64748b;
    border-radius: 10px / 7px;
}

.itf-editor-ruler__toggle::after {
    content: "";
    position: absolute;
    left: 12px;
    top: 12px;
    width: 4px;
    height: 4px;
    background: #64748b;
    border-radius: 50%;
}

.itf-editor-ruler__surface {
    padding: 0 var(--itf-space-4) var(--itf-space-3);
}

.itf-editor-ruler__inner {
    position: relative;
    height: 34px;
    border: 1px solid #d0d7de;
    border-radius: var(--itf-radius);
    background:
        linear-gradient(to bottom, #eef2f7 0%, #eef2f7 18px, #ffffff 18px, #ffffff 100%);
    overflow: hidden;
}

.itf-editor-ruler__page {
    position: absolute;
    top: 18px;
    height: 16px;
    background: rgba(255, 255, 255, 0.96);
    border-left: 1px solid #d0d7de;
    border-right: 1px solid #d0d7de;
}

.itf-editor-ruler__margin {
    position: absolute;
    top: 18px;
    height: 16px;
    background: rgba(203, 213, 225, 0.35);
}

.itf-editor-ruler__ticks {
    position: absolute;
    inset: 0;
}

.itf-editor-ruler__tick {
    position: absolute;
    top: 10px;
    width: 1px;
    height: 8px;
    background: #94a3b8;
}

.itf-editor-ruler__tick.is-major {
    top: 4px;
    height: 14px;
    background: #64748b;
}

.itf-editor-ruler__tick-label {
    position: absolute;
    top: -4px;
    left: 4px;
    font-size: var(--itf-font-size-xs);
    font-weight: 600;
    color: #475569;
    line-height: 1;
    transform: translateX(-10%);
}

.itf-editor-ruler__handle {
    position: absolute;
    top: 8px;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 1px solid #60a5fa;
    border-radius: 4px 4px 10px 10px;
    background: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.28);
    cursor: ew-resize;
}

.itf-editor-ruler__handle::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 5px;
    width: 6px;
    height: 6px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.92);
}

.itf-editor-ruler.is-collapsed .itf-editor-ruler__surface {
    display: none;
}

body.itf-editor-ruler-dragging {
    cursor: ew-resize !important;
}
