/* Announcements bar — YMCA Midsize 2026 (Hero Announcements A)
   Full-width purple notice that sits above the home hero. Built from core blocks
   (group + ymca/icon + paragraphs + buttons); this stylesheet strips the core
   button chrome so the "Learn More" link and the dismiss "X" render as the comp. */

.bmg-announcements {
    background: var(--purple-md);
    color: var(--white);
}

.bmg-announcements__inner {
    box-sizing: border-box;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    min-height: 92px;
}

/* info icon (ymca/icon block). In the block editor this block stretches to the
   full content width (flex-basis auto resolves to 100%), shoving the rest of the
   row off-screen and overflowing the canvas. fit-content pins it to the icon's
   own width in both the editor and the front end. */
.bmg-announcements .wp-block-ymca-icon {
    margin: 0;
    flex: 0 0 auto;
    width: -moz-fit-content;
    width: fit-content;
}

.bmg-announcements__label {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 22.5px;
    font-weight: 700;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* vertical divider — CSS-only (was an empty <span> before) */
.bmg-announcements__text {
    margin: 0;
    font-size: 18px;
    min-width: 0; /* allow the message to shrink so the row never overflows */
}

.bmg-announcements__text::before {
    content: "";
    display: inline-block;
    width: 1px;
    height: 56px;
    margin-right: 14px;
    background: var(--white);
    vertical-align: middle;
}

/* link + close cluster, pushed to the right */
.bmg-announcements__actions {
    margin-left: auto;
    flex: none;
    align-items: center;
    gap: 24px;
}

/* "Learn More" — core button reset to a text link with a ▶ caret */
.bmg-announcements__link .wp-block-button__link {
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: var(--white);
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
}

.bmg-announcements__link .wp-block-button__link::after {
    content: "";
    display: inline-block;
    margin-left: 10px;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 7px solid var(--white);
    vertical-align: middle;
}

/* dismiss "X" — core button reset; text hidden, X drawn via mask (same technique
   as the hero arrows). The "Dismiss" label stays in the DOM for screen readers. */
.bmg-announcements__close .wp-block-button__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    min-height: 0;
    border-radius: 0;
    background: transparent;
    font-size: 0;
    line-height: 0;
    color: transparent;
    cursor: pointer;
}

.bmg-announcements__close .wp-block-button__link::after {
    content: "";
    display: block;
    width: 24px;
    height: 24px;
    background: var(--white);
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path fill="black" d="M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"/></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path fill="black" d="M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"/></svg>');
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-position: center;
    mask-position: center;
}

@media (max-width: 1100px) {
    .bmg-announcements__inner {
        padding-left: 30px !important;
    }
    .bmg-announcements__close-wrapper {
        padding-right: 30px !important;
    }
}

/* tablet/mobile (out of 2026 desktop scope — keep usable) */
@media (max-width: 992px) {
    .bmg-announcements__inner {
        padding: 20px !important;
        flex-direction: column;
        gap: 10px;
        justify-content: start;
        align-items: start;
    }
    .bmg-announcements__close-wrapper {
        padding-right: 20px !important;
    }

    .bmg-announcements__row__right {
        min-height: unset !important;
        border: none !important;
        padding-left: 0 !important;

        flex-direction: column;
        align-items: start;
        gap: 10px;
    }
}
