/**
 * Content Blocks CSS
 * Стили для rich content блоков созданных в TinyMCE
 */

/* Общие стили для всех блоков */
.content-block {
    margin: 20px 0;
    clear: both;
    overflow: hidden;
}

/* CTA Button Styles for Public View */
.cta-button,
.features-cta-button {
    display: inline-block;
    padding: 15px 30px;
    min-height: 44px; /* Ensure minimum touch target size */
    background: rgba(255,255,255,0.2);
    border: 2px solid white;
    border-radius: 50px;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    user-select: none;
}

/* Make CTA buttons with href clickable - CRITICAL for functionality */
.cta-button[data-href]:not([data-href=""]),
.features-cta-button[data-href]:not([data-href=""]) {
    cursor: pointer !important;
    pointer-events: auto !important; /* Ensure clicks are captured */
    position: relative; /* Ensure proper layering */
    z-index: 10; /* Bring button to front */
}

/* Hover state - visual feedback */
.cta-button[data-href]:not([data-href=""]):hover,
.features-cta-button[data-href]:not([data-href=""]):hover {
    background: rgba(255,255,255,0.3) !important;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Focus state - for keyboard navigation and accessibility */
.cta-button[data-href]:not([data-href=""]):focus,
.features-cta-button[data-href]:not([data-href=""]):focus {
    outline: 3px solid #4A90F4;
    outline-offset: 3px;
    box-shadow: 0 0 0 3px rgba(74, 144, 244, 0.2);
}

/* Remove focus outline when not using keyboard (mouse clicks) */
.cta-button:focus:not(:focus-visible),
.features-cta-button:focus:not(:focus-visible) {
    outline: none;
}

/* Active/click state - tactile feedback */
.cta-button[data-href]:not([data-href=""]):active,
.features-cta-button[data-href]:not([data-href=""]):active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Блок с текстом и изображением слева */
.cb-text-image-left {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    transition: box-shadow 0.3s ease;
}

.cb-text-image-left:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.cb-text-image-left .cb-image {
    flex: 0 0 200px;
}

.cb-text-image-left .cb-text {
    flex: 1;
}

/* Блок с текстом и изображением справа */
.cb-text-image-right {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    transition: box-shadow 0.3s ease;
}

.cb-text-image-right:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.cb-text-image-right .cb-image {
    flex: 0 0 200px;
}

.cb-text-image-right .cb-text {
    flex: 1;
}

/* Блок с изображением сверху */
.cb-image-top-text {
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    transition: box-shadow 0.3s ease;
}

.cb-image-top-text:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.cb-image-top-text .cb-image {
    margin-bottom: 20px;
}

/* Двухколоночный блок */
.cb-two-column {
    display: flex;
    gap: 30px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    transition: box-shadow 0.3s ease;
}

.cb-two-column:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.cb-two-column .cb-column {
    flex: 1;
}

/* Выделенный блок */
.cb-highlight-box {
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.cb-highlight-box h3,
.cb-highlight-box h4,
.cb-highlight-box h5 {
    color: white;
    margin-top: 0;
}

/* Общие стили для изображений */
.cb-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}

/* Общие стили для текста в блоках */
.cb-text h3,
.cb-text h4,
.cb-text h5 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-weight: 600;
}

.cb-text p {
    margin: 0 0 15px 0;
    line-height: 1.6;
    color: #666;
}

.cb-text p:last-child {
    margin-bottom: 0;
}

/* Адаптивные стили для мобильных устройств */
@media (max-width: 768px) {
    .cb-text-image-left,
    .cb-text-image-right {
        flex-direction: column;
    }

    .cb-text-image-left .cb-image,
    .cb-text-image-right .cb-image {
        flex: none;
        max-width: 100%;
    }

    .cb-two-column {
        flex-direction: column;
        gap: 20px;
    }

    .content-block {
        margin: 15px 0;
    }

    .cb-text-image-left,
    .cb-text-image-right,
    .cb-image-top-text,
    .cb-two-column {
        padding: 15px;
    }

    /* Larger touch targets for mobile */
    .cta-button,
    .features-cta-button {
        padding: 18px 35px;
        font-size: 18px;
        min-height: 48px; /* Larger minimum for touch */
    }
}

@media (max-width: 480px) {
    .cb-text-image-left,
    .cb-text-image-right,
    .cb-image-top-text,
    .cb-two-column,
    .cb-highlight-box {
        padding: 15px;
        margin: 10px 0;
    }
    
    .cb-two-column {
        gap: 15px;
    }
    
    .cb-text-image-left,
    .cb-text-image-right {
        gap: 15px;
    }
}

/* Стили для редактируемого контента */
.content-block [contenteditable="true"]:focus {
    outline: 2px solid #4A90F4;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Дополнительные цветовые схемы для выделенных блоков */
.cb-highlight-box.cb-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.2);
}

.cb-highlight-box.cb-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.2);
}

.cb-highlight-box.cb-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.2);
}