/* Подключаем современные и выразительные шрифты */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@600;700&family=Work+Sans:wght@400;500;600&display=swap');

:root {
    /* Необруталистская палитра */
    --primary: #FF4911; /* Дерзкий оранжево-красный */
    --primary-hover: #E03E00;
    --bg-gradient: #F4F1EB; /* Цвет теплой ретро-бумаги */
    --card-bg: #FFFFFF;
    --card-dark: #FFE8A1; /* Яркий желтый для выделенных карточек */
    --text-main: #111111;
    --text-muted: #555555;
    --border-color: #111111; /* Жирный черный для контуров */
    --header-bg: #FFFFFF;
    --header-text: #111111;
    --radius: 0px; /* Убираем скругления или делаем их минимальными (оставим 6px для ретро-стиля) */
    --radius: 6px; 
    
    /* Жесткие тени - визитная карточка необрутализма */
    --shadow-sm: 2px 2px 0px 0px #111111;
    --shadow-md: 5px 5px 0px 0px #111111;
    --shadow-hover: 8px 8px 0px 0px #111111;
    --accent-green: #00C853;
}

::selection {
    background: var(--primary);
    color: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
    font-family: 'Work Sans', sans-serif; 
    background: var(--bg-gradient);
    color: var(--text-main); 
    line-height: 1.6; 
    display: flex; 
    flex-direction: column; 
    min-height: 100vh; 
}

h1, h2, h3, h4 { 
    font-family: 'Space Grotesk', sans-serif; 
    font-weight: 700; 
    line-height: 1.2; 
    color: var(--header-text); 
    letter-spacing: -0.02em;
}
a { text-decoration: none; color: var(--primary); transition: all 0.2s; font-weight: 600; }
a:hover { color: var(--primary-hover); }
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: 3px solid var(--border-color); /* Жирная линия */
    box-shadow: 0 4px 0px 0px rgba(17, 17, 17, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-container { 
    max-width: 1200px; margin: 0 auto; padding: 12px 20px; 
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 15px; 
}
.logo { font-size: 1.5rem; font-weight: 700; font-family: 'Space Grotesk', sans-serif; color: var(--header-text); display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: -1px; }
.logo:hover { color: var(--primary); transform: scale(1.02); }

/* Search */
.search-wrapper { flex-grow: 1; max-width: 450px; position: relative; display: none; }
@media(min-width: 768px) { .search-wrapper { display: block; } }
.search-input { 
    width: 100%; padding: 10px 40px 10px 16px; 
    border-radius: var(--radius); border: 2px solid var(--border-color); 
    background: #ffffff; outline: none; font-size: 0.95rem; color: var(--text-main); font-weight: 500;
    box-shadow: var(--shadow-sm); transition: all 0.2s ease;
}
.search-input:focus { 
    background: #E0F2FE; /* Светло-голубой при фокусе */
    transform: translate(-2px, -2px); 
    box-shadow: var(--shadow-md); 
}
.search-btn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-main); cursor: pointer; font-weight: bold; }
.search-results { 
    position: absolute; top: 100%; left: 0; right: 0; background: #ffffff; 
    border: 2px solid var(--border-color); border-radius: var(--radius); margin-top: 12px; 
    box-shadow: var(--shadow-md); max-height: 350px; overflow-y: auto; display: none; 
}
.search-results.active { display: block; }
.search-item { display: block; padding: 12px 16px; border-bottom: 2px solid var(--border-color); color: var(--text-main); }
.search-item:last-child { border-bottom: none; }
.search-item:hover { background-color: var(--card-dark); }
.search-item-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; color: var(--border-color); }
.search-item-desc { font-size: 0.8rem; color: var(--text-muted); }

/* Nav Buttons */
.header-nav { display: flex; align-items: center; gap: 15px; }
.nav-btn { background: none; border: none; color: var(--text-main); cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 6px; font-size: 0.95rem; transition: transform 0.2s;}
.nav-btn:hover { transform: translateY(-2px); color: var(--primary); }
.btn-primary { 
    background-color: var(--primary); color: #fff; padding: 8px 20px; 
    border-radius: var(--radius); font-weight: 700; font-family: 'Space Grotesk', sans-serif;
    border: 2px solid var(--border-color); cursor: pointer; 
    display: flex; align-items: center; gap: 8px; transition: all 0.2s ease; 
    box-shadow: var(--shadow-sm); text-transform: uppercase; letter-spacing: 1px;
}
.btn-primary:hover { 
    background-color: var(--primary-hover); 
    transform: translate(-3px, -3px); 
    box-shadow: var(--shadow-md); 
}

