/* Базовые настройки как у garry.net */
:root {
    --bg-sidebar: #fbfbfb;
    --text-dark: #111111;
    --text-muted: #666666;
    --text-light: #bbbbbb;
    --link-blue: #0070f3;
    --border-color: #eeeeee;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-stack);
    background-color: #fff;
    color: var(--text-dark);
}

.layout {
    display: flex;
}

/* Сайдбар */
.sidebar {
    width: 250px;
    height: 100vh;
    position: fixed;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 32px 16px;
    overflow-y: auto;
    min-height: 100vh;
}

.brand {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 32px;
    padding-left: 12px;
}

.section-label {
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 24px 0 8px 12px;
}

.menu-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 14px;
    border-radius: 6px;
}

.menu-item i:not(.icon-ext) {
    width: 16px;
    height: 16px;
    margin-right: 12px;
}

.icon-ext {
    margin-left: auto;
    width: 12px;
    height: 12px;
    opacity: 0.3;
}

.menu-item:hover {
    background: #f0f0f0;
    color: var(--text-dark);
}

.menu-item.active {
    background: #000;
    color: #fff;
}

.menu-item.active i {
    color: #fff;
}

/* Контент */
.main-content {
    margin-left: 250px;
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 80px 40px;
}

article {
    max-width: 650px;
    width: 100%;
}

.text-block p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.text-block a {
    color: var(--link-blue);
    text-decoration: none;
}

.text-block a:hover {
    text-decoration: underline;
}

/* Секции (Where, Blogs) */
.info-section {
    display: flex;
    margin-top: 50px;
}

.info-aside {
    width: 100px;
    flex-shrink: 0;
    color: var(--text-light);
    font-size: 16px;
}

.info-body {
    flex: 1;
}

.info-body p {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 16px;
    line-height: 1.6;
}

/* Карта-заглушка */
.map-box {
    width: 100%;
    height: 250px;
    background: #e5e3df url('https://upload.wikimedia.org/wikipedia/commons/e/ec/OpenStreetMap_logo.png') center/cover;
    border: 1px solid #ddd;
    border-radius: 4px;
    position: relative;
}

.map-label {
    position: absolute;
    top: 12px;
    left: 12px;
    background: white;
    padding: 10px;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 2px;
}

.map-label a {
    color: var(--link-blue);
    text-decoration: none;
}

/* Мобильная адаптация */
@media (max-width: 800px) {
    .layout { 
        flex-direction: column; 
        height: auto;
        overflow: visible;
    }
    .sidebar { 
        position: relative; 
        width: 100%; 
        height: auto; 
        min-height: auto;
        max-height: 35vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        border-right: none; 
        border-bottom: 1px solid var(--border-color); 
        padding: 10px;
        background: var(--bg-sidebar);
    }
    
    .brand {
        font-size: 14px;
        margin-bottom: 10px;
        text-align: center;
    }
    .menu-item {
        padding: 6px 8px;
        font-size: 12px;
        margin-bottom: 1px;
    }
    .section-label {
        font-size: 9px;
        margin: 8px 0 4px 8px;
    }
    .main-content { 
        margin-left: 0; 
        padding: 30px 20px; 
        height: auto;
        overflow: visible;
    }
    .info-section { 
        flex-direction: column; 
        gap: 10px; 
    }
    .posts-list-column { 
        display: none; 
    }
    .post-view-column { 
        margin-left: 0; 
        padding: 30px 20px; 
    }
}

/* Разделение на 3 колонки */
@media (min-width: 801px) {
    .layout {
        display: flex;
        height: auto;
        overflow: visible;
    }

    .posts-page .layout {
        height: 100vh;
        overflow: hidden;
    }
}

/* Средняя колонка со списком */
.posts-list-column {
    width: 300px;
    border-right: 1px solid var(--border-color);
    margin-left: 250px; /* Отступ от первого сайдбара */
    display: flex;
    flex-direction: column;
    background: #fff;
}

.column-header {
    padding: 24px 16px;
    font-weight: 700;
    font-size: 14px;
}

.posts-scroll-area {
    overflow-y: auto;
    flex: 1;
}

/* Карточка поста в списке */
.post-card {
    padding: 16px;
    border-bottom: 1px solid #f9f9f9;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.post-card:hover { background: #f5f5f5; }

.post-card.active {
    background: #111;
    color: #fff;
    border-radius: 8px;
}

.post-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.post-card-title {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
}

.post-card-comments {
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.6;
}

.post-card-comments i { width: 12px; height: 12px; }

.post-card-date {
    font-size: 12px;
    color: var(--text-muted);
}

.post-card.active .post-card-date { color: #888; }

/* Правая колонка с самим текстом */
.post-view-column {
    flex: 1;
    overflow-y: auto;
    padding: 100px 60px;
    display: flex;
    justify-content: center;
}

.post-full {
    max-width: 700px;
    width: 100%;
}

.post-header h1 {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -0.03em;
}

.post-meta {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 60px;
}

.post-body p {
    font-size: 18px;
    line-height: 1.7;
    margin-bottom: 24px;
    color: #222;
}

.post-content a {
    color: var(--link-blue);
    text-decoration: none;
}

.post-content a:hover {
    text-decoration: underline;
}

details.spoiler {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    margin: 12px 0;
}

details.spoiler > summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-dark);
}

details.spoiler .spoiler-body {
    margin-top: 10px;
    color: var(--text-dark);
}

.format-toolbar {
    position: fixed;
    z-index: 2000;
    display: flex;
    gap: 6px;
    padding: 6px 8px;
    background: #111;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.format-toolbar button {
    background: transparent;
    border: none;
    color: #fff;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.format-toolbar button:hover {
    background: rgba(255,255,255,0.12);
}

.post-footer-icon {
    margin-top: 80px;
    display: flex;
    justify-content: center;
    border-top: 1px solid var(--border-color);
    padding-top: 40px;
    color: #eee;
}

.post-footer-icon i { width: 48px; height: 48px; }

/* Стили для лайков и комментариев */
.post-card-stats {
    display: flex;
    gap: 8px;
    font-size: 11px;
    opacity: 0.6;
}

.post-card-likes, .post-card-comments {
    display: flex;
    align-items: center;
    gap: 2px;
}

.post-actions {
    margin: 30px 0;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
}

.btn-like {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px 20px;
    cursor: pointer;
    transition: 0.3s;
    font-size: 14px;
}

        .btn-like:hover:not(.disabled) {
            background: #e9ecef;
        }

        .btn-like.liked {
            background: #ff4458;
            color: white;
            border-color: #ff4458;
            font-weight: bold;
        }

        .btn-like.disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

.comments-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.comments-section h3 {
    margin-bottom: 20px;
    color: var(--text-dark);
}

.comment-form {
    margin-bottom: 30px;
}

.comment-form textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    resize: vertical;
    font-family: inherit;
    margin-bottom: 10px;
}

.comment-form button {
    background: var(--link-blue);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.3s;
}

.comment-form button:hover {
    background: #0051cc;
}

.comments-list {
    margin-top: 20px;
}

.comment {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
    border: 1px solid rgba(0,0,0,0.08);
}

.comment-author-name {
    min-width: 0;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.comment-date {
    font-size: 12px;
    color: var(--text-muted);
}

.comment-content {
    line-height: 1.5;
    color: var(--text-dark);
}

/* Мобильная адаптация */
@media (max-width: 1000px) {
    .posts-list-column { display: none; } /* Прячем список на мелких экранах */
    .post-view-column { margin-left: 0; padding: 40px 20px; }
}