/* Header-1 Inline Layout - Four Selector Pattern for FSE Compatibility */
.cm-header-container,
.editor-styles-wrapper .cm-header-container,
.wp-block-cm-header-1 .cm-header-container,
.block-editor-block-list__block.wp-block-cm-header-1 .cm-header-container {
    box-sizing: border-box;
    z-index: 5;
    width: 100%;
    display: flex;
    float: none;
    clear: none;
    padding: var(--header-1-padding, 0.8vw);
    margin: 0;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    background-color: var(--header-1-default-bg, rgb(77, 98, 77));
    color: var(--header-1-default-text, #ffffff);
}

/* Inline Text Wrapper - Full Width Container */
.text-wrapper-inline,
.editor-styles-wrapper .text-wrapper-inline,
.wp-block-cm-header-1 .text-wrapper-inline,
.block-editor-block-list__block.wp-block-cm-header-1 .text-wrapper-inline {
    box-sizing: border-box;
    display: flex;
    width: 100%;
    justify-content: flex-start;
    align-items: center;
    align-self: stretch;
}

/* Inline Title-Tagline Wrapper - High specificity selectors for FSE compatibility */
.cm-header-container .site-title-tagline-wrapper-inline,
.wp-block-group.cm-header-container .site-title-tagline-wrapper-inline,
.wp-block-cm-header-1 .cm-header-container .site-title-tagline-wrapper-inline,
.site-title-tagline-wrapper-inline,
.editor-styles-wrapper .site-title-tagline-wrapper-inline,
.wp-block-cm-header-1 .site-title-tagline-wrapper-inline,
.block-editor-block-list__block .wp-block-cm-header-1 .site-title-tagline-wrapper-inline,
.wp-block-template-part .wp-block-cm-header-1 .site-title-tagline-wrapper-inline,
.block-editor-block-list__layout .wp-block-cm-header-1 .site-title-tagline-wrapper-inline {
    display: inline-flex;
    flex-direction: row;
    align-items: baseline;
    gap: var(--header-1-tagline-spacing, 0.5em);
    width: auto; /* Allow wrapper to expand for longer titles */
    min-width: max-content; /* Ensure it doesn't shrink below needed size */
    flex-shrink: 0; /* Prevent flex shrinking */
    margin-left: .5em;
}

/* Site Title - Main Heading - Comprehensive FSE selectors */
.site-title,
.wp-block-cm-header-1 .site-title,
.editor-styles-wrapper .site-title,
.editor-styles-wrapper .wp-block-cm-header-1 .site-title,
.block-editor-block-list__layout .wp-block-cm-header-1 .site-title,
.block-editor-block-list__block .wp-block-cm-header-1 .site-title,
.wp-block-template-part .wp-block-cm-header-1 .site-title {
    box-sizing: border-box;
    font-size: var(--header-1-title-size, clamp(24px, 2.5vw, 48px));
    color: var(--header-1-default-text, #ffffff);
    letter-spacing: var(--header-1-title-spacing, 0.1em);
    margin: 0;
    padding: 0;
    font-weight: bold;
    white-space: nowrap !important; /* Force override of pre-wrap - prevent title from wrapping */
}

/* Site Tagline - Smaller Inline Text */
.site-tagline,
.editor-styles-wrapper .site-tagline,
.wp-block-cm-header-1 .site-tagline,
.block-editor-block-list__block.wp-block-cm-header-1 .site-tagline {
    box-sizing: border-box;
    font-size: var(--header-1-tagline-size, clamp(14px, 1.2vw, 24px));
    color: var(--header-1-tagline-color, #e9e8bd);
    margin: 0;
    padding: 0;
    font-weight: normal;
    white-space: nowrap;
}

/* Mobile Responsive */
@media (min-width: 0px) and (max-width: 550px) {
    .site-title-tagline-wrapper-inline,
    .editor-styles-wrapper .site-title-tagline-wrapper-inline,
    .wp-block-cm-header-1 .site-title-tagline-wrapper-inline,
    .block-editor-block-list__block.wp-block-cm-header-1 .site-title-tagline-wrapper-inline {
        flex-direction: column;
        align-items: center;
        gap: 0.2em;
    }
    
    .site-title,
    .editor-styles-wrapper .site-title,
    .wp-block-cm-header-1 .site-title,
    .block-editor-block-list__block.wp-block-cm-header-1 .site-title {
        font-size: clamp(18px, 4vw, 32px);
    }
    
    .site-tagline,
    .editor-styles-wrapper .site-tagline,
    .wp-block-cm-header-1 .site-tagline,
    .block-editor-block-list__block.wp-block-cm-header-1 .site-tagline {
        font-size: clamp(12px, 2.5vw, 18px);
    }
}

/* Tablet and Desktop */
@media (min-width: 551px) {
    .site-title-tagline-wrapper-inline,
    .editor-styles-wrapper .site-title-tagline-wrapper-inline,
    .wp-block-cm-header-1 .site-title-tagline-wrapper-inline,
    .block-editor-block-list__block.wp-block-cm-header-1 .site-title-tagline-wrapper-inline {
        flex-direction: row;
        align-items: baseline;
    }
}

/* Header-1 Container Specific Styles */
.header-1-container,
.editor-styles-wrapper .header-1-container,
.wp-block-cm-header-1 .header-1-container,
.block-editor-block-list__block.wp-block-cm-header-1 .header-1-container {
    min-height: 60px;
}

/* Ensure proper spacing and alignment */
.cm-header-1-loaded .site-title-tagline-wrapper-inline,
.editor-styles-wrapper .cm-header-1-loaded .site-title-tagline-wrapper-inline,
.wp-block-cm-header-1 .cm-header-1-loaded .site-title-tagline-wrapper-inline,
.block-editor-block-list__block.wp-block-cm-header-1 .cm-header-1-loaded .site-title-tagline-wrapper-inline {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}