/* Mapro Description Editor — public page styles. */

.mapro-editor-wrap {
    max-width: 1400px;
    margin: 24px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Thai", sans-serif;
    box-sizing: border-box;
}

.mapro-editor-wrap *,
.mapro-editor-wrap *::before,
.mapro-editor-wrap *::after {
    box-sizing: border-box;
}

.mapro-editor-intro {
    background: #eef4fb;
    border-left: 4px solid #2271b1;
    padding: 14px 18px;
    margin-bottom: 18px;
    border-radius: 4px;
}

.mapro-editor-intro h2 {
    margin: 0 0 8px;
    font-size: 20px;
    color: #1d2327;
}

.mapro-editor-intro p {
    margin: 0;
    color: #3c434a;
    line-height: 1.6;
}

.mapro-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
}

.mapro-btn {
    padding: 9px 16px;
    border: 1px solid #c3c4c7;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.3;
    transition: background-color .15s, border-color .15s;
}

.mapro-btn:hover {
    background: #f0f0f1;
    border-color: #8c8f94;
}

.mapro-btn-primary {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.mapro-btn-primary:hover {
    background: #135e96;
    border-color: #135e96;
    color: #fff;
}

.mapro-ed-status {
    margin-left: 8px;
    color: #0a7d00;
    font-weight: 500;
    font-size: 14px;
    min-height: 20px;
}

.mapro-ed-status.is-error {
    color: #d63638;
}

.mapro-editor-wrap #mapro-description-editor-textarea {
    visibility: hidden;
}

/* Modal */
.mapro-ed-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.mapro-ed-modal.is-open {
    display: flex;
}

.mapro-ed-modal-inner {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    max-width: 820px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.mapro-ed-modal-inner h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.mapro-ed-modal-inner p {
    margin: 0 0 8px;
    color: #50575e;
    font-size: 14px;
}

.mapro-ed-modal-inner textarea {
    flex: 1;
    width: 100%;
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
    font-size: 13px;
    padding: 10px 12px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    margin: 12px 0;
    min-height: 320px;
    resize: vertical;
    line-height: 1.5;
}

.mapro-ed-modal-inner textarea:focus {
    outline: 2px solid #2271b1;
    outline-offset: -2px;
    border-color: #2271b1;
}

.mapro-ed-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Help details */
.mapro-ed-help {
    margin-top: 18px;
    padding: 12px 16px;
    background: #fbfbfb;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.mapro-ed-help summary {
    cursor: pointer;
    font-weight: 500;
    color: #2271b1;
    padding: 4px 0;
}

.mapro-ed-help ul {
    margin: 10px 0 4px 20px;
    color: #3c434a;
    line-height: 1.7;
    font-size: 14px;
}

.mapro-ed-help code {
    background: #eef0f2;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
}

/* Ensure TinyMCE iframe looks right on frontend themes. */
.mapro-editor-wrap .tox.tox-tinymce {
    border-radius: 6px;
    border: 1px solid #c3c4c7;
}

@media (max-width: 640px) {
    .mapro-editor-wrap {
        margin: 12px auto;
        padding: 12px;
    }
    .mapro-editor-intro h2 { font-size: 18px; }
    .mapro-btn { flex: 1 0 auto; text-align: center; }
    .mapro-ed-status { flex: 1 0 100%; margin-left: 0; }
}
