/* Bento Grid Services */
.rovno-services-block {
    padding: 0 32px;
    margin-bottom: 64px;
}

.rovno-services-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 32px;
    align-items: stretch;
}

.rovno-services-title-wrapper {
    display: flex;
    align-items: center;
    padding-right: 20px;
}

.rovno-services-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    color: #1a1a1a;
}

/* Сетки для ПК */
.grid-span-2 {
    grid-column: span 2;
}

.grid-span-3 {
    grid-column: span 3;
}

.grid-span-4 {
    grid-column: span 4;
}

.grid-span-6 {
    grid-column: span 6;
}

/* Карточка */
.rovno-service-card {
    background: #fff;
    border-radius: 32px;
    border: 1px solid #EEEEEE;
    text-decoration: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

/* Базовая сетка архивов CPT (услуги/направления) */
.rovno-archive {
    padding: 60px 0 80px;
}

.rovno-archive__header {
    margin-bottom: 30px;
}

.rovno-archive__title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 10px;
}

.rovno-archive__description {
    color: #666;
}

.rovno-archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.rovno-archive-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.rovno-archive-card__link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.rovno-archive-card__thumb img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.rovno-archive-card__content {
    padding: 20px 22px 22px;
}

.rovno-archive-card__title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px;
}

.rovno-archive-card__excerpt {
    color: #757575;
    font-size: 14px;
    line-height: 1.5;
}

.rovno-service-card.grid-span-2 {
    max-height: 335px;
}

.rovno-service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.rsc-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    z-index: 2;
    position: relative;
}

.rsc-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 7px 0;
    color: var(--service-color, #003C8D);
    display: flex;
    align-items: center;
    gap: 10px;
}

.rsc-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.rsc-desc {
    color: #757575;
    font-size: 16px;
    line-height: 1.2;
    margin: 0;
    max-width: 90%;
}

.rsc-mobile-arrow {
    display: none;
    /* Only for mobile */
}

.rsc-image-wrapper {
    position: absolute;
    z-index: 1;
}

.rsc-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Позиция картинки: Снизу (Bottom) */
.img-pos-bottom .rsc-image-wrapper {
    position: relative;
    width: 100%;
    max-height: 200px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.img-pos-bottom .rsc-image-wrapper img {
    object-fit: contain;
    object-position: right;
}

/* Позиция картинки: Справа (Right) */
.img-pos-right {
    flex-direction: row;
}

.img-pos-right .rsc-content {
    width: 60%;
}

.img-pos-right .rsc-image-wrapper {
    right: 0;
    bottom: 0;
    height: 100%;
    width: 50%;
}

.img-pos-right .rsc-image-wrapper img {
    object-fit: contain;
    object-position: right bottom;
}

/* Позиция картинки: Слева (Left) */
.img-pos-left {
    flex-direction: row;
}

.img-pos-left .rsc-content {
    margin-left: 25%;
    max-width: 80%;
}

.img-pos-left .rsc-image-wrapper {
    left: 0;
    bottom: 0;
    height: 100%;
    width: 50%;
}

.img-pos-left .rsc-image-wrapper img {
    object-fit: cover;
    object-position: left bottom;
}

.grid-span-4.img-pos-left .rsc-image-wrapper {
    width: 20%;
}

.grid-span-4.img-pos-left .rsc-image-wrapper img {
    object-fit: contain;
    object-position: center;
}

.grid-span-4.img-pos-left .rsc-content {
    margin-left: 20%;
    width: 80%;
}

/* Адаптив - Планшеты */
@media (max-width: 1024px) {
    .rovno-services-block {
        padding: 16px 0 0 0;
    }

    .rovno-services-grid {
        gap: 16px 24px;
    }

    .rovno-service-card {
        border-radius: 23px;
    }

    .rsc-content {
        padding: 18px 24px;
    }

    .rsc-title {
        font-size: 18px;
        line-height: 22px;
        margin: 0 0 5px 0;
        gap: 4px;
    }

    .rsc-icon {
        max-width: 18px;
    }

    .rsc-desc {
        font-size: 14px;
        line-height: 18px;
    }

    .img-pos-left .rsc-image-wrapper img {
        object-fit: cover;
        object-position: center;
    }

    .img-pos-right .rsc-image-wrapper {
        right: -40px;
        bottom: 0;
        height: 90%;
        width: 50%;
    }

    /*.rovno-services-grid {
        grid-template-columns: repeat(4, 1fr);
    }*/

    /*.grid-span-2,
    .grid-span-3,
    .grid-span-4 {
        grid-column: span 2;
    }*/

    /*.rovno-services-title-wrapper.grid-span-2 {
        grid-column: span 4;
        margin-bottom: 10px;
    }*/

    /* Сбрасываем позиционирование картинок для планшета */
    /*.img-pos-left .rsc-content,
    .img-pos-right .rsc-content,
    .grid-span-4.img-pos-left .rsc-content {
        width: 100%;
        margin: 0;
    }*/

    /*.img-pos-left .rsc-image-wrapper,
    .img-pos-right .rsc-image-wrapper {
        position: relative;
        width: 100%;
        height: 150px;
        order: 2;
    }*/

    /*.img-pos-left,
    .img-pos-right {
        flex-direction: column;
    }*/
}

/* Адаптив - Мобильные телефоны */
@media (max-width: 767px) {

    .rovno-services-block {
        margin-bottom: 40px;
    }

    .rovno-services-grid {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .rovno-service-card {
        border-radius: 16px;
    }

    .rovno-services-title-wrapper {
        text-align: center;
        justify-content: center;
        padding: 0;
        margin-bottom: 10px;
    }

    .rovno-services-title {
        font-size: 24px;
        color: inherit;
    }

    .rovno-service-card {
        min-height: auto;
        flex-direction: row;
        align-items: center;
        padding: 13px 18px 13px 20px;
    }

    .rsc-image-wrapper {
        display: none !important;
    }

    .rsc-content {
        padding: 0;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
    }

    .rsc-text-wrap {
        display: flex;
        flex-direction: column;
        flex: 1;
        padding-right: 15px;
    }

    .rsc-title {
        margin-bottom: 3px;
    }

    .rsc-title .rsc-icon {
        display: none;
    }

    .rsc-desc {
        max-width: 100%;
    }

    .rsc-mobile-arrow {
        display: flex;
        color: var(--service-color, #0056b3);
        flex-shrink: 0;
    }

    .rsc-mobile-arrow svg {
        width: 48px;
        height: 48px;
    }
}