.post-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: Arial, sans-serif;
}

.post-layout {
    display: flex;
    justify-content: space-between;
    /* Распределяем пространство: автор слева, статья в центре, реклама справа */
    gap: 20px;
}

.author-post-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 15px 0;
    /* Отступы 15px сверху/снизу, 0 слева/справа (от края экрана 15px через padding container) */
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 10px;
    width: 25%;
    /* 25% ширины экрана */
    background: #fff;
    height: min-content;
    /* Высота по контенту */
}

.author-detail {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    background: #f9f9f9;
    border-radius: 8px;
    text-align: center;
}

.author-detail h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
}

.author-detail p {
    margin-bottom: 5px;
    font-size: 0.9em;
}

.author-avatar {
    max-width: 80px;
    height: auto;
    border-radius: 50%;
    margin-bottom: 10px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.post-main {
    width: 50%;
    /* 50% ширины экрана, в центре */
}

.ad-placeholder {
    width: 25%;
    height: min-content;
    padding: 15px;
    text-align: center;
    color: #aaa;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #666;
}

.post-title {
    font-size: 2em;
    margin-bottom: 10px;
    text-align: center;
}

.post-image-wrapper {
    margin-bottom: 20px;
    text-align: center;
}

.post-image {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    max-height: 400px;
    border-radius: 8px;
}

.post-content {
    line-height: 1.6;
    word-wrap: break-word;
    padding: 0 10px;
}

.post-rating-container {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 20px 0;
    justify-content: center;
}

.thumb-button {
    background: none;
    border: none;
    cursor: pointer;
    transition: fill 0.3s;
}

.thumb-button path {
    fill: none;
    stroke: #ccc;
    stroke-width: 2;
    transition: fill 0.3s, stroke 0.3s;
}

.thumb-button.active[data-is-like="true"] path {
    fill: green;
    stroke: green;
}

.thumb-button.active[data-is-like="false"] path {
    fill: red;
    stroke: red;
}

.table-of-contents {
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #ddd;
    background: #f9f9f9;
    border-radius: 8px;
}

.comments-section {
    margin-top: 40px;
    padding: 0 10px;
}

.comment-form {
    margin-top: 20px;
    padding: 0 10px;
}

.comment-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    font-family: Arial, sans-serif;
    font-size: 1em;
}

.comment-node {
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    color: #666;
}

.comment-body {
    margin-top: 10px;
}

.comment-text {
    margin-bottom: 10px;
}

.comment-rating-container {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 10px 0;
    justify-content: flex-start;
}

.comment-rating {
    font-size: 0.9em;
    color: #666;
}

.button-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.submit-btn,
.edit-btn,
.delete-btn,
.reply-button {
    padding: 8px 12px;
    background: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.3s;
}

.submit-btn:hover,
.edit-btn:hover,
.reply-button:hover {
    background: #0056b3;
}

.delete-btn {
    background: #dc3545;
}

.delete-btn:hover {
    background: #c82333;
}

.show-replies {
    background: #f0f0f0;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 4px;
    margin-top: 10px;
}

.replies {
    padding-left: 20px;
    margin-top: 10px;
}

.scroll-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #007bff;
    color: white;
    padding: 10px 15px;
    border-radius: 50%;
    text-decoration: none;
    transition: opacity 0.3s;
    opacity: 0.8;
}

.scroll-top:hover {
    opacity: 1;
}

.toggle-toc {
    width: 100%;
    padding: 10px;
    background: #f0f0f0;
    border: none;
    cursor: pointer;
    margin-bottom: 10px;
    border-radius: 4px;
}

.post-content svg {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px auto;
}

.post-content svg path {
    fill-rule: evenodd;
    stroke: none;
}

.hidden-button {
    display: none;
}

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

    .author-post-item {
        width: 100%;
        margin: 15px 0;
        padding: 10px;
    }

    .post-main {
        width: 100%;
    }

    .ad-placeholder {
        width: 100%;
        margin-top: 20px;
    }

    .post-meta {
        flex-direction: column;
        gap: 5px;
        align-items: center;
    }

    .post-image {
        max-height: 300px;
    }

    .post-title {
        font-size: 1.5em;
    }

    .submit-btn,
    .edit-btn,
    .delete-btn,
    .reply-button {
        width: 100%;
        margin-bottom: 5px;
    }

    .post-content,
    .comments-section,
    .comment-form {
        padding: 0;
    }

    .author-avatar {
        max-width: 80px;
    }

    .comment-textarea {
        width: 100%;
    }
}