/* ===================================================================
   RESET E VARIABILI
   =================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #1a3c6d;
    --light-bg: #f9f9f9;
    --white: #fff;
    --text-color: #333;
    --border-light: #e0e0e0;
}

/* ===================================================================
   ELEMENTI BASE
   =================================================================== */
body {
    font-family: 'Open Sans', Arial, Helvetica, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
    font-size: 0.85rem;
}

span {
    display: inline-block;
}

/* ===================================================================
   HEADER
   =================================================================== */
.layout-container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
    box-sizing: border-box;
}

.header {
    background-color: var(--primary-blue);
    color: var(--white);
    font-size: 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--white);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.header-subtitle {
    display: none;
    font-size: 0.85rem;
    color: #cfd8e3;
    margin-top: -0.2rem;
    font-style: italic;
    opacity: 0.9;
}

.flags {
    display: flex;
    gap: 0.5rem;
    font-size: 1.2rem;
}

.flag-icon {
    cursor: pointer;
    transition: transform 0.2s;
    border-radius: 50%;
    border: 2px solid var(--border-light);
    background-color: var(--white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.07);
    width: 28px;
    height: 28px;
}

    .flag-icon:hover {
        transform: scale(1.1);
        border-color: var(--primary-blue);
    }

/* ===================================================================
   NAVIGAZIONE
   =================================================================== */
.topnav {
    background-color: var(--primary-blue);
    padding: 0;
}

.nav-inner {
    position: relative;
    overflow: hidden;
}

.topnav a {
    float: left;
    display: block;
    color: #f2f2f2;
    text-align: center;
    padding: 7px 9px;
    text-decoration: none;
    font-size: 15px;
}

    .topnav a:hover {
        background-color: #ddd;
        color: black;
    }

    .topnav a.active {
        background-color: #2d67b9;
        color: white;
    }

.topnav .icon {
    display: none;
}

/* ===================================================================
   LAYOUT COMUNE
   =================================================================== */
.blocks-container,
.page-content {
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0 1rem;
}

.page-content {
    margin: 2rem auto;
}

/* ===================================================================
   BLOCCHI
   =================================================================== */
.block {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    padding: 2rem;
    transition: box-shadow 0.2s;
}

    /* ===================================================================
   TESTO GIUSTIFICATO NEI PARAGRAFI
   =================================================================== */
    .block p {
        text-align: justify;
        line-height: 1.7;
    }

    .block:hover {
        box-shadow: 0 4px 18px rgba(26, 60, 109, 0.14);
    }

    .block h2 {
        margin-bottom: 1rem;
        color: var(--primary-blue);
        border-bottom: 2px solid var(--border-light);
        padding-bottom: 0.5rem;
    }

    .block p,
    .block ul,
    .block .quote,
    .block .chapter-chips {
        margin-bottom: 2rem;
    }

.block-image {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-top: 1rem;
    margin-bottom: 1.7rem;
}

/* ===================================================================
   GRIGLIA BLOCCHI
   =================================================================== */
.blocks-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* ===================================================================
   LINK "TORNA ALLA HOME" E "INDIETRO"
   =================================================================== */
.TornaHome-link,
.Back-link {
    position: static;
    display: inline-block;
    color: var(--primary-blue);
    font-weight: 600;
    text-decoration: none;
    background: rgba(240, 245, 255, 0.5);
    border-radius: 5px;
    padding: 0.2em 0.7em;
    transition: background 0.2s;
}

    .TornaHome-link:hover,
    .Back-link:hover {
        text-decoration: underline;
        background: #f0f5ff;
    }

.continue-link {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    color: var(--primary-blue);
    font-weight: 600;
    text-decoration: none;
    background: rgba(240, 245, 255, 0.5);
    border-radius: 5px;
    padding: 0.2em 0.7em;
    transition: background 0.2s;
}

    .continue-link:hover {
        text-decoration: underline;
        background: #f0f5ff;
    }

/* ===================================================================
   ICONE E LISTE
   =================================================================== */
.icon-list li {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.0rem;
}

    .icon-list li a {
        color: #333 !important;
        text-decoration: none !important;
    }

        .icon-list li a:hover {
            color: #1a3c6d;
        }

