.principles {
	padding: 20px 0;
	background: #fff;
    /* max-width: 1320px; */
    /* margin: auto; */

    @media screen and (max-width: 768px) {
        padding: 20px 0;
    }

    .principles-title {
        font-family: 'Closer Text', sans-serif;
        font-weight: 500;
        font-size: 42px;
        line-height: 110%;
        letter-spacing: -0.02em;
        color: #013026;
        padding-bottom: 60px;
        margin: 0;
        max-width: 1320px; 
        margin: 0 auto; 

        @media screen and (max-width: 768px) {
            font-size: 32px;
            padding: 0 20px 30px;
        }
    }

    .principles-scroll {
        /* overflow-x: auto;
        overflow-y: hidden; */
        overflow: hidden;
        padding-bottom: 20px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        max-width: 1320px;
        margin: auto;
        overflow: visible;

        @media (max-width: 767px) {
            overflow-x: auto;
            margin: 0 0 0 20px;
        }

        .principles-row {
            display: flex;
            gap: 20px;
            min-width: max-content;
            will-change: transform;
            position: relative;
            z-index: 222;
            

            @media screen and (max-width: 768px) {
                gap: 14px;
            }

            .principles-card {
                flex: 0 0 430px;
                min-height: 450px;
                scroll-snap-align: start;
                border-radius: 20px;
                background: #fff;
                overflow: hidden;
                display: flex;
                flex-direction: column;
                justify-content: space-between;
                transition: transform 0.3s ease;
                position: relative;

                @media screen and (max-width: 768px) {
                    flex: 0 0 316px;
                    height: 340px;
                    min-height: unset;
                }

                /* &:hover {
                    transform: translateY(-4px);
                } */
                .principles-bg {
                    position: absolute;
                    inset: 0;
                    width: 100%;
                    height: 100%;
                    object-fit: cover;
                    z-index: 1;
                    transition: transform 0.4s ease;
                }

                .principles-overlay {
                    position: absolute;
                    inset: 0;
                    z-index: 2;
                    transition: background 0.3s ease;
                }

                .principles-footer {
                    position: absolute;
                    bottom: 0;
                    left: 0;
                    right: 0;
                    padding: 16px 16px;
                    z-index: 3;
                    background: #F1F5F8;
                    color: #013026;
                    margin: 8px;
                    border-radius: 12px;
                    transition: all 0.3s ease;

                    .principles-info {
                        display: flex;
                        align-items: center;
                        justify-content: space-between;
                        cursor: pointer;
                        transition: max-height 0.35s ease, opacity 0.35s ease;

                        @media screen and (max-width: 768px) {
                            gap: 10px;
                        }   

                        h3 {
                            font-family: 'Closer Text', sans-serif;
                            font-weight: 500;
                            font-size: 24px;
                            line-height: 120%;
                            letter-spacing: -0.02em;
                            margin: 0;

                            @media screen and (max-width: 768px) {
                                font-size: 21px;
                            }
                        }

                        .principles-toggle {
                            background: rgba(255, 255, 255, 0.15);
                            color: #013026;
                            border: none;
                            width: 28px;
                            height: 28px;
                            border-radius: 50%;
                            font-size: 30px;
                            line-height: 34px;
                            display: flex;
                            align-items: center;
                            justify-content: center;
                            cursor: pointer;
                            transition: background 0.5s ease, transform 0.5s ease;
                        }

                        /* .principles-toggle:hover {
                            background: rgba(255, 255, 255, 0.3);
                            transform: rotate(90deg);
                        } */
                    }

                    .principles-desc {
                        margin: 0;
                        /* font-size: 15px;
                        line-height: 1.5; */
                        /* color: #fff; */
                        max-height: 0;
                        opacity: 0;
                        overflow: hidden;
                        transition: padding-top 0.35s ease, max-height 0.35s ease, opacity 0.35s ease;
                        /* transition: all 0.4s ease; */
                    }
                }

                &.active .principles-desc {
                    font-family: 'Closer Text', sans-serif;
                    font-weight: 400;
                    font-size: 16px;
                    line-height: 130%;
                    letter-spacing: -0.01em;
                    color: #004735;
                    max-height: 100px;
                    opacity: 1;
                    padding-top: 20px;

                    @media screen and (max-width: 768px) {
                        padding-top: 10px; 
                        font-size: 14px;
                    }
                }

                &.active .principles-footer .principles-info .principles-toggle {
                    transform: rotate(45deg);
                }

            }
        }

    }
}



.principles-content {
	padding: 16px;
}

.principles-content h3 {
	font-size: 18px;
	font-weight: 600;
	color: #0a0a0a;
	margin-bottom: 6px;
}

.principles-content p {
	font-size: 15px;
	line-height: 1.5;
	color: #333;
}

/* === Убираем полосы прокрутки (по желанию) === */
.principles-scroll::-webkit-scrollbar {
	height: 8px;
}
.principles-scroll::-webkit-scrollbar-thumb {
	background: #ccc;
	border-radius: 4px;
}
.principles-scroll::-webkit-scrollbar-track {
	background: transparent;
}

/* === Адаптив === */
@media (max-width: 768px) {
	.principles-card {
		flex: 0 0 260px;
	}
}

/* === Editor Preview Styles === */
.editor-styles-wrapper {
    .principles-preview {
        background: #fff;
        padding: 40px 20px;
        /* border-radius: 20px; */
        /* border: 1px solid #e0e0e0; */

        .principles-preview-title {
            font-size: 24px;
            font-weight: 600;
            color: #004d40;
            margin-bottom: 30px;
        }

        .principles-preview-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
            gap: 20px;

            .principles-preview-card {
                border-radius: 16px;
                background: #f5f7f6;
                overflow: hidden;
                box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
                display: flex;
                flex-direction: column;
                justify-content: space-between;
                padding: 12px;

                .principles-preview-img {
                    img {
                        width: 100%;
                        height: 150px;
                        object-fit: cover;
                        border-radius: 12px;
                    }
                }

                .principles-preview-content {
                    margin-top: 10px;

                    .principles-input {
                        width: 100%;
                        font-weight: 600;
                        font-size: 16px;
                        color: #0a0a0a;
                        border: none;
                        background: transparent;
                        outline: none;
                    }

                    .principles-textarea {
                        width: 100%;
                        min-height: 50px;
                        font-size: 14px;
                        color: #444;
                        border: none;
                        background: transparent;
                        resize: none;
                        outline: none;
                    }
                }
            }
        }
    }
}

/* === Изображение на фоне === */

.principles-card:hover .principles-overlay {
	background: #00000033;
}

.principle-card-settings img {
	border-radius: 6px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}