/*
 * Block-scoped tokens. Mapped to the theme's existing global custom properties (style.css root) —
 * swap the right-hand var() names if the design system later adds newsletter-specific tokens.
 */
#dfdl-newsletter-signup {
    --nl-accent: var(--color-dfdl-green, #004c45);
    --nl-accent-contrast: var(--color-white, #fff);
    --nl-border: var(--color-whisper, #e7e7e7);
    --nl-error-text: #b60101;
    --nl-muted: var(--color-gray, #7d7d7d);
    --nl-radius: var(--setting-border-radius, 8px);
    margin: auto;
    padding: 2rem;
    width: min( 980px, calc( 100% - 4rem ) );
    @media( width <= 500px ) {
        margin-top: 1rem;
        padding: 1rem;
        width: min(980px, calc(100% - 2rem));
    }
}
#dfdl-newsletter-signup a {
    color: var(--nl-accent);
}
#dfdl-newsletter-signup h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2.5rem;
}
#dfdl-newsletter-signup h3 {
    font-size: 1.5rem;
    font-weight: 400;
}
#dfdl-newsletter-signup > h3 {
    font-size: 1.5rem;
    margin-bottom: 2.5rem;
    max-width: min(54rem, 100%);
}
.nl-tailor-group {
    margin-top: 32px;
}
.nl-tailor-group h2 + .description {
    margin-bottom: 0;
}
.nl-tailor-group > h2,
.nl-tailor-group h3 {
    margin-bottom: 0;
}
.nl-tailor-group .description {
    display: block;
    margin-bottom: 1rem;
    text-wrap: pretty;
}
.dfdl-newsletter-form label {
    display: block;
}
.dfdl-newsletter-form input:not([type="checkbox"]):not([type="radio"]),
.dfdl-newsletter-form select {
    background: #ffffff;
    border: 1px solid #cccccc;
    box-sizing: border-box;
    max-width: 100%;
    outline: none;
    padding: 7px 16px;
    width: 100%;
}
.dfdl-newsletter-form input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    background: #fff;
    border: 1px solid #666;
    border-radius: 3px;
    cursor: pointer;
    display: inline-grid;
    height: 16px;
    margin-top: 7px;
    width: 16px;
}
.dfdl-newsletter-form input[type="checkbox"]:checked {
    background: var(--nl-accent);
    border-color: var(--nl-accent);
    box-shadow: inset 0 0 0 3px #fff;
}
.dfdl-newsletter-form input:not([type="checkbox"]):user-invalid,
.dfdl-newsletter-form select:user-invalid {
    border-color: var(--nl-error-text);
}
.dfdl-newsletter-form input[type="checkbox"]:checked::before {
    transform: scale(1);
}
.dfdl-newsletter-form button {
    background: var(--color-white);
    border: 1.2px solid var(--primary-green);
    border-radius: 2px;
    color: var(--primary-green);
    font-size: var(--size-16);
    font-weight: var(--simi-bold);
    /* margin-bottom: 3rem; */
    /* margin-top: 1rem; */
    padding: 8px 40px;
    text-transform: uppercase;
    white-space: nowrap;
    width: min( 320px, 100% );
}
.dfdl-newsletter-form button:hover:not(:disabled) {
    background: var(--primary-green);
    color: var(--color-white);
    cursor: pointer;
}
.dfdl-newsletter-form button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}
.dfdl-newsletter-form :is(input, select, button, .nl-suggestion):focus-visible {
    outline: 2px solid var(--nl-accent);
    outline-offset: 2px;
}

/* Two-zone layout — 60/40 split below the full-width flagship card */
.nl-layout {
    align-items: start;
    display: grid;
    gap: 40px;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
}
.nl-selections {
    min-width: 0;
}

/* Flagship card */
.nl-flagship-card {
    border: solid 1px #555;
    border-radius: 3px;
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    position: relative;
    transition: background-color .25s, border-color .25s;
    @media( width <= 380px ) {
        padding: 1rem;
    }
}
.nl-flagship-card:has(input:checked) {
    background: color-mix(in srgb, var(--nl-accent) 5%, transparent);
    border-color: var(--nl-accent);
}
.nl-flagship-card:hover:not(:has(input:checked)) {
    background: color-mix(in srgb, var(--nl-accent) 2%, transparent);
    border-color: color-mix(in srgb, var(--nl-accent) 50%, transparent);
}
.dfdl-newsletter-form .nl-flagship-header {
    align-items: center;
    border-bottom: dotted 1px #999;
    cursor: pointer;
    display: flex;
    gap: 8px;
    margin-bottom: .5rem;
    padding-bottom: .5rem;
}
.dfdl-newsletter-form .nl-flagship-header::after {
    content: "";
    cursor: pointer;
    inset: 0;
    position: absolute;
}
.dfdl-newsletter-form .nl-flagship-header input[type="checkbox"] {
    height: 20px;
    margin-top: 10px;
    width: 20px;
}
.nl-flagship-title {
    font-size: 1.5rem;
    font-weight: 600;
    @media( width <= 380px ) {
        font-size: 1.35rem;
    }
}
.nl-flagship-card .nl-descriptor {
    color: inherit;
    font-size: 1.1rem;
}
.nl-flagship-meta {
    font-size: 1rem;
    font-weight: 600;
    margin-block: 1rem;
}
.nl-descriptor {
    display: block;
    font-size: 0.85rem;
    margin-top: 4px;
    text-wrap: pretty;
}

