/* ========== Просмотр заметки ========== */

.note-viewer .post-container {
    max-width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
}

.note-viewer .post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
    flex-wrap: wrap;
    gap: 16px;
    animation: pageFadeIn var(--duration-slow) var(--ease-out);
}

.note-viewer .post-title {
    font-size: 2rem;
    margin: 0;
    flex: 1;
    min-width: 200px;
    font-weight: 700;
    color: var(--color-heading);
    line-height: 1.25;
    letter-spacing: -0.03em;
}

.note-viewer .post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-top: 8px;
}

.note-viewer .post-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    flex-wrap: wrap;
    transition: all var(--duration-normal) var(--ease-out);
}

.note-viewer .post-actions.fixed {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
}

/* Кнопки действий */
.note-viewer .share-btn,
.note-viewer .edit-btn,
.note-viewer .toggle-access-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: var(--font-sans);
    transition: all var(--duration-fast) var(--ease-out);
    text-decoration: none;
}

.note-viewer .share-btn {
    background: #0ea5e9;
    color: white;
}

.note-viewer .share-btn:hover {
    background: #0284c7;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.35);
}

.note-viewer .share-btn.copied {
    background: var(--color-success);
}

.note-viewer .edit-btn {
    background: var(--color-primary);
    color: white;
}

.note-viewer .edit-btn:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
    text-decoration: none;
}

.note-viewer .toggle-access-btn.access-public {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.note-viewer .toggle-access-btn.access-public:hover {
    background: #fde68a;
}

.note-viewer .toggle-access-btn.access-private {
    background: var(--color-bg);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

.note-viewer .toggle-access-btn.access-private:hover {
    background: var(--color-border);
    color: var(--color-text);
}

/* Контент заметки */
#post-content,
.note-content {
    max-width: 100%;
    word-wrap: break-word;
    animation: pageFadeIn 0.5s var(--ease-out) 0.1s both;
}

#post-content h1 {
    font-size: 1.75rem;
    margin: 1.5rem 0 1rem;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-border);
    font-weight: 700;
    color: var(--color-heading);
    letter-spacing: -0.02em;
}

#post-content h2 {
    font-size: 1.375rem;
    margin: 1.25rem 0 0.75rem;
    font-weight: 600;
    color: var(--color-heading);
    letter-spacing: -0.01em;
}

#post-content h3 {
    font-size: 1.125rem;
    margin: 1rem 0 0.5rem;
    font-weight: 600;
    color: var(--color-text);
}

#post-content p {
    margin: 0.875rem 0;
    line-height: var(--line-height-reading);
    font-size: var(--text-reading);
    color: var(--color-text);
}

#post-content a {
    color: var(--color-primary);
    text-decoration: none;
    border-bottom: 1px solid rgba(59, 130, 246, 0.35);
    transition: all var(--duration-fast);
    font-weight: 500;
}

#post-content a:hover {
    color: var(--color-primary-hover);
    border-bottom-color: var(--color-primary);
}

#post-content strong {
    font-weight: 700;
    color: var(--color-heading);
}

#post-content em {
    font-style: italic;
    color: var(--color-text-muted);
}

#post-content ul,
#post-content ol {
    margin: 0.875rem 0;
    padding-left: 1.75rem;
}

#post-content li {
    margin: 0.375rem 0;
    line-height: 1.7;
}

#post-content blockquote {
    margin: 1.25rem 0;
    padding: 12px 20px;
    border-left: 4px solid var(--color-primary);
    background: var(--color-bg-subtle);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--color-text-muted);
    font-style: italic;
}

#post-content img {
    display: block;
    margin: 1.5rem auto;
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: transform var(--duration-normal) var(--ease-out);
}

#post-content img:hover {
    transform: scale(1.01);
}

#post-content hr {
    border: none;
    height: 1px;
    background: var(--color-border);
    margin: 2rem 0;
}

.note-viewer .back-to-blog {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
}

.note-viewer .back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-primary);
    text-decoration: none;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    transition: all var(--duration-fast) var(--ease-out);
}

.note-viewer .back-link:hover {
    background: var(--color-primary-light);
    border-color: var(--color-primary);
    transform: translateX(-2px);
}

.note-viewer .back-link::before {
    content: '←';
    font-size: 1rem;
}

@media (max-width: 768px) {
    .note-viewer .post-header {
        flex-direction: column;
    }

    .note-viewer .post-title {
        font-size: 1.5rem;
    }

    .note-viewer .post-actions.fixed {
        top: 10px;
        right: 10px;
        left: 10px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .note-viewer .post-title {
        font-size: 1.35rem;
    }

    .note-viewer .share-btn,
    .note-viewer .edit-btn,
    .note-viewer .toggle-access-btn {
        font-size: 0.75rem;
        padding: 8px 12px;
    }
}
