/* =========================================================
   STILE GENERALE
   ========================================================= */

body {
    font-family: "Lato", sans-serif;

    background-color: #E3E9ED;

    background-image:
        radial-gradient(
            ellipse at 15% 15%,
            rgba(92, 118, 135, 0.18) 0%,
            rgba(92, 118, 135, 0.08) 25%,
            transparent 55%
        ),
        radial-gradient(
            ellipse at 85% 25%,
            rgba(255, 255, 255, 0.35) 0%,
            rgba(255, 255, 255, 0.15) 30%,
            transparent 60%
        ),
        radial-gradient(
            ellipse at 75% 80%,
            rgba(82, 110, 128, 0.14) 0%,
            rgba(82, 110, 128, 0.06) 30%,
            transparent 60%
        ),
        radial-gradient(
            ellipse at 20% 85%,
            rgba(255, 255, 255, 0.30) 0%,
            transparent 55%
        );

    color: #333333;

    margin: 0;

    padding: 20px;
}


/* =========================================================
   TITOLI
   ========================================================= */

h1 {
    text-align: center;
    color: #42586B;
}

h2 {
    color: #42586B;
    font-weight: 700;
    letter-spacing: 0.3px;
}

h3 {
    color: #42586B;
}


/* =========================================================
   HERO
   ========================================================= */

.hero {
    text-align: center;

    padding: 60px 20px;

    background-image:
        linear-gradient(
            rgba(0, 0, 0, 0.20),
            rgba(0, 0, 0, 0.20)
        ),
        url("../immagini/tarsia-alto.webp");

    background-size: cover;

    background-position: center;

    background-attachment: fixed;

    border-radius: 18px;
}

.stemma {
    width: 140px;
    margin-bottom: 20px;

    filter:
        drop-shadow(
            0 4px 8px rgba(244, 240, 232, 0.9)
        );
}

.hero h1 {
    font-size: 40px;
    margin-bottom: 10px;

    color: white;

    text-shadow:
        0 3px 10px rgba(0, 0, 0, 0.75);
}

.sottotitolo {
    color: white;
    font-size: 22px;

    text-shadow:
        0 3px 10px rgba(0, 0, 0, 0.75);
}


/* =========================================================
   RICERCA
   ========================================================= */

.area-ricerca {
    text-align: center;
    margin-top: 35px;
}

input {
    width: 90%;
    max-width: 500px;

    padding: 12px;

    font-size: 16px;

    border: 1px solid #ccc;
    border-radius: 8px;

    text-align: center;

    box-sizing: border-box;
}

button {
    margin-top: 10px;

    padding: 12px 25px;

    background: #31475A;

    color: white;

    border: none;

    border-radius: 8px;

    font-size: 16px;

    cursor: pointer;

    opacity: 0.85;
}

.area-ricerca button {
    background: transparent;

    color: white;

    border: 2px solid white;

    padding: 12px 35px;

    border-radius: 25px;

    text-shadow:
        0 2px 5px rgba(0, 0, 0, 0.5);

    transition: 0.3s;
}

.area-ricerca button:hover {
    background: white;
    color: #31475A;
}


/* =========================================================
   RISULTATI E SCHEDA
   ========================================================= */

#risultati,
#scheda {
    background: #F1F4F5;

    max-width: 700px;

    margin: 30px auto;

    padding: 25px;

    border-radius: 14px;

    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.06);
}

#risultati {
    display: block;
}

#risultati:empty {
    display: none;
}

.risultato-card {
    background: white;

    margin: 20px auto;

    padding: 20px;

    border-radius: 14px;

    box-shadow:
        0 3px 12px rgba(0, 0, 0, 0.06);
}

.risultato-card h3 {
    margin-top: 0;
}


/* =========================================================
   LINK
   ========================================================= */

a {
    color: #42586B;

    text-decoration: underline;

    font-weight: bold;
}


/* =========================================================
   PULSANTI
   ========================================================= */

.scheda-button {
    display: inline-block;

    margin-top: 15px;

    padding: 10px 18px;

    background: #31475A;

    color: white;

    border: 2px solid #31475A;

    border-radius: 10px;

    font-weight: bold;

    letter-spacing: 0.2px;

    text-decoration: none;
}

.pulsante {
    display: inline-block;

    margin-top: 20px;

    padding: 12px 22px;

    background: #31475A;

    color: white;

    border: 2px solid #31475A;

    border-radius: 10px;

    font-weight: bold;

    letter-spacing: 0.2px;

    text-decoration: none;
}

#scheda > h1 {
    color: #42586B;

    font-size: 32px;

    margin-bottom: 30px;
}

.pulsanti-cimitero {
    display: flex;

    gap: 15px;

    margin-top: 20px;
}

.pulsanti-cimitero .pulsante {
    margin-top: 0;

    flex: 1;

    text-align: center;
}


/* =========================================================
   SCHEDA DEFUNTO
   ========================================================= */

.scheda-contenuto {
    display: flex;

    gap: 40px;

    align-items: flex-start;
}

.dati-defunto {
    flex: 1;
}

.titolo-posizione {
    color: #42586B;

    margin-top: 25px;

    margin-bottom: 15px;
}

.foto-defunto {
    width: 300px;

    height: 300px;

    display: flex;

    align-items: center;

    justify-content: center;

    overflow: hidden;
}

.foto-defunto img {
    max-width: 100%;

    max-height: 100%;

    object-fit: contain;

    border-radius: 16px;
}


/* =========================================================
   FOTO MANCANTE
   ========================================================= */

.foto-mancante {
    width: 100%;

    max-width: 280px;

    padding: 30px 20px;

    text-align: center;

    background: white;

    border: 1px solid #D5DDE2;

    border-radius: 14px;

    box-shadow:
        0 3px 12px rgba(0, 0, 0, 0.06);

    box-sizing: border-box;

    color: #555;
}

.foto-mancante p {
    margin: 0 0 20px;

    font-size: 16px;

    line-height: 1.5;
}

.foto-mancante img {
    width: 72%;

    height: auto;

    object-fit: contain;

    filter:
        drop-shadow(
            0 3px 8px rgba(0, 0, 0, 0.15)
        );
}


/* =========================================================
   HOME BLOCCHI
   ========================================================= */

.blocco-home {
    max-width: 900px;

    margin: 40px auto;

    background: #F1F4F5;

    padding: 30px;

    border-radius: 14px;

    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.06);
}

.blocco-home p {
    line-height: 1.7;

    font-size: 17px;
}

.blocco-home h2 {
    text-align: left;

    font-size: 28px;

    margin-bottom: 25px;
}

.cosa-puoi-fare h2 {
    text-align: center;
}

.titolo-centro {
    text-align: center !important;
}

.contribuisci {
    text-align: center;
}

.contribuisci h2 {
    text-align: center;
}


/* =========================================================
   INTRO HOME
   ========================================================= */

.intro-home {
    text-align: center;

    max-width: 650px;

    margin: 0 auto 35px;

    line-height: 1.6;
}


/* =========================================================
   FUNZIONI HOME
   ========================================================= */

.funzioni-home {
    display: flex;

    justify-content: space-between;

    gap: 25px;
}

.funzione {
    flex: 1;

    background: white;

    padding: 25px 20px;

    border-radius: 14px;

    text-align: center;

    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.06);

    transition: 0.3s;
}

.funzione:hover {
    transform: translateY(-5px);
}

.funzione img {
    width: 75px;

    height: 75px;

    object-fit: contain;

    margin-bottom: 5px;

    transition: 0.3s;
}

.funzione:hover img {
    transform: translateY(-4px);
}

.funzione h3 {
    margin-top: 5px;

    margin-bottom: 10px;
}

.funzione p {
    line-height: 1.5;

    font-size: 15px;
}


/* =========================================================
   SEZIONE CIMITERO
   ========================================================= */

.cimitero-sezione {
    display: flex;

    align-items: center;

    gap: 40px;
}

.cimitero-sezione img {
    width: 45%;

    border-radius: 16px;
}

.cimitero-sezione div {
    flex: 1;
}


/* =========================================================
   ICONE TITOLI
   ========================================================= */

.titolo-con-icona {
    display: flex;

    align-items: center;

    gap: 15px;
}

.titolo-con-icona img {
    width: 75px;

    object-fit: contain;
}


/* =========================================================
   GESTIONE FOOTER
   ========================================================= */

.gestione-sito {
    display: flex;

    justify-content: space-around;

    gap: 20px;

    text-align: center;
}

.gestione-sito div {
    flex: 1;
}

.gestione-sito p {
    margin-bottom: 8px;

    font-size: 14px;
}

.gestione-sito strong {
    font-size: 15px;
}


/* =========================================================
   COLLABORAZIONE COMUNE
   ========================================================= */

.collaborazione-comune {
    display: block;

    width: 100%;

    margin: 22px 0 0;

    padding-top: 12px;

    text-align: center;

    font-size: 15px;

    font-style: italic;

    font-weight: 700;

    box-sizing: border-box;
}


/* =========================================================
   FOOTER
   ========================================================= */

.footer-sito {
    box-sizing: border-box;

    width: 100%;

    margin: 60px 0 0;

    padding: 40px 20px;

    background-image:
        linear-gradient(
            rgba(0, 0, 0, 0.15),
            rgba(0, 0, 0, 0.15)
        ),
        url("../immagini/Tarsia-lago.webp");

    background-size: cover;

    background-position: center;

    color: white;

    text-align: center;
}

.footer-box {
    background: rgba(49, 71, 90, 0.45);

    border: 1px solid rgba(255, 255, 255, 0.25);

    padding: 18px;

    margin: 15px auto;

    width: 100%;

    max-width: 700px;

    box-sizing: border-box;

    border-radius: 12px;

    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.18);
}

.footer-box h3 {
    color: white;

    font-size: 20px;

    margin-top: 0;
}

.footer-box p {
    line-height: 1.4;
}

.footer-box a {
    color: white;

    text-decoration: underline;
}

.footer-secondario h3 {
    font-size: 16px;
}

.footer-secondario p,
.footer-secondario a {
    font-size: 14px;

    line-height: 1.4;
}


/* =========================================================
   CONTATTI
   ========================================================= */

.blocco-contatto {
    margin-top: 30px;

    padding: 25px;

    background: white;

    border-radius: 14px;

    box-shadow:
        0 5px 18px rgba(0, 0, 0, 0.08);
}


/* =========================================================
   PLANIMETRIA
   ========================================================= */

.planimetria {
    text-align: center;
}

.planimetria .torna {
    display: block;

    text-align: left;

    width: max-content;
}

.planimetria h2 {
    margin-top: 25px;
}

.descrizione-planimetria {
    max-width: 700px;

    margin: 20px auto 30px;

    line-height: 1.6;
}

.zoom-container {
    width: 100%;

    overflow: hidden;

    border-radius: 14px;

    background: white;

    touch-action: pinch-zoom;
}

.zoom-container img {
    width: 100%;

    transition: transform 0.2s ease;

    transform-origin: center;

    border-radius: 14px;
}


/* =========================================================
   AVVISO HOME - SITO IN AGGIORNAMENTO
   ========================================================= */

