/* ═══════════════════════════════════════════════════════
   Memory Perspectives — mp-* prefix
   ═══════════════════════════════════════════════════════ */

/* ── Section container ── */
.mp-section {
    border-top: 1px solid #dedede;
    padding: 20px 0 8px;
    margin-top: 16px;
}

.mp-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.mp-header-icon {
    font-size: 22px;
    color: #EA794C;
    margin-right: 8px;
}

.mp-header-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.mp-manage-btn {
    background: none;
    border: 1px solid #dedede;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #757575;
    transition: all 0.2s;
}

.mp-manage-btn:hover {
    color: #EA794C;
    border-color: #EA794C;
}

/* ── Perspective block ── */
.mp-block {
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    transition: opacity 0.2s;
}

.mp-author-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.mp-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    margin-right: 10px;
    flex-shrink: 0;
}

.mp-avatar-sm {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    margin-right: 8px;
    flex-shrink: 0;
}

.mp-author-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mp-author-name {
    font-family: 'SFPROTEXT', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.mp-author-date {
    font-family: 'SFPROTEXT', sans-serif;
    font-size: 12px;
    color: #757575;
}

.mp-actions {
    display: flex;
    gap: 4px;
}

.mp-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #757575;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.mp-action-btn:hover {
    color: #EA794C;
    background: rgba(234, 121, 76, 0.1);
}

.mp-action-danger:hover {
    color: #df361f;
    background: rgba(223, 54, 31, 0.1);
}

.mp-action-btn .material-icons-outlined {
    font-size: 18px;
}

/* ── Content + Images ── */
.mp-content {
    font-family: 'SFPROTEXT', sans-serif;
    font-size: 14px;
    line-height: 22px;
    color: #333;
    margin-bottom: 8px;
}

/* Perspective text comes from a plain textarea; ugc_paragraphs wraps its
   blank-line paragraphs at render time. */
.mp-content p {
    margin: 0 0 8px;
}

.mp-content p:last-child {
    margin-bottom: 0;
}

.mp-image-strip {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    /* ink-soft keeps the thumb at 3:1 or better on the card in both themes; ink-faint does not. */
    --mp-strip-thumb: var(--ds-ink-soft);
    --mp-strip-track: transparent;
    scrollbar-width: thin;
    scrollbar-color: var(--mp-strip-thumb) var(--mp-strip-track);
}

/* Only where scrollbar-color is missing: there scrollbar-width: thin would switch off the WebKit styling. */
@supports not (scrollbar-color: auto) {
    .mp-image-strip {
        scrollbar-width: auto;
    }

    .mp-image-strip::-webkit-scrollbar {
        height: var(--ds-space-1);
    }

    .mp-image-strip::-webkit-scrollbar-thumb {
        background: var(--mp-strip-thumb);
        border-radius: var(--ds-radius-pill);
    }

    .mp-image-strip::-webkit-scrollbar-track {
        background: var(--mp-strip-track);
    }
}

.mp-image-thumb {
    width: 64px;
    height: 64px;
    min-width: 64px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    transition: opacity 0.2s;
}

.mp-image-thumb:hover {
    opacity: 0.85;
}

/* ── Empty state ── */
.mp-empty {
    text-align: center;
    padding: 16px;
    color: #999;
    font-size: 14px;
    font-family: 'SFPROTEXT', sans-serif;
}

/* ── Add note: why the viewer cannot add one now (turned off, later, restricted) ── */
.mp-add-note {
    margin: 0;
    padding: var(--ds-space-2) 0;
    text-align: center;
    color: var(--ds-ink-soft);
    font-size: var(--ds-font-size-caption);
}

/* ── CTA button ── */
.mp-cta {
    text-align: center;
    padding: 8px 0;
}

.mp-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border: 2px solid #EA794C;
    border-radius: 500px;
    background: transparent;
    color: #EA794C;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.mp-cta-btn:hover {
    background: #EA794C;
    color: white;
}