/* Layout */
.layout-container { max-width: 1200px; margin: 40px 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%; }
@media(min-width: 860px) { .main-content { width: 72%; } }
.sidebar { width: 100%; display: flex; flex-direction: column; gap: 24px; }
@media(min-width: 860px) { .sidebar { width: 28%; } }

/* Sidebar Cards */
.card { background: var(--card-bg); border: 2px solid var(--border-color); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-md); transition: transform 0.2s; }
.card:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-hover); }
.card-dark { background: var(--card-dark); }
.widget-title { font-size: 1.25rem; border-bottom: 3px solid var(--border-color); padding-bottom: 12px; margin-bottom: 16px; color: var(--header-text); font-family: 'Space Grotesk', sans-serif;}
.stat-list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; font-weight: 600; border-bottom: 2px dashed var(--border-color); font-size: 0.95rem;}
.stat-list li:last-child { border-bottom: none; }
.stat-list li span:first-child { color: var(--text-main); display: flex; align-items: center; gap: 8px; }
.stat-list li span:first-child::before { content: "►"; color: var(--primary); font-size: 0.8rem; }
.stat-list li span:last-child { background: #E9D5FF; padding: 2px 8px; border: 2px solid var(--border-color); border-radius: 4px; box-shadow: 2px 2px 0 0 #111; font-weight: 700; }
.random-links li { margin-bottom: 12px; font-weight: 600; font-size: 0.95rem; line-height: 1.4; display: flex; gap: 8px; align-items:flex-start;}
.random-links li::before { content: ""; display: block; width: 12px; height: 12px; background: var(--accent-green); border: 2px solid var(--border-color); border-radius: 50%; margin-top: 5px; flex-shrink: 0;}

/* Index Post List */
.page-title { font-size: 2.5rem; margin-bottom: 24px; color: var(--header-text); text-transform: uppercase; letter-spacing: -2px; }
.post-list { display: grid; grid-template-columns: 1fr; gap: 20px; }

.post-item { 
    background: var(--card-bg); border: 2px solid var(--border-color); 
    border-radius: var(--radius); padding: 24px; 
    display: flex; flex-direction: column; transition: all 0.2s;
    box-shadow: var(--shadow-md);
}
.post-item:hover { transform: translate(-4px, -4px); box-shadow: var(--shadow-hover); background: #FAFAFA;}

.post-item-top { display: flex; gap: 16px; margin-bottom: 16px; }
.post-avatar { width: 54px; height: 54px; border-radius: var(--radius); object-fit: cover; background: #C4B5FD; flex-shrink: 0; border: 2px solid var(--border-color); box-shadow: 2px 2px 0 0 #111;}
.post-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 8px; line-height: 1.2; font-family: 'Space Grotesk', sans-serif;}
.post-title a { color: var(--header-text); text-decoration: underline; text-decoration-color: transparent; transition: text-decoration-color 0.2s; }
.post-title a:hover { color: var(--header-text); text-decoration-color: var(--primary); }
.post-desc { font-size: 1rem; color: var(--text-muted); margin-bottom: 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.tags { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.tag { background-color: #FF90E8; color: #111; font-size: 0.75rem; font-weight: 700; padding: 4px 10px; border-radius: 4px; border: 2px solid var(--border-color); box-shadow: 2px 2px 0 0 #111; text-transform: uppercase; letter-spacing: 1px;}

.post-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 0.85rem; color: var(--text-main); font-weight: 600; align-items: center; border-top: 2px dashed var(--border-color); padding-top: 16px; }
.meta-item { display: flex; align-items: center; gap: 6px; }

/* Pagination */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 50px; }
.page-link { padding: 10px 16px; border: 2px solid var(--border-color); background: #ffffff; color: var(--text-main); border-radius: var(--radius); font-weight: 700; font-family: 'Space Grotesk', sans-serif; transition: all 0.2s; box-shadow: var(--shadow-sm); }
.page-link:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-md); background: var(--card-dark); }
.page-link.active { background: var(--primary); color: #fff; box-shadow: inset 3px 3px 0 0 rgba(0,0,0,0.2); transform: translate(2px, 2px); }

/* Single Post View */
.breadcrumb { font-size: 0.95rem; margin-bottom: 24px; color: var(--text-main); font-weight: 600; border: 2px solid var(--border-color); display: inline-block; padding: 4px 12px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm);}
.breadcrumb a { color: var(--text-main); text-decoration: underline; }
.breadcrumb a:hover { color: var(--primary); }
.post-main-title { font-size: 3rem; margin-bottom: 30px; word-break: break-word; color: var(--header-text); line-height: 1.1; letter-spacing: -2px; }

/* Message Blocks */
.message-block { 
    background: var(--card-bg); border: 2px solid var(--border-color); 
    border-radius: var(--radius); margin-bottom: 24px; display: flex; flex-direction: column; 
    box-shadow: var(--shadow-md); overflow: hidden;
}
@media(min-width: 640px) { .message-block { flex-direction: row; } }

.user-panel { 
    background: #A7F3D0; /* Пастельный мятный */
    padding: 24px 16px; border-bottom: 2px solid var(--border-color); 
    display: flex; flex-direction: row; align-items: center; gap: 15px; 
}
@media(min-width: 640px) { 
    .user-panel { 
        width: 180px; border-bottom: none; border-right: 2px solid var(--border-color); 
        flex-direction: column; text-align: center; flex-shrink: 0; 
    } 
}
.user-panel img { width: 80px; height: 80px; border-radius: var(--radius); object-fit: cover; margin-bottom: 12px; border: 2px solid var(--border-color); box-shadow: 4px 4px 0 0 #111; background: #fff;}
.user-name-side { font-weight: 700; font-size: 1.1rem; color: var(--header-text); margin-bottom: 4px; word-wrap: break-word; font-family: 'Space Grotesk', sans-serif;}
.user-stats { font-size: 0.8rem; color: var(--text-main); line-height: 1.5; font-weight: 600; background: #fff; border: 1px solid var(--border-color); padding: 4px; border-radius: 4px;}

.message-content { padding: 24px; flex-grow: 1; display: flex; flex-direction: column; justify-content: flex-start; }
.message-header { display: flex; justify-content: space-between; margin-bottom: 20px; align-items: center; flex-wrap: wrap; gap: 10px; border-bottom: 2px solid var(--border-color); padding-bottom: 12px;}
.message-date { font-size: 0.9rem; color: var(--text-main); display:flex; align-items:center; gap: 6px; font-weight: 600; background: #F4F1EB; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--border-color);}
.message-header a { color: var(--text-main); font-weight: 700; text-decoration: underline;}
.message-header a:hover { color: var(--primary); }
.message-text { font-size: 1.05rem; line-height: 1.7; color: var(--text-main); word-wrap: break-word; }

.badge { background: #38BDF8; color: #111; border: 2px solid var(--border-color); font-size: 0.75rem; padding: 2px 8px; border-radius: 4px; font-weight: 700; margin-top: 8px; display: inline-block; box-shadow: 2px 2px 0 0 #111;}
.reply-badge { font-size: 0.8rem; background: #FDE047; border: 2px solid var(--border-color); color: #111; padding: 6px 12px; border-radius: 4px; margin-bottom: 16px; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; box-shadow: 2px 2px 0 0 #111; }

.message-block.op-post { border: 3px solid var(--primary); box-shadow: 6px 6px 0 0 var(--primary); }
.message-block.op-post .user-panel { background: #FEE2E2; } /* Пастельный красный для автора */

.comments-header { font-size: 1.8rem; font-weight: 700; font-family: 'Space Grotesk', sans-serif; margin: 50px 0 24px 0; color: var(--header-text); border-bottom: 4px solid var(--border-color); padding-bottom: 12px; text-transform: uppercase;}
.comment { margin-bottom: 24px; scroll-margin-top: 80px; }

.cta-box { background: #FBCFE8; border: 3px dashed var(--border-color); border-radius: var(--radius); padding: 40px 24px; text-align: center; margin-top: 50px; box-shadow: var(--shadow-md); transition: transform 0.2s;}
.cta-box:hover { transform: scale(1.01) rotate(-1deg); }
.cta-title { font-size: 1.6rem; margin-bottom: 12px; color: var(--header-text); font-weight: 700; font-family: 'Space Grotesk', sans-serif;}
.cta-text { font-size: 1.05rem; color: var(--text-main); margin-bottom: 20px; font-weight: 500;}

/* Footer */
.site-footer { background: var(--header-bg); border-top: 3px solid var(--border-color); color: var(--text-main); padding: 50px 20px; margin-top: auto; font-size: 0.95rem; box-shadow: inset 0 4px 0 0 rgba(17,17,17,0.05);}
.footer-container { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1fr; gap: 40px; }
@media(min-width: 768px) { .footer-container { grid-template-columns: repeat(3, 1fr); } }
.footer-title { color: var(--header-text); font-size: 1.25rem; margin-bottom: 20px; font-weight: 700; font-family: 'Space Grotesk', sans-serif; border-bottom: 2px solid var(--border-color); display: inline-block; padding-bottom: 4px;}
.footer-text { line-height: 1.7; font-weight: 500;}