/* ===================================
   NEWSLETTER
   Form di iscrizione (brick, footer, pagine), pagine /newsletter/*
   (esito, disiscrizione, archivio, versione web).

   Comune a tutti i design: usa le variabili dei CSS dei design
   (--primary, --bg-white, --text-dark, --radius-*, --font-heading…), quindi
   prende da solo colori e font del design attivo. Le differenze di forma
   stanno in fondo, per classe del body:
     design1               body.design-design1 (nessuna classe tema)
     design2 Moderno       .theme-modern
     design3 Pulito        .theme-clean
     design4 Immersivo     .theme-immersive
     design5 Scuro         .theme-immersive--dark (sopra design4)
     design6 Fresco        .theme-fresh
     design7 Mattoncini    .theme-brick (4 colori: usa le variabili --bk-*)
     design8 Album         .theme-album (carta, nastro adesivo, posta aerea: variabili --ab-*)
   =================================== */

.nl-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Trappola per i bot: fuori dallo schermo, non display:none (alcuni bot lo saltano) */
.nl-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---------- Form ---------- */
.nl-form {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
}

.nl-form .newsletter-form {
    display: flex;
    gap: var(--spacing-sm, 1rem);
    width: 100%;
}

.nl-form .newsletter-form input[type="email"] {
    flex: 1;
    min-width: 0;
}

.nl-form .newsletter-form button {
    flex: 0 0 auto;
    cursor: pointer;
}

.nl-form .newsletter-form button:disabled {
    opacity: 0.7;
    cursor: progress;
}

.nl-privacy {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.875rem;
    line-height: 1.45;
    cursor: pointer;
}

.nl-privacy input {
    flex: 0 0 auto;
    width: 1.05rem;
    height: 1.05rem;
    margin: 0.12rem 0 0;
    accent-color: var(--primary);
}

.nl-privacy a {
    color: inherit;
    text-decoration: underline;
}

.nl-feedback {
    margin: 0;
    padding: 0.7rem 0.95rem;
    border-radius: var(--radius-sm, 8px);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-dark);
}

.nl-feedback--ok::before {
    content: '✓ ';
    color: #15803D;
}

.nl-feedback--error {
    background: #FDECEC;
    color: #9B1C1C;
}

/* Form dentro i box colorati (brick, footer): testo chiaro */
.newsletter .nl-privacy {
    color: rgba(255, 255, 255, 0.92);
}

/* ---------- Box nel footer ---------- */
.footer-newsletter {
    padding: 0 0 var(--spacing-xl, 3rem);
}

.footer-newsletter-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: var(--spacing-lg, 2rem) var(--spacing-xl, 3rem);
    align-items: center;
    padding-bottom: var(--spacing-xl, 3rem);
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.footer-newsletter-title {
    margin: 0 0 0.4rem;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: #FFFFFF;
}

.footer-newsletter-text p {
    margin: 0;
}

.footer-newsletter-links {
    margin-top: 0.6rem !important;
    font-size: 0.875rem;
}

.footer-newsletter-links a {
    color: inherit;
    text-decoration: underline;
    opacity: 0.85;
}

.footer-newsletter .newsletter-form input {
    padding: 0.85rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-sm, 8px);
    background: rgba(255, 255, 255, 0.96);
    color: #16213A;
    font: inherit;
    font-size: 1rem;
}

.footer-newsletter .newsletter-form button {
    padding: 0.85rem 1.5rem;
    border: 0;
    border-radius: var(--radius-sm, 8px);
    background: var(--primary);
    color: #FFFFFF;
    font: inherit;
    font-weight: 700;
}

.footer-newsletter .newsletter-form button:hover {
    background: var(--primary-dark);
}

.footer-newsletter .nl-privacy {
    color: inherit;
    opacity: 0.9;
}

/* ---------- Pagine /newsletter ---------- */
.nl-page {
    padding: var(--spacing-xxl, 4rem) 0;
}

.nl-page--archive,
.nl-page--detail {
    padding-top: var(--spacing-lg, 2rem);
}

.nl-card {
    max-width: 640px;
    margin: 0 auto;
    padding: clamp(1.75rem, 4vw, 3rem);
    background: var(--bg-white);
    color: var(--text-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 16px);
    box-shadow: var(--shadow-lift, 0 16px 36px rgba(0, 0, 0, 0.12));
}

