/**
 * Footer Styles — Alternativa Child Theme
 * @version 2.5.0
 *
 * Comportamento hover-expand:
 *   - Collassato : solo .footer-top-bar è visibile (max-height = --footer-collapsed-height)
 *   - Espanso    : hover su .site-footer → max-height cresce fino a rivelare .footer-bottom
 *   - Mobile     : sempre espanso (nessun hover su touch)
 *
 * Struttura HTML attesa:
 *   footer.site-footer
 *     div.footer-top-bar    ← logo · descrizione · CTA newsletter · CTA notifiche (altezza fissa)
 *     div.footer-bottom     ← form newsletter · privacy policy · social
 *
 * Changelog 2.4.0:
 *   - Rimossi stili modal AJAX (#nl-prefs-modal, .nl-modal-*):
 *     la gestione iscrizione avviene tramite i link nelle email del plugin Newsletter.
 *
 * Changelog 2.3.0:
 *   - Fix: la regola "display:none" sui label nascondeva anche la checkbox privacy (required).
 *     Ora il nascondimento è circoscritto al solo label del campo email.
 *   - Fix: le liste argomenti (.tnp-lists) vengono nascoste nel footer per compattezza.
 *   - Fix: aggiunto flex-wrap al form per consentire al campo privacy di andare a capo.
 *   - Nuovo: stili dedicati al campo privacy (.tnp-privacy-field) per sfondo scuro.
 */

/* ============================================================
   VARIABILI
   ============================================================ */
:root {
    --footer-collapsed-height: 68px;  /* altezza della sola fascia superiore visibile a riposo.
                                         Deve combaciare con l'altezza effettiva di .footer-top-bar.
                                         Calibra questo valore se logo o testo generano un'altezza
                                         diversa da quella attesa (es. wrapping su viewport stretti). */
    --footer-height: 600px;
}

.site-footer {
    --ft-bg:        #d60000;
    --ft-bg-top:    rgba(0, 0, 0, 0.15);   /* top-bar leggermente più scura */
    --ft-color:     #ffffff;
    --ft-muted:     rgba(255, 255, 255, 0.65);
    --ft-border:    rgba(255, 255, 255, 0.2);
    --ft-btn-bg:    rgba(255, 255, 255, 0.15);
    --ft-btn-bg-h:  rgba(255, 255, 255, 0.28);
    --ft-radius:    6px;
    --ft-input-h:   36px;    /* altezza input / bottoni nella fascia inferiore */
    --ft-max-w:     1400px;
    --ft-pad-y:     32px;
    --ft-pad-x:     1.2rem;
    --ft-trans:     0.2s ease;
    --ft-font-size: 1.3rem;
    --ft-font-size: 1.3rem;
    --ft-privacy-font-size: 1.3rem;
}

.site-footer:focus-within {
    max-height: var(--footer-height);   /* valore > altezza reale — non viene mai raggiunto fisicamente */
    cursor: default;
}
.site-footer:focus-within::before {
    opacity: 0;
}

/* ============================================================
   FOOTER BASE + MECCANISMO COLLAPSE / HOVER-EXPAND
   ============================================================ */
.site-footer {
    position: relative;
    z-index: 5;
    background: var(--ft-bg);
    color: var(--ft-color);
    padding: 0;                         /* il padding è gestito dalle fasce interne */
    border-top-left-radius: 24px;
    overflow: hidden;                   /* taglia .footer-bottom quando collassato */

    /* ── Stato collassato ── */
    max-height: var(--footer-collapsed-height);
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: ns-resize;                  /* indica che il footer è espandibile */
    display: none;
}

/* Indicatore visivo "c'è altro sotto" — la pillola bianca */
.site-footer::before {
    content: '';
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    left: 50%;
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.45);
    border-radius: 2px;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 2;
}

/* ── Stato espanso (hover) ── */
.site-footer:hover {
    max-height: var(--footer-height);   /* valore > altezza reale — non viene mai raggiunto fisicamente */
    cursor: default;
}

.site-footer:hover::before {
    opacity: 0;          /* nasconde la pillola quando espanso */
}

/* ── Responsive: mobile sempre espanso ── */

@media (max-width: 932px) {
    .footer-nl-wrap .tnp form {
        flex-wrap: wrap;       /* consente alla riga privacy di andare a capo */
    }
}

@media (max-width: 768px) {
    .site-footer {
        max-height: none;
        overflow: visible;
        cursor: default;
    }
    .site-footer::before {
        display: none;
    }
}

/* Bordi arrotondati responsive */
@media (min-width: 900px) {
    .site-footer { border-top-left-radius: 55px; }
}
@media (min-width: 1600px) {
    .site-footer { border-top-left-radius: 72px; }
}

/* Link base nel footer */
.site-footer a {
    color: var(--ft-color);
    text-decoration: none;
    transition: opacity var(--ft-trans);
}
.site-footer a:hover,
.site-footer a:focus-visible {
    opacity: 0.8;
    text-decoration: underline;
}


