/*
 * Список анкет: сетка, карточка, кнопки под списком.
 *
 * Класс .posts-wrap оставлен — в него дописывает карточки getMorePosts
 * из script.js. Остальное своё, с префиксом pc- (post card).
 */

.posts-wrap {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px;
    margin: 0 0 26px;
}

/* ── Карточка ─────────────────────────────────────────────────────── */

.pc {
    --pc-ink: #14132B;
    --pc-muted: #77768F;
    --pc-line: #EAEAF3;
    --pc-soft: #F6F6FB;
    --pc-brand: #4F4BFF;
    --pc-brand-light: #6C69FF;

    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0;
    border: 1px solid var(--pc-line);
    border-radius: 20px;
    background: #fff;
    overflow: hidden;
    font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--pc-ink);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.pc *,
.pc *::before,
.pc *::after {
    box-sizing: border-box;
}

.pc:hover {
    transform: translateY(-4px);
    border-color: #DDDCFF;
    box-shadow: 0 26px 46px -28px rgba(20, 19, 43, .55);
}

.pc a {
    text-decoration: none;
    color: inherit;
}

.pc :focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 75, 255, .35);
    border-radius: 10px;
}

/* Фотография */

.pc__photo {
    position: relative;
    aspect-ratio: 3 / 4;
    background: var(--pc-soft);
    overflow: hidden;
}

.pc__photo-link {
    display: block;
    height: 100%;
}

.pc__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .55s cubic-bezier(.2, .8, .2, 1);
}

.pc:hover .pc__image {
    transform: scale(1.05);
}

.pc__photo::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 45%;
    background: linear-gradient(180deg, rgba(14, 13, 34, 0), rgba(14, 13, 34, .55));
    pointer-events: none;
}

.pc__stub {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    font-size: 54px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #6C69FF, #FF5C7A);
}

.pc__badges {
    position: absolute;
    z-index: 2;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pc__badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .01em;
    color: #fff;
    backdrop-filter: blur(6px);
}

.pc__badge--check {
    background: linear-gradient(135deg, #23C08B, #12A374);
}

.pc__badge--video {
    background: rgba(14, 13, 34, .62);
    border: 1px solid rgba(255, 255, 255, .2);
}

.pc__price {
    position: absolute;
    z-index: 2;
    left: 12px;
    bottom: 12px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(6px);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -.01em;
    white-space: nowrap;
    box-shadow: 0 8px 20px -12px rgba(20, 19, 43, .8);
}

/* Текст */

.pc__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 15px 15px;
    flex: 1 1 auto;
}

.pc__head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.pc__name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 15.5px;
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color .18s ease;
}

.pc:hover .pc__name {
    color: var(--pc-brand);
}

.pc__age {
    flex: 0 0 auto;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--pc-soft);
    font-size: 12px;
    font-weight: 700;
    color: var(--pc-muted);
    font-variant-numeric: tabular-nums;
}

.pc__metro {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    color: var(--pc-muted);
    transition: color .18s ease;
}

.pc__metro svg {
    flex: 0 0 auto;
}

/* Длинное название станции не должно ломать высоту карточки. */
.pc__metro span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

a.pc__metro:hover {
    color: var(--pc-brand);
}

/* Параметры и метки */

.pc__specs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
    color: var(--pc-muted);
}

.pc__dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #C9C8DA;
}

.pc__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.pc__tag {
    max-width: 100%;
    padding: 4px 9px;
    border-radius: 8px;
    background: var(--pc-soft);
    font-size: 11px;
    font-weight: 600;
    color: #3D3C5C;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pc__tag--night {
    background: #EFEFFF;
    color: #2E2BC7;
}

.pc__reviews {
    position: absolute;
    z-index: 2;
    right: 12px;
    bottom: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(14, 13, 34, .62);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
}

/* Кнопки */

.pc__actions {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: auto;
    padding-top: 4px;
}

.pc__phone,
.pc__more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 13px;
    font-size: 13.5px;
    font-weight: 700;
    white-space: nowrap;
    transition: transform .18s ease, box-shadow .18s ease, color .18s ease, border-color .18s ease;
}

.pc__phone {
    color: #fff;
    background: linear-gradient(135deg, #6C69FF 0%, #4F4BFF 100%);
    box-shadow: 0 12px 24px -14px rgba(79, 75, 255, .95);
    font-variant-numeric: tabular-nums;
}

.pc__phone:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 16px 30px -14px rgba(79, 75, 255, 1);
}

.pc__more {
    color: var(--pc-muted);
    border: 1px solid var(--pc-line);
    background: #fff;
}

.pc__more:hover {
    color: var(--pc-brand);
    border-color: #C9C7FF;
}

/* ── Заголовок списка и кнопки под ним ────────────────────────────── */

.big-bold-text {
    font-size: clamp(26px, 4.4vw, 40px);
    line-height: 1.14;
    letter-spacing: -.02em;
    margin-bottom: 0;
}

.total-h1-wrap {
    gap: 12px;
    margin: 6px 0 20px;
}

.total-h1-wrap .total {
    padding: 7px 14px;
    border-radius: 999px;
    background: #EFEFFF;
    color: #2E2BC7;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.section-title {
    font-size: clamp(20px, 3vw, 26px);
    font-weight: 700;
    letter-spacing: -.02em;
    color: #14132B;
    margin: 30px 0 16px;
}

.get-more {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 280px;
    min-height: 52px;
    margin: 0 auto 22px;
    padding: 0 24px;
    border-radius: 15px;
    background: #fff;
    border: 1px solid #EAEAF3;
    color: #14132B;
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    transition: color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.get-more:hover {
    color: #4F4BFF;
    border-color: #C9C7FF;
    transform: translateY(-2px);
    box-shadow: 0 18px 34px -26px rgba(20, 19, 43, .9);
}

.get-more.is-loading {
    color: #77768F;
    pointer-events: none;
}

/* Постраничная навигация остаётся ради ссылок для поиска. */
.pagination {
    gap: 6px;
    margin-bottom: 26px;
}

.pagination .page-item .page-link {
    min-width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #EAEAF3;
    border-radius: 12px;
    color: #3D3C5C;
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 600;
    transition: color .18s ease, border-color .18s ease, background .18s ease;
}

.pagination .page-item .page-link:hover {
    color: #4F4BFF;
    border-color: #C9C7FF;
    background: #F6F6FB;
}

.pagination .page-item.active .page-link {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #6C69FF, #4F4BFF);
    text-decoration: none;
}

.pagination .page-item.disabled .page-link {
    opacity: .45;
}

/* ── Экраны ───────────────────────────────────────────────────────── */

@media (max-width: 767px) {
    .posts-wrap {
        grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
        gap: 12px;
    }

    .pc {
        border-radius: 16px;
    }

    .pc__body {
        padding: 11px 12px 12px;
        gap: 6px;
    }

    .pc__name {
        font-size: 14px;
    }

    .pc__phone,
    .pc__more {
        min-height: 38px;
        padding: 0 8px;
        gap: 6px;
        font-size: 12px;
    }

    .pc__badge {
        font-size: 9.5px;
        padding: 4px 7px;
    }

    .pc__specs {
        font-size: 11px;
        gap: 5px;
    }

    /* В узкой карточке метки встают друг под друга — оставляем одну. */
    .pc__tag:nth-child(n+2) {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pc,
    .pc * {
        transition: none !important;
    }
}