.nl-card--message {
    text-align: center;
}

.nl-card h1,
.nl-card h2 {
    margin: 0 0 0.75rem;
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 3.4vw, 2.2rem);
    line-height: 1.15;
    color: var(--text-dark);
}

.nl-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4.5rem;
    height: 4.5rem;
    margin-bottom: 1.25rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    font-size: 2rem;
    line-height: 1;
}

.nl-card--error .nl-icon {
    background: #FDECEC;
}

.nl-eyebrow {
    margin: 0 0 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary);
}

.nl-lead {
    margin: 0 0 1.5rem;
    font-size: 1.075rem;
    line-height: 1.6;
    color: var(--text-medium);
}

.nl-lead strong {
    color: var(--text-dark);
}

.nl-small {
    margin: 1.25rem 0 0;
    font-size: 0.9rem;
    color: var(--text-light, var(--text-medium));
}

.nl-small a {
    color: var(--primary);
}

.nl-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin: 0;
}

.nl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.6rem;
    border: 2px solid var(--primary);
    border-radius: var(--radius-sm, 8px);
    background: var(--primary);
    color: #FFFFFF;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition, all 0.25s ease);
}

.nl-btn:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #FFFFFF;
}

.nl-btn--ghost {
    background: transparent;
    color: var(--text-dark);
    border-color: var(--border);
}

.nl-btn--ghost:hover {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

/* Form nelle card chiare (archivio, versione web, disiscrizione) */
.nl-card .newsletter-form input,
.nl-form--stacked input[type="email"] {
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 8px);
    background: var(--bg-cream);
    color: var(--text-dark);
    font: inherit;
    font-size: 1rem;
}

.nl-card .newsletter-form button {
    padding: 0.85rem 1.5rem;
    border: 0;
    border-radius: var(--radius-sm, 8px);
    background: var(--primary);
    color: #FFFFFF;
    font: inherit;
    font-weight: 700;
}

.nl-card .newsletter-form button:hover {
    background: var(--primary-dark);
}

.nl-card .nl-privacy {
    color: var(--text-medium);
}

.nl-card .nl-feedback {
    background: var(--bg-cream);
}

.nl-form--stacked > label {
    font-weight: 700;
    font-size: 0.95rem;
}

.nl-card--signup {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 1.5rem 2.5rem;
    align-items: center;
    max-width: 1000px;
    text-align: left;
}

.nl-card--signup .nl-lead {
    margin-bottom: 0;
}

/* Archivio */
.nl-section-title {
    margin: var(--spacing-xxl, 4rem) 0 var(--spacing-lg, 2rem);
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--text-dark);
}

.nl-empty {
    color: var(--text-medium);
}

.nl-archive {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-lg, 2rem);
}

.nl-archive-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-white);
    color: var(--text-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 16px);
    text-decoration: none;
    transition: var(--transition, all 0.25s ease);
}

.nl-archive-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lift, 0 16px 36px rgba(0, 0, 0, 0.12));
}

.nl-archive-media {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    background: color-mix(in srgb, var(--primary) 12%, var(--bg-cream));
    font-size: 2.5rem;
}

.nl-archive-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nl-archive-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1.25rem 1.4rem 1.5rem;
}

.nl-archive-body h3 {
    margin: 0 0 0.5rem;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    line-height: 1.25;
}

.nl-archive-body p:not(.nl-eyebrow) {
    margin: 0 0 1rem;
    color: var(--text-medium);
    line-height: 1.5;
}

.nl-link {
    margin-top: auto;
    font-weight: 700;
    color: var(--primary);
}

/* Versione web */
.nl-hero .nl-eyebrow {
    color: inherit;
    opacity: 0.85;
}

.nl-section {
    max-width: 760px;
    margin: 0 auto var(--spacing-xxl, 4rem);
}

.nl-section--split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(1.5rem, 4vw, 3.5rem);
    align-items: center;
    max-width: 1100px;
}

.nl-section--reverse .nl-section-media {
    order: 2;
}

.nl-section-media {
    margin: 0;
}

.nl-section-media img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg, 16px);
}

.nl-section-body h2 {
    margin: 0 0 1rem;
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    line-height: 1.2;
    color: var(--text-dark);
}

.nl-section-body .story-content {
    color: var(--text-medium);
    font-size: 1.075rem;
    line-height: 1.7;
}