.mp-cta-btn .material-icons-outlined {
    font-size: 18px;
}

/* ── Inline editor ── */
.mp-editor {
    background: #fafafa;
    border: 1px solid #dedede;
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
}

.mp-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.mp-editor-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.mp-editor-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #757575;
    padding: 2px;
}

.mp-editor-textarea {
    width: 100%;
    border: 1px solid #dedede;
    border-radius: 6px;
    padding: 10px 12px;
    font-family: 'SFPROTEXT', sans-serif;
    font-size: 14px;
    line-height: 20px;
    resize: vertical;
    min-height: 80px;
    box-sizing: border-box;
}

.mp-editor-textarea:focus {
    outline: none;
    border-color: #EA794C;
}

.mp-editor-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0;
}

.mp-editor-image-preview {
    position: relative;
    width: 56px;
    height: 56px;
}

.mp-editor-image-thumb {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
}

.mp-editor-image-remove {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #df361f;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.mp-editor-image-remove .material-icons-outlined {
    font-size: 12px;
}

.mp-editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.mp-editor-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: #757575;
    font-size: 13px;
    font-family: 'SFPROTEXT', sans-serif;
    transition: color 0.2s;
}

.mp-editor-upload-btn:hover {
    color: #EA794C;
}

.mp-editor-upload-btn .material-icons-outlined {
    font-size: 20px;
}

.mp-editor-submit-group {
    display: flex;
    gap: 8px;
}

.mp-editor-cancel {
    padding: 6px 16px;
    border: 1px solid #dedede;
    border-radius: 6px;
    background: white;
    color: #757575;
    font-family: 'SFPROTEXT', sans-serif;
    font-size: 13px;
    cursor: pointer;
}

.mp-editor-submit {
    padding: 6px 16px;
    border: none;
    border-radius: 6px;
    background: #EA794C;
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.mp-editor-submit:hover {
    background: #f37442;
}

/* ── Author: Allow perspectives ── */
.mp-settings {
    margin: 0 0 var(--ds-space-3);
}

.mp-settings-label {
    font-family: 'Montserrat', sans-serif;
    font-size: var(--ds-font-size-bodySm);
    font-weight: 600;
    color: var(--ds-ink);
}

.mp-toggle-label {
    display: flex;
    align-items: center;
    gap: var(--ds-space-2);
    min-height: var(--ds-space-12);
    cursor: pointer;
}

.mp-toggle-label input[type="checkbox"] {
    width: var(--ds-space-5);
    height: var(--ds-space-5);
    margin: 0;
    accent-color: var(--ds-brand-strong);
}

.mp-toggle-text {
    margin: 0;
    font-family: 'SFPROTEXT', sans-serif;
    font-size: var(--ds-font-size-caption);
    color: var(--ds-ink-soft);
}

/* ── Manage panel ── */
.mp-manage-panel {
    background: white;
    border: 1px solid #dedede;
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
}

.mp-manage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.mp-manage-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.mp-manage-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #757575;
}

.mp-manage-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
}

.mp-manage-author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'SFPROTEXT', sans-serif;
    font-size: 14px;
    color: #333;
}

.mp-manage-empty {
    text-align: center;
    color: #999;
    font-size: 14px;
    padding: 12px;
}

/* ── Image lightbox ── */
.mp-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mp-lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

/* ── Mobile ── */
@media (max-width: 812px) {
    .mp-section {
        padding: 16px 0 4px;
        margin-top: 12px;
    }

    .mp-block {
        padding: 10px 12px;
        margin-bottom: 8px;
    }

    .mp-editor {
        padding: 12px;
    }
}

/* ── Editor error: the refusal the server gave, kept beside the text the member typed ── */
.mp-editor-error {
    margin: var(--ds-space-2) 0 0;
    color: var(--ds-error-text);
    font-size: var(--ds-font-size-caption);
}
