/* Newsletter signup modal — opened from the sidebar "Subscribe now!" button
   (data-newsletter-open). Recreates the footer newsletter form's POST to
   /api/newsletter/subscribe inside a themed dialog. All colours pull from the
   theme variables so each site's modal matches its palette. */
.sd-newsletter-modal[hidden] {
    display: none;
}

.sd-newsletter-modal {
    position: fixed;
    inset: 0;
    /* Above the categories drawer (1060) and its backdrop (1050). */
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.sd-newsletter-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
}

.sd-newsletter-modal__content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: var(--background);
    color: var(--text-color);
    border-radius: 6px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
    overflow: hidden;
}

.sd-newsletter-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--accent-color);
    color: var(--accent-color-text);
    padding: .5em .75em;
}

.sd-newsletter-modal__title {
    margin: 0;
    font-size: 1rem;
    font-weight: normal;
}

.sd-newsletter-modal__close {
    background: none;
    border: 0;
    color: var(--accent-color-text);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 .25rem;
}

    .sd-newsletter-modal__close:hover {
        opacity: .8;
    }

.sd-newsletter-modal__body {
    padding: 1rem;
}

.sd-newsletter-modal__text {
    margin: 0 0 .75rem;
    font-size: .9rem;
}

.sd-newsletter-modal__label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    margin-bottom: .35rem;
}

/* Input + Submit share one row; the field flexes to fill, the button hugs its
   label. Wraps to two lines on very narrow widths so neither gets crushed. */
.sd-newsletter-modal__row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: .5rem;
}

.sd-newsletter-modal__input {
    flex: 1 1 12rem;
    min-width: 0;
    box-sizing: border-box;
    padding: .5em .65em;
    border: 1px solid var(--border-color);
    /* Keep the field white/dark-text regardless of theme panel colour so the
       typed address stays legible on dark themes (matches the footer input). */
    background: #fff;
    color: #333;
    font-size: .9rem;
    border-radius: 3px;
}

.sd-newsletter-modal__btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.sd-newsletter-modal__msg {
    margin-top: .6rem;
    font-size: .85rem;
    min-height: 1.2em;
}

    .sd-newsletter-modal__msg--error {
        color: var(--error-text-color);
    }

    .sd-newsletter-modal__msg--success {
        color: var(--success-text-color);
    }

/* Lock the page behind the open modal so only the dialog is interactive. */
body.sd-newsletter-modal-open {
    overflow: hidden;
}