.nl-section-body .story-content a {
    color: var(--primary);
}

.nl-section-body .nl-btn {
    margin-top: 0.5rem;
}

.nl-pets {
    margin-bottom: var(--spacing-xxl, 4rem);
}

@media (max-width: 860px) {
    .footer-newsletter-inner,
    .nl-card--signup,
    .nl-section--split {
        grid-template-columns: 1fr;
    }

    .nl-section--reverse .nl-section-media {
        order: 0;
    }
}

@media (max-width: 520px) {
    .nl-form .newsletter-form {
        flex-direction: column;
    }

    .nl-form .newsletter-form button {
        width: 100%;
    }
}

/* ===================================
   Varianti per design
   =================================== */

/* design2 Moderno: bordi spessi color inchiostro, ombre "a sticker" */
.theme-modern .nl-card,
.theme-modern .nl-archive-card {
    border: var(--stroke);
    box-shadow: var(--pop);
}

.theme-modern .nl-archive-card:hover {
    box-shadow: var(--pop-hover);
    transform: translate(-3px, -3px);
}

.theme-modern .nl-btn,
.theme-modern .nl-card .newsletter-form button,
.theme-modern .footer-newsletter .newsletter-form button {
    border: var(--stroke);
    border-radius: 999px;
    box-shadow: var(--pop);
}

.theme-modern .nl-btn:hover {
    box-shadow: var(--pop-hover);
    transform: translate(-2px, -2px);
}

.theme-modern .nl-btn--ghost {
    background: var(--bg-white);
    color: var(--ink);
}

.theme-modern .nl-card .newsletter-form input,
.theme-modern .footer-newsletter .newsletter-form input,
.theme-modern .nl-form--stacked input[type="email"] {
    border: var(--stroke);
    border-radius: 999px;
    padding-left: 1.25rem;
}

.theme-modern .nl-icon {
    background: var(--sun);
    border: var(--stroke);
}

.theme-modern .nl-section-media img {
    border: var(--stroke);
    box-shadow: var(--pop);
}

.theme-modern .footer-newsletter-inner {
    border-bottom-color: rgba(255, 255, 255, 0.18);
}

/* design3 Pulito: footer chiaro, linee sottili, niente ombre */
.theme-clean .footer-newsletter-inner {
    border-bottom-color: var(--line);
}

.theme-clean .footer-newsletter-title {
    color: var(--ink);
}

.theme-clean .footer-newsletter .newsletter-form input {
    border-color: var(--line-strong);
    background: var(--bg-white);
}

.theme-clean .nl-card,
.theme-clean .nl-archive-card {
    box-shadow: none;
}

.theme-clean .nl-archive-card:hover {
    box-shadow: var(--shadow-lift);
}

.theme-clean .nl-btn,
.theme-clean .nl-card .newsletter-form button,
.theme-clean .footer-newsletter .newsletter-form button {
    border-radius: 999px;
}

.theme-clean .nl-card .newsletter-form input,
.theme-clean .nl-form--stacked input[type="email"] {
    border-radius: 999px;
    padding-left: 1.25rem;
    background: var(--bg-white);
}

.theme-clean .nl-card h1,
.theme-clean .nl-card h2 {
    font-weight: 600;
    letter-spacing: -0.02em;
}

.theme-clean .nl-lead {
    font-family: var(--font-accent);
    font-style: italic;
    font-size: 1.3rem;
    line-height: 1.45;
}

.theme-clean .nl-eyebrow {
    letter-spacing: 0.16em;
    font-weight: 600;
}

.theme-clean .nl-icon {
    background: var(--accent);
}

/* design4 Immersivo (e design5): titoli serif, angoli ampi, foto ad arco */
.theme-immersive .nl-card,
.theme-immersive .nl-archive-card {
    border-radius: var(--radius-xl);
    border-color: transparent;
}

.theme-immersive .nl-card h1,
.theme-immersive .nl-card h2,
.theme-immersive .nl-section-body h2,
.theme-immersive .nl-section-title {
    font-weight: 600;
    letter-spacing: -0.02em;
}

.theme-immersive .nl-btn,
.theme-immersive .nl-card .newsletter-form button,
.theme-immersive .footer-newsletter .newsletter-form button {
    border-radius: 999px;
}

