/*
 * Site notices, built to the Figma tokens rather than to approximations.
 *
 *   type        16px / 20.8px (1.3), weight 400, letter spacing 0
 *   link        weight 600, underlined, line height equal to the font size
 *   icon        44px
 *   gap         20px icon to content, 10px message to link
 *   preheader   background brand primary, text on-primary, padding 28px 80px
 *   callout     background brand error at 5%, 6px brand-error edge, padding 24px
 *
 * One stylesheet serves the public page and the admin preview, so the preview
 * cannot drift from what a visitor sees.
 */

.ashm-notice {
    --ashm-notice-brand: #0060ae;
    --ashm-notice-on-brand: #ffffff;
    --ashm-notice-error: #d81159;
    --ashm-notice-text: #333333;
    --ashm-notice-size: 16px;
    --ashm-notice-line: 20.8px;

    box-sizing: border-box;
    width: 100%;
}

.ashm-notice *,
.ashm-notice *::before,
.ashm-notice *::after {
    box-sizing: inherit;
}

.ashm-notice__inner {
    display: flex;
    align-items: center;
    gap: 20px;
}

.ashm-notice__icon {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
}

.ashm-notice__icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.ashm-notice__content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
    min-width: 0;
}

.ashm-notice__body p {
    margin: 0;
    font-size: var(--ashm-notice-size);
    line-height: var(--ashm-notice-line);
    font-weight: 400;
    letter-spacing: 0;
}

.ashm-notice__body a {
    color: inherit;
    text-decoration: underline;
}

/*
 * The design's util_btn: its own row under the message, not a link inside the
 * copy. The 10px gap comes from .ashm-notice__content, and the leading equals
 * the font size so the row is the 18px the design gives it.
 */
.ashm-notice__cta,
.ashm-notice__cta:visited,
.ashm-notice__cta:hover,
.ashm-notice__cta:focus,
.ashm-notice__cta:active {
    align-self: flex-start;
    color: inherit;
    font-size: var(--ashm-notice-size);
    font-weight: 600;
    line-height: var(--ashm-notice-size);
    letter-spacing: 0;
    text-decoration: underline;
    text-underline-position: from-font;
    box-shadow: none;
    outline: none;
}

.ashm-notice__cta:hover,
.ashm-notice__cta:focus {
    opacity: 0.85;
}

.ashm-notice--preheader {
    background: var(--ashm-notice-brand);
    color: var(--ashm-notice-on-brand);
}

.ashm-notice--preheader .ashm-notice__inner {
    /* The band bleeds full width; the content holds to the site container. */
    max-width: 1240px;
    margin: 0 auto;
    padding: 28px 80px;
}

.ashm-notice--preheader .ashm-notice__dismiss {
    flex: 0 0 24px;
    align-self: flex-start;
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
    line-height: 0;
}

.ashm-notice--preheader .ashm-notice__dismiss:hover,
.ashm-notice--preheader .ashm-notice__dismiss:focus {
    opacity: 0.85;
}

.ashm-notice--preheader .ashm-notice__dismiss svg {
    display: block;
    width: 100%;
    height: 100%;
}

.ashm-notice--callout {
    background: rgba(216, 17, 89, 0.05);
    border-left: 6px solid var(--ashm-notice-error);
    border-radius: 0;
    color: var(--ashm-notice-text);
}

.ashm-notice--callout .ashm-notice__inner {
    padding: 24px;
}

@media (max-width: 782px) {
    .ashm-notice__inner {
        align-items: flex-start;
        gap: 12px;
    }

    .ashm-notice--preheader .ashm-notice__inner {
        padding: 20px 16px;
    }

    .ashm-notice--callout .ashm-notice__inner {
        padding: 16px;
    }

    .ashm-notice__icon {
        flex-basis: 32px;
        width: 32px;
        height: 32px;
    }
}

/*
 * Dismissed state. The rule that acts on this class is emitted inline in the
 * head, not from this file: a class on the root element does nothing until a
 * rule referencing it exists, so a deferred stylesheet would move the flash
 * rather than remove it. Kept here as the readable copy of that rule.
 */
.ashm-notice-dismissed .ashm-notice--preheader {
    display: none;
}
