/* =========================================
   DESIGN 2: SOCIAL FEED UI (Правый скриншот)
   ========================================= */
:root {
    --primary: #0095F6; /* Instagram Blue */
    --primary-hover: #1877F2;
    --bg-gradient: #FAFAFA; /* Фирменный фон IG */
    --card-bg: #FFFFFF;
    --card-dark: #FFFFFF;
    --text-main: #262626; /* Темно-серый текст */
    --text-muted: #8E8E8E;
    --border-color: #DBDBDB; /* Строгая серая граница */
    --header-bg: #FFFFFF;
    --header-text: #262626;
    --radius: 8px; /* Небольшое скругление */
    --shadow-sm: none; /* Никаких теней */
    --shadow-md: none;
    --accent-green: #3897f0;
    --ig-gradient: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
    background: var(--bg-gradient);
    color: var(--text-main); 
    line-height: 1.5; 
    display: flex; flex-direction: column; min-height: 100vh; 
}

h1, h2, h3, h4 { font-weight: 600; line-height: 1.2; color: var(--header-text); }
a { text-decoration: none; color: var(--primary); }
a:hover { color: var(--text-main); }
ul { list-style: none; }
.icon { width: 1.25em; height: 1.25em; display: inline-block; vertical-align: -0.125em; fill: currentColor; }

/* Header */
.site-header { 
    background: var(--header-bg); border-bottom: 1px solid var(--border-color);
    position: sticky; top: 0; z-index: 1000; height: 60px; display: flex; align-items: center;
}
.header-container { width: 100%; max-width: 975px; margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.4rem; font-weight: 700; color: var(--header-text); font-family: 'Pacifico', cursive, sans-serif; /* Имитация рукописного лого */ }