.avviso-costruzione {
    width: 100%;

    box-sizing: border-box;

    padding: 14px 50px 14px 20px;

    background: #F1F4F5;

    border-bottom: 1px solid rgba(0, 0, 0, 0.10);

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.06);

    display: flex;

    align-items: center;

    justify-content: center;

    position: relative;

    z-index: 1000;
}

.avviso-testo {
    width: 100%;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    text-align: center;

    gap: 4px;

    color: #4b555b;
}

.avviso-testo strong {
    font-size: 16px;

    font-weight: 700;

    text-align: center;
}

.avviso-testo span {
    font-size: 14px;

    line-height: 1.4;

    text-align: center;
}

#chiudi-avviso {
    position: absolute;

    right: 18px;

    top: 50%;

    transform: translateY(-50%);

    width: 32px;

    height: 32px;

    border: none;

    background: transparent;

    font-size: 26px;

    line-height: 1;

    color: #222;

    cursor: pointer;

    margin: 0;

    padding: 0;
}

/* =========================================================
   SCHERMATA DI ACCESSO ADMIN / OPERATORE
========================================================= */

body:has(.admin-login) {
    background: #eef2f4;
}

body:has(.admin-login) .admin-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding-top: 40px;
    padding-bottom: 40px;
}

body:has(.admin-login) .admin-login {
    width: 100%;
    max-width: 500px;
    margin: 0;
    padding: 35px;
    box-sizing: border-box;

    background: #ffffff;

    border: 1px solid #d5dde2;
    border-radius: 14px;

    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.08);
}

/* =========================================================
   AREA AMMINISTRATIVA
   ========================================================= */

.admin-container {
    max-width: 1400px;

    margin: 40px auto;

    padding: 0 20px;
}

.admin-login {
    max-width: 500px;

    margin: 0 auto 40px;

    padding: 30px;

    background: rgba(255, 255, 255, 0.9);

    border-radius: 10px;

    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.08);
}

.admin-login h1 {
    margin-top: 0;
}

.admin-login label {
    display: block;

    margin: 0 0 6px;

    color: #42586B;

    font-weight: 700;
}

.admin-login input {
    width: 100%;

    box-sizing: border-box;

    padding: 11px 12px;

    margin-bottom: 16px;

    border: 1px solid #cbd4da;

    border-radius: 7px;

    background: white;

    color: #333;

    font-family: inherit;

    font-size: 15px;

    text-align: left;
}

.admin-login input:focus {
    outline: none;

    border-color: #6d8496;

    box-shadow:
        0 0 0 3px rgba(66, 88, 107, 0.10);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;

    margin-bottom: 6px;

    font-weight: bold;
}

.form-group input {
    width: 100%;

    box-sizing: border-box;

    padding: 10px;

    border: 1px solid #ccc;

    border-radius: 5px;

    font-size: 1rem;
}

.admin-login button {
    padding: 10px 20px;

    border: none;

    border-radius: 5px;

    cursor: pointer;

    font-size: 1rem;
}

#admin-area {
    overflow-x: auto;
}


/* =========================================================
   INTESTAZIONE AREA AMMINISTRATORE
   ========================================================= */

.admin-intestazione {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 20px;

    padding: 22px 25px;

    background: rgba(255, 255, 255, 0.88);

    border: 1px solid #d5dde2;

    border-radius: 14px;

    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.06);

    box-sizing: border-box;
}

.admin-intestazione h2 {
    margin: 0 0 6px;

    color: #42586B;

    font-size: 26px;
}

.admin-intestazione p {
    margin: 0;

    color: #66737d;

    line-height: 1.5;
}


/* =========================================================
   PULSANTE ESCI ADMIN
   ========================================================= */

.bottone-esci {
    flex: 0 0 auto;

    margin: 0;

    padding: 10px 20px;

    background: #6f3939;

    color: white;

    border: none;

    border-radius: 8px;

    font-family: inherit;

    font-size: 14px;

    font-weight: 700;

    cursor: pointer;

    opacity: 1;
}

.bottone-esci:hover {
    background: #5a2e2e;
}


/* =========================================================
TABELLA ARCHIVIO AMMINISTRATIVO
========================================================= */

#archivio {
    width: 100%;
    overflow-x: auto;
    margin-top: 20px;
    border-radius: 12px;
}

#archivio table {
    width: 100%;
    min-width: 1000px;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border: 1px solid #d5dde2;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
    table-layout: fixed;
}

#archivio thead {
    background: #42586B;
    color: white;
}

#archivio th {
    padding: 14px 12px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    vertical-align: middle;
    border-bottom: 2px solid #31475A;
    white-space: nowrap;
}

#archivio td {
    padding: 12px;
    color: #42586B;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid #e1e6e9;
    overflow-wrap: anywhere;
}

#archivio tbody tr:nth-child(odd) {
    background: #ffffff;
}

#archivio tbody tr:nth-child(even) {
    background: #f3f7f9;
}

#archivio tbody tr:hover {
    background: #e8f0f4;
}

#archivio tbody tr td {
    border-bottom: none;
}

/* =========================================================
LARGHEZZA E ALLINEAMENTO COLONNE ARCHIVIO
========================================================= */

/* ID */
#archivio th:nth-child(1),
#archivio td:nth-child(1) {
    width: 6%;
    text-align: center;
}

/* Cognome e Nome */
#archivio th:nth-child(2),
#archivio td:nth-child(2) {
    width: 24%;
    text-align: left;
}

/* Anno decesso */
#archivio th:nth-child(3),
#archivio td:nth-child(3) {
    width: 14%;
    text-align: center;
}

/* Posizione */
#archivio th:nth-child(4),
#archivio td:nth-child(4) {
    width: 12%;
    text-align: center;
}

/* Note */
#archivio th:nth-child(5),
#archivio td:nth-child(5) {
    width: 24%;
    text-align: left;
    white-space: normal;
    word-break: break-word;
    line-height: 1.4;
}

/* Pubblicato */
#archivio th:nth-child(6),
#archivio td:nth-child(6) {
    width: 10%;
    text-align: center;
}

/* Azioni */
#archivio th:nth-child(7),
#archivio td:nth-child(7) {
    width: 10%;
    text-align: center;
}


/* =========================================================
   PULSANTI ARCHIVIO
========================================================= */

#archivio button {
    display: inline-block;

    min-width: 82px;

    margin: 3px;

    padding: 8px 12px;

    border: none;

    border-radius: 7px;

    color: white;

    font-family: inherit;

    font-size: 13px;

    font-weight: 700;

    cursor: pointer;

    white-space: nowrap;

    text-align: center;

    opacity: 1;

    transition:
        background 0.2s ease,
        transform 0.1s ease;
}

#archivio button:hover {
    transform: translateY(-1px);
}


/* MODIFICA */

#archivio .bottone-modifica {
    background: #31475A;
}

#archivio .bottone-modifica:hover {
    background: #42586B;
}


/* ELIMINA */

#archivio .bottone-elimina {
    background: #6f3939;
}

#archivio .bottone-elimina:hover {
    background: #5a2e2e;
}


/* =========================================================
   RICERCA AMMINISTRATIVA
   ========================================================= */

.admin-ricerca {
    margin: 20px 0 22px;

    padding: 18px 20px;

    background: rgba(255, 255, 255, 0.90);

    border: 1px solid #d5dde2;

    border-radius: 14px;

    box-shadow:
        0 5px 18px rgba(57, 73, 84, 0.08);

    box-sizing: border-box;
}

.admin-ricerca-titolo {
    display: flex;

    align-items: center;

    gap: 12px;

    margin-bottom: 14px;

    color: #42586B;
}

.admin-ricerca-titolo strong {
    display: block;

    font-size: 17px;

    font-weight: 700;
}

.admin-ricerca-titolo small {
    display: block;

    margin-top: 3px;

    color: #73808a;

    font-size: 13px;

    font-weight: 400;
}

.admin-ricerca-icona {
    display: flex;

    align-items: center;

    justify-content: center;

    width: 38px;

    height: 38px;

    flex: 0 0 38px;

    background: #e7eef2;

    color: #50697b;

    border-radius: 10px;

    font-size: 24px;

    font-weight: 700;

    line-height: 1;
}

.admin-ricerca-campo {
    position: relative;

    width: 100%;
}

.admin-ricerca-campo input {
    width: 100%;

    max-width: none;

    box-sizing: border-box;

    padding: 13px 48px 13px 15px;

    margin: 0;

    border: 1px solid #cbd6dc;

    border-radius: 10px;

    background: #fff;

    color: #334854;

    font-family: inherit;

    font-size: 15px;

    text-align: left;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.admin-ricerca-campo input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

.admin-ricerca-campo input:focus {
    outline: none;

    border-color: #6d8496;

    box-shadow:
        0 0 0 3px rgba(109, 132, 150, 0.15);
}


#cancella-ricerca {
    position: absolute;

    top: 50%;
    right: 12px;

    transform: translateY(-50%);

    display: flex;
    align-items: center;
    justify-content: center;

    width: 26px;
    height: 26px;

    margin: 0;
    padding: 0;

    border: none;
    border-radius: 50%;

    background: transparent;

    color: #71808a;

    font-family: Arial, sans-serif;
    font-size: 20px;
    font-weight: 400;

    line-height: 1;

    cursor: pointer;

    opacity: 0.5;
}

#cancella-ricerca:hover {
    background: #edf2f5;

    color: #31475A;

    opacity: 1;
}

#cancella-ricerca:focus {
    outline: none;

    background: #edf2f5;

    color: #31475A;
}

/* =========================================================
   FINESTRA MODIFICA / INSERIMENTO ADMIN
   ========================================================= */

#modifica-defunto {
    display: none;

    position: fixed;

    top: 50%;

    left: 50%;

    transform: translate(-50%, -50%);

    width: 94%;

    max-width: 900px;

    max-height: 92vh;

    padding: 0;

    background: #f7f9fa;

    border: 1px solid #d5dde2;

    border-radius: 18px;

    box-shadow:
        0 15px 45px rgba(0, 0, 0, 0.25);

    overflow-y: auto;

    z-index: 1000;

    box-sizing: border-box;
}


/* CONTENUTO INTERNO */

.contenuto-modifica {
    position: relative;

    width: 100%;

    box-sizing: border-box;
}


/* TITOLO */

#modifica-defunto h2 {
    margin: 0;

    padding: 24px 65px 22px 30px;

    background: #42586B;

    color: white;

    font-size: 25px;

    font-weight: 700;

    border-radius: 18px 18px 0 0;
}


/* X */

#chiudi-modifica {
    position: absolute;

    top: 13px;

    right: 15px;

    width: 42px;

    height: 42px;

    margin: 0;

    padding: 0;

    border: none;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.30);

    color: white;

    font-size: 30px;

    line-height: 1;

    cursor: pointer;

    z-index: 1002;
}

#chiudi-modifica:hover {
    background: rgba(255, 255, 255, 0.40);
}


/* =========================================================
   FORM ADMIN
   ========================================================= */