i.fas,
i.far,
i.fab {
    color: #1a3c6d !important;
}

a:hover i.fas,
a:hover i.far,
a:hover i.fab {
    color: #2d67b9 !important;
}

/* ===================================================================
   AUDIO/VIDEO LIST
   =================================================================== */
.audio-video-list {
    display: flex;
    flex-direction: column;
    gap: 0.0rem;
}

    .audio-video-list li {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        min-height: 2.0rem;
    }

.audio-title {
    flex: 0 1 80%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

    .audio-title::first-letter {
        font-weight: bold;
    }

.audio-icons {
    flex: 0 0 auto;
    display: flex;
    gap: 0.6rem;
    color: #1a3c6d;
}

/* ===================================================================
   PAGINA AUDIO/VIDEO - LAYOUT GRIGLIA
   =================================================================== */

/* Contenitore della lista: usa CSS Grid */
#incontri-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 colonne su desktop */
    gap: 2rem;
    margin-top: 2rem;
}

/* Ogni elemento della lista diventa una "card" */
.registrazione-item {
    display: flex !important;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    margin-bottom: 0 !important; /* Rimuovi il margine inferiore */
    border-bottom: none !important; /* Rimuovi il bordo inferiore */
}

    .registrazione-item:hover {
        box-shadow: 0 4px 16px rgba(26, 60, 109, 0.15);
        transform: translateY(-2px);
    }

/* Icone disposte in riga orizzontale */
.icone-registrazione {
    flex-direction: row !important;
    justify-content: flex-start;
    gap: 1rem !important;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #f0f0f0;
}

/* Dati testuali */
.dati-registrazione {
    flex: 1;
}

/* Su mobile: torna a 1 colonna */
@media (max-width: 768px) {
    #incontri-list {
        grid-template-columns: 1fr; /* 1 colonna su mobile */
        gap: 1.5rem;
    }

    .registrazione-item {
        padding: 1.2rem;
    }
}

/* ===================================================================
   CITAZIONI E TESTO BIBLICO
   =================================================================== */
.quote {
    background-color: #f0f5ff;
    padding: 1rem;
    border-left: 4px solid var(--primary-blue);
    margin-bottom: 2rem;
}

.bibbia {
    font-style: italic;
    color: var(--primary-blue);
    font-weight: 600;
}

/* ===================================================================
   CHIP CAPITOLI
   =================================================================== */
.chapter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0 1.5rem 0;
}

    .chapter-chips .chip {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        background-color: var(--primary-blue);
        color: var(--white);
        font-size: 0.85rem;
        font-weight: 600;
        border-radius: 50%;
        flex-shrink: 0;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

/* ===================================================================
   COLONNE
   =================================================================== */
.two-columns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    list-style: none;
    padding: 0;
    margin: 0 auto;
    max-width: 600px;
}

/* ===================================================================
   MAPPA
   =================================================================== */
#map_canvas {
    flex: 1;
    min-width: 33.33%;
    height: 500px;
    min-height: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    object-fit: contain;
}

/* ===================================================================
   POPUP E DETTAGLI
   =================================================================== */
.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    overflow: auto;
}

.popup-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    width: 80%;
    max-width: 700px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    position: relative;
}

.close-popup {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    font-weight: bold;
}

    .close-popup:hover {
        color: #1a3c6d;
    }

.dettaglio-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: #1a3c6d;
    font-weight: 600;
    text-decoration: none;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

    .dettaglio-link:hover {
        background-color: #f0f5ff;
        text-decoration: underline;
    }

/* ===================================================================
   ELEMENTI CHIESA
   =================================================================== */
.chiesa-item {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 1.2rem;
    margin-bottom: 1.2rem;
}

    .chiesa-item h4 {
        margin-bottom: 0.5rem;
        color: #1a3c6d;
    }

    .chiesa-item p {
        margin: 0.3rem 0;
        line-height: 1.4;
    }

/* ===================================================================
   FORM DI RICERCA
   =================================================================== */
