/* --- Общие стили страницы --- */
body {
    font-family: 'Inter', Arial, sans-serif;
    background: #f0f0f0;
    margin: 0;
    padding: 0;
}

/* --- Профиль --- */
.profile-container,
.user-posts {
    display: flex;
    justify-content: center;
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding-top: 50px;
}

.profile-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    padding: 20px;
    max-width: 900px;
    width: 90%;
    position: relative;
}

.settings-link {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    color: #333;
    text-decoration: none;
}

.profile-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.avatar-block {
    flex-shrink: 0;
}

.avatar-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info h2 {
    margin: 0;
}

.user-description {
    margin-top: 5px;
    color: #555;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.btn-create-post {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    font-weight: bold;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.3s;
}

.btn-create-post:hover {
    background-color: #45a049;
}

/* --- Посты пользователя --- */
.user-posts {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.user-post {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    max-width: 900px;
    width: 90%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: background 0.3s;
}

.user-post:hover {
    background: #f9f9f9;
}

.post-header {
    display: flex;
    justify-content: flex-end;
    padding: 10px 15px 0 15px;
    font-size: 0.9em;
    color: #888;
}

.post-image-container {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    padding: 0 10px;
    box-sizing: border-box;
}

.post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
}

.post-content {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 18px;
    line-height: 1.6;
    color: #333;
    padding: 10px;
    position: relative;
    display: -webkit-box;
    -webkit-line-clamp: 7; /* показываем 7 строк */
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    text-align: justify;
    text-align-last: left;
}

.post-content::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3em;
    background: linear-gradient(to bottom, transparent, #fff);
}

.post-content strong {
    display: block;
    margin-bottom: 10px;
    font-size: 1.1em;
}

/* --- Ссылка на весь пост --- */
.post-link-wrapper {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background 0.3s;
}

.post-link-wrapper:hover {
    background: #f9f9f9;
}

/* --- Футер поста (лайки/дизлайки/комментарии) --- */
.club-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.club-footer button {
    border: none;
    background: #fbfbfb;
    font-size: 15px;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 8px;
    transition: background 0.3s ease, transform 0.2s ease;
    flex: 1;
    margin: 0 5px;
    text-align: center;
}

.club-footer button:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.btn-like {
    color: green;
}

.btn-dislike {
    color: red;
}

.btn-comment {
    color: #333;
}

.club-user-info {
    max-width: 900px;
    width: 90%;
    margin: 0 auto;
}

/* На странице user.php запретим клубному топу раздуваться */
.profile-container.club-top-block {
    padding-top: 0 !important;
    align-items: stretch !important;
    max-width: none !important;
    width: 100% !important;
}


/* --- Адаптив --- */
@media (max-width: 700px) {
    .profile-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .action-buttons {
        margin-left: 0;
        flex-direction: column;
        gap: 8px;
    }

    .club-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .club-footer button {
        width: 100%;
        margin: 5px 0;
        text-align: center !important;
    }
}