#form-defunto {
    padding: 25px 30px 30px;

    box-sizing: border-box;
}

#form-defunto label {
    display: block;

    margin: 0 0 6px;

    color: #42586B;

    font-weight: 700;

    font-size: 14px;
}

#form-defunto input,
#form-defunto textarea {
    width: 100%;

    box-sizing: border-box;

    padding: 11px 12px;

    border: 1px solid #cbd4da;

    border-radius: 7px;

    background: white;

    color: #333;

    font-family: inherit;

    font-size: 15px;

    margin-bottom: 16px;

    outline: none;
}

#form-defunto input:focus,
#form-defunto textarea:focus {
    border-color: #6d8496;

    box-shadow:
        0 0 0 3px rgba(66, 88, 107, 0.10);
}

#form-defunto textarea {
    min-height: 100px;

    resize: vertical;

    line-height: 1.5;
}


/* ETA */

#form-defunto #eta {
    background: #edf2f5;

    color: #42586B;

    font-weight: 700;
}


/* OSSERVAZIONI */

#form-defunto #osservazioni {
    min-height: 100px;

    resize: vertical;
}


/* NOTE INTERNE */

#form-defunto #note {
    min-height: 110px;

    resize: vertical;

    background: #fafafa;
}


/* =========================================================
   FOTO - ADMIN
   ========================================================= */

.blocco-foto-admin {
    margin: 8px 0 20px;

    padding: 18px;

    background: #edf2f5;

    border: 1px solid #d5dde2;

    border-radius: 10px;

    box-sizing: border-box;
}

.blocco-foto-admin label {
    margin-bottom: 8px;
}

.blocco-foto-admin input[type="file"] {
    width: 100%;

    margin: 0 0 8px;

    padding: 9px;

    background: white;

    box-sizing: border-box;

    cursor: pointer;
}

.blocco-foto-admin small {
    display: block;

    margin-bottom: 12px;

    color: #66737d;

    font-size: 13px;

    line-height: 1.4;
}

.nome-foto-attuale {
    margin: 10px 0 8px;
    padding: 9px 11px;
    background: #ffffff;
    border: 1px solid #d5dde2;
    border-radius: 7px;
    color: #4f5d66;
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
}

.anteprima-foto {
    display: none;

    width: 100%;

    margin-top: 12px;

    padding: 12px;

    background: white;

    border: 1px solid #d5dde2;

    border-radius: 10px;

    box-sizing: border-box;

    text-align: center;
}

.anteprima-foto img {
    display: block;

    max-width: 100%;

    max-height: 300px;

    margin: 0 auto;

    object-fit: contain;

    border-radius: 8px;
}


/* =========================================================
   CHECKBOX
   ========================================================= */

#form-defunto .checkbox-admin {
    display: flex;

    align-items: center;

    gap: 10px;

    margin: 10px 0 20px;

    padding: 14px 16px;

    background: #edf4f7;

    border: 1px solid #cbd9e0;

    border-radius: 8px;

    cursor: pointer;

    box-sizing: border-box;
}

#form-defunto .checkbox-admin input[type="checkbox"] {
    width: 20px;

    height: 20px;

    margin: 0;

    padding: 0;

    flex: 0 0 auto;

    cursor: pointer;

    accent-color: #42586B;
}


/* =========================================================
   PULSANTE SALVA ADMIN
   ========================================================= */

#form-defunto button[type="submit"] {
    margin: 0;

    padding: 12px 24px;

    border: none;

    border-radius: 8px;

    background: #31475A;

    color: white;

    font-family: inherit;

    font-size: 16px;

    font-weight: 700;

    cursor: pointer;

    opacity: 1;
}

#form-defunto button[type="submit"]:hover {
    background: #42586B;
}


/* =========================================================
   AZIONI PRINCIPALI ADMIN
   ========================================================= */

.admin-azioni-principali {
    margin: 15px 0 20px;

    display: flex;

    gap: 10px;

    flex-wrap: wrap;
}

.admin-azioni-principali button {
    margin: 0;

    padding: 12px 20px;

    border: none;

    border-radius: 8px;

    background: #31475A;

    color: white;

    font-family: inherit;

    font-size: 15px;

    font-weight: 700;

    cursor: pointer;

    opacity: 1;
}

.admin-azioni-principali button:hover {
    background: #42586B;
}


/* =========================================================
   ELENCO ELIMINATI
   ========================================================= */

.archivio-cancellati {
    margin-top: 35px;

    padding: 25px;

    background: rgba(255, 255, 255, 0.75);

    border: 1px solid #d5dde2;

    border-radius: 12px;
}

.titolo-cancellati h2 {
    margin: 0 0 8px;

    color: #42586B;

    font-size: 22px;
}

.titolo-cancellati p {
    margin: 0 0 20px;

    color: #66737d;

    font-size: 14px;
}


/* =========================================================
   FINESTRA ELENCO ELIMINATI
   ========================================================= */

.finestra-cancellati {
    display: none;

    position: fixed;

    top: 0;

    left: 0;

    width: 100%;

    height: 100%;

    background: rgba(30, 45, 55, 0.55);

    z-index: 2000;

    overflow-y: auto;

    box-sizing: border-box;
}

.contenuto-cancellati {
    position: relative;

    width: 94%;

    max-width: 1000px;

    max-height: 90vh;

    margin: 5vh auto;

    padding: 30px;

    background: #f7f9fa;

    border: 1px solid #d5dde2;

    border-radius: 18px;

    box-shadow:
        0 15px 45px rgba(0, 0, 0, 0.25);

    overflow-y: auto;

    box-sizing: border-box;
}

.contenuto-cancellati h2 {
    margin: 0 0 8px;

    padding-right: 50px;

    color: #42586B;

    font-size: 25px;
}

.descrizione-cancellati {
    margin: 0 0 25px;

    color: #66737d;

    font-size: 14px;

    line-height: 1.5;
}

.chiudi-cancellati {
    position: absolute;

    top: 15px;

    right: 15px;

    width: 42px;

    height: 42px;

    margin: 0;

    padding: 0;

    border: none;

    border-radius: 50%;

    background: #31475A;

    color: white;

    font-size: 30px;

    line-height: 1;

    cursor: pointer;
}

.chiudi-cancellati:hover {
    background: #42586B;
}

#cancellati {
    width: 100%;

    overflow-x: auto;
}

#cancellati table {
    width: 100%;

    min-width: 700px;

    border-collapse: separate;

    border-spacing: 0;

    background: white;

    border: 1px solid #d5dde2;

    border-radius: 10px;

    overflow: hidden;
}

#cancellati thead {
    background: #42586B;

    color: white;
}

#cancellati th {
    padding: 12px;

    text-align: left;

    font-size: 14px;

    font-weight: 700;

    white-space: nowrap;
}

#cancellati td {
    padding: 11px 12px;

    color: #42586B;

    font-size: 14px;

    border-bottom: 1px solid #e1e6e9;

    text-align: center;

    font-weight: 700;
}

#cancellati tbody tr:nth-child(even) {
    background: #f3f7f9;
}

#cancellati tbody tr td {
    border-bottom: none;
}

#cancellati button {
    margin: 0;

    padding: 8px 14px;

    border: none;

    border-radius: 7px;

    background: #31475A;

    color: white;

    font-family: inherit;

    font-size: 13px;

    font-weight: 700;

    cursor: pointer;
}

#cancellati button:hover {
    background: #42586B;
}


/* =========================================================
   AREA OPERATORE
   ========================================================= */

#operatore-area {
    max-width: 900px;

    margin: 0 auto 40px;

    padding: 30px;

    background: rgba(255, 255, 255, 0.88);

    border: 1px solid #d5dde2;

    border-radius: 14px;

    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.06);

    box-sizing: border-box;
}

#operatore-area h2 {
    margin-top: 0;

    margin-bottom: 8px;

    text-align: left;
}

#operatore-area > p {
    margin-top: 0;

    margin-bottom: 25px;

    color: #66737d;

    line-height: 1.5;
}


/* =========================================================
   MODULO OPERATORE
   ========================================================= */

.form-operatore {
    padding: 25px;

    background: #f7f9fa;

    border: 1px solid #d5dde2;

    border-radius: 12px;

    box-sizing: border-box;
}

.form-operatore h3 {
    margin: 0 0 8px;

    color: #42586B;

    font-size: 22px;
}

.descrizione-operatore {
    margin: 0 0 25px;

    color: #66737d;

    font-size: 14px;

    line-height: 1.5;
}

#form-defunto-operatore {
    width: 100%;
}

#form-defunto-operatore label {
    display: block;

    margin: 0 0 6px;

    color: #42586B;

    font-size: 14px;

    font-weight: 700;
}

#form-defunto-operatore input,
#form-defunto-operatore textarea {
    width: 100%;

    box-sizing: border-box;

    padding: 11px 13px;

    margin-bottom: 17px;

    border: 1px solid #cbd4da;

    border-radius: 7px;

    background: white;

    color: #333;

    font-family: inherit;

    font-size: 15px;

    outline: none;
}

#form-defunto-operatore input:focus,
#form-defunto-operatore textarea:focus {
    border-color: #6d8496;

    box-shadow:
        0 0 0 3px rgba(66, 88, 107, 0.10);
}

#form-defunto-operatore textarea {
    min-height: 100px;

    resize: vertical;

    line-height: 1.5;
}


/* =========================================================
   FOTO OPERATORE
   ========================================================= */

#form-defunto-operatore .blocco-foto-admin {
    margin-top: 8px;
}

#operatore-foto {
    cursor: pointer;
}


/* =========================================================
   OSSERVAZIONI OPERATORE
   ========================================================= */

#operatore-osservazioni {
    min-height: 110px;
}


/* =========================================================
   NOTE OPERATORE
   ========================================================= */

#operatore-note {
    min-height: 110px;

    background: #fafafa;
}


/* =========================================================
   PULSANTE INSERIMENTO
   ========================================================= */

#form-defunto-operatore button[type="submit"] {
    margin: 5px 0 0;

    padding: 12px 24px;

    border: none;

    border-radius: 8px;

    background: #31475A;

    color: white;

    font-family: inherit;

    font-size: 15px;

    font-weight: 700;

    cursor: pointer;

    opacity: 1;
}

#form-defunto-operatore button[type="submit"]:hover {
    background: #42586B;
}


/* =========================================================
   MESSAGGIO OPERATORE
   ========================================================= */

#operatore-form-messaggio {
    margin: 18px 0 0;

    color: #42586B;

    font-weight: 700;

    line-height: 1.5;
}


/* =========================================================
   RICHIESTA MODIFICA OPERATORE
   ========================================================= */

.richiesta-modifica-operatore {
    margin-top: 25px;

    padding: 22px 25px;

    background: white;

    border: 1px solid #d5dde2;

    border-radius: 12px;

    box-sizing: border-box;
}

.richiesta-modifica-operatore h3 {
    margin: 0 0 8px;

    color: #42586B;

    font-size: 19px;
}

.richiesta-modifica-operatore p {
    margin: 0 0 15px;

    color: #66737d;

    line-height: 1.5;
}

