/**
 * Theme Name: Blocksy Child
 */

/* ===============================
   TABELLA MODELLI
=============================== */
.scroll-tabella {
    width: 100%;
    overflow-x: auto;
    border: 2px solid #ccc;
}

.tabella-modelli {
    width: max-content;
    min-width: 3500px;
    border-collapse: collapse;
    font-size: 13px;
}

.tabella-modelli th,
.tabella-modelli td {
    border: 1px solid #ddd;
    padding: 6px;
}

.tabella-modelli th {
    background: #f5f5f5;
    white-space: nowrap;
}

.tabella-modelli input {
    width: 150px;
}

.tabella-modelli textarea {
    width: 300px;
    min-width: 300px;
    height: 120px;
}

.tabella-modelli tr:nth-child(even) {
    background: #fafafa;
}


/* ===============================
   ICONE SEZIONI (SAFE)
=============================== */

/* SOLO sui titoli → NON rompe Elementor */
h2.sezione {
    position: relative;
    padding-left: 70px;
}

/* icona */
h2.sezione::before {
    content: "";
    position: absolute;
    left: 0;
    top: 5px;
    width: 50px;
    height: 50px;
    background-size: contain;
    background-repeat: no-repeat;
}

/* ===============================
   ICONE SEZIONI
=============================== */

/* titolo sezione */
h2.sezione {
    position: relative;
    padding-left: 80px;
}

/* contenitore icona */
h2.sezione::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background-size: contain;
    background-repeat: no-repeat;
}

/* ===============================
   MAPPATURA ICONE
=============================== */

h2.sezione.info::before {
    background-image: url('/wp-content/themes/blocksy-child/icone/1_INFORMAZIONI.png');
}

h2.sezione.rilievo_integrato::before {
    background-image: url('/wp-content/themes/blocksy-child/icone/2_RILIEVO.png');
}

h2.sezione.rappresentazioni::before {
    background-image: url('/wp-content/themes/blocksy-child/icone/3_RAPPRESENTAZIONI.png');
}

h2.sezione.modellazioni_tridimensionali::before {
    background-image: url('/wp-content/themes/blocksy-child/icone/4_MODELLAZIONI_TRIDIMENSIONALI.png');
}

h2.sezione.virtual::before {
    background-image: url('/wp-content/themes/blocksy-child/icone/5_VIRTUAL_TOUR.png');
}

h2.sezione.documentazione::before {
    background-image: url('/wp-content/themes/blocksy-child/icone/6_DOCUMENTAZIONE_ARCHIVIO.png');
}

h2.sezione.pubblicazioni::before {
    background-image: url('/wp-content/themes/blocksy-child/icone/7_PUBBLICAZIONI_CONSULTATE.png');
}

h2.sezione.gruppo::before {
    background-image: url('/wp-content/themes/blocksy-child/icone/8_PUBBLICAZIONI_GRUPPO RIC.png');
}

h2.sezione.bibliografia::before {
    background-image: url('/wp-content/themes/blocksy-child/icone/9_BIBLIOGRAFIA.png');
}

h2.sezione.schedatura::before {
    background-image: url('/wp-content/themes/blocksy-child/icone/10_SCHEDATURA.png');
}
	
/* ===============================
   GALLERIA MOBILE UNIFORME
=============================== */

@media (max-width: 768px) {

    .galleria-modelli,
    .wp-block-columns,
    .blocks-gallery-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px;
        align-items: start;
    }

    /* singola card */
    .galleria-modelli > *,
    .wp-block-columns > *,
    .blocks-gallery-item {
        width: 100% !important;
    }

    /* immagini */
    .galleria-modelli img,
    .wp-block-columns img,
    .blocks-gallery-item img {
        width: 100%;
        height: auto;
        display: block;
    }

}

@media (max-width: 768px) {

    /* prende tutti i blocchi immagini */
    .entry-content figure {
        width: 100%;
        aspect-ratio: 1 / 1;  /* ✅ QUADRATO */
        overflow: hidden;
        margin: 0;
    }

    /* immagine dentro */
    .entry-content figure img {
        width: 100%;
        height: 100%;
        object-fit: cover;   /* ✅ riempie e taglia */
    }

}

.icone a.icona {
    font-size: 20px !important;
    line-height: 1 !important;
    display: inline-block !important;
}

/* contenitore icone TOC */
#ez-toc-container a {
    position: relative;
    padding-left: 35px;
    display: block;
}

/* base icona */
#ez-toc-container a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    background-size: contain;
    background-repeat: no-repeat;
}

/* base icona */
#ez-toc-container li a::before {
    content: "";
    display: block;
    width: 30px;
    height: 30px;
    margin: 0 auto;
    background-size: contain;
    background-repeat: no-repeat;
}

/* mapping intelligente (non fragile) */

#ez-toc-container a[href*="informazioni"]::before {
    background-image: url('/wp-content/uploads/img/1_INFORMAZIONI.png');
}

#ez-toc-container a[href*="rilievo"]::before {
    background-image: url('/wp-content/uploads/img/2_RILIEVO.png');
}

#ez-toc-container a[href*="rappresentazioni"]::before {
    background-image: url('/wp-content/uploads/img/3_RAPPRESENTAZIONI.png');
}

#ez-toc-container a[href*="modellazioni"]::before {
    background-image: url('/wp-content/uploads/img/4_MODELLAZIONI%20TRIDIMENSIONALI.png');
}

#ez-toc-container a[href*="virtual"]::before {
    background-image: url('/wp-content/uploads/img/5_VIRTUAL%20TOUR.png');
}

#ez-toc-container a[href*="documentazione"]::before {
    background-image: url('/wp-content/uploads/img/6_DOCUMENTAZIONE%20ARCHIVIO.png');
}

#ez-toc-container a[href*="pubblicazioni"]::before {
    background-image: url('/wp-content/uploads/img/7_PUBBLICAZIONI%20CONSULTATE.png');
}

#ez-toc-container a[href*="bibliografia"]::before {
    background-image: url('/wp-content/uploads/img/9_BIBLIOGRAFIA.png');
}

#ez-toc-container a[href*="schedatura"]::before {
    background-image: url('/wp-content/uploads/2025/02/10_SCHEDATURA.png');
}
.toc-sidebar {
    position: fixed;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    z-index: 999;

    display: flex;
    flex-direction: column;
    gap: 8px;

    background: rgba(255,255,255,0.9);
    padding: 10px;
    border-radius: 10px;
}

.toc-item {
    width: 40px;
    height: 40px;
    display: block;
}

.toc-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.toc-item:hover {
    transform: scale(1.1);
}