/* Regional / updates grids */
.checkbox-grid {
    display: grid;
    gap: 24px 32px;
}
.regional-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.updates-grid {
    display: flex;
    gap: 32px;
    margin-bottom: 2rem;
    @media(width <= 380px ) {
        flex-direction: column;
        gap: 16px;
    }
}
.updates-grid label {
    cursor: pointer;
}
.header-countries {
    margin-bottom: 1rem;
}

/* Country cards — name and both checkboxes are always visible, no reveal/hide interaction. */
.nl-country-grid {
    display: grid;
    gap: 24px 32px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 1.5rem;
}
.nl-country-card {
    border: 1px solid var(--nl-border);
    border-radius: var(--nl-radius);
    margin: 0;
    padding: 12px 16px;
    transition: border-color .25s;
}
.nl-country-card:has(.nl-chip input:checked) {
    border-color: var(--nl-accent);
}
.nl-country-card legend {
    font-weight: var(--simi-bold);
    padding: 0;
}
.nl-country-card-boxes {
    display: flex;
    gap: 4px 16px;
    margin-top: 8px;
}
.nl-country-card-boxes label {
    align-items: center;
    display: flex;
    gap: 4px;
}
.nl-country-card-boxes .nl-chip {
    align-items: center;
    background: var(--color-white, #fff);
    border: 1px solid #999;
    border-radius: 999px;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    font-size: 0.85rem;
    gap: 0;
    padding: 7px calc(14px + 1rem);
    position: relative;
    transition: background-color .25s, border-color .25s, color .25s;
    user-select: none;
}
.nl-country-card-boxes .nl-chip input[type="checkbox"] {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}
.nl-country-card-boxes .nl-chip:has(input:checked) {
    background: var(--nl-accent);
    border-color: var(--nl-accent);
    color: var(--nl-accent-contrast);
}
.nl-country-card-boxes .nl-chip:has(input:focus-visible) {
    outline: 2px solid var(--nl-accent);
    outline-offset: 2px;
}
.nl-practice-title {
    cursor: pointer;
    font-weight: 600;
}

/* Honeypot (unchanged) */
.field-shift {
    left: -9999px;
    position: absolute;
}

/* Details aside */
.nl-details {
    background: #fafafa;
    border-radius: var(--nl-radius);
    padding: 24px;
    @media(width <= 380px ) {
        padding: 16px;
    }
}
.nl-details h3 {
    margin-top: 0;
}
.nl-error {
    background: var(--color-white, #fff);
    border: 1px solid var(--nl-error-text);
    border-radius: 3px;
    color: var(--nl-error-text);
    margin: 0 0 16px;
    padding: 12px 16px;
}
.nl-field {
    margin-bottom: 1rem;
}
.nl-submit-hint {
    color: var(--nl-error-text);
    font-size: 0.85rem;
    margin: 0 0 8px;
}
.nl-submit-hint:empty {
    display: none;
}
.nl-field label {
    font-weight: var(--simi-bold);
    margin-bottom: 4px;
}
.nl-optional {
    color: var(--nl-muted);
    font-weight: 400;
}
.dfdl-newsletter-form .nl-suggestion {
    background: none;
    border: none;
    color: var(--nl-accent);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    margin: 8px 0 0;
    padding: 0;
    text-decoration: underline;
    text-transform: none;
    width: auto;
}
.dfdl-newsletter-form .nl-suggestion::after {
    content: "?";
}

.entry-content .postscript p {
    font-size: smaller;
    margin-block: 1rem;
    margin-inline: 0;
    max-width: min(43rem, 100%);
}
.postscript {
    color: #555;
}
#dfdl-newsletter-signup .nl-details h3 {
    margin-top: 1rem;
}
/* Confirmation state */
.nl-confirmation {
    background: var(--color-light-gray, #f6f6f6);
    border-radius: var(--nl-radius);
    padding: 32px;
}
.entry-content .nl-confirmation p {
    margin: 0;
}
#dfdl-newsletter-signup .nl-confirmation h2 {
    margin-top: .5rem;
}
#dfdl-newsletter-signup .header-updates {
    margin-top: 1rem;
}
/* Mobile sticky bar */
.nl-sticky-bar {
    display: none;
}
@media (max-width: 900px) {
    .js .nl-sticky-bar.is-visible {
        align-items: center;
        background: var(--color-white);
        border-top: 1px solid var(--nl-border);
        bottom: 0;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
        display: flex;
        justify-content: flex-end;
        left: 0;
        padding: 12px 20px;
        position: fixed;
        right: 0;
        z-index: 100;
    }
    .nl-sticky-bar button {
        margin: 0;
        padding: 8px 20px;
        width: auto;
    }
}

@media (max-width: 900px) {
    .nl-layout {
        grid-template-columns: 1fr;
    }
    .nl-country-grid {
        grid-template-columns: 1fr;
    }
    .entry-content .nl-submit-hint {
        margin: 0;
        padding-bottom: 1rem;
    }
}
@media (max-width: 700px) {
    .regional-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dfdl-newsletter-form button,
    .nl-country-card,
    .nl-country-card-boxes .nl-chip,
    .nl-flagship-card {
        transition: none;
    }
    html {
        scroll-behavior: auto;
    }
}