#richiedi-modifica {
    margin: 0;

    padding: 11px 20px;

    background: #31475A;

    color: white;

    border: none;

    border-radius: 8px;

    font-family: inherit;

    font-size: 14px;

    font-weight: 700;

    cursor: pointer;

    opacity: 1;
}

#richiedi-modifica:hover {
    background: #42586B;
}


/* =========================================================
   LOGOUT OPERATORE
   ========================================================= */

#logout-operatore {
    margin-top: 20px;

    padding: 10px 20px;

    background: #6f3939;

    color: white;

    border: none;

    border-radius: 8px;

    font-family: inherit;

    font-size: 14px;

    font-weight: 700;

    cursor: pointer;

    opacity: 1;
}

#logout-operatore:hover {
    background: #5a2e2e;
}



/* =========================================================
   LINK AREA AMMINISTRATIVA NEL FOOTER
========================================================= */

.footer-admin {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    width: fit-content;
    margin: 18px auto 0;
    padding: 8px 14px;

    color: rgba(255, 255, 255, 0.85);

    text-decoration: none;

    font-size: 13px;
    font-weight: 400;

    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 7px;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

.footer-admin-icona {
    width: 23px;
    height: 23px;
    min-width: 28px;
    flex: 0 0 28px;

    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.footer-admin:hover {
    background: rgba(255, 255, 255, 0.10);
    color: white;
    border-color: rgba(255, 255, 255, 0.45);
}



/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

    body {
        padding: 15px;

        width: 100%;

        box-sizing: border-box;

        overflow-x: hidden;
    }


    /* HERO */

    .hero {
        background-attachment: scroll;

        min-height: 420px;

        display: flex;

        flex-direction: column;

        justify-content: center;

        align-items: center;

        background-size: cover;
    }

    .stemma {
        width: 100px;

        margin-bottom: 20px;
    }

    .hero h1 {
        font-size: 32px;
    }

    .sottotitolo {
        font-size: 18px;
    }


    /* SCHEDA DEFUNTO */

    #scheda {
        width: 100%;

        max-width: 700px;

        box-sizing: border-box;

        padding: 20px;

        margin: 30px auto;

        overflow: hidden;
    }

    .scheda-contenuto {
        width: 100%;

        max-width: 100%;

        flex-direction: column;

        gap: 25px;

        box-sizing: border-box;
    }

    .dati-defunto {
        width: 100%;

        min-width: 0;

        box-sizing: border-box;
    }

    .foto-defunto {
        width: 250px;

        height: 250px;

        max-width: 100%;

        margin: auto;

        box-sizing: border-box;
    }

    .foto-defunto img {
        max-width: 100%;

        max-height: 100%;
    }

    .foto-mancante {
        width: 250px;

        max-width: 100%;

        margin: auto;

        box-sizing: border-box;
    }

    .foto-mancante img {
        width: 72%;

        max-width: 100%;

        height: auto;

        object-fit: contain;
    }


    /* PULSANTI */

    .pulsante,
    .scheda-button {
        max-width: 100%;

        box-sizing: border-box;
    }


    /* HOME */

    .funzioni-home {
        flex-direction: column;
    }

    .funzione {
        width: auto;
    }

    .cimitero-sezione {
        flex-direction: column;
    }

    .cimitero-sezione div {
        text-align: center;
    }

    .cimitero-sezione h2 {
        text-align: center;
    }

    .cimitero-sezione img {
        width: 100%;
    }

    .pulsanti-cimitero {
        flex-direction: column;
    }

    .gestione-sito {
        flex-direction: column;

        align-items: center;

        width: 100%;
    }

    .gestione-sito div {
        width: 100%;

        flex: none;
    }


    /* COLLABORAZIONE COMUNE */

    .collaborazione-comune {
        display: block;

        width: 100%;

        margin: 18px 0 0;

        text-align: center;

        font-size: 14px;

        font-style: italic;

        font-weight: 700;

        box-sizing: border-box;
    }


    /* FOOTER */

    .footer-sito {
        width: 100%;

        box-sizing: border-box;

        padding: 35px 15px;
    }

    .footer-box {
        width: 100%;

        box-sizing: border-box;
    }


    /* AVVISO MOBILE */

    .avviso-costruzione {
        width: 100%;

        padding: 14px 45px 14px 15px;

        display: flex;

        align-items: center;

        justify-content: center;

        box-sizing: border-box;
    }

    .avviso-testo {
        width: 100%;

        display: flex;

        flex-direction: column;

        align-items: center;

        justify-content: center;

        text-align: center;

        gap: 4px;
    }

    .avviso-testo strong {
        font-size: 15px;

        text-align: center;
    }

    .avviso-testo span {
        font-size: 13px;

        line-height: 1.4;

        text-align: center;
    }

    #chiudi-avviso {
        right: 8px;

        top: 50%;

        transform: translateY(-50%);
    }


    /* =====================================================
       AREA ADMIN MOBILE
       ===================================================== */

    .admin-container {
        padding: 0 10px;
    }

    .admin-login {
        width: 100%;

        box-sizing: border-box;

        padding: 22px;
    }

    #modifica-defunto {
        width: 96%;

        max-height: 94vh;

        border-radius: 14px;
    }

    #modifica-defunto h2 {
        padding: 20px 55px 18px 20px;

        font-size: 21px;

        border-radius: 14px 14px 0 0;
    }

    #form-defunto {
        padding: 20px;
    }

    #chiudi-modifica {
        top: 10px;

        right: 10px;

        width: 38px;

        height: 38px;

        font-size: 27px;
    }

    .admin-azioni-principali {
        flex-direction: column;
    }

    .admin-azioni-principali button {
        width: 100%;
    }


    /* =====================================================
       RICERCA ADMIN MOBILE
       ===================================================== */

    .admin-ricerca {
        padding: 16px;
    }

    .admin-ricerca-titolo {
        align-items: flex-start;
    }

    .admin-ricerca-icona {
        width: 34px;

        height: 34px;

        flex-basis: 34px;

        font-size: 21px;
    }

    .admin-ricerca-campo input {
        font-size: 16px;
    }


    /* =====================================================
       FOTO MOBILE
       ===================================================== */

    .blocco-foto-admin {
        padding: 15px;
    }

    .anteprima-foto img {
        max-height: 240px;
    }


    /* =====================================================
       OPERATORE MOBILE
       ===================================================== */

    #operatore-area {
        width: 100%;

        margin: 0 auto 25px;

        padding: 20px;

        border-radius: 12px;
    }

    #operatore-area h2 {
        font-size: 23px;
    }

    .form-operatore {
        padding: 18px;

        border-radius: 10px;
    }

    .form-operatore h3 {
        font-size: 20px;
    }

    #form-defunto-operatore input,
    #form-defunto-operatore textarea {
        font-size: 16px;
    }

    #form-defunto-operatore button[type="submit"] {
        width: 100%;
    }

    .richiesta-modifica-operatore {
        padding: 18px;
    }

    #richiedi-modifica {
        width: 100%;
    }

    #logout-operatore {
        width: 100%;
    }


    /* =====================================================
       ELENCO ELIMINATI MOBILE
       ===================================================== */

    .contenuto-cancellati {
        width: 96%;

        max-height: 94vh;

        margin: 3vh auto;

        padding: 20px;

        border-radius: 14px;
    }

    .contenuto-cancellati h2 {
        font-size: 21px;
    }

    .chiudi-cancellati {
        top: 10px;

        right: 10px;

        width: 38px;

        height: 38px;

        font-size: 27px;
    }

    #cancellati table {
        min-width: 700px;
    }

    .archivio-cancellati {
        padding: 20px;
    }


    /* =====================================================
       TABELLA ADMIN MOBILE
       ===================================================== */

    #archivio {
        margin-top: 15px;

        overflow-x: auto;
    }

    #archivio table {
        min-width: 900px;
    }

    #archivio th,
    #archivio td {
        padding: 10px 8px;

        font-size: 13px;
    }


    /* INTESTAZIONE ADMIN MOBILE */

    .admin-intestazione {
        align-items: flex-start;

        flex-direction: column;

        padding: 20px;
    }

    .admin-intestazione h2 {
        font-size: 23px;
    }

    .bottone-esci {
        width: 100%;
    }
}

/* =====================================================
   PULSANTE ELIMINA - AREA ADMIN
   ===================================================== */

.bottone-elimina {
    background: #6f3939;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.bottone-elimina:hover {
    background: #5a2e2e;
}

/* =====================================================
   FINESTRA AVVISI AREA ADMIN
===================================================== */

.finestra-avviso {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background: rgba(20, 30, 40, 0.55);

    display: flex;
    align-items: center;
    justify-content: center;

    z-index: 9999;

    padding: 20px;
    box-sizing: border-box;
}

.avviso-admin {
    width: 100%;
    max-width: 440px;

    background: #ffffff;

    border-radius: 12px;

    padding: 30px 30px 25px;

    box-sizing: border-box;

    text-align: center;

    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.25);

    border-top: 5px solid #31475A;
}

.avviso-icona {
    width: 58px;
    height: 58px;

    margin: 0 auto 18px;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #e8f1ec;
    color: #486b5a;

    font-size: 30px;
    font-weight: 700;
}

.avviso-admin h3 {
    margin: 0 0 12px;

    color: #31475A;

    font-size: 21px;
    font-weight: 700;
}

.avviso-admin p {
    margin: 0;

    color: #4c5963;

    font-size: 15px;
    line-height: 1.6;
}

.avviso-azioni {
    display: flex;

    justify-content: center;

    gap: 10px;

    margin-top: 25px;
}

.avviso-bottone {
    min-width: 100px;

    padding: 10px 22px;

    border: none;
    border-radius: 8px;

    font-family: inherit;

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    transition: background 0.2s ease;
}

.avviso-bottone.conferma {
    background: #31475A;
    color: white;
}

.avviso-bottone.conferma:hover {
    background: #42586B;
}

.avviso-bottone.annulla {
    background: #6f3939;
    color: white;
}

.avviso-bottone.annulla:hover {
    background: #5a2e2e;
}


/* =====================================================
   TIPI DI AVVISO
===================================================== */

.avviso-admin.successo {
    border-top-color: #486b5a;
}

.avviso-admin.successo .avviso-icona {
    background: #e8f1ec;
    color: #486b5a;
}

.avviso-admin.attenzione {
    border-top-color: #a17b38;
}

.avviso-admin.attenzione .avviso-icona {
    background: #f5efe2;
    color: #a17b38;
}

.avviso-admin.errore {
    border-top-color: #6f3939;
}

.avviso-admin.errore .avviso-icona {
    background: #f3e7e7;
    color: #6f3939;
}

.avviso-admin.conferma {
    border-top-color: #31475A;
}

.avviso-admin.conferma .avviso-icona {
    background: #e8edf1;
    color: #31475A;
}

/* =====================================================
   IMPORTAZIONE MASSIVA EXCEL
===================================================== */

.riquadro-importa {
    max-width: 850px;
    margin: 20px 0 30px;
    padding: 25px 28px;

    background: #f8fafb;
    border: 1px solid #d5dde3;
    border-left: 5px solid #31475A;
    border-radius: 10px;

    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);

    box-sizing: border-box;
}