.theme-immersive .nl-card .newsletter-form input,
.theme-immersive .footer-newsletter .newsletter-form input,
.theme-immersive .nl-form--stacked input[type="email"] {
    border-radius: 999px;
    padding-left: 1.25rem;
}

.theme-immersive .nl-section-media img {
    border-radius: 999px 999px var(--radius-lg) var(--radius-lg);
    aspect-ratio: 4 / 5;
    object-fit: cover;
}

.theme-immersive .nl-archive-media {
    margin: 0.75rem 0.75rem 0;
    border-radius: 999px 999px var(--radius-md) var(--radius-md);
    overflow: hidden;
    aspect-ratio: 4 / 3;
}

.theme-immersive .nl-eyebrow {
    color: var(--primary);
}

.theme-immersive .footer-newsletter-title {
    font-weight: 600;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    color: var(--imx-on-ink);
}

.theme-immersive .footer-newsletter-inner {
    border-bottom-color: color-mix(in srgb, var(--imx-on-ink) 14%, transparent);
}

/* design5 Scuro: campi e messaggi su fondo scuro */
.theme-immersive--dark .nl-card {
    border-color: var(--border);
}

.theme-immersive--dark .nl-card .newsletter-form input,
.theme-immersive--dark .nl-form--stacked input[type="email"] {
    background: var(--bg-cream);
    border-color: var(--border);
    color: var(--text-dark);
}

.theme-immersive--dark .footer-newsletter .newsletter-form input {
    background: var(--bg-white);
    border-color: var(--border);
    color: var(--text-dark);
}

.theme-immersive--dark .nl-card .newsletter-form button,
.theme-immersive--dark .footer-newsletter .newsletter-form button,
.theme-immersive--dark .nl-btn {
    color: #0B0B0F;
}

.theme-immersive--dark .nl-btn--ghost {
    color: var(--text-dark);
}

.theme-immersive--dark .nl-feedback {
    background: var(--bg-cream);
    color: var(--text-dark);
}

.theme-immersive--dark .nl-feedback--error {
    background: #3A1518;
    color: #FFB4B4;
}

/* Animale già adottato nella versione web della newsletter */
.nl-adopted-badge {
    background: var(--accent) !important;
    color: var(--text-dark) !important;
}

.theme-immersive--dark .nl-adopted-badge {
    color: #0B0B0F !important;
}

/* design6 Fresco: pillole, angoli morbidi, footer scuro */
.theme-fresh .nl-card,
.theme-fresh .nl-archive-card {
    border-radius: var(--radius-lg);
    border-color: var(--line);
    box-shadow: none;
}

.theme-fresh .nl-archive-card:hover {
    box-shadow: var(--shadow-soft);
}

.theme-fresh .nl-card h1,
.theme-fresh .nl-card h2,
.theme-fresh .nl-section-body h2,
.theme-fresh .nl-section-title {
    font-weight: 800;
    letter-spacing: -0.02em;
}

.theme-fresh .nl-btn,
.theme-fresh .nl-card .newsletter-form button,
.theme-fresh .footer-newsletter .newsletter-form button {
    border-radius: 999px;
}

.theme-fresh .nl-card .newsletter-form input,
.theme-fresh .footer-newsletter .newsletter-form input,
.theme-fresh .nl-form--stacked input[type="email"] {
    border-radius: 999px;
    padding-left: 1.25rem;
    background: #fff;
}

.theme-fresh .nl-section-media img,
.theme-fresh .nl-archive-media {
    border-radius: var(--radius-md);
    overflow: hidden;
}

.theme-fresh .nl-icon {
    background: var(--mint);
    color: var(--primary-dark);
}

.theme-fresh .nl-eyebrow {
    color: var(--primary);
}

/* Box newsletter nel footer: il footer di design6 è scuro */
.theme-fresh .footer-newsletter-inner {
    border-bottom-color: #34454A;
}

.theme-fresh .footer-newsletter-title {
    color: #fff;
    font-weight: 800;
}

.theme-fresh .footer-newsletter-text,
.theme-fresh .footer-newsletter-links a {
    color: #C2CDC9;
}

/* design7 Mattoncini: riquadri con il bordo in rilievo, pulsanti a mattoncino.
   I colori arrivano dalle variabili della variante (rosso, bianco, nero, grigio). */
