/* vsevkontakte.ru — стили
   Минималистичный, читаемый, mobile-first.
*/

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PT Sans", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #222;
    background: #f7f7f8;
    -webkit-font-smoothing: antialiased;
}
a { color: #2a5db0; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
}

/* === HEADER === */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e6e6e8;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    margin-bottom: 24px;
}
.site-header .container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 14px;
    padding-bottom: 14px;
}
.site-header .logo {
    font-size: 19px;
    font-weight: 700;
    color: #2a5db0;
    margin-right: 8px;
}
.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 14px;
}
.main-nav a {
    color: #444;
    padding: 4px 0;
}
.main-nav a:hover { color: #2a5db0; text-decoration: none; }

/* === FOOTER === */
.site-footer {
    background: #fff;
    border-top: 1px solid #e6e6e8;
    margin-top: 40px;
    padding: 24px 0;
    color: #666;
    font-size: 13px;
}
.site-footer p { margin: 4px 0; }
.site-footer .muted { color: #999; font-size: 12px; }

/* === PAGE HEADER === */
.page-header {
    margin-bottom: 28px;
}
.page-header h1 {
    font-size: 28px;
    margin: 0 0 6px 0;
    font-weight: 700;
}
.muted { color: #888; font-size: 13px; }

/* === CATEGORIES (главная) === */
.categories { margin-bottom: 40px; }
.categories h2 {
    font-size: 18px;
    margin: 0 0 14px 0;
    font-weight: 600;
}
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.cat-card {
    background: #fff;
    border: 1px solid #e6e6e8;
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: box-shadow 0.15s, transform 0.15s;
}
.cat-card:hover {
    box-shadow: 0 4px 14px rgba(42,93,176,0.10);
    transform: translateY(-1px);
    text-decoration: none;
}
.cat-card .cat-name { font-weight: 500; color: #222; }
.cat-card .cat-count {
    background: #eef2f8;
    color: #2a5db0;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 24px;
    text-align: center;
}

/* === FEATURED / GRID (карточки) === */
.featured h2 {
    font-size: 18px;
    margin: 0 0 14px 0;
    font-weight: 600;
}
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 40px;
}
.profile-card {
    background: #fff;
    border: 1px solid #e6e6e8;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-align: center;
    transition: box-shadow 0.15s, transform 0.15s;
    color: inherit;
}
.profile-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    transform: translateY(-2px);
    text-decoration: none;
}
.profile-card .avatar {
    aspect-ratio: 1 / 1;
    background: #eef0f3;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.profile-card .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.profile-card .avatar-fallback {
    font-size: 48px;
    color: #aaa;
    font-weight: 600;
}
.profile-card .info { padding: 10px 12px 14px; }
.profile-card .name {
    font-weight: 500;
    color: #222;
    margin-bottom: 2px;
    line-height: 1.3;
    /* усечение до 2 строк */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.profile-card .city {
    font-size: 12px;
    color: #888;
}

/* === PAGINATION === */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 24px 0 8px;
    justify-content: center;
}
.pagination a, .pagination .current {
    padding: 6px 12px;
    border: 1px solid #e6e6e8;
    border-radius: 4px;
    background: #fff;
    color: #2a5db0;
    font-size: 14px;
    min-width: 32px;
    text-align: center;
}
.pagination .current {
    background: #2a5db0;
    color: #fff;
    border-color: #2a5db0;
}
.pagination a:hover {
    text-decoration: none;
    background: #eef2f8;
}

/* === PROFILE (страница) === */
.profile {
    background: #fff;
    border: 1px solid #e6e6e8;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 24px;
}
.profile-header {
    display: flex;
    gap: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eef0f3;
    margin-bottom: 24px;
}
.profile-avatar {
    width: 140px;
    height: 140px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #eef0f3;
}
.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.profile-head-info { flex: 1; min-width: 0; }
.profile-head-info h1 {
    font-size: 26px;
    margin: 0 0 6px 0;
    font-weight: 700;
}
.profile-city { margin: 4px 0 12px 0; color: #555; font-size: 14px; }

.profile-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
@media (max-width: 720px) {
    .profile-body { grid-template-columns: 1fr; }
    .profile-header { flex-direction: column; }
    .profile-avatar { width: 100px; height: 100px; }
}
.profile-section h2 {
    font-size: 16px;
    margin: 0 0 10px 0;
    color: #2a5db0;
    font-weight: 600;
}
.profile-section dl {
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px 0;
}
.profile-section dt {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 10px;
}
.profile-section dd {
    margin: 0 0 0 0;
    color: #222;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.profile-photos {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #eef0f3;
}
.profile-photos h2 {
    font-size: 16px;
    margin: 0 0 12px 0;
    color: #2a5db0;
}
.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 6px;
}
.photos-grid a {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 4px;
    background: #eef0f3;
}
.photos-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.profile-source {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eef0f3;
    font-size: 12px;
}

/* === FRIENDS === */
.profile-friends {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #eef0f3;
}
.profile-friends h2 {
    font-size: 16px;
    margin: 0 0 12px 0;
    color: #2a5db0;
}
.friends-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.friend-card {
    background: #f2f4f7;
    color: #2a5db0;
    padding: 5px 10px;
    border-radius: 14px;
    font-size: 13px;
    border: 1px solid #e6e6e8;
    transition: background 0.15s;
}
a.friend-card:hover {
    background: #e6ecf5;
    text-decoration: none;
}

/* === SUMMARY (живой текст) === */
.profile-summary {
    background: #f7f9fc;
    border-left: 3px solid #2a5db0;
    border-radius: 0 6px 6px 0;
    padding: 16px 20px;
    margin: 0 0 24px 0;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
}
.profile-summary p {
    margin: 0 0 8px 0;
}
.profile-summary p:last-child {
    margin-bottom: 0;
}
.profile-summary .summary-lead {
    font-size: 17px;
    font-weight: 600;
    color: #1f2a3d;
    margin-bottom: 12px;
}
.profile-summary .summary-stats {
    color: #777;
    font-size: 14px;
    margin-top: 8px;
}

/* === MOBILE === */
@media (max-width: 600px) {
    .site-header .container { padding: 12px 16px; }
    .main-nav { gap: 10px; font-size: 13px; }
    .container { padding: 0 14px; }
    .page-header h1 { font-size: 22px; }
    .cat-grid { grid-template-columns: repeat(2, 1fr); }
    .grid { grid-template-columns: repeat(2, 1fr); }
    .profile { padding: 16px; }
    .profile-head-info h1 { font-size: 22px; }
}