.riquadro-importa h3 {
    margin: 0 0 15px;

    color: #31475A;

    font-size: 21px;
    font-weight: 700;
}

.riquadro-importa p {
    margin: 8px 0;

    color: #4d5b65;

    font-size: 14px;
    line-height: 1.6;
}

.riquadro-importa p strong {
    color: #6f3939;
}


/* -----------------------------------------------------
   SELEZIONE FILE
----------------------------------------------------- */

.riquadro-importa label {
    display: block;

    margin-top: 22px;
    margin-bottom: 8px;

    color: #31475A;

    font-size: 14px;
    font-weight: 700;
}

#file-importa-nuovi {
    display: block;

    width: 100%;

    padding: 10px;

    box-sizing: border-box;

    background: white;

    border: 1px solid #c7d0d7;
    border-radius: 7px;

    font-family: inherit;
    font-size: 14px;

    color: #4d5b65;

    cursor: pointer;
}

#file-importa-nuovi:hover {
    border-color: #31475A;
}


/* -----------------------------------------------------
   PULSANTI IMPORTAZIONE
----------------------------------------------------- */

.azioni-importa {
    display: flex;
    flex-wrap: wrap;

    gap: 10px;

    margin-top: 22px;
    padding-top: 20px;

    border-top: 1px solid #d9e0e5;
}

.azioni-importa button {
    margin: 0;

    padding: 11px 20px;

    border: none;
    border-radius: 8px;

    font-family: inherit;
    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.1s ease;
}

.azioni-importa button:hover {
    transform: translateY(-1px);
}


/* Anteprima */

#anteprima-importa-nuovi {
    background: #31475A;
    color: white;
}

#anteprima-importa-nuovi:hover {
    background: #42586B;
}


/* Conferma */

#conferma-importa-nuovi {
    background: #486b5a;
    color: white;
}

#conferma-importa-nuovi:hover {
    background: #3d5b4c;
}


/* Annulla */

#annulla-importa-nuovi {
    background: #6f3939;
    color: white;
}

#annulla-importa-nuovi:hover {
    background: #5a2e2e;
}


/* -----------------------------------------------------
   RISULTATO IMPORTAZIONE
----------------------------------------------------- */

.risultato-importa {
    margin-top: 20px;

    padding: 15px 18px;

    background: white;

    border: 1px solid #d5dde3;
    border-radius: 8px;

    color: #4d5b65;

    font-size: 14px;
    line-height: 1.6;

    box-sizing: border-box;
}

.risultato-importa:empty {
    display: none;
}


/* -----------------------------------------------------
   ADATTAMENTO TELEFONO
----------------------------------------------------- */

@media (max-width: 600px) {

    .riquadro-importa {
        padding: 20px;
    }

    .azioni-importa {
        flex-direction: column;
    }

    .azioni-importa button {
        width: 100%;
    }

}

/* =========================================================
   LARGHEZZA COMPLETA MODULI INSERIMENTO
========================================================= */

#form-inserimento-operatore,
#form-defunto-operatore,
.contenuto-modifica,
#form-defunto {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

#form-defunto-operatore input,
#form-defunto-operatore textarea,
#form-defunto input,
#form-defunto textarea {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}


/* =========================================================
   PULSANTE VAI AL SITO
========================================================= */

.bottone-vai-sito {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 100px;
    height: 35px;
    box-sizing: border-box;

    padding: 0;

    background: transparent;
    color: #31475A;

    border: 1px solid #31475A;
    border-radius: 8px;

    font-family: inherit;
    font-size: 14px;
    font-weight: 700;

    text-decoration: none;
    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.bottone-vai-sito:hover {
    background: #31475A;
    color: white;
}

/* =========================================================
   PULSANTI VAI AL SITO + ESCI
   Posizionamento indipendente dall'impaginazione
========================================================= */
.admin-intestazione {
    position: relative;
}

.admin-intestazione .bottone-esci {
    position: absolute;
    top: 50%;
    right: 25px;
    transform: translateY(-50%);
}

.admin-intestazione .bottone-vai-sito {
    position: absolute;
    top: 50%;
    right: 105px;
    transform: translateY(-50%);
}

/* Allineamento Vai al sito - Area Operatore */

#operatore-area .bottone-vai-sito {
    top: calc(52% + 18px);
}


/* =========================================================
   HOME TARSIA — HEADER, HERO E FOOTER
   Avviso di costruzione riattivabile tramite .mostra-avviso
   ========================================================= */

body.home-tarsia .header-home-tarsia {
  width: 100%;
  margin: 0 auto 22px;
  padding: 10px clamp(18px, 4vw, 52px);
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #dbe3e9;
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(32, 56, 76, .06);
}

body.home-tarsia .nav-home-tarsia {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 76px;
}

body.home-tarsia .nav-home-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(18px, 3vw, 38px);
}

body.home-tarsia .nav-home-links a {
  color: #233f56;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}

body.home-tarsia .nav-home-links a:hover {
  color: #587d96;
}

body.home-tarsia .logo-home-tarsia {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

body.home-tarsia .logo-home-tarsia img {
  display: block;
  width: auto;
  max-width: 190px;
  max-height: 66px;
  object-fit: contain;
}

body.home-tarsia .hero-home-tarsia {
  min-height: 410px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(38px, 6vw, 78px) 22px;
  border-radius: 18px;
  box-sizing: border-box;
  background-attachment: scroll;
}

body.home-tarsia .hero-contenuto-tarsia {
  width: min(100%, 850px);
  margin: 0 auto;
}

body.home-tarsia .hero-home-tarsia h1 {
  max-width: 800px;
  margin: 0 auto 18px;
  color: #fff;
  font-size: clamp(34px, 4.5vw, 54px);
  line-height: 1.12;
  letter-spacing: -.7px;
  text-shadow: 0 3px 18px rgba(0, 0, 0, .7);
}

body.home-tarsia .hero-home-tarsia h2 {
  max-width: none;
  margin: 0 auto 30px;
  color: #fff;
  font-size: clamp(14px, 1.5vw, 18px);
  font-weight: 400;
  line-height: 1.55;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .85);

  white-space: nowrap;}

body.home-tarsia .hero-home-tarsia .area-ricerca {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
  width: min(100%, 650px);
  margin: 0 auto;
}

body.home-tarsia .hero-home-tarsia .area-ricerca input {
  flex: 1;
  min-width: 0;
  min-height: 54px;
  padding: 0 18px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 9px;
  background: #fff;
  color: #233f56;
  font-size: 16px;
  box-sizing: border-box;
}

body.home-tarsia .hero-home-tarsia .area-ricerca button {
  min-height: 54px;
  padding: 0 26px;
  border: 0;
  border-radius: 9px;
  background: #233f56;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

body.home-tarsia .hero-home-tarsia .area-ricerca button:hover {
  background: #345d79;
}

body.home-tarsia #footer .footer-sito {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 18px;
  padding: 30px clamp(16px, 3vw, 40px);
  background: #edf2f5;
  color: #263f54;
  border: 1px solid #d9e2e8;
  border-radius: 16px;
  text-align: left;
}

body.home-tarsia #footer .footer-box {
  width: 100%;
  max-width: none;
  height: auto;
  margin: 0;
  padding: 16px;
  box-sizing: border-box;
  border: 1px solid #dce5eb;
  border-radius: 12px;
  background: #fff;
  color: #263f54;
  box-shadow: 0 5px 18px rgba(35, 63, 86, .05);
}

body.home-tarsia #footer .footer-box h3 {
  color: #233f56;
  font-size: 18px;
  line-height: 1.3;
}

body.home-tarsia #footer .footer-box p,
body.home-tarsia #footer .footer-box strong {
  color: #42586b;
}

body.home-tarsia #footer .footer-box a {
  color: #234b69;
  font-weight: 700;
}

body.home-tarsia #footer .collaborazione-comune {
  display: none !important;
}

body.home-tarsia #footer .footer-admin {
  grid-column: 1 / -1;
  justify-self: end;
  color: #234b69;
}

body.home-tarsia .avviso-costruzione {
  display: none !important;
}

body.home-tarsia.mostra-avviso .avviso-costruzione {
  display: flex !important;
}

@media (max-width: 760px) {
  body.home-tarsia .header-home-tarsia {
    padding: 12px 16px;
    margin-bottom: 14px;
  }

  body.home-tarsia .nav-home-tarsia {
    min-height: auto;
    flex-direction: column-reverse;
    gap: 12px;
    padding: 8px 0;
  }

  body.home-tarsia .logo-home-tarsia img {
    max-width: 260px;
    max-height: 68px;
  }

  body.home-tarsia .nav-home-links {
    justify-content: center;
    gap: 22px;
  }

  body.home-tarsia .hero-home-tarsia {
    min-height: 390px;
    padding: 38px 18px;
  }

  body.home-tarsia .hero-home-tarsia .area-ricerca {
    flex-direction: column;
  }

  body.home-tarsia .hero-home-tarsia .area-ricerca button {
    width: 100%;
  }

  body.home-tarsia #footer .footer-sito {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 12px;
  }

  body.home-tarsia #footer .footer-admin {
    grid-column: auto;
  }
  body.home-tarsia .hero-home-tarsia h2 {
    white-space: normal;
    max-width: 100%;
    font-size: 17px;
  }

}


/* HOME TARSIA — FINITURE RICHIESTE */

/* Barra squadrata, aderente alla fotografia della hero */
body.home-tarsia {
  padding: 0;
}

body.home-tarsia .header-home-tarsia {
  width: 100%;
  margin: 0;
  padding: 8px clamp(18px, 4vw, 52px);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.home-tarsia .nav-home-tarsia {
  flex-direction: row-reverse;
  min-height: 76px;
}

/* Logo a sinistra, menu a destra */
body.home-tarsia .logo-home-tarsia {
  justify-content: flex-start;
}

body.home-tarsia .logo-home-tarsia img {
  max-width: 260px;
  max-height: 72px;
}

/* La hero riprende l'effetto dello sfondo fisso */
body.home-tarsia .hero-home-tarsia {
  margin: 0;
  border-radius: 0;
  background-attachment: fixed;
}

/* Foto del lago sullo sfondo esterno del footer */
body.home-tarsia #footer .footer-sito {
  background-image:
    linear-gradient(rgba(13, 30, 43, .30), rgba(13, 30, 43, .30)),
    url("../immagini/Tarsia-lago.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 0;
  border-radius: 0;
}

/* Il progetto: titolo + tre righe ordinate */
body.home-tarsia #footer .footer-box:first-child .gestione-sito {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

body.home-tarsia #footer .footer-box:first-child .gestione-sito > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5ebef;
}

body.home-tarsia #footer .footer-box:first-child .gestione-sito > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

body.home-tarsia #footer .footer-box:first-child .gestione-sito p {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: #627384;
}

body.home-tarsia #footer .footer-box:first-child .gestione-sito strong {
  display: block;
  font-size: 15px;
  line-height: 1.45;
  color: #233f56;
}

