/*
 * The newsletter block of the home page and of the blog articles (resources/views/common/newsletter/_home_block.blade.php,
 * public/js/newsletter-form.js).
 * The country chips (_country_chips.blade.php) are also those of the confirmation page (confirm.blade.php).
 *
 * A soft tinted panel: the promises on the left, the form on a white card on the right; stacked under 992px.
 * Colours, type, radii, spacing and shadows come from the site's tokens (style.css).
 */

/* On an article, the block breathes like the article's other sections. */
.home-newsletter--article {
    padding-block: var(--r2e-section-y);
}

.home-newsletter-panel {
    background: var(--r2e-primary-50);
    border: 1px solid var(--r2e-primary-100);
    border-radius: var(--r2e-radius-xl);
    padding: var(--r2e-space-8) var(--r2e-space-6);
}
@media (min-width: 992px) {
    .home-newsletter-panel { padding: var(--r2e-space-12); }
}

/* The four promises, each with its icon in a white disc. */
.home-newsletter-promises {
    display: grid;
    gap: var(--r2e-space-3);
    margin-top: var(--r2e-space-6);
}
@media (min-width: 576px) {
    .home-newsletter-promises { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.home-newsletter-promise {
    display: flex;
    align-items: center;
    gap: var(--r2e-space-3);
    font-weight: 600;
}
.home-newsletter-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: white;
    color: var(--bs-primary);
    box-shadow: var(--r2e-shadow-sm);
}

/* The form card. */
.home-newsletter-form {
    background: white;
    border-radius: var(--r2e-radius-lg);
    box-shadow: var(--r2e-shadow);
    padding: var(--r2e-space-6);
}
@media (min-width: 992px) {
    .home-newsletter-form { padding: var(--r2e-space-8); }
}
.home-newsletter-optional {
    font-weight: 400;
    font-size: var(--r2e-text-sm);
    color: var(--r2e-ink-muted);
    margin-left: var(--r2e-space-1);
}

/* Country chips: radios drawn as pills, one at a time. */
.home-newsletter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--r2e-space-2);
}
.home-newsletter-chip {
    display: inline-flex;
    align-items: center;
    padding: var(--r2e-space-2) var(--r2e-space-4);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--r2e-radius-pill);
    background: white;
    color: var(--r2e-ink);
    font-size: var(--r2e-text-sm);
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, color 0.15s ease-in-out;
}
.home-newsletter-chip:hover {
    border-color: var(--bs-primary);
    color: var(--bs-primary);
}
.btn-check:checked + .home-newsletter-chip {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
}
.btn-check:focus-visible + .home-newsletter-chip {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
    .home-newsletter-chip { transition: none; }
}

/* The email field and the button on one line, the button under the field when the card is too narrow. */
.home-newsletter-field {
    display: flex;
    flex-wrap: wrap;
    gap: var(--r2e-space-2);
}
/* The field and the button share one height, the large button's 48px (Victor, 2026-11-25). */
.home-newsletter-field .form-control {
    flex: 1 1 14rem;
    min-width: 0;
    height: var(--r2e-space-12);
}
.home-newsletter-field .r2e-submit {
    flex: 1 0 auto;
    height: var(--r2e-space-12);
}
@media (min-width: 576px) {
    .home-newsletter-field .r2e-submit { flex-grow: 0; }
}
.home-newsletter-note {
    margin-top: var(--r2e-space-3);
    font-size: var(--r2e-text-sm);
    color: var(--r2e-ink-muted);
}