.theme-brick .nl-card,
.theme-brick .nl-archive-card {
    border: 0;
    border-top: 12px solid var(--bk-red);
    border-radius: 10px;
    background: var(--bk-card);
    color: var(--ink);
    box-shadow: 0 6px 0 var(--bk-card-side);
}

.theme-brick .nl-archive-card:nth-child(4n+2) { border-top-color: var(--bk-yellow); }
.theme-brick .nl-archive-card:nth-child(4n+3) { border-top-color: var(--bk-blue); }
.theme-brick .nl-archive-card:nth-child(4n) { border-top-color: var(--bk-green); }

.theme-brick .nl-card h1,
.theme-brick .nl-card h2,
.theme-brick .nl-section-body h2,
.theme-brick .nl-section-title {
    font-weight: 700;
    color: var(--ink);
}

.theme-brick .nl-btn {
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: var(--bk-on-primary);
    font-family: var(--font-heading);
    font-weight: 600;
    box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .16), 0 5px 0 var(--btn-side);
}

.theme-brick .nl-form--stacked input[type="email"] {
    border: 2px solid var(--line-strong);
    border-radius: 7px;
    background: var(--bk-field);
    color: var(--ink);
}

.theme-brick .nl-section-media img,
.theme-brick .nl-archive-media {
    border-radius: 6px;
    overflow: hidden;
}

.theme-brick .nl-icon {
    border-radius: 8px;
    background: var(--bk-yellow);
    color: #1E1E21;
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .16), 0 4px 0 var(--bk-yellow-side);
}

.theme-brick .nl-eyebrow {
    color: var(--primary);
}

.theme-brick .nl-adopted-badge {
    border-radius: 5px;
}

/* design8 Album: fogli di carta con il nastro adesivo, pulsanti a etichetta,
   titoli scritti a mano. Colori dalle variabili --ab-* di theme-album.css. */
.theme-album .nl-card,
.theme-album .nl-archive-card {
    position: relative;
    border: 0;
    border-radius: 1px;
    background: var(--ab-card);
    color: var(--ab-ink);
    box-shadow: var(--ab-shadow-photo);
}

.theme-album .nl-archive-card:nth-child(odd) { transform: rotate(-.6deg); }
.theme-album .nl-archive-card:nth-child(even) { transform: rotate(.6deg); }

.theme-album .nl-card h1,
.theme-album .nl-card h2,
.theme-album .nl-section-body h2,
.theme-album .nl-section-title {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--ab-ink);
}

.theme-album .nl-form--stacked input[type="email"] {
    border: 0;
    border-bottom: 2px solid rgba(38, 40, 58, .35);
    border-radius: 0;
    background: rgba(244, 236, 221, .5);
    color: var(--ab-ink);
}

.theme-album .nl-section-media img,
.theme-album .nl-archive-media {
    border-radius: 0;
    overflow: hidden;
}

.theme-album .nl-icon {
    border-radius: 50%;
    background: var(--ab-red);
    color: #FFFDF8;
}

.theme-album .nl-eyebrow {
    font-family: var(--font-type);
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ab-red);
}

.theme-album .nl-adopted-badge {
    border-radius: 2px;
    font-family: var(--font-type);
}

/* design8 Album, box nel footer (cartolina chiara dentro il footer scuro): campo email,
   casella del consenso e link privacy con il colore dell'inchiostro, non quello chiaro dei link del footer */
.theme-album .footer-newsletter .newsletter-form input {
    border: 0;
    border-bottom: 2px solid rgba(38, 40, 58, .45);
    border-radius: 0;
    background: rgba(244, 236, 221, .7);
    color: var(--ab-ink);
}

.theme-album .footer-newsletter .newsletter-form input::placeholder {
    color: rgba(38, 40, 58, .55);
}

.theme-album .footer-newsletter .nl-privacy {
    color: var(--ab-ink);
    opacity: 1;
}

.theme-album .footer-newsletter .nl-privacy input {
    accent-color: var(--ab-red);
    outline: 2px solid rgba(38, 40, 58, .45);
    outline-offset: 1px;
}

.theme-album .site-footer .footer-newsletter .nl-privacy a,
.theme-album .site-footer .footer-newsletter-links a {
    color: var(--ab-red);
    font-weight: 600;
}

.theme-album .site-footer .footer-newsletter .nl-privacy a:hover,
.theme-album .site-footer .footer-newsletter-links a:hover {
    color: var(--ab-blue);
}
