/* ─── Mumubl Editor — Medium-style writing interface ─────────────────────── */

#mumubl-editor-wrap {
    max-width: 740px;
    margin: 0 auto;
    padding: 0 20px 100px;
    font-family: Georgia, 'Times New Roman', serif;
}

/* Notices */
.mumubl-notice {
    padding: 14px 18px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
}
.mumubl-notice--success { background: #e8f5e9; color: #2e7d32; border-left: 4px solid #4caf50; }
.mumubl-notice--error   { background: #fdecea; color: #c62828; border-left: 4px solid #ef5350; }
.mumubl-notice ul { margin: 0; padding-left: 18px; }

/* ─── Writing area card ──────────────────────────────────────────────────── */
/* Gives the title + editor a distinct "paper" feel against the page chrome. */
.mumubl-editor-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 24px rgba(0,0,0,0.09);
    border: 1px solid rgba(0,0,0,0.06);
    padding: 32px 40px 28px;
    margin-bottom: 24px;
}

/* Featured image zone */
.mumubl-image-zone {
    position: relative;
    width: 100%;
    min-height: 220px;
    background: #f5f5f5;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    margin-bottom: 12px;
    transition: background 0.2s;
}
.mumubl-image-zone:hover { background: #eeeeee; }
.mumubl-image-zone.has-image .mumubl-image-placeholder { display: none; }
.mumubl-image-zone img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.mumubl-image-placeholder {
    text-align: center;
    color: #aaa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    padding: 40px;
}
.mumubl-remove-image {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}
.mumubl-image-credit-wrap {
    margin-bottom: 20px;
}
.mumubl-image-credit-wrap.is-hidden { display: none; }
.mumubl-image-credit-wrap input {
    width: 100%;
    border: none;
    border-bottom: 1px solid #e0e0e0;
    padding: 6px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 12px;
    color: #888;
    background: transparent;
    outline: none;
}

/* Title */
.mumubl-title-input {
    display: block;
    width: 100%;
    border: none;
    outline: none;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 38px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
    padding: 10px 0 6px;
    margin-bottom: 4px;
    background: transparent;
    box-shadow: none;
    resize: none;
}
.mumubl-title-input::placeholder { color: #c0c0c0; }

/* Quill editor container */
#mumubl-quill-editor {
    min-height: 320px;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 20px;
    line-height: 1.75;
    color: #1a1a1a;
    outline: none;
    margin-bottom: 4px;
}
.ql-container.ql-bubble {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 20px;
    border: none !important;
}
.ql-editor {
    padding: 0 !important;
}
.ql-editor.ql-blank::before {
    color: #c0c0c0;
    font-style: italic;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 20px;
    left: 0;
}
.ql-bubble .ql-tooltip { z-index: 9999; }

/* ─── Article details panel ──────────────────────────────────────────────── */
.mumubl-details-panel {
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    margin-bottom: 80px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.mumubl-details-panel summary {
    padding: 14px 18px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    list-style: none;
    user-select: none;
}
.mumubl-details-panel summary::-webkit-details-marker { display: none; }
.mumubl-details-panel summary::after {
    content: ' \25BE';
    font-size: 10px;
    color: #999;
}
.mumubl-details-panel[open] summary::after { content: ' \25B4'; }

.mumubl-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    padding: 0 18px 18px;
}
.mumubl-field { display: flex; flex-direction: column; gap: 6px; }
.mumubl-field--full { grid-column: 1 / -1; }
.mumubl-field label {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.mumubl-field select,
.mumubl-field input[type="text"],
.mumubl-field input[type="datetime-local"] {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 14px;
    color: #333;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}
.mumubl-field-note {
    margin: 4px 0 0;
    font-size: 12px;
    color: #aaa;
    line-height: 1.5;
}
.mumubl-field-note .mumubl-credits--none { color: #c0392b; }

/* ─── Autocomplete ───────────────────────────────────────────────────────── */
.mumubl-autocomplete {
    position: relative;
}
.mumubl-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 6px;
}
.mumubl-chips:empty { display: none; }
.mumubl-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #eef0f2;
    border-radius: 3px;
    padding: 3px 8px;
    font-size: 13px;
    color: #333;
}
.mumubl-chip-x {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    padding: 0 1px;
    font-size: 15px;
    line-height: 1;
    margin-left: 2px;
}
.mumubl-chip-x:hover { color: #333; }
.mumubl-autocomplete-input {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 14px;
    color: #333;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}
.mumubl-autocomplete-list {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    z-index: 200;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 6px 14px rgba(0,0,0,0.10);
}
.mumubl-autocomplete-item {
    padding: 8px 12px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}
.mumubl-autocomplete-item:hover { background: #f5f5f5; }

/* ─── Radio buttons (Entry Type) ─────────────────────────────────────────── */
.mumubl-radios {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.mumubl-radio-label {
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    user-select: none;
}
.mumubl-radio-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.mumubl-radio-label:has(input:checked) {
    border-color: #1a1a1a;
    background: #1a1a1a;
    color: #fff;
}

/* New-term chips get a slightly different shade to indicate they're being created */
.mumubl-chip--new {
    background: #ddeeff;
}

/* ─── Post-save screen ───────────────────────────────────────────────────── */
.mumubl-saved-screen {
    max-width: 560px;
    margin: 40px auto 60px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.mumubl-saved-icon {
    font-size: 52px;
    line-height: 1;
    margin-bottom: 16px;
    color: #4caf50;
}
.mumubl-saved-heading {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px;
}
.mumubl-saved-post-title {
    font-size: 16px;
    color: #888;
    margin: 0 0 32px;
}
.mumubl-saved-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 48px;
}

.mumubl-share-section {
    text-align: left;
    border-top: 1px solid #e8e8e8;
    padding-top: 28px;
}
.mumubl-share-heading {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0 0 14px;
}
.mumubl-share-caption {
    background: #f8f8f8;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 14px;
}
.mumubl-share-caption p {
    margin: 0;
    font-size: 14px;
    color: #444;
    line-height: 1.6;
}
.mumubl-share-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.mumubl-share-btn {
    display: inline-block;
    padding: 9px 18px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s;
}
.mumubl-share-btn:hover { opacity: 0.85; }
.mumubl-share-btn--fb      { background: #1877F2; color: #fff; }
.mumubl-share-btn--x       { background: #000; color: #fff; }
.mumubl-share-btn--threads { background: #000; color: #fff; }
.mumubl-share-btn--instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: #fff;
}

/* ─── Sticky submit bar ──────────────────────────────────────────────────── */
.mumubl-submit-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    z-index: 100;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.mumubl-submit-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.mumubl-submit-status {
    font-size: 13px;
    color: #999;
    font-style: italic;
}
.mumubl-submit-actions { display: flex; gap: 10px; }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.mumubl-btn {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 9px 20px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    display: inline-block;
}
.mumubl-btn--primary           { background: #1a1a1a; color: #fff; }
.mumubl-btn--primary:hover     { background: #333; }
.mumubl-btn--secondary         { background: #f0f0f0; color: #333; }
.mumubl-btn--secondary:hover   { background: #e0e0e0; }
.mumubl-btn--ghost             { background: none; color: #aaa; padding: 9px 8px; font-size: 13px; }
.mumubl-btn--ghost:hover       { color: #333; }

/* ─── Fullscreen mode ────────────────────────────────────────────────────── */
#mumubl-editor-wrap.is-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    max-width: none;
    margin: 0;
    overflow-y: auto;
    background: #f4f4f2;
    padding: 32px 40px 100px;
    box-sizing: border-box;
}
#mumubl-editor-wrap.is-fullscreen .mumubl-editor-card,
#mumubl-editor-wrap.is-fullscreen .mumubl-details-panel,
#mumubl-editor-wrap.is-fullscreen .mumubl-notice {
    max-width: 740px;
    margin-left: auto;
    margin-right: auto;
}
#mumubl-editor-wrap.is-fullscreen .mumubl-submit-bar {
    z-index: 10001;
}

@media ( max-width: 600px ) {
    .mumubl-editor-card { padding: 20px 18px 16px; }
    .mumubl-title-input { font-size: 26px; }
    #mumubl-quill-editor, .ql-container.ql-bubble { font-size: 17px; }
    .mumubl-fields-grid { grid-template-columns: 1fr; }
    #mumubl-editor-wrap.is-fullscreen { padding: 16px 16px 100px; }
}