/* Spazio e leggibilità su telefono */
@media (max-width: 760px) {
  body.home-tarsia .nav-home-tarsia {
    flex-direction: column;
    gap: 12px;
  }

  body.home-tarsia .logo-home-tarsia img {
    max-width: 260px;
    max-height: 68px;
  }

  body.home-tarsia .hero-home-tarsia {
    background-attachment: scroll;
  }

  body.home-tarsia #footer .footer-sito {
    padding: 22px 16px;
  }
  body.home-tarsia .hero-home-tarsia h2 {
    white-space: normal;
    max-width: 100%;
    font-size: 17px;
  }

}


/* HOME TARSIA — LOGO E FOOTER VETRATO */

/* Rende il logo esplicitamente visibile */
body.home-tarsia .header-home-tarsia,
body.home-tarsia .nav-home-tarsia,
body.home-tarsia .logo-home-tarsia {
  overflow: visible;
}

body.home-tarsia .logo-home-tarsia {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  flex: 0 0 auto;
  width: auto;
  max-width: 45%;
  position: relative;
  z-index: 2;
}

body.home-tarsia .logo-home-tarsia img {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: auto !important;
  height: auto !important;
  max-width: min(300px, 100%);
  max-height: 76px;
  object-fit: contain;
}

/* Card semitrasparenti effetto vetro */
body.home-tarsia #footer .footer-box {
  background: rgba(255, 255, 255, .76) !important;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, .72);
  box-shadow: 0 8px 28px rgba(20, 42, 58, .12);
  color: #233f56;
  text-align: left;

  padding: 16px;}

/* Il progetto: titolo e tre righe compatte */
body.home-tarsia #footer .footer-box:first-child {
  text-align: left;
}

body.home-tarsia #footer .footer-box:first-child .gestione-sito {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body.home-tarsia #footer .footer-box:first-child .gestione-sito > div {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 0 0 5px;
  border-bottom: 1px solid rgba(35, 63, 86, .14);
  text-align: left;
}

body.home-tarsia #footer .footer-box:first-child .gestione-sito > div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

body.home-tarsia #footer .footer-box:first-child .gestione-sito p {
  display: inline;
  margin: 0;
  color: #40576a;
  font-size: 14px;
}

body.home-tarsia #footer .footer-box:first-child .gestione-sito strong {
  display: inline;
  color: #233f56;
  font-size: 14px;
  font-weight: 700;
}

@media (max-width: 760px) {
  body.home-tarsia .logo-home-tarsia {
    max-width: 100%;
  }

  body.home-tarsia .logo-home-tarsia img {
    max-width: 260px;
    max-height: 68px;
  }
}


/* HOME TARSIA — ULTIME FINITURE */

/* Pulsante Cerca: blu più luminoso e leggero */
body.home-tarsia .hero-home-tarsia .area-ricerca button {
  background: #426b89 !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: 0 4px 14px rgba(12, 32, 48, .18);
  transition: background .2s ease, transform .2s ease;
}

body.home-tarsia .hero-home-tarsia .area-ricerca button:hover {
  background: #527f9f !important;
  transform: translateY(-1px);
}

/* Area amministrativa sempre leggibile */
body.home-tarsia #footer .footer-admin,
body.home-tarsia #footer a.footer-admin,
body.home-tarsia #footer .footer-admin:visited {
  color: #fff !important;
  background: #294b65;
  display: inline-block;
  padding: 10px 16px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 700;
}

body.home-tarsia #footer .footer-admin:hover {
  background: #426b89;
}

/* Effetto vetro satinato più evidente sulle card */
body.home-tarsia #footer .footer-box {
  background: rgba(250, 252, 253, .62) !important;
  -webkit-backdrop-filter: blur(18px) saturate(125%);
  backdrop-filter: blur(18px) saturate(125%);
  border: 1px solid rgba(255, 255, 255, .82);
  box-shadow:
    0 10px 30px rgba(20, 42, 58, .13),
    inset 0 1px 0 rgba(255, 255, 255, .75);
  transition: transform .25s ease, box-shadow .25s ease;

  padding: 16px;}

body.home-tarsia #footer .footer-box:hover {
  transform: translateY(-3px);
  box-shadow:
    0 15px 34px rgba(20, 42, 58, .17),
    inset 0 1px 0 rgba(255, 255, 255, .85);
}

@media (prefers-reduced-motion: reduce) {
  body.home-tarsia #footer .footer-box,
  body.home-tarsia .hero-home-tarsia .area-ricerca button {
    transition: none;
  }
}


/* HOME TARSIA — FOTO FOOTER E ULTIME FINITURE */

/* Più spazio alla fotografia del lago */
body.home-tarsia #footer .footer-sito {
  min-height: 360px;
  background-size: cover;
  background-position: center 55%;
  background-repeat: no-repeat;
  background-color: #263f54;
  background-image:
    linear-gradient(rgba(13, 30, 43, .12), rgba(13, 30, 43, .12)),
    url("../immagini/Tarsia-lago.webp");
}

/* Card più trasparenti: la fotografia resta visibile */
body.home-tarsia #footer .footer-box {
  background: rgba(250, 252, 253, .34) !important;
  -webkit-backdrop-filter: blur(8px) saturate(115%);
  backdrop-filter: blur(8px) saturate(115%);
  border: 1px solid rgba(255, 255, 255, .58);
  box-shadow: 0 8px 24px rgba(15, 35, 50, .12),
    inset 0 1px 0 rgba(255, 255, 255, .45);

  padding: 16px;}

/* Area amministrativa discreta, senza pulsante blu.
   L'icona è applicata solo alla home: il link resta invariato. */
body.home-tarsia #footer .footer-admin,
body.home-tarsia #footer a.footer-admin,
body.home-tarsia #footer .footer-admin:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 4px;
  color: #fff !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0;
  box-shadow: none !important;
  text-decoration: none;
  font-weight: 600;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .45);
}

body.home-tarsia #footer .footer-admin .footer-admin-icona {
  display: none;
}

body.home-tarsia #footer .footer-admin::before {
  content: "\\2699";
  font-family: sans-serif;
  font-size: 23px;
  line-height: 1;
  color: #fff;
}

body.home-tarsia #footer .footer-admin:hover {
  color: #fff !important;
  background: transparent !important;
  opacity: .82;
}

@media (max-width: 700px) {
  body.home-tarsia #footer .footer-sito {
    min-height: 0;
    background-position: center;
  }

  body.home-tarsia #footer .footer-box {
    background: rgba(250, 252, 253, .48) !important;
  
  padding: 16px;}
}

/* HOME TARSIA — CORREZIONE DEFINITIVA FOOTER */

/* Footer più alto: maggiore presenza della fotografia */
body.home-tarsia #footer .footer-sito {
  min-height: 500px;
  box-sizing: border-box;
  padding: 65px clamp(16px, 4vw, 52px) 45px;
  background-image:
    linear-gradient(rgba(13, 30, 43, .08), rgba(13, 30, 43, .08)),
    url("../immagini/Tarsia-lago.webp") !important;
  background-size: cover !important;
  background-position: center 55% !important;
  background-repeat: no-repeat !important;
}

/* Card bianche trasparenti, senza vetro né sfocatura */
body.home-tarsia #footer .footer-box {
  background: rgba(255, 255, 255, .76) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  border: 1px solid rgba(255, 255, 255, .65) !important;
  box-shadow: 0 4px 14px rgba(15, 35, 50, .10) !important;

  padding: 16px;}

/* Nessuna animazione sulle card */
body.home-tarsia #footer .footer-box,
body.home-tarsia #footer .footer-box:hover {
  transform: none !important;
  transition: none !important;
}

/* Ingranaggio visibile e link senza sfondo */
body.home-tarsia #footer a.footer-admin,
body.home-tarsia #footer a.footer-admin:visited {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 4px !important;
  color: #fff !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  text-decoration: none;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .6);
}

body.home-tarsia #footer a.footer-admin .footer-admin-icona {
  display: none !important;
}

body.home-tarsia #footer a.footer-admin::before {
  content: "⚙";
  display: inline-block;
  font-family: sans-serif;
  font-size: 23px;
  line-height: 1;
  color: #fff;
}

body.home-tarsia #footer a.footer-admin:hover {
  background: transparent !important;
  opacity: .8;
}

@media (max-width: 700px) {
  body.home-tarsia #footer .footer-sito {
    min-height: 0;
    padding: 35px 16px;
    background-position: center !important;
  }

  body.home-tarsia #footer .footer-box {
    background: rgba(255, 255, 255, .82) !important;
  
  padding: 16px;}
}



/* PAGINE SECONDARIE — IDENTITÀ VISIVA TARSIA */

/* Barra di navigazione uguale alla home */
body.pagina-secondaria {
  padding: 0;
}

/* Footer condiviso con fotografia e card più compatte */
body.pagina-secondaria #footer .footer-sito {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 18px;
  min-height: 500px;
  box-sizing: border-box;
  margin-top: 60px;
  padding: 55px clamp(16px, 4vw, 52px) 35px;
  background-image:
    linear-gradient(rgba(13, 30, 43, .08), rgba(13, 30, 43, .08)),
    url("../immagini/Tarsia-lago.webp");
  background-size: cover;
  background-position: center 55%;
  background-repeat: no-repeat;
  color: #263f54;
  text-align: left;
}

body.pagina-secondaria #footer .footer-box {
  width: 100%;
  max-width: none;
  height: auto;
  min-width: 0;
  margin: 0;
  padding: 16px;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, .65);
  border-radius: 12px;
  background: rgba(255, 255, 255, .76);
  box-shadow: 0 4px 14px rgba(15, 35, 50, .10);
  color: #263f54;
  text-align: left;
}

body.pagina-secondaria #footer .footer-box h3 {
  margin-top: 0;
  color: #233f56;
  font-size: 18px;
  line-height: 1.3;
}

body.pagina-secondaria #footer .footer-box p,
body.pagina-secondaria #footer .footer-box strong {
  color: #42586b;
}

body.pagina-secondaria #footer .footer-box a {
  color: #234b69;
  font-weight: 700;
}

body.pagina-secondaria #footer .footer-box:first-child .gestione-sito {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body.pagina-secondaria #footer .footer-box:first-child .gestione-sito > div {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px 6px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(35, 63, 86, .14);
}

body.pagina-secondaria #footer .footer-box:first-child .gestione-sito > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

body.pagina-secondaria #footer .footer-box:first-child .gestione-sito p,
body.pagina-secondaria #footer .footer-box:first-child .gestione-sito strong {
  display: inline;
  margin: 0;
  font-size: 14px;
}

body.pagina-secondaria #footer .footer-admin,
body.pagina-secondaria #footer .footer-admin:visited {
  grid-column: 1 / -1;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  color: #fff !important;
  background: transparent;
  border: 0;
  box-shadow: none;
  text-decoration: none;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .6);
}

body.pagina-secondaria #footer .footer-admin .footer-admin-icona {
  display: none;
}

body.pagina-secondaria #footer .footer-admin::before {
  content: "⚙";
  font-size: 23px;
  line-height: 1;
}

