/**
 * CoderWeb Theme - Block Styles
 * Styles for all pagebuilder blocks
 */

/* ========================================
   TEXT BLOCK
   ======================================== */
.cw-text-block {
    width: 100%;
    word-wrap: break-word;
}

.cw-text-block p {
    margin: 0 0 1em 0;
}

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

.cw-text-block h1,
.cw-text-block h2,
.cw-text-block h3,
.cw-text-block h4,
.cw-text-block h5,
.cw-text-block h6 {
    margin: 0 0 0.5em 0;
    line-height: 1.2;
}

/* ========================================
   IMAGE BLOCK
   ======================================== */
.cw-image-block {
    width: 100%;
    margin: 0;
}

.cw-image-block img {
    max-width: 100%;
    height: auto;
    display: block;
}

.cw-image-block a {
    display: inline-block;
    text-decoration: none;
}

.cw-image-placeholder {
    background: #f0f0f0;
    border: 2px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #999;
    font-size: 14px;
}

.cw-image-caption {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
    font-style: italic;
}

/* ========================================
   BUTTON BLOCK
   ======================================== */
.cw-button-block {
    width: 100%;
    margin: 10px 0;
}

.cw-button {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1.5;
}

/* Button Sizes */
.cw-button-small {
    padding: 8px 16px;
    font-size: 14px;
}

.cw-button-medium {
    padding: 12px 24px;
    font-size: 16px;
}

.cw-button-large {
    padding: 16px 32px;
    font-size: 18px;
}

.cw-button-full-width {
    display: block;
    width: 100%;
}

/* Button Styles */
.cw-button-primary {
    background-color: #007bff;
    color: #ffffff;
}

.cw-button-primary:hover {
    background-color: #0056b3;
}

.cw-button-secondary {
    background-color: #6c757d;
    color: #ffffff;
}

.cw-button-secondary:hover {
    background-color: #545b62;
}

.cw-button-success {
    background-color: #28a745;
    color: #ffffff;
}

.cw-button-success:hover {
    background-color: #218838;
}

.cw-button-danger {
    background-color: #dc3545;
    color: #ffffff;
}

.cw-button-danger:hover {
    background-color: #c82333;
}

.cw-button-warning {
    background-color: #ffc107;
    color: #212529;
}

.cw-button-warning:hover {
    background-color: #e0a800;
}

.cw-button-info {
    background-color: #17a2b8;
    color: #ffffff;
}

.cw-button-info:hover {
    background-color: #138496;
}

.cw-button-light {
    background-color: #f8f9fa;
    color: #212529;
    border: 1px solid #dee2e6;
}

.cw-button-light:hover {
    background-color: #e2e6ea;
}

.cw-button-dark {
    background-color: #343a40;
    color: #ffffff;
}

.cw-button-dark:hover {
    background-color: #23272b;
}

/* ========================================
   COLUMNS BLOCK
   ======================================== */
.cw-columns-block {
    width: 100%;
    margin: 20px 0;
}

.cw-columns-wrapper {
    display: flex;
    flex-wrap: nowrap;
}

.cw-column {
    flex: 1;
    min-width: 0; /* Prevents flex items from overflowing */
}

/* Column Count Specific Styles */
.cw-columns-1 .cw-column {
    flex: 0 0 100%;
}

.cw-columns-2 .cw-column {
    flex: 0 0 50%;
}

.cw-columns-3 .cw-column {
    flex: 0 0 33.333%;
}

.cw-columns-4 .cw-column {
    flex: 0 0 25%;
}

/* Column Placeholder */
.cw-column-placeholder {
    padding: 20px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    text-align: center;
    color: #6c757d;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive Columns */
@media (max-width: 768px) {
    .cw-columns-responsive .cw-columns-wrapper {
        flex-direction: column;
    }

    .cw-columns-responsive .cw-column {
        flex: 0 0 100%;
        width: 100%;
    }
}

/* ========================================
   GENERAL BLOCK UTILITIES
   ======================================== */
.cw-block {
    margin-bottom: 20px;
}

.cw-block:last-child {
    margin-bottom: 0;
}

/* Spacing Utilities */
.cw-spacing-small {
    margin-bottom: 10px;
}

.cw-spacing-medium {
    margin-bottom: 20px;
}

.cw-spacing-large {
    margin-bottom: 40px;
}

/* Alignment Utilities */
.cw-align-left {
    text-align: left;
}

.cw-align-center {
    text-align: center;
}

.cw-align-right {
    text-align: right;
}

.cw-align-justify {
    text-align: justify;
}
