/* ==========================================================================
   HEADING BLOCK STYLES (Modules)
   ========================================================================== */

/* Base Heading Block Wrapper */
.lp-heading-block {
    width: 100%;
    /* Ensure full width in flex containers */
    max-width: 100%;
    line-height: 1.4;
    overflow-wrap: anywhere;
    word-break: break-word;
    box-sizing: border-box;
}

/* Active Editing State handled by Adapter Layer */

.lp-heading-block a {
    line-height: inherit;
    display: inline;
}

/* Base Heading Content */
.lp-heading-content {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
    overflow-wrap: anywhere;
    word-break: break-word;
    /* Typography Defaults */
    font-weight: bold;
    line-height: 1.4;
    color: var(--lp-heading-color, #333333);
    font-size: var(--lp-heading-font-size, 20px);
    text-align: var(--lp-heading-align, left);
    /* Preserves line breaks from textarea */
}

/* 1. Left Border */
.lp-heading-left-border {
    padding: 10px 10px 10px 15px;
    background: var(--lp-heading-bg-color, #f0f0f1);
    border-left: 5px solid var(--lp-heading-border-color, #2271b1);
    /* Explicitly force block display */
    display: block;
    width: 100%;
    box-sizing: border-box;
    /* Override legacy props if needed */
    white-space: normal;
}

/* 2. Bottom Border */
.lp-heading-bottom-border {
    padding-bottom: 5px;
    border-bottom: 3px solid var(--lp-heading-border-color, #2271b1);
    min-width: 0;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

/* 3. Center Lines (― Title ―) */
.lp-heading-center-lines {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    column-gap: 15px;

    text-align: center;
    justify-content: var(--lp-heading-justify, center);
    width: 100%;
    box-sizing: border-box;
    /* Inherit font/color from base */
}

.lp-heading-center-lines-text {
    grid-column: 2;
    min-width: 0;
    max-width: 100%;
    justify-self: center;
    text-align: center;
}

.lp-heading-center-lines::before,
.lp-heading-center-lines::after {
    content: '';
    align-self: center;
    border-bottom: 2px solid var(--lp-heading-accent-color, #2271b1);
    max-width: 80px;
    min-width: 16px;
    width: 100%;
}

.lp-heading-center-lines::before {
    grid-column: 1;
    justify-self: end;
}

.lp-heading-center-lines::after {
    grid-column: 3;
    justify-self: start;
}

/* Double Border */
.lp-heading-double-border {
    padding: 10px;
    border-top: 2px solid var(--lp-heading-border-color, #2271b1);
    border-bottom: 2px solid var(--lp-heading-border-color, #2271b1);
    text-align: var(--lp-heading-align, center);
    display: block;
    width: 100%;
    box-sizing: border-box;
}

/* Square Icon */
.lp-heading-square-icon {
    display: flex;
    align-items: flex-start;
    min-width: 0;
    justify-content: var(--lp-heading-justify, flex-start);
    width: 100%;
    box-sizing: border-box;
}

.lp-heading-square-icon::before {
    content: '';
    display: inline-block;
    width: 0.8em;
    height: 0.8em;
    background-color: var(--lp-heading-accent-color, #2271b1);
    margin-right: 10px;
    flex: 0 0 0.8em;
    flex-shrink: 0;
    margin-top: 0.3em;
}

/* Speech Bubble */
/* Speech Bubble (Increased specificity to override style.css reset) */
.lp-heading-block .lp-heading-content.lp-heading-speech-bubble,
.lp-heading-speech-bubble {
    position: relative;
    z-index: 1;
    overflow: visible;
    background: none;
    /* Use gradient background if provided, else solid via var */
    /* Note: JS/PHP handles gradient logic by setting background property directly if needed, 
       otherwise we rely on var for solid color */
    background-color: var(--lp-heading-bubble-color, #2271b1);
    color: var(--lp-heading-color, #ffffff);
    padding: 15px 20px;
    border-radius: 2px;

    text-align: center;
    margin-bottom: 15px;
    display: block;
    width: 100%;
    box-sizing: border-box;
    /* space for arrow */
}

.lp-heading-speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-style: solid;
    border-width: 10px 10px 0 10px;
    border-color: var(--lp-heading-bubble-color, #2271b1) transparent transparent transparent;
    display: block;
    width: 0;
    height: 0;
}

/* Stripe Background */
.lp-heading-stripe-bg {
    background: repeating-linear-gradient(45deg,
            var(--lp-heading-bg-color, #f0f0f1),
            var(--lp-heading-bg-color, #f0f0f1) 10px,
            #ffffff 10px,
            #ffffff 20px);
    /* Allow override via custom property if necessary, otherwise stick to pattern */
    border: 2px solid var(--lp-heading-border-color, #2271b1);
    padding: 10px;
    display: block;
    width: 100%;
}

/* Label Tag */
/* Label Tag (Increased specificity) */
.lp-heading-block .lp-heading-content.lp-heading-label-tag,
.lp-heading-label-tag {
    position: relative;
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 15px 20px;
    background-color: var(--lp-heading-accent-color, #2271b1);
    /* Use Accent Color (Border Color) input */
    color: var(--lp-heading-color, #ffffff);
    border-radius: 0 4px 4px 0;
    /* Sharp left corners for fold alignment */
    margin-bottom: 10px;
    /* Space for the fold */
}

.lp-heading-label-tag::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 10px 10px 0;
    border-color: transparent #888 transparent transparent;
}

/* Check Mark */
/* Check Mark (Increased specificity) */
.lp-heading-block .lp-heading-content.lp-heading-check-mark,
.lp-heading-check-mark {
    background: var(--lp-heading-bg-color, #e5f5ff);
    /* Light Blue Background */
    padding: 15px;
    position: relative;
    overflow: visible;
    border-radius: 4px;
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: var(--lp-heading-align, left);
    color: inherit;
    margin-top: 25px;
    /* Add top margin to account for absolute label */
}

.lp-heading-check-label {
    position: absolute;
    top: -20px;
    left: 10px;
    background: var(--lp-heading-accent-color, #2271b1);
    /* Blue Badge */
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 10px 4px 24px;
    /* Left padding for icon */
    border-radius: 4px 4px 0 0;
    line-height: 1;
}

.lp-heading-check-label::before {
    content: '\2714';
    /* Heavy Check Mark */
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
}