.search-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1.5rem 0;
}

    .search-container select {
        padding: 0.5rem;
        border: 1px solid #ddd;
        border-radius: 4px;
        background-color: white;
        width: 100%;
        max-width: 300px;
    }

/* ===================================================================
   FORM DI CONTATTO
   =================================================================== */
.form-container {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.form-group {
    margin-bottom: 1.2rem;
}

    .form-group label {
        display: block;
        margin-bottom: 0.4rem;
        font-weight: 600;
        color: #1a3c6d;
        font-size: 0.95rem;
    }

    .form-group input,
    .form-group textarea {
        width: 100%;
        padding: 0.6rem;
        border: 1px solid #ccc;
        border-radius: 4px;
        font-family: 'Open Sans', sans-serif;
        font-size: 1rem;
        background-color: white;
        transition: border-color 0.2s, box-shadow 0.2s;
    }

        .form-group input:focus,
        .form-group textarea:focus {
            outline: none;
            border-color: #1a3c6d;
            box-shadow: 0 0 0 2px rgba(26, 60, 109, 0.15);
        }

    .form-group textarea {
        min-height: 100px;
        resize: vertical;
    }

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 1.5rem 0;
}

    .checkbox-group input[type="checkbox"] {
        width: 20px !important;
        height: 20px !important;
        margin: 0 !important;
        cursor: pointer;
        accent-color: #1a3c6d;
        flex-shrink: 0;
        border: 2px solid #ccc;
        border-radius: 3px;
        background-color: white;
        appearance: auto;
    }

        .checkbox-group input[type="checkbox"]:hover {
            border-color: #1a3c6d;
        }

        .checkbox-group input[type="checkbox"]:checked {
            background-color: #1a3c6d;
            border-color: #1a3c6d;
        }

    .checkbox-group label {
        font-weight: normal;
        color: #333;
        font-size: 1rem;
        cursor: pointer;
        margin: 0;
    }

.submit-btn {
    background-color: #1a3c6d;
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Open Sans', sans-serif;
    transition: background-color 0.2s;
}

    .submit-btn:hover {
        background-color: #2d67b9;
    }

/* ===================================================================
   RADIO BUTTON
   =================================================================== */
.radio-group {
    margin-bottom: 1.2rem;
}

.radio-label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: #1a3c6d;
    font-size: 0.95rem;
}

