/* ── Comment Media Upload – v1.0.1 ─────────────────────────────────── */

/* ── Textarea wrapper: button sits inside at bottom-left ──────────── */
.cmu-textarea-outer {
    position: relative;
    display: block;
    width: 100%;
}
.cmu-textarea-outer textarea {
    display: block;
    width: 100%;
    padding-bottom: 48px !important;
    box-sizing: border-box;
}
.cmu-textarea-outer .cmu-btn {
    position: absolute;
    bottom: 8px;
    left: 8px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
.cmu-textarea-outer .cmu-btn:hover,
.cmu-textarea-outer .cmu-btn:focus-visible {
    background: #fff !important;
    border-color: #888;
    color: #222;
}

/* Attach button */
.cmu-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1.5px solid #ccc;
    border-radius: 20px;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    line-height: 1.4;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    width: max-content;
}
.cmu-btn:hover,
.cmu-btn:focus-visible {
    background: #f4f4f4;
    border-color: #888;
    color: #222;
    outline: none;
}
.cmu-btn svg {
    flex-shrink: 0;
}

/* ── Preview area ───────────────────────────────────────────────────── */
.cmu-preview {
    min-height: 0;
}
.cmu-pre-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    background: #fafafa;
    max-width: 100%;
    box-sizing: border-box;
}
.cmu-pre-img {
    width: 72px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    flex-shrink: 0;
}
.cmu-pre-name {
    font-size: 12px;
    color: #666;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1 1 auto;
}
.cmu-pre-remove {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: #e74c3c;
    color: #fff;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.cmu-pre-remove:hover {
    background: #c0392b;
}

/* ── Frontend display ───────────────────────────────────────────────── */
.cmu-media {
    margin-top: 10px;
    max-width: 100%;
}

/* Image */
.cmu-img-link {
    display: block;
    max-width: 100%;
    width: fit-content;
}
.cmu-img {
    display: block;
    max-width: 100%;
    width: auto;
    max-height: 420px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    transition: opacity 0.2s;
}
.cmu-img:hover {
    opacity: 0.88;
}

/* Video */
.cmu-vid {
    display: block;
    max-width: 100%;
    width: 100%;
    max-height: 420px;
    border-radius: 8px;
    background: #111;
}

/* ── Mobile ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .cmu-btn {
        font-size: 12px;
        padding: 5px 11px;
    }
    .cmu-pre-img {
        width: 54px;
        height: 42px;
    }
    .cmu-pre-name {
        max-width: 110px;
    }
    .cmu-img {
        max-height: 260px;
    }
    .cmu-vid {
        max-height: 260px;
    }
}
