/**
 * Consolidated styles for Lucca Blocks
 *
 * This file contains all the styles for the Lucca Blocks plugin.
 * It replaces the individual SCSS files for each block.
 *
 * This includes both frontend styles and editor-specific styles.
 */

/* Article List Block Styles */
.wp-block-lucca-blocks-article-list {
    margin: 0 auto;
    max-width: 1200px;
}

.wp-block-lucca-blocks-article-list .article-list-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.wp-block-lucca-blocks-article-list.columns-2 .article-list-container {
    grid-template-columns: repeat(2, 1fr);
}

.wp-block-lucca-blocks-article-list.columns-3 .article-list-container {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
    .wp-block-lucca-blocks-article-list.columns-2 .article-list-container,
    .wp-block-lucca-blocks-article-list.columns-3 .article-list-container {
        grid-template-columns: 1fr;
    }
}

/* Editor-specific styles for Article List */
.editor-styles-wrapper .wp-block-lucca-blocks-article-list {
    border: 1px dashed #ccc;
    padding: 20px;
}

.editor-styles-wrapper .wp-block-lucca-blocks-article-list.is-selected,
.editor-styles-wrapper .wp-block-lucca-blocks-article-list.has-child-selected {
    border: 1px dashed #007cba;
}

/* Speech Bubble Block Styles */
.wp-block-lucca-blocks-speech-bubble {
    margin: 30px 0;
    max-width: 100%;
}

.wp-block-lucca-blocks-speech-bubble .speech-bubble-container {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 15px;
}

.wp-block-lucca-blocks-speech-bubble.position-right .speech-bubble-container {
    flex-direction: row-reverse;
}

.wp-block-lucca-blocks-speech-bubble .speech-bubble-person {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: 80px;
}

.wp-block-lucca-blocks-speech-bubble .speech-bubble-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.wp-block-lucca-blocks-speech-bubble .speech-bubble-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wp-block-lucca-blocks-speech-bubble .speech-bubble-name {
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    margin-top: 5px;
}

.wp-block-lucca-blocks-speech-bubble .speech-bubble {
    position: relative;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    flex: 1;
    max-width: calc(100% - 100px);
}

.wp-block-lucca-blocks-speech-bubble .speech-bubble-content {
    position: relative;
    z-index: 1;
}

.wp-block-lucca-blocks-speech-bubble .speech-bubble-content p {
    margin: 0;
    line-height: 1.6;
}

.wp-block-lucca-blocks-speech-bubble .speech-bubble-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    top: 20px;
}

.wp-block-lucca-blocks-speech-bubble.position-left .speech-bubble-arrow {
    left: -10px;
    border-width: 10px 10px 10px 0;
    border-color: transparent currentColor transparent transparent;
}

.wp-block-lucca-blocks-speech-bubble.position-right .speech-bubble-arrow {
    right: -10px;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent currentColor;
}

/* Editor-specific styles for Speech Bubble */
.editor-styles-wrapper .wp-block-lucca-blocks-speech-bubble {
    /* Removed border and padding to match frontend appearance */
    margin: 30px 0;
}

.editor-styles-wrapper .wp-block-lucca-blocks-speech-bubble.is-selected,
.editor-styles-wrapper .wp-block-lucca-blocks-speech-bubble.has-child-selected {
    /* Subtle outline when selected instead of dashed border */
    outline: 1px solid rgba(0, 124, 186, 0.2);
    outline-offset: 4px;
}

.editor-styles-wrapper .speech-bubble-image-preview {
    max-width: 60px;
    max-height: 60px;
    border-radius: 50%;
    margin-bottom: 10px;
}

.editor-styles-wrapper .speech-bubble-image-buttons {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 10px;
}

/* Override the arrow color in the editor to use background-color instead of currentColor */
.editor-styles-wrapper .wp-block-lucca-blocks-speech-bubble .speech-bubble-arrow {
    /* These styles will be overridden by the inline styles we added in the JS */
    border-color: inherit !important;
}

