/* Icons */
.ph-si {
    width: 1.5em;
    height: 1.5em;
    margin: 0 0.25em;
    fill: currentColor;
}

/* SVG ICONS BASE */
.ph-si-feed {color: #F8961E;}
.ph-si-image {color: #33739e; margin-bottom: 0.3em}
.ph-si-tab.ph-si-image {color: #33739e;}
.ph-si-category {color: #F9C74F; margin-bottom: 0.3em}
.ph-si-star {color: #ffc93c;}
.ph-si-comment {color: #333a9e;}
.ph-si-upload {color: #0d6e35;}
.ph-si-upload-multiple {color: #333a9e;}
.ph-si-earth {color: #0d6e35;}
.ph-si-stats {color: #F8961E;}
.ph-si-ytb {color: #ff0000;}
.ph-si-trash {color: #ff0000;}

.ph-si-enabled {color: #0d6e35;}
.ph-si-disabled {color: #ff0000;}

.ph-si-category-top-category {color: #F9C74F; margin-bottom: 0.3em}
.ph-si-category-top-back {color: #F3722C; margin-bottom: 0.3em}
.ph-si-detail-top-back{color: #F3722C; margin-bottom: 0.3em; width: 3em;height:3em;}

.ph-si-next-btn,
.ph-si-prev-btn {color: #fff;margin-bottom:0.25em;}

.ph-si-category-medium {color: #F9C74F; background: #f0f0f0;}

.ph-si-back-medium {color: #b0b0b0; background: #f0f0f0;}
.ph-si-lock-medium {color: #b0b0b0; background: #f0f0f0;}

.pg-categories-items-box,
.pg-category-items-box {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-content: flex-start;
}

@media only screen and (max-width: 768px) {
    .pg-categories-items-box,
    .pg-category-items-box  {
        justify-content: center;
    }
}

.pg-item-box,
.pg-category-box {
	padding: 0.5em;
	width: 15em;
	display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.pg-item-box figure,
.pg-category-box figure {
    margin: 0;
}

.pg-item-box-info,
.pg-category-box-info {
    margin: 0;
    padding: 0;
	width: 100%;
	padding: 0.5em 1em;
}

#phocagallery svg {
    vertical-align: middle;
}

.pg-svg-box {
    margin: 0;
    padding: 0;
    line-height: 0;
}
.pg-svg-box svg {
    padding: 2.5em;
    margin: 0;
}

/* Pagination */
.com_phocagallery .form-select {
    width: auto;
    margin-left: 0.5em;
    margin-right: 0.5em;
}

.com_phocagallery .pagination {
    align-items: center;
    justify-content: flex-end;
}

/* Loading */
.ph-lds-ellipsis {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 0px;
}

.ph-loading-text {
    text-align: center;
}
.ph-loading-text .ph-lds-ellipsis {
    height: 50px;
}  
.ph-loading-hidden {
    display: none;
}

#phocagallery {
    margin-bottom: 1em;
}

@media only screen and (max-width: 768px) {
    .com_phocagallery form > .pagination,
    .com-phocagallery form > .pagination {
        flex-direction: column;
        align-items: center;
    }
}


/* ===================================================
   CORREZIONI STRUTTURALI MECCATRONICA VALLEY
   =================================================== */

/* 1. Layout contenitore */
.pg-categories-items-box,
.pg-category-items-box {
    justify-content: center !important;
    gap: 25px !important;
    margin-top: 20px !important;
}

/* 2. Scheda Categoria / Immagine */
.pg-item-box,
.pg-category-box {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    padding: 12px !important;
    width: 250px !important; /* Dimensione fissa per la scheda */
    box-sizing: border-box !important;
}

.pg-item-box:hover,
.pg-category-box:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 12px 24px rgba(30, 141, 211, 0.18) !important;
    border-color: #1e8dd3 !important;
}

/* 3. Immagini proporzionate (no schiacciamento) */
.pg-category-box-image,
.pg-item-box-image {
    width: 100% !important;
    height: 160px !important; /* Altezza fissa */
    overflow: hidden !important;
    border-radius: 8px !important;
}

.pg-category-box-image img,
.pg-item-box-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* Ritaglia l'immagine mantenendo le proporzioni */
    object-position: center !important;
    box-shadow: none !important;
    transition: transform 0.4s ease !important;
}

.pg-item-box:hover .pg-item-box-image img,
.pg-category-box:hover .pg-category-box-image img {
    transform: scale(1.06) !important;
}

/* 4. Nasconde le icone accanto ai titoli */
.pg-category-box-title svg,
.pg-category-box-title .ph-si,
.pg-category-box-title .ph-si-category,
.pg-item-box-title svg,
.pg-item-box-title .ph-si {
    display: none !important;
}

/* 5. Titoli puliti, formattati e distanziati */
.pg-item-box-title,
.pg-category-box-title {
    margin-top: 12px !important;
    justify-content: center !important;
    text-align: center !important;
    display: block !important;
    width: 100% !important;
}

.pg-item-box-title a,
.pg-category-box-title a {
    color: #1e8dd3 !important;
    font-family: 'Aldrich', sans-serif !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    text-decoration: none !important;
    word-break: normal !important;
    white-space: normal !important;
    display: inline-block !important;
}

.pg-item-box-title a:hover,
.pg-category-box-title a:hover {
    color: #0d5c91 !important;
}

/* Conteggio immagini accanto o sotto al titolo */
.pg-category-box-count {
    color: #64748b !important;
    font-size: 0.85rem !important;
    font-weight: normal !important;
    margin-left: 4px !important;
}