.radio-options {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

    .radio-item input[type="radio"] {
        accent-color: #1a3c6d;
        width: 16px;
        height: 16px;
        cursor: pointer;
        margin: 0;
    }

    .radio-item label {
        margin: 0;
        font-weight: normal;
        cursor: pointer;
        color: #333;
        font-size: 1rem;
    }

.radio-group .text-danger {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.85rem;
}

/* ===================================================================
   MESSAGGI E NOTE
   =================================================================== */
.form-note {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: #d32f2f;
    line-height: 1.4;
    text-align: center;
}

.form-error {
    color: #d32f2f;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    text-align: center;
}

.text-danger {
    color: #d32f2f;
    font-size: 0.85rem;
    margin-top: 0.2rem;
    display: block;
}

.consent-group {
    position: relative;
}

    .consent-group input[type="checkbox"],
    .consent-group label {
        display: inline-block;
        vertical-align: top;
    }

.consent-error {
    display: block !important;
    clear: both;
    margin-top: 0.3rem;
}

.alert-success {
    background-color: #e6f4ea;
    border-left: 4px solid #1a3c6d;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 0 4px 4px 0;
}

/* ===================================================================
   FOOTER (AGGIORNATO)
   =================================================================== */
.footer {
    background-color: var(--primary-blue);
    color: var(--white);
    font-size: 0.9rem;
    margin-top: 2rem;
}

.footer-inner {
    display: block; /* Cambiato da flex a block per gestire le due viste */
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

/* --- VERSIONE DESKTOP --- */
.footer-desktop-view {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-mobile-view {
    display: none; /* Nascosto su desktop */
}

.footer a {
    color: var(--white);
    text-decoration: none;
    margin: 0 0.5rem;
}

    .footer a:hover {
        text-decoration: underline;
    }

.footer-links {
    display: flex;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-left i,
.footer-right i {
    margin-right: 0.5rem;
    color: var(--white) !important; /* Forza le icone a essere bianche nel footer */
}

/* ===================================================================
   DIALOG PERSONALIZZATA
   =================================================================== */
.chiesa-dialog.ui-dialog {
    border-radius: 8px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
    border: none !important;
    background: white !important;
}

.chiesa-dialog .ui-dialog-titlebar {
    background: #1a3c6d !important;
    color: white !important;
    border: none !important;
    border-radius: 8px 8px 0 0 !important;
    padding: 0.8rem 1.2rem !important;
    font-family: 'Open Sans', sans-serif !important;
    font-weight: 600 !important;
    font-size: 1.1rem !important;
    position: relative !important;
}

/* === PULSANTE DI CHIUSURA: RESET TOTALE === */
.chiesa-dialog .ui-dialog-titlebar-close {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    width: 28px !important;
    height: 28px !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    /* Nascondi qualsiasi testo o icona ereditata */
    font-size: 0 !important;
    line-height: 0 !important;
    color: transparent !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.2s ease !important;
}

    .chiesa-dialog .ui-dialog-titlebar-close:hover {
        background: rgba(255, 255, 255, 0.4) !important;
    }

    /* === NASCONDI COMPLETAMENTE L'ICONA SPRITE DI JQUERY UI === */
    .chiesa-dialog .ui-dialog-titlebar-close .ui-icon,
    .chiesa-dialog .ui-dialog-titlebar-close .ui-button-icon {
        display: none !important;
        background-image: none !important;
        background-color: transparent !important;
    }

    .chiesa-dialog .ui-dialog-titlebar-close .ui-button-icon-space {
        display: none !important;
    }

    /* === DISEGNA UNA "X" BIANCA CON CSS (Infallibile) === */
    .chiesa-dialog .ui-dialog-titlebar-close::before,
    .chiesa-dialog .ui-dialog-titlebar-close::after {
        content: "" !important;
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        width: 14px !important;
        height: 2px !important;
        background-color: #ffffff !important;
        border-radius: 2px !important;
    }

    /* Prima linea della X (ruotata a 45 gradi) */
    .chiesa-dialog .ui-dialog-titlebar-close::before {
        transform: translate(-50%, -50%) rotate(45deg) !important;
    }

    /* Seconda linea della X (ruotata a -45 gradi) */
    .chiesa-dialog .ui-dialog-titlebar-close::after {
        transform: translate(-50%, -50%) rotate(-45deg) !important;
    }

/* === CONTENUTO DELLA DIALOG === */
.chiesa-dialog .ui-dialog-content {
    padding: 1.5rem !important;
    background-color: white !important;
    overflow-y: auto !important;
    max-height: calc(500px - 60px) !important;
    font-family: 'Open Sans', sans-serif !important;
    line-height: 1.6 !important;
    color: #333 !important;
}

.chiesa-dialog .text4 {
    margin: 0;
    font-size: 1rem;
}

/* ===================================================================
   CARD LINK UTILI
   =================================================================== */
.link-cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}

.link-card {
    display: flex;
    flex-direction: column;
    background-color: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    height: 100%;
}

    .link-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 20px rgba(26, 60, 109, 0.15);
        border-color: var(--primary-blue);
    }

.link-card-image-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: #f0f5ff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.link-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.link-card:hover .link-card-img {
    transform: scale(1.05);
}

.link-card-body {
    padding: 1.2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

    .link-card-body h3 {
        margin: 0 0 0.6rem 0;
        color: var(--primary-blue);
        font-size: 1.15rem;
        font-weight: 600;
        line-height: 1.3;
    }

    .link-card-body p {
        margin: 0;
        font-size: 0.95rem;
        color: #555;
        line-height: 1.5;
    }

/* ===================================================================
   PULSANTE "TORNA IN CIMA"
   =================================================================== */
#btn-torna-in-cima {
    position: fixed;
    bottom: 30px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #1a3c6d;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(26, 60, 109, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
    z-index: 999;
}

    #btn-torna-in-cima i {
        color: white !important;
    }

    #btn-torna-in-cima.visible {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    #btn-torna-in-cima:hover {
        background-color: #2d67b9;
        box-shadow: 0 6px 16px rgba(26, 60, 109, 0.4);
        transform: translateY(-2px);
    }

    #btn-torna-in-cima:active {
        transform: translateY(0);
        box-shadow: 0 2px 8px rgba(26, 60, 109, 0.3);
    }