/* ============================================================
   FASCIA SUPERIORE — logo + descrizione + CTA newsletter + CTA notifiche
   Altezza fissa = --footer-collapsed-height: deve corrispondere
   esattamente alla variabile :root per garantire l'allineamento.
   ============================================================ */
.footer-top-bar {
    min-height: var(--footer-collapsed-height);
    display: flex;
    align-items: center;
    /*background: var(--ft-bg-top);*/
    padding: 0 var(--ft-pad-x);
    border-bottom: 1px solid var(--ft-border);
    position: relative;
    z-index: 1;                /* sopra la pillola ::before del footer */
    flex-shrink: 0;
    box-sizing: border-box;
}

.footer-top-inner {
    width: 100%;
    max-width: var(--ft-max-w);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0;
}

/* ── Brand: logo + denominazione associazione ─────────────── */
.footer-top-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

.footer-top-brand-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.footer-top-brand-link:hover {
    opacity: 0.85;
    text-decoration: none;
}

.footer-top-brand-link > img {
    border-radius:50%;
}

.footer-top-logo {
    height: 40px;
    width: auto;
    display: block;
}

.footer-top-assoc-name {
    margin: 0;
    font-size: var(--ft-font-size);
    font-weight: 600;
    color: var(--ft-color);
    line-height: 1.3;
    letter-spacing: 0.01em;
    /* nasconde il testo su viewport molto stretti per non mandare a capo la top-bar */
}

@media (max-width: 500px) {
    .footer-top-assoc-name {
        display: none;
    }
}

/* ── CTA: newsletter + notifiche RSS ─────────────────────── */
.footer-top-cta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Testo invito newsletter */
.footer-cta-text {
    font-size: var(--ft-font-size);
    font-weight: 600;
    color: var(--ft-color);
    white-space: nowrap;
    opacity: 0.9;
}

/* Nasconde il testo su mobile (mostrato solo su desktop) */
@media (max-width: 640px) {
    .footer-cta-text {
        display: none;
    }
}

/* Link CTA generico */
.footer-cta-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: var(--ft-input-h);
    padding: 0 0.8rem;
    background: var(--ft-btn-bg);
    border: 1px solid var(--ft-border);
    border-radius: var(--ft-radius);
    color: var(--ft-color);
    font-size: var(--ft-font-size);
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    flex-shrink: 0;
    transition: background var(--ft-trans);
}
.footer-cta-link:hover,
.footer-cta-link:focus-visible {
    background: var(--ft-btn-bg-h);
    opacity: 1;
    text-decoration: none;
}

.footer-cta-rss {
    display: none;
}

/* Icona RSS nel link CTA */
.footer-rss-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex-shrink: 0;
}


/* ============================================================
   FASCIA INFERIORE — form newsletter + azioni + social
   Questa fascia è nascosta quando il footer è collassato
   e diventa visibile durante l'hover (espansione max-height).

   Layout con social menu:    [ email ][ Iscriviti / Gestisci ]  /  [ ● ● ● ]
                               [ ☐ Ho letto l'informativa privacy... ]
   Layout senza social menu:  [ email ][ Iscriviti / Gestisci ]
                               [ ☐ Ho letto l'informativa privacy... ]
   In entrambi i casi .footer-nl-wrap occupa tutta la larghezza disponibile.
   ============================================================ */
.footer-bottom {
    padding: var(--ft-pad-y) var(--ft-pad-x);
    background: var(--ft-bg-top);
}

.footer-bottom-inner {
    max-width: var(--ft-max-w);
    margin: 0 auto;
    display: flex;
    flex-direction: row;   /* sempre in riga */
    flex-wrap: wrap;       /* va a capo se non c'è spazio */
    align-items: center;
    gap: 12px 20px;        /* row-gap column-gap */
}


/* ── Form newsletter (email + submit + privacy) ──────────── */

/* Wrapper form newsletter — occupa sempre tutta la larghezza disponibile.
   Il menu social, quando presente, va su riga propria grazie al flex-wrap del container. */
.footer-nl-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 100%;
    min-width: 0;
    white-space: normal;
    word-break: break-word;
}

/* Override stili plugin Newsletter (Stefano Lissa)
   Il plugin genera .tnp / .tnp-subscription con form annidato. */
.footer-nl-wrap .tnp,
.footer-nl-wrap .tnp-subscription {
    margin: 0;
    padding: 0;
    max-width: 100%;
    width: 100%;
}

.footer-nl-wrap .tnp form {
    display: flex;
    align-items: center;
    /*flex-wrap: wrap;*/       /* consente alla riga privacy di andare a capo */
    gap: 0.4rem;
    margin: 0;
    padding: 0;
}

/* Nascondi SOLO il label del campo email (sostituito dal placeholder).
   NON nascondere il label della privacy: contiene la checkbox required. */
.footer-nl-wrap .tnp .tnp-field-email label,
.footer-nl-wrap .tnp .tnp-field-label {
    display: none;
}

