/* Блок-карточка */
.block-card {
    margin: 40px 0;
    border: 1px solid #e0e5eb;
    border-radius: 12px;
    background: #f8faff;
    transition: all 0.25s ease-in-out;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.block-card:hover {
    box-shadow: 0 8px 25px rgba(0, 50, 150, 0.12);
    border-color: #b0c4de;
    background: #ffffff;
}

.block-card-link {
    display: block;
    text-decoration: none !important;
    color: inherit !important;
}

.block-card-inner {
    display: flex;
    align-items: stretch;
    min-height: 120px;
}

/* Фото */
.block-card-image {
    flex: 0 0 180px;
    min-height: 120px;
    background: #eef2f7;
    overflow: hidden;
}

.block-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Контентная часть */
.block-card-content {
    flex: 1;
    padding: 20px 25px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 20px;
    position: relative;
}

.block-card-header {
    flex: 1 1 60%;
}

.block-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0b1e33;
    line-height: 1.3;
    display: block;
}

.block-card-description {
    font-size: 0.95rem;
    font-weight: 400;
    color: #4a5b6b;
    line-height: 1.5;
    margin-top: 6px;
    flex-basis: 100%;
    order: 3;
}

/* Кнопка */
.block-card-action {
    flex: 0 0 auto;
    margin-left: auto;
}

.block-card-button {
    display: inline-block;
    font-weight: 600;
    font-size: 0.95rem;
    color: #1a73e8; /* Акцентный синий */
    letter-spacing: 0.3px;
    white-space: nowrap;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.2s;
    background: rgba(26, 115, 232, 0.06);
}

.block-card-link:hover .block-card-button {
    background: rgba(26, 115, 232, 0.14);
}

/* Вертикальная мобильная раскладка */
@media (max-width: 640px) {
    .block-card-inner {
        flex-direction: column;
    }

    .block-card-image {
        flex: 0 0 200px;
        width: 100%;
        min-height: unset;
    }

    .block-card-content {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px 18px;
    }

    .block-card-header {
        flex: 1 1 auto;
        width: 100%;
    }

    .block-card-title {
        font-size: 1.1rem;
    }

    .block-card-description {
        margin-top: 4px;
        font-size: 0.9rem;
        order: 2;
    }

    .block-card-action {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }

    .block-card-button {
        white-space: normal;
        text-align: right;
    }
}

/* Стили для редактора */
.blockcard-wrapper {
    margin: 20px 0;
    border: 2px dashed #3b82f6;
    border-radius: 8px;
    padding: 4px;
    background: #f0f7ff;
    cursor: pointer;
}

.blockcard-wrapper:hover {
    border-color: #2563eb;
    background: #e6f0ff;
}

.blockcard-container {
    display: flex;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
}

.blockcard-image {
    flex: 0 0 150px;
    min-height: 100px;
    background: #e5e7eb;
}

.blockcard-content {
    flex: 1;
    padding: 15px 20px;
}

.blockcard-title {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
}

.blockcard-description {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #4b5563;
}

.blockcard-button {
    display: inline-block;
    color: #3b82f6;
    font-weight: 500;
}

/* Стили для карточек на фронте */
.article-card {
    margin: 30px 0;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.article-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    border-color: #3b82f6;
    transform: translateY(-3px);
}

.card-link {
    display: flex;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.card-image {
    flex: 0 0 200px;
    min-height: 160px;
    background: #f3f4f6;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-content {
    flex: 1;
    padding: 22px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0b1e33;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.card-description {
    font-size: 0.95rem;
    color: #4b5563;
    line-height: 1.6;
    margin: 0 0 14px 0;
}

.card-button {
    display: inline-block;
    color: #3b82f6;
    font-weight: 600;
    font-size: 0.95rem;
    align-self: flex-start;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s;
}

.card-link:hover .card-button {
    border-bottom-color: #3b82f6;
}

.card-compact .card-content {
    justify-content: center;
}
.card-compact .card-title {
    margin-bottom: 0;
}

/* Мобильная версия */
@media (max-width: 600px) {
    .card-link {
        flex-direction: column;
    }
    
    .card-image {
        flex: 0 0 auto;
        height: 200px;
        width: 100%;
    }
    
    .card-content {
        padding: 18px 20px;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    .card-button {
        align-self: flex-end;
        margin-top: 4px;
    }
}

/* центрирование по вертикали */
.block-card:has(.block-card-description:empty) .block-card-content {
    align-items: center;
}
.block-card-description:empty {
    display: none;
}

.article-card {
    margin: 30px 0;
    border: 2px solid #3b82f6;
    border-radius: 12px;
    padding: 4px;
    background: #f0f7ff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}
.article-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    border-color: #2563eb;
}
.card-link {
    display: flex;
    text-decoration: none;
    color: inherit;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    min-height: 120px;
}
.card-image {
    flex: 0 0 180px;
    background: #e5e7eb;
}
.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.card-content {
    flex: 1;
    padding: 18px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.card-title {
    margin: 0 0 6px 0;
    font-size: 18px;
    font-weight: 700;
    color: #0b1e33;
}
.card-description {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #4b5563;
    line-height: 1.5;
}
.card-button {
    display: inline-block;
    color: #3b82f6;
    font-weight: 600;
    font-size: 15px;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s;
}
.card-link:hover .card-button {
    border-bottom-color: #3b82f6;
}
.card-compact .card-content {
    justify-content: center;
}
@media (max-width: 600px) {
    .card-link {
        flex-direction: column;
    }
    .card-image {
        flex: 0 0 auto;
        height: 200px;
        width: 100%;
    }
    .card-content {
        padding: 16px 18px;
    }
}

.article-card {
    margin: 30px 0;
    border: 2px solid #3b82f6;
    border-radius: 12px;
    padding: 4px;
    background: #f0f7ff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}
.article-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    border-color: #2563eb;
}
.card-link {
    display: flex;
    text-decoration: none;
    color: inherit;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    min-height: 120px;
}
.card-image {
    flex: 0 0 180px;
    background: #e5e7eb;
}
.card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.card-content {
    flex: 1;
    padding: 18px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.card-title {
    margin: 0 0 6px 0;
    font-size: 18px;
    font-weight: 700;
    color: #0b1e33;
}
.card-button {
    display: inline-block;
    color: #3b82f6;
    font-weight: 600;
    font-size: 15px;
    border-bottom: 2px solid transparent;
}
.card-link:hover .card-button {
    border-bottom-color: #3b82f6;
}
.card-compact .card-content {
    justify-content: center;
}
@media (max-width: 600px) {
    .card-link {
        flex-direction: column;
    }
    .card-image {
        flex: 0 0 auto;
        height: 200px;
        width: 100%;
    }
}