/* ===================================================================
   CARD NOTIFICA PUSH
   =================================================================== */
.notifica-card {
    background: linear-gradient(135deg, #f0f5ff 0%, #ffffff 100%);
    border-left: 4px solid #1a3c6d;
    border-radius: 8px;
    padding: 1.5rem 2rem;
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 2px 8px rgba(26, 60, 109, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

@keyframes bell-ring {
    0%, 50%, 100% {
        transform: rotate(0);
    }

    10%, 30% {
        transform: rotate(-15deg);
    }

    20%, 40% {
        transform: rotate(15deg);
    }
}

/* ===================================================================
   BANNER CONSENSO COOKIE (GDPR)
   =================================================================== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    color: var(--text-color);
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    border-top: 3px solid var(--primary-blue);
    padding: 1.2rem 1rem;
    transition: transform 0.4s ease-in-out;
}

    .cookie-banner.hidden {
        transform: translateY(150%);
        visibility: hidden;
    }

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.cookie-text {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.5;
}

    .cookie-text i {
        color: var(--primary-blue);
        margin-right: 0.5rem;
        font-size: 1.2rem;
    }

    .cookie-text a {
        color: var(--primary-blue);
        font-weight: 600;
        text-decoration: underline;
    }

.cookie-buttons {
    display: flex;
    gap: 0.8rem;
    flex-shrink: 0;
}

.btn-accept,
.btn-reject {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Open Sans', sans-serif;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-accept {
    background-color: var(--primary-blue);
    color: var(--white);
}

    .btn-accept:hover {
        background-color: #2d67b9;
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(26, 60, 109, 0.3);
    }

.btn-reject {
    background-color: transparent;
    color: var(--primary-blue);
    border: 1px solid var(--border-light);
}

    .btn-reject:hover {
        background-color: #f0f5ff;
        border-color: var(--primary-blue);
    }

/* Stili specifici per l'header e la nav dell'area admin */
.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

    .logout-btn:hover {
        background-color: #dc3545;
        border-color: #dc3545;
        color: white;
        transform: translateY(-1px);
    }

.admin-badge {
    background-color: #ffc107;
    color: #000;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 700;
    margin-left: 0.5rem;
    vertical-align: middle;
    text-transform: uppercase;
}

.public-site-link {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

    .public-site-link:hover {
        background-color: #28a745 !important;
        color: white !important;
        border-color: #28a745;
    }

/* Footer admin minimalista */
.footer-admin {
    background-color: #15315a;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    margin-top: 3rem;
    padding: 1.5rem 0;
    text-align: center;
}

    .footer-admin a {
        color: var(--white);
        text-decoration: underline;
    }

/* ===================================================================
   MEDIA QUERY - DESKTOP (min-width: 769px)
   =================================================================== */
@media (min-width: 769px) {
    .header-subtitle {
        display: block;
    }

    .block-1 {
        grid-column: 1 / -1;
    }

    .link-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

/* ===================================================================
   FORM INVIO EMAIL (PAGINA SPECIFICA)
   =================================================================== */

.email-wrapper {
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
}

.email-card {
    width: 100%;
    max-width: 800px;
    background-color: var(--white);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(26, 60, 109, 0.12);
    border-top: 5px solid var(--primary-blue);
}

.email-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-light);
}

    .email-header i {
        font-size: 2.5rem;
        color: var(--primary-blue);
    }

    .email-header h2 {
        margin: 0;
        color: var(--primary-blue);
        font-size: 1.5rem;
        border: none;
    }

    .email-header p {
        margin: 0.3rem 0 0 0;
        color: #666;
        font-size: 0.9rem;
    }

.selection-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #f0f5ff;
    color: var(--primary-blue);
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 2rem;
    border-left: 4px solid var(--primary-blue);
}

.no-selection-warning {
    background-color: #fff3cd;
    color: #856404;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid #ffc107;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.form-group .required {
    color: #d32f2f;
    margin-left: 0.2rem;
    font-weight: bold;
}

.form-group textarea {
    min-height: 200px;
    resize: vertical;
    line-height: 1.5;
}

.form-group .help-text {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.4rem;
    font-style: italic;
}

.checkbox-group .checkbox-desc {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.3rem;
    margin-bottom: 0;
}

/* Pulsanti azione specifici - ora coerenti con .submit-btn */
.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
    align-items: center;
}

/* Pulsante Annulla - stile bottone grigio pieno */
.btn-cancel {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Open Sans', sans-serif;
    text-decoration: none;
    transition: background-color 0.2s;
}

    .btn-cancel:hover {
        background-color: #5a6268;
        color: white;
        text-decoration: none;
    }

.validation-summary {
    background-color: #fde8e8;
    color: #d32f2f;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid #d32f2f;
    margin-bottom: 1.5rem;
}

.field-validation-error {
    color: #d32f2f;
    font-size: 0.85rem;
    margin-top: 0.3rem;
    display: block;
}

.email-card .form-group label {
    display: inline-block !important;
    margin-bottom: 0 !important;
    margin-right: 0.3rem;
}

.email-card .form-group .required {
    display: inline-block;
    vertical-align: top;
    margin-left: 0.2rem;
}

/* ===================================================================
   MEDIA QUERY - MOBILE (max-width: 768px)
   =================================================================== */
@media (max-width: 768px) {
    /* Header */
    .layout-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .header {
        font-size: 0.7rem;
    }

    .header-inner {
        gap: 0.5rem;
    }

    .flag-icon {
        width: 24px;
        height: 24px;
    }

    .flags {
        gap: 0.3rem;
    }

    /* Blocchi */
    .blocks-container {
        padding: 0 1rem;
    }

    .block {
        width: 100%;
        padding: 1rem;
    }

    /* --- VERSIONE MOBILE DEL FOOTER (Identica alla topnav) --- */
    .footer-desktop-view {
        display: none !important;
    }

    .footer-mobile-view {
        display: flex;
        align-items: center;
        position: relative;
        padding: 0;
        background-color: var(--primary-blue);
    }

        .footer-mobile-view a:not(.icon) {
            display: inline-block;
            color: #f2f2f2;
            padding: 14px 16px;
            margin: 0; /* Reset del margine globale del footer */
            text-decoration: none;
            font-size: 15px;
            transition: background-color 0.3s;
        }

            .footer-mobile-view a:not(.icon):hover {
                background-color: #ddd;
                color: black;
            }

    /* Menu a tendina nascosto */
    .footer-mobile-links {
        display: none;
        position: absolute;
        bottom: 100%; /* <-- ANCORA IL MENU AL BORDO SUPERIORE DELLA BARRA */
        left: 0;
        width: 100%;
        background-color: #15315a;
        flex-direction: column;
        z-index: 1000; /* Leggermente aumentato per stare sopra a tutto */
        box-shadow: 0 -4px 10px rgba(0,0,0,0.3); /* Ombra verso l'alto per dare profondità */
        border-radius: 8px 8px 0 0; /* Angoli arrotondati solo in alto per un effetto più moderno */
        overflow: hidden;
    }

        .footer-mobile-links a {
            display: block;
            padding: 14px 16px;
            border-top: 1px solid rgba(255,255,255,0.1);
            text-align: left;
        }

            .footer-mobile-links a:hover {
                background-color: #1a3c6d;
                color: white;
            }

    /* Classe aggiunta via JS per mostrare il menu */
    .footer-mobile-view.responsive .footer-mobile-links {
        display: flex;
    }

    /* Icona hamburger */
    .footer-mobile-view .icon {
        display: block;
        padding: 14px 16px;
        color: white;
        font-size: 15px;
        margin-left: auto; /* Spinge l'icona a destra */
        text-decoration: none;
    }

        .footer-mobile-view .icon:hover {
            background-color: #ddd;
            color: black;
        }

    /* Pagine interne */
    .incontri-top {
        flex-direction: column;
    }

    .incontri-testo,
    .incontri-form {
        width: 100% !important;
        min-width: auto;
    }

    .registrazione-item {
        flex-direction: column;
        gap: 1rem;
    }

    .icone-registrazione {
        flex-direction: row !important;
        justify-content: flex-start;
    }

    .dovesiamo-top {
        flex-direction: column !important;
        gap: 1.5rem;
    }

        .dovesiamo-top > div {
            width: 100% !important;
            min-width: 0 !important;
            flex: none !important;
        }

    .dovesiamo-text p {
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
    }

    .chiesa-item {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .chiesa-icone {
        justify-content: flex-start;
    }

    .chapter-chips .chip {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    /* Form */
    .search-container {
        flex-direction: column;
    }

    .popup-content {
        width: 95%;
        margin: 10% auto;
        padding: 1.5rem;
    }

    .form-group input,
    .form-group textarea {
        padding: 0.8rem;
        font-size: 1rem;
    }

    .submit-btn {
        width: 100%;
        padding: 0.8rem;
    }

    /* Dialog fullscreen mobile */
    .fullscreen-dialog.ui-dialog,
    .mobile-fullscreen.ui-dialog {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        z-index: 9999 !important;
    }

    .fullscreen-dialog .ui-dialog-titlebar,
    .mobile-fullscreen .ui-dialog-titlebar {
        position: sticky !important;
        top: 0 !important;
        z-index: 10 !important;
        border-radius: 0 !important;
        padding: 1rem !important;
        margin: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .fullscreen-dialog .ui-dialog-content,
    .mobile-fullscreen .ui-dialog-content {
        height: calc(100vh - 60px) !important;
        max-height: calc(100vh - 60px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding: 1.5rem 1rem !important;
        box-sizing: border-box !important;
    }

    .fullscreen-dialog .text4,
    .mobile-fullscreen .text4 {
        font-size: 1rem;
        line-height: 1.7;
        word-wrap: break-word;
    }

    .ui-widget-overlay {
        z-index: 9998 !important;
    }

    /* Pulsante torna in cima */
    #btn-torna-in-cima {
        width: 42px;
        height: 42px;
        bottom: 20px;
        right: 15px;
        font-size: 1rem;
    }

    /* Card link utili */
    .link-cards-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .link-card-image-wrapper {
        height: 180px;
    }

    /* Card notifica */
    .notifica-card {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem 1rem;
        gap: 1rem;
    }

        .notifica-card a {
            width: 100%;
            text-align: center;
            box-sizing: border-box;
        }

    /* Cookie banner mobile */
    .cookie-content {
        flex-direction: column;
        text-align: center;
        gap: 1.2rem;
    }

    .cookie-text {
        text-align: center;
    }

    .cookie-buttons {
        width: 100%;
        justify-content: center;
    }

    .btn-accept,
    .btn-reject {
        flex: 1;
        padding: 0.8rem 1rem;
    }

    .logout-btn span {
        display: none;
    }

    .logout-btn {
        padding: 0.5rem;
        border-radius: 50%;
    }

    .email-card {
        padding: 1.5rem;
    }

    .email-header {
        flex-direction: column;
        text-align: center;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-cancel {
        width: 100%;
    }
}

/* ===================================================================
   MEDIA QUERY - TOPNAV MOBILE (max-width: 769px)
   =================================================================== */
@media screen and (max-width: 769px) {
    .topnav a:not(:first-child) {
        display: none;
    }

    .topnav a.icon {
        float: right;
        display: block;
    }

    body.page-internal .page-content {
        padding: 0 0.75rem;
        max-width: none;
    }

    body.page-internal .block {
        padding: 1.5rem 1rem;
        width: 100%;
        box-sizing: border-box;
    }

    body.page-internal .block-image {
        width: 100%;
        margin: 1rem 0;
    }

    .topnav.responsive {
        position: relative;
    }

        .topnav.responsive .nav-inner {
            position: relative;
        }

        .topnav.responsive .icon {
            position: absolute;
            right: 1rem;
            top: 0;
        }

        .topnav.responsive a {
            float: none;
            display: block;
            text-align: left;
        }
}