/* Nascondi le liste argomenti nel footer: complessità non necessaria
   qui; la selezione degli argomenti è disponibile nel modal
   "Gestisci iscrizione" tramite [newsletter_profile]. */
.footer-nl-wrap .tnp .tnp-lists {
    display: none;
}

/* Wrapper campi singoli: rimuove margini plugin */
.footer-nl-wrap .tnp .tnp-field {
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}
.footer-nl-wrap .tnp .tnp-field-email {
    /*flex: 1;*/
    min-width: 20vw;
    margin-right: 2vw;
}

/* Input email */
.footer-nl-wrap .tnp input[type="email"],
.footer-nl-wrap .tnp-email,
.footer-nl-fallback input[type="email"] {
    height: var(--ft-input-h);
    width: 100%;
    padding: 0 0.7rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: var(--ft-radius);
    color: var(--ft-color);
    font-size: var(--ft-font-size);
    line-height: 1;
    box-sizing: border-box;
    transition: border-color var(--ft-trans), background var(--ft-trans);
}
.footer-nl-wrap .tnp input[type="email"]::placeholder,
.footer-nl-fallback input[type="email"]::placeholder {
    color: var(--ft-muted);
}
.footer-nl-wrap .tnp input[type="email"]:focus,
.footer-nl-fallback input[type="email"]:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.2);
}

/* Pulsante submit newsletter */
.footer-nl-wrap .tnp input[type="submit"],
.footer-nl-wrap .tnp .tnp-submit,
.footer-nl-fallback button[type="submit"] {
    height: var(--ft-input-h);
    padding: 0 0.9rem;
    background: #ffffff;
    color: var(--ft-bg);
    border: none;
    border-radius: var(--ft-radius);
    font-size: var(--ft-font-size);
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--ft-trans), opacity var(--ft-trans);
    font-family: inherit;
}
.footer-nl-wrap .tnp input[type="submit"]:hover,
.footer-nl-fallback button[type="submit"]:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* ── Campo privacy — occupa tutta la larghezza (va a capo) ── */
.footer-nl-wrap .tnp .tnp-privacy-field {
    flex: 1 1 100%;          /* ← AGGIUNTO: forza riga propria e larghezza piena */
    min-width: 0;            /* ← AGGIUNTO: permette la compressione flex */
    margin-right: 2vw;
    display: flex;
    align-items: flex-start;
    gap: 0;
    font-size: var(--ft-privacy-font-size);
    color: var(--ft-muted);
    line-height: 1.45;
    margin-top: 0.15rem;
}

.footer-nl-wrap .tnp .tnp-privacy-field label {
    display: flex;          /* sovrascrive il display:none generico — questo label è visibile */
    align-items: flex-start;
    gap: 0.4rem;
    cursor: pointer;
    min-width: 0;            /* ← AGGIUNTO */
    overflow-wrap: break-word; /* ← AGGIUNTO: sicurezza extra per parole lunghe (es. URL) */
}

.footer-nl-wrap .tnp .tnp-privacy-field input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 0.15rem;   /* allineamento ottico con la prima riga di testo */
    accent-color: #ffffff;
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.footer-nl-wrap .tnp .tnp-privacy-field a {
    color: var(--ft-color);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.footer-nl-wrap .tnp .tnp-privacy-field a:hover {
    opacity: 0.8;
}

/* Fallback form (plugin non attivo) */
.footer-nl-fallback {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
}


/* ── Social nav ──────────────────────────────────────────── */

.footer-social-nav {
    display: flex;
    flex-shrink: 0;
}

.footer-social-list {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-social-list a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ft-btn-bg);
    transition: background var(--ft-trans), transform 0.25s ease;
    text-decoration: none;
}
.footer-social-list a:hover,
.footer-social-list a:focus-visible {
    background: var(--ft-btn-bg-h);
    transform: scale(1.1);
    opacity: 1;
    text-decoration: none;
}

/* Icone social via CSS (SVG inline come data-URI) */
.footer-social-list [href*="facebook.com"]::before,
.footer-social-list [href*="x.com"]::before,
.footer-social-list [href*="twitter.com"]::before,
.footer-social-list [href*="instagram.com"]::before,
.footer-social-list [href*="youtube.com"]::before {
    content: '';
    display: block;
    width: 18px;
    height: 18px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
.footer-social-list [href*="facebook.com"]::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/></svg>');
}
.footer-social-list [href*="x.com"]::before,
.footer-social-list [href*="twitter.com"]::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>');
}
.footer-social-list [href*="instagram.com"]::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z"/></svg>');
}
.footer-social-list [href*="youtube.com"]::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"/></svg>');
}
/*
.footer-credits {
    max-width: var(--ft-max-w);
    margin: 16px auto 0;
    padding-top: 12px;
    font-size: 0.76rem;
    color: var(--ft-muted);
    text-align: center;
    border-top: 1px solid var(--ft-border);
}
*/

/* ── screen-reader-text (utility standard WP) ─────────────── */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}



