.hm-article-newsletter {
    --hm-newsletter-plum: #4e1c43;
    --hm-newsletter-paper: #fff7fd;
    --hm-newsletter-muted: #f1ddec;
    box-sizing: border-box;
    container-type: inline-size;
    padding: clamp(1.25rem, 4vw, 2.1875rem);
    background: var(--hm-newsletter-plum);
    color: var(--hm-newsletter-paper);
    text-align: center;
}

.hm-article-newsletter > .wp-block-heading {
    margin: 0;
    color: inherit;
}

.hm-article-newsletter > .hm-newsletter-description {
    max-inline-size: 38ch;
    margin: .5rem auto 0;
    color: var(--hm-newsletter-muted);
}

.hm-article-newsletter .hm-newsletter-signup {
    max-inline-size: 23.75rem;
    margin: 1rem auto 0;
    scroll-margin-block-start: 12rem;
}

.hm-newsletter-signup .es_form_wrapper {
    margin: 0 !important;
}

.hm-newsletter-signup form.es_subscription_form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: .5rem;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    text-align: start;
}

.hm-newsletter-signup form.es_subscription_form[hidden] { display: none; }
.hm-newsletter-signup .es-field-wrap {
    min-inline-size: 0;
    margin: 0 !important;
}

.hm-newsletter-signup .es-field-wrap label {
    display: block;
    margin-block-end: 0 !important;
    color: inherit !important;
    font-family: var(--wp--preset--font-family--rubik) !important;
    font-size: var(--wp--preset--font-size--x-small) !important;
    line-height: normal !important;
}

.hm-newsletter-signup :is(input[type="email"], input[type="submit"]) {
    box-sizing: border-box;
    min-block-size: 44px;
    margin: 0 !important;
    border-radius: 4px;
    font-family: var(--wp--preset--font-family--rubik);
}

.hm-newsletter-signup input[type="email"] {
    inline-size: 100% !important;
    min-inline-size: 0;
    margin-block-start: .25rem !important;
    padding-inline: .75rem;
    border: 1px solid #a497a2 !important;
    background: #fff !important;
    color: #29252c !important;
}

.hm-newsletter-signup input[type="submit"] {
    inline-size: auto !important;
    padding-inline: .75rem !important;
    cursor: pointer;
    white-space: nowrap;
}

.hm-article-newsletter .hm-newsletter-signup input[type="submit"] {
    border-color: var(--hm-newsletter-paper) !important;
    background: var(--hm-newsletter-paper) !important;
    color: var(--hm-newsletter-plum) !important;
}

.hm-article-newsletter .hm-newsletter-signup input:focus-visible {
    outline: 2px solid var(--hm-newsletter-paper);
    outline-offset: 3px;
}

.hm-newsletter-signup input[type="submit"]:disabled { cursor: wait; }

.hm-newsletter-signup :is(.es_subscription_message, .hm-newsletter-feedback) {
    display: block;
    margin: 0;
    color: inherit;
    font-family: var(--wp--preset--font-family--rubik);
    font-size: var(--wp--preset--font-size--x-small);
}

.hm-newsletter-signup :is(.es_subscription_message, .hm-newsletter-feedback):empty { display: none; }
.hm-newsletter-signup :is(.es_subscription_message, .hm-newsletter-feedback):not(:empty) { margin-block-start: .75rem; }

.hm-newsletter-masthead { position: relative; }
.hm-newsletter-masthead > .wp-block-image { max-inline-size: calc(100% - 13rem); }

.hm-newsletter-masthead .hm-masthead-newsletter {
    max-inline-size: none;
    margin: 0;
    scroll-margin-block-start: var(--wp--preset--spacing--40);
}

.hm-masthead-newsletter > summary {
    position: absolute;
    inset-block-start: calc(var(--wp--preset--spacing--30) + .75rem);
    inset-inline-end: var(--wp--preset--spacing--30);
    display: flex;
    align-items: center;
    gap: .5rem;
    inline-size: max-content;
    min-block-size: 44px;
    list-style: none;
    color: var(--wp--preset--color--theme-1);
    font-family: var(--wp--preset--font-family--rubik);
    font-size: var(--wp--preset--font-size--x-small);
    text-decoration: underline;
    text-underline-offset: .25em;
    cursor: pointer;
}

.hm-masthead-newsletter > summary::-webkit-details-marker { display: none; }

.hm-masthead-mail-icon {
    position: relative;
    display: inline-block;
    box-sizing: border-box;
    inline-size: .9rem;
    block-size: .65rem;
    border: 1px solid currentColor;
    border-radius: 2px;
    overflow: hidden;
}

.hm-masthead-mail-icon::before {
    content: '';
    position: absolute;
    inset-block-start: -.31rem;
    inset-inline-start: .13rem;
    inline-size: .49rem;
    block-size: .49rem;
    border-inline-end: 1px solid currentColor;
    border-block-end: 1px solid currentColor;
    transform: rotate(45deg);
}

.hm-masthead-newsletter-panel {
    margin-block-start: var(--wp--preset--spacing--20);
    padding: var(--wp--preset--spacing--30);
    background: #faf1f8;
    color: var(--wp--preset--color--theme-5);
    font-family: var(--wp--preset--font-family--rubik);
    font-size: var(--wp--preset--font-size--x-small);
}

.hm-masthead-newsletter-panel > p { margin-block: 0; }
.hm-masthead-newsletter-panel .hm-newsletter-signup {
    margin-block-start: .75rem;
    max-inline-size: 24rem;
}

.hm-masthead-newsletter-panel input[type="email"] {
    font-size: var(--wp--preset--font-size--small);
}

.hm-masthead-newsletter-panel input[type="submit"] {
    border-color: var(--wp--preset--color--theme-2) !important;
    background: var(--wp--preset--color--theme-2) !important;
    color: var(--wp--preset--color--theme-1) !important;
}

@media (max-width: 600px) {
    .hm-newsletter-masthead > .wp-block-image { max-inline-size: 100%; }
    .hm-masthead-newsletter > summary { position: static; margin-inline-start: auto; }
    .hm-masthead-newsletter-panel { margin-block-start: 0; }
}

@media (max-width: 375px) {
    .hm-masthead-newsletter-panel form.es_subscription_form { grid-template-columns: minmax(0, 1fr); }
}

@container (max-width: 22rem) {
    .hm-article-newsletter form.es_subscription_form {
        grid-template-columns: minmax(0, 1fr);
    }

    .hm-article-newsletter .hm-newsletter-signup input[type="submit"] { inline-size: 100% !important; }
}
