@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --grp-red:      #e63946;
    --grp-red-rgb:  230, 57, 70;
    --grp-dark:     #0d0d0f;
    --grp-dark2:    #16161a;
    --grp-dark3:    #1e1e24;
    --grp-dark4:    #26262e;
    --grp-border:   rgba(255,255,255,.07);
    --grp-border2:  rgba(255,255,255,.12);
    --grp-text:     #f0f0f5;
    --grp-muted:    #5a5a6a;
    --grp-muted2:   #8a8a9a;
    --grp-font:     'Manrope', system-ui, -apple-system, sans-serif;
}

/* ── Анимации ── */
@keyframes grpIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes grpShimmer {
    0%   { background-position: -400px 0; }
    100% { background-position:  400px 0; }
}
@keyframes grpScan {
    0%   { transform: translateY(-100%); }
    100% { transform: translateY(600%); }
}
@keyframes grpGlow {
    0%,100% { opacity: .35; }
    50%     { opacity: 1; }
}
@keyframes grpArrow {
    0%   { transform: translateX(0); }
    50%  { transform: translateX(4px); }
    100% { transform: translateX(0); }
}

/* ════════════════════════════════════════
   ОБЁРТКА
   ════════════════════════════════════════ */
.grp-wrap {
    margin: 48px 0 0;
    padding-top: 4px;
    font-family: var(--grp-font);
    -webkit-font-smoothing: antialiased;
    animation: grpIn .5s cubic-bezier(.4,0,.2,1) both;
}

/* ── Заголовок блока ── */
.grp-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.grp-header-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--grp-border2));
}
.grp-header-line--right {
    background: linear-gradient(270deg, transparent, var(--grp-border2));
}

.grp-header-icon {
    display: flex;
    align-items: center;
    color: var(--grp-red);
    filter: drop-shadow(0 0 5px rgba(var(--grp-red-rgb), .55));
    flex-shrink: 0;
}

.grp-title {
    font-size: 11px !important;
    font-weight: 800 !important;
    color: var(--grp-muted2) !important;
    letter-spacing: .12em !important;
    text-transform: uppercase !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap;
    flex-shrink: 0;
    border: none !important;
    background: none !important;
}

/* ════════════════════════════════════════
   СЕТКА КАРТОЧЕК
   ════════════════════════════════════════ */
.grp-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* 4 карточки = 2×2 */
.grp-grid:has(.grp-card:nth-child(4):last-child) {
    grid-template-columns: repeat(2, 1fr);
}

/* 3 карточки — первая широкая */
.grp-grid:has(.grp-card:nth-child(3):last-child) {
    grid-template-columns: repeat(3, 1fr);
}

/* 2 карточки */
.grp-grid:has(.grp-card:nth-child(2):last-child) {
    grid-template-columns: repeat(2, 1fr);
}

/* ════════════════════════════════════════
   КАРТОЧКА
   ════════════════════════════════════════ */
.grp-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--grp-dark2);
    border: 1px solid var(--grp-border);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none !important;
    color: var(--grp-text) !important;
    transition: border-color .2s, transform .2s, box-shadow .2s;
    will-change: transform;
}

/* Красная полоска сверху */
.grp-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--grp-red), transparent 70%);
    opacity: 0;
    transition: opacity .2s;
    z-index: 2;
}

.grp-card:hover {
    border-color: rgba(var(--grp-red-rgb), .28);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(var(--grp-red-rgb),.08);
    text-decoration: none !important;
    color: var(--grp-text) !important;
}
.grp-card:hover::before { opacity: 1; }

/* ── Угловые декоры ── */
.grp-card__corner {
    position: absolute;
    width: 8px; height: 8px;
    border-color: rgba(var(--grp-red-rgb), .2);
    border-style: solid;
    opacity: 0;
    transition: opacity .2s;
    z-index: 3;
}
.grp-card:hover .grp-card__corner { opacity: 1; }
.grp-card__corner--tl { top: 5px; left: 5px; border-width: 1px 0 0 1px; border-radius: 2px 0 0 0; }
.grp-card__corner--br { bottom: 5px; right: 5px; border-width: 0 1px 1px 0; border-radius: 0 0 2px 0; }

/* ── Картинка ── */
.grp-card__thumb {
    position: relative;
    width: 100%;
    padding-top: 52%;
    overflow: hidden;
    background: var(--grp-dark3);
    flex-shrink: 0;
}

.grp-card__thumb img {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s cubic-bezier(.4,0,.2,1);
}
.grp-card:hover .grp-card__thumb img { transform: scale(1.04); }

/* Placeholder без картинки */
.grp-card__thumb-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--grp-dark3);
}
.grp-card__thumb-placeholder svg {
    color: var(--grp-muted);
    opacity: .3;
}

/* Тёмный оверлей + CRT scan */
.grp-card__thumb-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.55) 100%);
    pointer-events: none;
    z-index: 1;
}
.grp-card__thumb-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(0,0,0,.04) 3px,
        rgba(0,0,0,.04) 4px
    );
}
/* Scan-line */
.grp-card__thumb-overlay::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    height: 30%;
    background: linear-gradient(180deg, transparent, rgba(var(--grp-red-rgb),.03) 50%, transparent);
    animation: grpScan 5s linear infinite;
    opacity: 0;
    transition: opacity .3s;
}
.grp-card:hover .grp-card__thumb-overlay::after { opacity: 1; }

/* ── Тело карточки ── */
.grp-card__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px 14px;
    flex: 1;
}

/* Мета: категория + дата */
.grp-card__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.grp-card__cat {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--grp-red);
    background: rgba(var(--grp-red-rgb), .1);
    border: 1px solid rgba(var(--grp-red-rgb), .2);
    padding: 2px 7px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.grp-card__date {
    font-size: 11px;
    color: var(--grp-muted2);
    font-weight: 500;
}

/* Заголовок */
.grp-card__title {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--grp-text) !important;
    line-height: 1.4 !important;
    letter-spacing: -.01em !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .15s;
}
.grp-card:hover .grp-card__title { color: var(--grp-text) !important; }

/* Фрагмент */
.grp-card__excerpt {
    font-size: 12px;
    color: var(--grp-muted2);
    line-height: 1.55;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* CTA */
.grp-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    color: var(--grp-red);
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-top: auto;
    padding-top: 6px;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity .2s, transform .2s;
}
.grp-card__cta svg { transition: transform .3s; }
.grp-card:hover .grp-card__cta {
    opacity: 1;
    transform: translateX(0);
}
.grp-card:hover .grp-card__cta svg {
    animation: grpArrow .7s ease infinite;
}

/* ════════════════════════════════════════
   МОБИЛКА
   ════════════════════════════════════════ */
@media (max-width: 680px) {
    .grp-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    .grp-card {
        flex-direction: row;
        border-radius: 14px;
    }

    .grp-card__thumb {
        width: 110px;
        min-width: 110px;
        padding-top: 0;
        height: auto;
        min-height: 90px;
        border-radius: 0;
        flex-shrink: 0;
    }
    .grp-card__thumb img {
        position: absolute;
        height: 100%;
    }

    .grp-card__body { padding: 10px 12px; gap: 4px; }
    .grp-card__title { font-size: 13px !important; -webkit-line-clamp: 2; }
    .grp-card__excerpt { display: none; }
    .grp-card__cta { opacity: 1; transform: none; padding-top: 4px; }

    .grp-wrap { margin-top: 32px; }
}

@media (max-width: 400px) {
    .grp-card__thumb { width: 90px; min-width: 90px; }
}