@media (max-width: 760px) {

  body.pagina-secondaria #footer .footer-sito {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 35px 16px;
    gap: 12px;
    background-position: center;
  }

  body.pagina-secondaria #footer .footer-box {
    padding: 16px;
  }

  body.pagina-secondaria #footer .footer-admin {
    grid-column: auto;
    justify-self: center;
  }
}

/* Stessa griglia e stessa larghezza delle card in tutte le pagine */
body.home-tarsia #footer .footer-sito,
body.pagina-secondaria #footer .footer-sito {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  column-gap: 22px;
  box-sizing: border-box;
}

body.home-tarsia #footer .footer-box,
body.pagina-secondaria #footer .footer-box {
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
  box-sizing: border-box;

  padding: 16px;}

#footer .collaborazione-comune {
  display: none !important;
}

@media (max-width: 760px) {

  body.home-tarsia #footer .footer-sito,
  body.pagina-secondaria #footer .footer-sito {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 16px;
  }
}

@media (max-width: 760px) {
}

@media (max-width: 760px) {
}


/* =========================================================
   PAGINE SECONDARIE — HEADER E HERO ALLINEATI ALLA HOME
   Unica definizione; dimensioni riprese dalla home.
   ========================================================= */

body.pagina-secondaria .header-home-tarsia {
  width: 100%;
  margin: 0;
  padding: 8px clamp(18px, 4vw, 52px);
  box-sizing: border-box;
  background: #fff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.pagina-secondaria .nav-home-tarsia {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 76px;
}

body.pagina-secondaria .nav-home-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(18px, 3vw, 38px);
}

body.pagina-secondaria .nav-home-links a {
  color: #233f56;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}

body.pagina-secondaria .nav-home-links a:hover {
  color: #587d96;
}

body.pagina-secondaria .logo-home-tarsia {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;
  margin: 0;
}

body.pagina-secondaria .logo-home-tarsia img {
  display: block;
  width: auto;
  max-width: min(300px, 100%);
  max-height: 76px;
  object-fit: contain;
}

/* Hero: altezza, spaziatura e tipografia della home */
body.pagina-secondaria .hero-secondario {
  width: 100%;
  min-height: 410px;
  margin: 0;
  padding: clamp(38px, 6vw, 78px) 22px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 18px;
  background-image:
    linear-gradient(rgba(0, 0, 0, .20), rgba(0, 0, 0, .20)),
    url("../immagini/tarsia-alto.webp");
  background-size: cover;
  background-position: center;
  background-attachment: scroll;
}

body.pagina-secondaria .hero-secondario .stemma {
  display: none;
}

body.pagina-secondaria .hero-secondario h1 {
  max-width: 800px;
  margin: 0 auto 18px;
  color: #fff;
  font-size: clamp(34px, 4.5vw, 54px);
  line-height: 1.12;
  letter-spacing: -.7px;
  font-weight: 700;
  text-shadow: 0 3px 18px rgba(0, 0, 0, .7);
}

body.pagina-secondaria .hero-secondario p {
  max-width: none;
  margin: 0 auto 30px;
  color: #fff;
  font-size: clamp(14px, 1.5vw, 18px);
  font-weight: 400;
  line-height: 1.55;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .85);

  white-space: nowrap;}

@media (max-width: 760px) {
  body.pagina-secondaria .header-home-tarsia {
    padding: 12px 16px;
  }

  body.pagina-secondaria .nav-home-tarsia {
    flex-direction: column;
    gap: 12px;
    min-height: auto;
    padding: 8px 0;
  }

  body.pagina-secondaria .logo-home-tarsia img {
    max-width: 260px;
    max-height: 68px;
  }

  body.pagina-secondaria .nav-home-links {
    justify-content: center;
    gap: 22px;
  }

  body.pagina-secondaria .hero-secondario {
    min-height: 390px;
    padding: 38px 18px;
    background-attachment: scroll;
  }
  body.pagina-secondaria .hero-secondario p {
    white-space: normal;
    max-width: 100%;
    font-size: 17px;
  }

}


/* FOOTER — card compatte, link vicini al testo */
body.home-tarsia #footer .footer-sito,
body.pagina-secondaria #footer .footer-sito {
  align-items: start !important;
}

body.home-tarsia #footer .footer-box,
body.pagina-secondaria #footer .footer-box {
  height: auto !important;
  align-self: start !important;
  padding: 14px !important;
  box-sizing: border-box;
}

body.home-tarsia #footer .footer-box h3,
body.pagina-secondaria #footer .footer-box h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

body.home-tarsia #footer .footer-box p,
body.pagina-secondaria #footer .footer-box p {
  margin-top: 0;
  margin-bottom: 4px !important;
  line-height: 1.3;
}

body.home-tarsia #footer .footer-box.footer-secondario > a,
body.pagina-secondaria #footer .footer-box.footer-secondario > a {
  display: inline-block;
  margin-top: 24px !important;
}

body.home-tarsia #footer .footer-box:first-child .gestione-sito,
body.pagina-secondaria #footer .footer-box:first-child .gestione-sito {
  gap: 5px !important;
}

body.home-tarsia #footer .footer-box:first-child .gestione-sito > div,
body.pagina-secondaria #footer .footer-box:first-child .gestione-sito > div {
  padding-bottom: 4px !important;
}



/* HOME TARSIA — FASCIA PANORAMICA PRIMA DEL FOOTER */
body.home-tarsia .fascia-memoria-tarsia {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 340px;
  box-sizing: border-box;
  margin: 0;
  padding: 64px 24px;
  overflow: hidden;
  color: #fff;
  text-align: center;
  background-image:
    linear-gradient(rgba(12, 28, 39, 0.22), rgba(12, 28, 39, 0.38)),
    url("../immagini/Tarsia-lago.webp");
  background-size: cover;
  background-position: center 52%;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body.home-tarsia .fascia-memoria-tarsia__contenuto {
  position: relative;
  z-index: 1;
  width: min(100%, 900px);
  margin: 0 auto;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}

body.home-tarsia .fascia-memoria-tarsia h2 {
  margin: 0 0 12px;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 3.5vw, 46px);
  font-weight: 600;
  line-height: 1.2;
}

body.home-tarsia .fascia-memoria-tarsia p {
  margin: 0;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(18px, 2vw, 27px);
  font-style: italic;
  line-height: 1.5;
}

body.home-tarsia .fascia-memoria-tarsia__linea {
  display: block;
  width: 100px;
  height: 2px;
  margin: 24px auto 0;
  background: rgba(255, 255, 255, 0.9);
}

/* LOGO NEL FOOTER — SOLO HOMEPAGE */
body.home-tarsia #footer .footer-sito::before {
  content: "";
  display: block;
  grid-column: 1 / -1;
  width: min(290px, 85%);
  height: 68px;
  margin: 0 0 10px;
  background-image: url("../immagini/logo-orizzontale-3.svg");
  background-position: left center;
  background-repeat: no-repeat;
  background-size: contain;
}

/* Adattamento per telefoni */
@media (max-width: 700px) {
  body.home-tarsia .fascia-memoria-tarsia {
    min-height: 270px;
    padding: 48px 20px;
    background-attachment: scroll;
    background-position: center;
  }

  body.home-tarsia #footer .footer-sito::before {
    grid-column: 1 / -1;
    width: min(260px, 90%);
    height: 60px;
    margin: 0 auto 12px;
    background-position: center;
  }
}


/* HOME TARSIA — RACCORDO FASCIA LAGO E FOOTER */
body.home-tarsia .fascia-memoria-tarsia {
  margin: 0 !important;
  margin-bottom: 0 !important;
  border: 0 !important;
}

/* Il contenitore del footer non deve introdurre spazi */
body.home-tarsia #footer {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

/* Footer classico a tinta unita, senza fotografia */
body.home-tarsia #footer .footer-sito {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 28px 42px !important;
  align-items: start !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 30px max(28px, calc((100% - 1180px) / 2)) 38px !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #f7f5ef !important;
  background-image: none !important;
  color: #24445a !important;
}

/* Logo sopra le tre colonne */
body.home-tarsia #footer .footer-sito::before {
  grid-column: 1 / -1 !important;
  display: block !important;
  width: min(290px, 85%) !important;
  height: 66px !important;
  margin: 0 0 4px !important;
  background-image: url("../immagini/logo-orizzontale-3.svg") !important;
  background-position: left center !important;
  background-repeat: no-repeat !important;
  background-size: contain !important;
}

/* Colonne semplici, senza effetto card */
body.home-tarsia #footer .footer-box {
  min-width: 0 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  color: #36566b !important;
  text-align: left !important;
}

body.home-tarsia #footer .footer-box h2,
body.home-tarsia #footer .footer-box h3 {
  margin-top: 0 !important;
  color: #164b70 !important;
}

body.home-tarsia #footer .footer-box p,
body.home-tarsia #footer .footer-box li {
  color: #526f81 !important;
}

body.home-tarsia #footer .footer-box a {
  color: #164b70 !important;
  text-shadow: none !important;
}

/* Mobile */
@media (max-width: 700px) {
  body.home-tarsia #footer .footer-sito {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 24px !important;
    padding: 28px 22px 32px !important;
  }

  body.home-tarsia #footer .footer-sito::before {
    grid-column: 1 !important;
    width: min(260px, 90%) !important;
    height: 60px !important;
    margin: 0 auto 4px !important;
    background-position: left center !important;
  }
}


/* CORREZIONI FINALI HOMEPAGE TARSIA */

/* Logo corretto nel footer */
body.home-tarsia #footer .footer-sito::before {
  background-image: url("../immagini/logo.png") !important;
  background-position: left center !important;
  background-repeat: no-repeat !important;
  background-size: contain !important;
}

/* Titolo fascia lago: stesso font del titolo hero */
body.home-tarsia .fascia-memoria-tarsia h2 {
  font-family: inherit !important;
}

/* Link area amministrativa sempre blu e leggibile */
body.home-tarsia #footer .footer-sito a,
body.home-tarsia #footer .footer-sito a:link,
body.home-tarsia #footer .footer-sito a:visited {
  color: #164b70 !important;
  text-shadow: none !important;
}

body.home-tarsia #footer .footer-sito a:hover,
body.home-tarsia #footer .footer-sito a:focus {
  color: #0b3049 !important;
  text-decoration: underline !important;
}


/* ICONA AMMINISTRAZIONE — BLU SU FOOTER CHIARO */
body.home-tarsia #footer a[href*="admin"],
body.home-tarsia #footer a[href*="amministra"],
body.home-tarsia #footer a[href*="gestione"] {
  color: #164b70 !important;
  fill: #164b70 !important;
}

body.home-tarsia #footer a[href*="admin"] svg,
body.home-tarsia #footer a[href*="amministra"] svg,
body.home-tarsia #footer a[href*="gestione"] svg,
body.home-tarsia #footer a[href*="admin"] svg *,
body.home-tarsia #footer a[href*="amministra"] svg *,
body.home-tarsia #footer a[href*="gestione"] svg * {
  color: #164b70 !important;
  fill: #164b70 !important;
  stroke: #164b70 !important;
}