@media (max-width: 768px) {
    .wp-block-lucca-blocks-speech-bubble .speech-bubble-container {
        flex-direction: column;
        align-items: center;
    }

    .wp-block-lucca-blocks-speech-bubble.position-right .speech-bubble-container {
        flex-direction: column;
    }

    .wp-block-lucca-blocks-speech-bubble .speech-bubble {
        max-width: 100%;
    }

    .wp-block-lucca-blocks-speech-bubble .speech-bubble-arrow {
        display: none;
    }
}

/* Full Width Block Styles */
.wp-block-lucca-blocks-full-width {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    box-sizing: border-box;
}

/* When the block has align-full class, make it truly full width */
.wp-block-lucca-blocks-full-width.alignfull {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    left: 0;
    right: 0;
    position: relative;
    box-sizing: border-box;
    /* Fix for themes that might add padding to the body or container */
    padding-left: 0;
    padding-right: 0;
}

.wp-block-lucca-blocks-full-width .full-width-content {
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
}

/* Content width options */
.wp-block-lucca-blocks-full-width.content-width-contained .full-width-content {
    max-width: 1200px;
    padding-left: 20px;
    padding-right: 20px;
}

.wp-block-lucca-blocks-full-width.content-width-wide .full-width-content {
    max-width: 1600px;
    padding-left: 20px;
    padding-right: 20px;
}

.wp-block-lucca-blocks-full-width.content-width-full .full-width-content {
    width: 100%;
    max-width: 100%;
}

/* Parallax effect */
.wp-block-lucca-blocks-full-width[data-parallax="true"] {
    background-attachment: fixed;
    overflow: hidden;
}

/* Editor-specific styles for Full Width */
.editor-styles-wrapper .wp-block-lucca-blocks-full-width {
    border: 1px dashed #ccc;
    padding: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.editor-styles-wrapper .wp-block-lucca-blocks-full-width.is-selected,
.editor-styles-wrapper .wp-block-lucca-blocks-full-width.has-child-selected {
    border: 1px dashed #007cba;
}

.editor-styles-wrapper .full-width-background-preview {
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
    border-radius: 4px;
}

.editor-styles-wrapper .full-width-image-buttons {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 10px;
}

/* Simple Block Styles */
.wp-block-lucca-blocks-simple-block {
    margin: 0 auto;
    max-width: 740px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.wp-block-lucca-blocks-simple-block:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.wp-block-lucca-blocks-simple-block p {
    margin: 0;
    line-height: 1.6;
    font-size: 16px;
}

/* Card Block Styles */
.wp-block-lucca-blocks-card-block {
    margin: 0 auto;
    max-width: 740px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.wp-block-lucca-blocks-card-block:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.wp-block-lucca-blocks-card-block .card-image {
    width: 100%;
    height: auto;
    display: block;
}

.wp-block-lucca-blocks-card-block .card-content {
    padding: 20px;
}

.wp-block-lucca-blocks-card-block h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 20px;
    font-weight: 600;
}

.wp-block-lucca-blocks-card-block p {
    margin: 0;
    line-height: 1.6;
    font-size: 16px;
}

/* Editor-specific styles */

/* Simple Block Editor Styles */
.editor-styles-wrapper .wp-block-lucca-blocks-simple-block {
    border: 1px dashed #ccc;
}

.editor-styles-wrapper .wp-block-lucca-blocks-simple-block.is-selected,
.editor-styles-wrapper .wp-block-lucca-blocks-simple-block.has-child-selected {
    border: 1px dashed #007cba;
}

/* Card Block Editor Styles */
.editor-styles-wrapper .wp-block-lucca-blocks-card-block {
    border: 1px dashed #ccc;
}

.editor-styles-wrapper .wp-block-lucca-blocks-card-block.is-selected,
.editor-styles-wrapper .wp-block-lucca-blocks-card-block.has-child-selected {
    border: 1px dashed #007cba;
}

.editor-styles-wrapper .wp-block-lucca-blocks-card-block .components-placeholder {
    min-height: 100px;
}

.editor-styles-wrapper .wp-block-lucca-blocks-card-block .block-editor-media-placeholder {
    margin-bottom: 0;
}

.editor-styles-wrapper .wp-block-lucca-blocks-card-block .components-button.is-button {
    display: inline-flex;
    align-items: center;
}