/* Search */
.search-wrapper { flex-grow: 1; max-width: 268px; position: relative; display: none; }
@media(min-width: 768px) { .search-wrapper { display: block; } }
.search-input { 
    width: 100%; padding: 8px 16px; border-radius: 8px; border: none; 
    background: #EFEFEF; outline: none; font-size: 1rem; color: #262626; 
}
.search-input:focus { background: #fff; border: 1px solid var(--border-color); padding: 7px 15px;}
.search-btn { display: none; }
.search-results { position: absolute; top: 100%; left: 0; right: 0; background: #ffffff; border: 1px solid var(--border-color); border-radius: 6px; margin-top: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); display: none;}
.search-results.active { display: block; }
.search-item { display: block; padding: 12px 16px; border-bottom: 1px solid var(--border-color); }
.search-item-title { font-weight: 600; font-size: 0.9rem; color: var(--text-main); }
.search-item-desc { font-size: 0.8rem; color: var(--text-muted); }

/* Nav Buttons */
.header-nav { display: flex; align-items: center; gap: 22px; }
.nav-btn { background: none; border: none; color: var(--text-main); cursor: pointer; display: flex; align-items: center; gap: 0;}
.nav-btn span { display: none; } /* Скрываем текст кнопок в шапке, оставляем иконки */
.nav-btn svg { width: 24px; height: 24px; }
.btn-primary { 
    background-color: var(--primary); color: #fff; padding: 6px 16px; 
    border-radius: 8px; font-weight: 600; border: none; cursor: pointer; font-size: 0.9rem;
}
.btn-primary:hover { background-color: var(--primary-hover); color: #fff;}

/* Layout */
.layout-container { max-width: 975px; margin: 30px auto; padding: 0 20px; display: flex; flex-direction: column; gap: 30px; flex-grow: 1; width: 100%; }
@media(min-width: 860px) { .layout-container { flex-direction: row; } }
.main-content { flex-grow: 1; width: 100%; max-width: 600px;}
@media(min-width: 860px) { .main-content { width: 65%; } }
.sidebar { width: 100%; display: flex; flex-direction: column; gap: 20px; max-width: 320px; }
@media(min-width: 860px) { .sidebar { width: 35%; margin-top: 20px;} }

/* Sidebar Cards (Стиль рекомендаций) */
.card { background: transparent; border: none; padding: 0; margin-bottom: 20px; }
.card-dark { background: transparent; }
.widget-title { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); margin-bottom: 15px; border: none; padding: 0;}
.stat-list li { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 0.9rem;}
.stat-list li span:first-child { color: var(--text-main); font-weight: 600;}
.stat-list li span:first-child::before { display: none; }
.stat-list li span:last-child { color: var(--primary); font-weight: 600; cursor: pointer;}
.random-links li { margin-bottom: 10px; font-size: 0.85rem; }

/* Index Post List (Стиль Ленты) */
.page-title { display: none; } /* Скрываем заголовок страницы для реализма ленты */
.post-list { display: grid; grid-template-columns: 1fr; gap: 15px; }
.post-item { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 0; display: flex; flex-direction: column; }
.post-item-top { display: flex; gap: 12px; padding: 14px; align-items: center; border-bottom: 1px solid #EFEFEF;}

/* Имитация кольца Stories вокруг аватарки */
.post-avatar { 
    width: 42px; height: 42px; border-radius: 50%; object-fit: cover; 
    border: 2px solid transparent; 
    background: linear-gradient(white, white) padding-box, var(--ig-gradient) border-box;
    padding: 2px;
}
.post-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 0; }
.post-title a { color: var(--text-main); }
.post-desc { font-size: 0.9rem; color: var(--text-main); padding: 14px; margin-bottom: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 14px 10px; }
.tag { background: transparent; color: #00376B; font-size: 0.9rem; font-weight: 400; padding: 0; margin-right: 5px;}
.tag::before { content: "#"; }
.post-meta { display: flex; padding: 0 14px 14px; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;}

/* Single Post View & Messages */
.breadcrumb { display: none; }
.post-main-title { font-size: 1.5rem; margin-bottom: 16px; color: var(--text-main); font-weight: 400;}

/* Комментарии в стиле IG */
.message-block { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius); margin-bottom: 15px; display: flex; flex-direction: column; }
@media(min-width: 640px) { .message-block { flex-direction: row; } }
.user-panel { background: #fff; padding: 15px; display: flex; flex-direction: row; align-items: center; gap: 15px; border-bottom: 1px solid var(--border-color);}
@media(min-width: 640px) { .user-panel { width: 250px; border-bottom: none; border-right: 1px solid var(--border-color); flex-direction: row; align-items: flex-start; flex-shrink: 0; } }
.user-panel img { width: 56px; height: 56px; border-radius: 50%; padding: 2px; border: 1px solid var(--border-color); margin-bottom: 0;}
.user-name-side { font-weight: 600; font-size: 0.9rem; color: var(--text-main); margin-bottom: 2px;}
.user-stats { font-size: 0.8rem; color: var(--text-muted); }
.message-content { padding: 15px; flex-grow: 1; }
.message-header { display: flex; justify-content: space-between; margin-bottom: 10px; }
.message-date { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase;}
.message-text { font-size: 0.9rem; line-height: 1.4; color: var(--text-main); }
.badge { background: transparent; color: var(--text-muted); font-size: 0.8rem; font-weight: 600; padding: 0;}
.reply-badge { font-size: 0.8rem; background: transparent; color: var(--text-muted); border-left: 2px solid var(--border-color); padding-left: 10px; border-radius: 0; margin-bottom: 10px; display: block; font-weight: 400;}
.message-block.op-post { border: 1px solid var(--border-color); }

.comments-header { font-size: 1rem; font-weight: 600; margin: 30px 0 15px 0; color: var(--text-muted); border: none; }
.cta-box { background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius); padding: 20px; text-align: center; margin-top: 30px; }
.cta-title { font-size: 1rem; margin-bottom: 10px; font-weight: 600;}

/* Pagination & Footer */
.pagination { display: flex; justify-content: center; gap: 5px; margin-top: 30px; }
.page-link { padding: 8px 12px; border: 1px solid var(--border-color); background: #fff; color: var(--text-main); border-radius: 4px; font-weight: 600; font-size: 0.85rem;}
.page-link.active { background: var(--text-main); color: #fff; border-color: var(--text-main); }
.site-footer { background: #FAFAFA; border-top: none; padding: 30px 20px; margin-top: auto; font-size: 0.8rem;}
.footer-container { max-width: 975px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; text-align: center;}
@media(min-width: 768px) { .footer-container { flex-direction: row; justify-content: space-between; text-align: left; } }
.footer-title { display: none; }
.footer-text { color: var(--text-muted); }