/* FIX DEFINITIVO — INGRANAGGIO AREA AMMINISTRATIVA HOMEPAGE */
body.home-tarsia #footer a.footer-admin,
body.home-tarsia #footer a.footer-admin:link,
body.home-tarsia #footer a.footer-admin:visited,
body.home-tarsia #footer a.footer-admin:hover,
body.home-tarsia #footer a.footer-admin:focus {
  color: #164b70 !important;
  background: transparent !important;
  text-shadow: none !important;
}

body.home-tarsia #footer a.footer-admin .footer-admin-icona {
  color: #164b70 !important;
  background: transparent !important;
  filter: none !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #164b70 !important;
  fill: #164b70 !important;
  stroke: #164b70 !important;
}

body.home-tarsia #footer a.footer-admin .footer-admin-icona svg,
body.home-tarsia #footer a.footer-admin .footer-admin-icona svg *,
body.home-tarsia #footer a.footer-admin .footer-admin-icona path,
body.home-tarsia #footer a.footer-admin .footer-admin-icona i {
  color: #164b70 !important;
  fill: #164b70 !important;
  stroke: #164b70 !important;
  -webkit-text-fill-color: #164b70 !important;
}


/* FIX MIRATO: INGRANAGGIO E LINK BLU NEL FOOTER HOMEPAGE */
body.home-tarsia #footer a.footer-admin,
body.home-tarsia #footer a.footer-admin:link,
body.home-tarsia #footer a.footer-admin:visited,
body.home-tarsia #footer a.footer-admin:hover,
body.home-tarsia #footer a.footer-admin:focus {
  color: #164b70 !important;
  text-shadow: none !important;
}

body.home-tarsia #footer a.footer-admin::before {
  content: "⚙" !important;
  color: #164b70 !important;
  -webkit-text-fill-color: #164b70 !important;
  text-shadow: none !important;
}

body.home-tarsia #footer a.footer-admin .footer-admin-icona {
  display: none !important;
}


/* FASCIA MEMORIA — SENZA LINEA DECORATIVA */
body.home-tarsia .fascia-memoria-tarsia__linea {
  display: none !important;
}

/* COLORE D'ACCENTO DEL LOGO: GIALLO SENAPE */
:root {
  --colore-accento-tarsia: #D7A35C;
}


/* ACCENTI SENAPE — IDENTITÀ VISIVA TARSIA */
:root {
  --colore-accento-tarsia: #D7A35C;
}

/* Accento discreto sotto il titolo della fascia panoramica */
body.home-tarsia .fascia-memoria-tarsia h2 {
  text-decoration: none !important;
}

/* Il link amministrativo usa il senape solo al passaggio del mouse */
body.home-tarsia #footer a.footer-admin:hover,
body.home-tarsia #footer a.footer-admin:focus-visible {
  color: #D7A35C !important;
}

body.home-tarsia #footer a.footer-admin:hover::before,
body.home-tarsia #footer a.footer-admin:focus-visible::before {
  color: #D7A35C !important;
  -webkit-text-fill-color: #D7A35C !important;
}

/* Link del footer: accento senape al passaggio del mouse */
body.home-tarsia #footer .footer-box a:hover,
body.home-tarsia #footer .footer-box a:focus-visible {
  color: #D7A35C !important;
}


/* =========================================================
   TARSIA — FOOTER UNIFICATO SU TUTTE LE PAGINE
   ========================================================= */

body.home-tarsia #footer,
body.pagina-secondaria #footer {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

body.home-tarsia #footer .footer-sito,
body.pagina-secondaria #footer .footer-sito {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  align-items: start !important;
  gap: 26px 38px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 30px max(28px, calc((100% - 1180px) / 2)) 34px !important;
  background: #f7f5ef !important;
  background-image: none !important;
  color: #36566b !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  text-align: left !important;
}

/* Logo condiviso */
body.home-tarsia #footer .footer-sito::before,
body.pagina-secondaria #footer .footer-sito::before {
  content: "" !important;
  display: block !important;
  grid-column: 1 / -1 !important;
  width: min(290px, 85%) !important;
  height: 66px !important;
  margin: 0 0 2px !important;
  background-image: url("../immagini/logo.png") !important;
  background-position: left center !important;
  background-repeat: no-repeat !important;
  background-size: contain !important;
}

body.home-tarsia #footer .footer-box,
body.pagina-secondaria #footer .footer-box {
  min-width: 0 !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #36566b !important;
  text-align: left !important;
  transform: none !important;
}

body.home-tarsia #footer .footer-box h3,
body.pagina-secondaria #footer .footer-box h3 {
  margin: 0 0 14px !important;
  color: #164b70 !important;
  font-size: 17px !important;
}

body.home-tarsia #footer .footer-box p,
body.home-tarsia #footer .footer-box strong,
body.pagina-secondaria #footer .footer-box p,
body.pagina-secondaria #footer .footer-box strong {
  color: #526f81 !important;
}

body.home-tarsia #footer .footer-box a,
body.pagina-secondaria #footer .footer-box a {
  color: #164b70 !important;
  text-shadow: none !important;
  text-decoration: none;
  transition: color .2s ease;
}

body.home-tarsia #footer .footer-box a:hover,
body.home-tarsia #footer .footer-box a:focus-visible,
body.pagina-secondaria #footer .footer-box a:hover,
body.pagina-secondaria #footer .footer-box a:focus-visible {
  color: #D7A35C !important;
  text-decoration: underline;
}

/* Area amministrativa coerente con il footer chiaro */
body.home-tarsia #footer a.footer-admin,
body.pagina-secondaria #footer a.footer-admin,
body.home-tarsia #footer a.footer-admin:visited,
body.pagina-secondaria #footer a.footer-admin:visited {
  grid-column: 1 / -1 !important;
  justify-self: end !important;
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 0 !important;
  padding: 8px 0 !important;
  color: #164b70 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  text-decoration: none !important;
  text-shadow: none !important;
  transition: color .2s ease;
}

body.home-tarsia #footer a.footer-admin::before,
body.pagina-secondaria #footer a.footer-admin::before {
  content: "⚙" !important;
  display: inline-block;
  color: inherit !important;
  -webkit-text-fill-color: currentColor !important;
  font-size: 22px;
  line-height: 1;
  text-shadow: none !important;
}

body.home-tarsia #footer a.footer-admin .footer-admin-icona,
body.pagina-secondaria #footer a.footer-admin .footer-admin-icona {
  display: none !important;
}

body.home-tarsia #footer a.footer-admin:hover,
body.home-tarsia #footer a.footer-admin:hover::before,
body.pagina-secondaria #footer a.footer-admin:hover,
body.pagina-secondaria #footer a.footer-admin:hover::before,
body.home-tarsia #footer a.footer-admin:focus-visible,
body.pagina-secondaria #footer a.footer-admin:focus-visible {
  color: #D7A35C !important;
  -webkit-text-fill-color: #D7A35C !important;
}

/* Pulsanti del sito: senape al passaggio del mouse */
body.home-tarsia .hero-home-tarsia .area-ricerca button,
body.home-tarsia a.pulsante,
body.pagina-secondaria a.pulsante,
body.home-tarsia a.scheda-button,
body.pagina-secondaria a.scheda-button {
  transition: background-color .2s ease, color .2s ease,
              border-color .2s ease, transform .2s ease;
}

body.home-tarsia .hero-home-tarsia .area-ricerca button:hover,
body.home-tarsia .hero-home-tarsia .area-ricerca button:focus-visible,
body.home-tarsia a.pulsante:hover,
body.pagina-secondaria a.pulsante:hover,
body.home-tarsia a.scheda-button:hover,
body.pagina-secondaria a.scheda-button:hover,
body.home-tarsia a.pulsante:focus-visible,
body.pagina-secondaria a.pulsante:focus-visible,
body.home-tarsia a.scheda-button:focus-visible,
body.pagina-secondaria a.scheda-button:focus-visible {
  background: #D7A35C !important;
  border-color: #D7A35C !important;
  color: #172b3a !important;
  -webkit-text-fill-color: #172b3a !important;
}

/* Layout responsive */
@media (max-width: 760px) {
  body.home-tarsia #footer .footer-sito,
  body.pagina-secondaria #footer .footer-sito {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 24px !important;
    padding: 28px 22px 30px !important;
  }

  body.home-tarsia #footer .footer-sito::before,
  body.pagina-secondaria #footer .footer-sito::before {
    grid-column: 1 !important;
    width: min(260px, 90%) !important;
    height: 60px !important;
    margin: 0 0 4px !important;
  }

  body.home-tarsia #footer a.footer-admin,
  body.pagina-secondaria #footer a.footer-admin {
    grid-column: 1 !important;
    justify-self: start !important;
  }
}


/* PLANIMETRIA — ZOOM PRECISO E TRASCINAMENTO */
body.pagina-secondaria .zoom-container {
  position: relative;
  width: 100%;
  aspect-ratio: 2090 / 854;
  overflow: hidden;
  padding: 0;
  border-radius: 14px;
  background: #fff;
  isolation: isolate;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

body.pagina-secondaria .zoom-container:active {
  cursor: grabbing;
}

body.pagina-secondaria .zoom-container img#planimetria {
  position: absolute;
  inset: 0 auto auto 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: fill;
  margin: 0;
  border-radius: 0;
  transform: translate3d(0, 0, 0) scale(1);
  transform-origin: 0 0;
  transition: none;
  pointer-events: none;
  will-change: transform;
}

.controlli-planimetria {
  position: absolute;
  z-index: 5;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px;
  border: 1px solid rgba(22, 75, 112, .15);
  border-radius: 10px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 3px 14px rgba(20, 42, 58, .16);
  cursor: default;
}

.controlli-planimetria button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #d8e0e5;
  border-radius: 7px;
  background: #f7f5ef;
  color: #164b70;
  font: inherit;
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
}

.controlli-planimetria #zoom-reset {
  font-size: 12px;
  font-weight: 700;
}

.controlli-planimetria button:hover:not(:disabled),
.controlli-planimetria button:focus-visible {
  background: #D7A35C;
  border-color: #D7A35C;
  color: #172b3a;
}

.controlli-planimetria button:disabled {
  opacity: .4;
  cursor: not-allowed;
}

#zoom-livello {
  min-width: 44px;
  padding: 0 3px;
  color: #36566b;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.istruzione-planimetria {
  position: absolute;
  z-index: 4;
  bottom: 10px;
  left: 50%;
  max-width: calc(100% - 20px);
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(22, 42, 56, .82);
  color: white;
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
  transform: translateX(-50%);
  text-align: center;
}

@media (max-width: 600px) {
  .controlli-planimetria {
    top: 7px;
    right: 7px;
    gap: 4px;
    padding: 5px;
  }

  .controlli-planimetria button {
    min-width: 34px;
    height: 34px;
    padding: 0 7px;
  }

  .controlli-planimetria #zoom-reset {
    font-size: 11px;
  }

  #zoom-livello {
    min-width: 36px;
    font-size: 11px;
  }

  .istruzione-planimetria {
    bottom: 6px;
    font-size: 10px;
  }
}
