/* Insight Editor — Aviation Sectional (web v5).
 *
 * The Quill snow theme and the shared authoring atoms live in
 * /css/aviation-forecasts.css. This file covers only the editor-specific
 * layout: the borderless title headline, cover-image control, metadata
 * fields, action rows, the inline-image modal, the "saving" indicator, and
 * the in-Quill map embed. All rules are scoped under .fm-aviation.
 */

.editor-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 32px 24px 64px;
}

/* ─── Title input — borderless display headline ─── */
.fm-aviation .editor-title-input {
    width: 100%;
    border: none;
    background: transparent;
    outline: none;
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: 900;
    font-size: 42px;
    line-height: 1.05;
    letter-spacing: -0.015em;
    text-transform: uppercase;
    color: var(--ink);
    padding: 8px 0 16px;
}
.fm-aviation .editor-title-input::placeholder { color: var(--ink-3); }

/* ─── Cover image ─── */
.fm-aviation .cover-image-section { margin-bottom: 24px; }
.fm-aviation .cover-image-upload {
    border: 1.5px dashed var(--ink);
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    color: var(--ink-2);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px; letter-spacing: 0.06em;
}
.fm-aviation .cover-image-upload:hover { background: var(--paper-3); color: var(--ink); }
.fm-aviation .cover-image-preview {
    position: relative;
    border: 1.5px solid var(--ink);
    margin-bottom: 16px;
}
.fm-aviation .cover-image-preview img {
    width: 100%; max-height: 320px; object-fit: cover; display: block;
}
.fm-aviation .cover-image-remove {
    position: absolute; top: 10px; right: 10px;
    width: 30px; height: 30px;
    background: var(--ink); color: var(--paper);
    border: none; cursor: pointer; font-size: 18px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
}
.fm-aviation .cover-image-remove:hover { background: var(--magenta); }

/* ─── Quill wrapper ─── */
/* Borderless: Quill's own toolbar + container carry the ink box (themed in
 * aviation-forecasts.css). Editor gets a taller writing area than the default. */
.fm-aviation .editor-wrapper { margin: 0; }
.fm-aviation .editor-wrapper .ql-editor { min-height: 520px; }

/* ─── Metadata fields (summary, external URL, tags) ─── */
.fm-aviation .editor-metadata {
    margin-top: 32px; padding-top: 24px;
    border-top: 1px solid var(--rule-2);
}
.fm-aviation .editor-metadata h3 {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--ink); font-weight: 600;
    margin: 0 0 8px;
    display: flex; align-items: center; gap: 10px;
}
.fm-aviation .metadata-field { margin-bottom: 18px; }
.fm-aviation .metadata-field label {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--ink-2); font-weight: 600;
    margin-bottom: 8px;
}
.fm-aviation .metadata-field input,
.fm-aviation .metadata-field textarea {
    width: 100%; padding: 10px 12px;
    background: var(--paper);
    border: 1.5px solid var(--ink); border-radius: 0;
    font-family: 'Inter', system-ui, sans-serif; font-size: 13px; line-height: 1.45;
    color: var(--ink); outline: none;
}
.fm-aviation .metadata-field input:focus,
.fm-aviation .metadata-field textarea:focus {
    box-shadow: inset 0 0 0 1px var(--ink); background: var(--paper-2);
}
.fm-aviation .metadata-field textarea { resize: vertical; min-height: 80px; }
.fm-aviation .metadata-field .field-hint {
    display: block;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 12px; color: var(--ink-3); margin-top: 6px;
}

/* ─── Action rows ─── */
.fm-aviation .editor-actions {
    display: flex; gap: 12px;
    margin-top: 32px; padding-top: 24px;
    border-top: 1px solid var(--rule-2);
}

/* ─── Inline-image upload modal ─── */
.fm-aviation .image-modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(15, 20, 25, 0.55); z-index: 200;
    align-items: center; justify-content: center; padding: 24px;
}
.fm-aviation .image-modal-overlay.active { display: flex; }
.fm-aviation .image-modal {
    width: 100%; max-width: 480px;
    background: var(--paper-2); border: 1.5px solid var(--ink);
    box-shadow: var(--shadow-dropdown);
    padding: 22px;
}
.fm-aviation .image-modal h3 {
    font-family: 'Roboto Condensed', sans-serif; font-weight: 900;
    font-size: 20px; text-transform: uppercase; color: var(--ink);
    margin: 0 0 16px;
}
.fm-aviation .image-modal-actions {
    display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px;
}

/* ─── "Saving…" indicator ─── */
.fm-aviation .editor-saving {
    position: fixed; top: 72px; right: 24px; z-index: 300;
    display: none;
    background: var(--ink); color: var(--paper);
    padding: 8px 14px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
}
.fm-aviation .editor-saving.active { display: block; }

/* ─── Map embed blot (inside the Quill editor) ─── */
.fm-aviation .ql-editor .map-embed {
    position: relative; margin: 18px 0;
    border: 1.5px solid var(--ink); background: var(--paper-3);
    overflow: hidden; cursor: default;
}
.fm-aviation .ql-editor .map-embed:hover { border-color: var(--azure); }
.fm-aviation .ql-editor .map-embed-snapshot { width: 100%; display: block; margin: 0; }
.fm-aviation .ql-editor .map-embed-overlay {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; background: var(--paper-2);
    border-top: 1.5px solid var(--ink);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
    font-weight: 600; color: var(--ink);
}
.fm-aviation .ql-editor .map-embed-overlay .material-icons { font-size: 18px; color: var(--ink); }
.fm-aviation .ql-editor .map-embed-remove {
    position: absolute; top: 8px; right: 8px;
    width: 28px; height: 28px;
    background: var(--ink); color: var(--paper);
    border: none; cursor: pointer; font-size: 16px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.15s;
}
.fm-aviation .ql-editor .map-embed:hover .map-embed-remove { opacity: 1; }
.fm-aviation .ql-editor .map-embed-remove:hover { background: var(--magenta); }

@media (max-width: 768px) {
    .editor-container { padding: 24px 16px 56px; }
    .fm-aviation .editor-title-input { font-size: 30px; }
}
