/* Elle Newsletter signup block — preconfigured design.
   All visual decisions live here, not in the editor. */

.eln-signup {
    --eln-bg: #f7f3ed;
    --eln-fg: #1a1a1a;
    /* Derived from --eln-fg so body / small print / labels / status all
       follow the editor's chosen text color while staying visually muted.
       Old browsers without color-mix get the rgba fallback. */
    --eln-muted: rgba(0, 0, 0, 0.55);
    --eln-muted: color-mix(in srgb, var(--eln-fg) 65%, transparent);
    --eln-button-bg: #000;
    --eln-button-fg: #fff;
    --eln-border-color: #e0d9cd;
    --eln-border-width: 1px;
    --eln-border-radius: 6px;
    --eln-image-width: 25%;
    background: var(--eln-bg);
    color: var(--eln-fg);
    border: var(--eln-border-width) solid var(--eln-border-color);
    border-radius: var(--eln-border-radius);
    padding: clamp(20px, 4vw, 32px);
    margin: 32px 0;
    display: flex;
    gap: 20px;
}

/* Image layout: side-by-side. Default vertical alignment is "top"
   (flex-start); modifier classes shift to middle / bottom. Falls back to
   stacked on narrow viewports. */
.eln-signup--image-left {
    flex-direction: row;
    align-items: flex-start;
}
.eln-signup--image-left.eln-signup--image-align-middle {
    align-items: center;
}
.eln-signup--image-left.eln-signup--image-align-bottom {
    align-items: flex-end;
}

.eln-signup--image-left .eln-signup__media {
    flex: 0 0 auto;
    width: var(--eln-image-width, 25%);
}

@media (max-width: 600px) {
    .eln-signup--image-left {
        flex-direction: column;
    }
    .eln-signup--image-left .eln-signup__media {
        width: 100%;
    }
}

/* Image layout: image on top, copy below. Image centered at natural size,
   never cropped, never blown up beyond the container width. */
.eln-signup--image-top {
    flex-direction: column;
}
.eln-signup--image-top .eln-signup__media {
    width: 100%;
    text-align: center;
}
.eln-signup--image-top .eln-signup__image {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    width: auto;
}

/* No image — single column, content full width. */
.eln-signup--text-only {
    flex-direction: column;
}

.eln-signup__media {
    margin: 0;
    padding: var(--eln-image-padding, 0);
}

.eln-signup__image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: calc(var(--eln-radius) - 2px);
}

.eln-signup__content {
    display: grid;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0;
}

.eln-signup__hed {
    margin: 0;
    font-family: var(--font-heading, inherit);
    /* --eln-hed-scale (set inline by the render, default 1) multiplies the
       responsive size so a variant can shrink its headline for tight spots
       like sidebar widgets without losing the fluid clamp. */
    font-size: calc(clamp(20px, 2.4vw, 26px) * var(--eln-hed-scale, 1));
    line-height: 1.2;
    /* Site convention is 300 for editorial headers (#review-heading,
       .home .section-heading h2). Set explicitly because the parent theme's
       broad `h1, h2, h3, h4, h5, h6` rule applies font-weight: 700, which
       would otherwise win on `inherit`. */
    font-weight: 300;
    color: var(--eln-fg);
}

.eln-signup__body {
    margin: 0;
    color: var(--eln-muted);
    line-height: 1.5;
    /* Default to inheriting site body size; --eln-body-size is set inline
       on the wrapper when an editor picks an override. */
    font-size: var(--eln-body-size, inherit);
}

.eln-signup__body > p,
.eln-signup__body > ul,
.eln-signup__body > ol {
    margin: 0 0 0.6em;
}

.eln-signup__body > p:last-child,
.eln-signup__body > ul:last-child,
.eln-signup__body > ol:last-child {
    margin-bottom: 0;
}

.eln-signup__small-print {
    margin: 8px 0 0;
    font-size: 0.75em;
    color: var(--eln-muted);
    line-height: 1.4;
}

.eln-signup__small-print a {
    color: inherit;
    text-decoration: underline;
}

.eln-signup__form {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 10px;
    margin: 4px 0 0;
}

/* Default field spans the whole row. Editors set per-row span via the
   inline --eln-field-span CSS variable; valid values are 1–12. */
.eln-signup__field {
    display: block;
    grid-column: span var(--eln-field-span, 12);
    min-width: 0;
}

/* Non-field children (button, status text, small print, honeypot) always
   take the full row and break to a new line. */
.eln-signup__form > .eln-signup__submit,
.eln-signup__form > .eln-signup__status,
.eln-signup__form > .eln-signup__small-print,
.eln-signup__form > .eln-signup__hp {
    grid-column: 1 / -1;
}

/* On narrow viewports, force every field back to full-width so side-by-side
   pairs stack instead of crushing. */
@media (max-width: 480px) {
    .eln-signup__field {
        grid-column: 1 / -1;
    }
}

.eln-signup__label {
    display: block;
    font-size: 13px;
    color: var(--eln-muted);
    margin-bottom: 4px;
}

.eln-signup__field input[type="email"],
.eln-signup__field input[type="text"],
.eln-signup__field select {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--eln-border);
    border-radius: calc(var(--eln-radius) - 2px);
    background: #fff;
    color: var(--eln-fg);
    font-size: 15px;
    font: inherit;
}

.eln-signup__field input:focus,
.eln-signup__field select:focus {
    outline: 2px solid var(--accent-color, #cd202e);
    outline-offset: 1px;
}

.eln-signup__hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Button matches the elle-gourmet-blocks convention (recipe-roundup,
   product). Black background, uppercase heading-font label, opacity
   hover. The !important on color guards against theme link/button
   resets that target generic <button> selectors. */
.eln-signup__submit {
    display: inline-block;
    appearance: none;
    border: 0;
    background: var(--eln-button-bg);
    color: var(--eln-button-fg) !important;
    padding: 10px 22px;
    border-radius: 3px;
    font-family: var(--font-heading, inherit);
    font-size: 14px;
    /* Match the site heading convention (300). See note on .eln-signup__hed. */
    font-weight: 300;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    justify-self: start;
    transition: opacity 0.2s ease;
}

.eln-signup__submit:hover:not(:disabled) {
    opacity: 0.75;
    color: var(--eln-button-fg) !important;
}

.eln-signup__submit:disabled {
    opacity: 0.6;
    cursor: progress;
}

.eln-signup__status {
    margin: 0;
    min-height: 1.2em;
    font-size: 14px;
    color: var(--eln-muted);
}

.eln-signup__status[data-kind="error"] {
    color: var(--accent-color, #cd202e);
    font-weight: 500;
}

.eln-signup__success {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--eln-fg);
    padding: 8px 0;
}

.visually-hidden {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    width: 1px;
    height: 1px;
    overflow: hidden;
}
