.pgd-gallery { --pgd-label-font: Inter, sans-serif; --pgd-field-font: Arial; margin: 1.5rem 0; }
.pgd-gallery, .pgd-gallery * { border-radius: var(--pgd-radius, 0px) !important; }
#pgd-editor, #pgd-editor * { border-radius: 0 !important; }
.pgd-gallery [hidden] { display: none !important; }
.pgd-filters { display: grid; grid-template-columns: repeat(var(--pgd-filter-columns, 4), minmax(0, 1fr)); gap: var(--pgd-filter-row-gap, 15px) var(--pgd-filter-col-gap, 10px); padding: 0; background: var(--pgd-filter-bg, #fff); }
/* Valori ricavati dal form Contatti DIASEN: etichette Inter, campi Arial. */
.pgd-filters label { display: block; margin: 0 0 8px; padding: 0; font-family: var(--pgd-label-font, inherit); font-size: var(--pgd-label-size, 14px); line-height: 1.5; letter-spacing: normal; color: var(--pgd-label-color, #666); font-weight: 400; text-transform: var(--pgd-uppercase, uppercase); }
.pgd-gallery .pgd-filters select { box-sizing: border-box; width: 100%; height: auto; min-height: 0; margin: 0; padding: var(--pgd-field-y, 12px) calc(var(--pgd-field-x, 15px) + 20px) var(--pgd-field-y, 12px) var(--pgd-field-x, 15px); font-family: var(--pgd-field-font, inherit); font-size: var(--pgd-field-size, 14px); font-weight: 400; font-style: normal; line-height: normal; letter-spacing: normal; text-transform: none; color: var(--pgd-field-color, #666); background-color: var(--pgd-field-bg, #fff); border: 1px solid var(--pgd-border-color, #e5e5e5); box-shadow: none; outline: none; transition: border-color .2s ease; -webkit-appearance: none; -moz-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M6 8L0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right var(--pgd-field-x, 15px) center; cursor: pointer; }
.pgd-gallery .pgd-filters select:focus { border-color: #999; }
.pgd-gallery .pgd-reset { justify-self: start; box-sizing: border-box; min-width: 0; min-height: 0; height: auto; margin: 0; padding: 12px 30px; font-family: var(--pgd-field-font, inherit); font-size: var(--pgd-button-size, 14px); font-weight: 400; font-style: normal; line-height: normal; letter-spacing: 1px; text-align: center; text-transform: uppercase; color: var(--pgd-button-color, #fff); background: var(--pgd-button-bg, #000); border: 0; box-shadow: none; cursor: pointer; transition: background .2s ease; -webkit-appearance: none; appearance: none; }
.pgd-gallery .pgd-reset:hover { color: var(--pgd-button-color, #fff); background: var(--pgd-button-hover, #333); }
.pgd-gallery :is(select, button):focus-visible { outline: 2px solid #666; outline-offset: 3px; }
.pgd-count { margin: 1rem 0; font-family: var(--pgd-label-font, inherit); font-size: var(--pgd-label-size, 14px); line-height: 1.5; }
.pgd-grid { display: grid; grid-template-columns: repeat(var(--pgd-columns, 4), minmax(0, 1fr)); gap: var(--pgd-gap, 16px); }
.pgd-grid .pgd-item { margin: 0; overflow: hidden; }
.pgd-item img { display: block; width: 100%; height: auto; aspect-ratio: var(--pgd-ratio, 4 / 3); object-fit: cover; transition: transform .3s ease; }
.pgd-open { display: block; overflow: hidden; cursor: zoom-in; }
.pgd-open:focus-visible { outline: 3px solid #176cce; outline-offset: -3px; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .pgd-open:hover img, .pgd-open:hover .pgd-preview-placeholder { transform: scale(var(--pgd-hover, 1.04)); }
}
.pgd-lightbox { box-sizing: border-box; position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: #000; color: #fff; overflow: hidden; }
.pgd-lightbox::backdrop { background: #000; }
.pgd-lightbox, .pgd-lightbox * { border-radius: 0 !important; }
.pgd-lightbox [hidden] { display: none !important; }
.pgd-lightbox-panel { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.pgd-lightbox-image { display: block; width: auto; height: auto; max-width: calc(100% - 120px); max-height: calc(100% - 120px); object-fit: contain; touch-action: pan-y; }
.pgd-lightbox button { position: absolute; display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; min-width: 48px; min-height: 48px; padding: 0; border: 1px solid #666; background: #000; color: #fff; font: 32px/1 Arial, sans-serif; cursor: pointer; box-shadow: none; }
.pgd-lightbox button:hover { background: #222; color: #fff; }
.pgd-lightbox button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.pgd-lightbox-close { top: 12px; right: 12px; }
.pgd-lightbox-prev { top: calc(50% - 24px); left: 12px; }
.pgd-lightbox-next { top: calc(50% - 24px); right: 12px; }
.pgd-lightbox-status { position: absolute; bottom: 12px; left: 60px; right: 60px; margin: 0; text-align: center; color: #fff; font-size: 14px; }
@media (max-width: 520px) {
    .pgd-lightbox-image { max-width: 100%; max-height: calc(100% - 140px); }
    .pgd-lightbox-prev, .pgd-lightbox-next { top: auto; bottom: 12px; }
}
.pgd-empty { padding: 1rem; background: #fff; border: 1px solid #e3e3e3; }
#pgd-list { display: flex; flex-wrap: wrap; gap: 12px; padding: 0; }
#pgd-list .pgd-thumb { list-style: none; width: 180px; padding: 8px; border: 1px solid #ccd0d4; background: #fff; cursor: move; }
.pgd-thumb img { display: block; width: 180px; height: 140px; object-fit: cover; margin-bottom: 8px; }
.pgd-thumb .button { padding: 0 5px; }
.pgd-terms { max-height: 180px; overflow-y: auto; padding: 5px; }
.pgd-terms label { display: block; padding: 5px 0; }
#pgd-editor [hidden] { display: none !important; }
#pgd-selection { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 14px; margin-top: 14px; background: #f6f7f7; border: 1px solid #dcdcde; }
#pgd-list .pgd-thumb { box-sizing: border-box; width: 220px; cursor: move; }
#pgd-list .pgd-thumb img { width: 100%; }
#pgd-list .pgd-quick-image { display: block; width: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; }
#pgd-list .pgd-quick-image:focus-visible { outline: 2px solid #2271b1; outline-offset: 2px; }
#pgd-list .pgd-pick { display: none; margin-bottom: 8px; }
#pgd-editor.pgd-organizing .pgd-pick { display: block; }
#pgd-editor.pgd-organizing .pgd-thumb { cursor: default; }
#pgd-editor.pgd-organizing .pgd-prev, #pgd-editor.pgd-organizing .pgd-next { display: none; }
#pgd-editor .pgd-thumb:has(.pgd-select:checked) { border: 2px solid #2271b1; background: #f0f6fc; }
#pgd-list .pgd-summary { font-size: 12px; line-height: 1.5; height: 54px; overflow: auto; margin: 8px 0; }
#pgd-list .pgd-quick { width: 100%; margin-bottom: 8px; }
#pgd-feedback { color: #1d2327; }
#pgd-organizer { box-sizing: border-box; width: min(900px, calc(100% - 32px)); max-height: calc(100vh - 40px); padding: 24px; border: 1px solid #c3c4c7; background: #fff; color: #1d2327; overflow-y: auto; }
#pgd-organizer::backdrop { background: rgb(0 0 0 / 60%); }
.pgd-organizer-head, .pgd-organizer-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.pgd-organizer-head h2 { margin: 0; font-size: 20px; }
.pgd-organizer-actions { margin-top: 18px; padding-top: 16px; border-top: 1px solid #dcdcde; }
.pgd-organizer-search { box-sizing: border-box; width: 100%; margin: 0 0 16px; min-height: 40px; }
.pgd-organizer-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pgd-organizer-group { border: 1px solid #dcdcde; padding: 12px; }
.pgd-organizer-group summary { font-weight: 600; cursor: pointer; }
.pgd-organizer-options { max-height: 190px; overflow-y: auto; margin-top: 12px; }
.pgd-organizer-options label { display: block; padding: 6px 0; }
#pgd-quick-preview img { display: block; width: auto; max-width: 100%; height: 120px; object-fit: contain; margin: 12px 0; }
#pgd-organizer-status { min-height: 20px; }
.pgd-taxonomy-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; max-width: 1200px; }
.pgd-taxonomy-card, .pgd-settings-section, .pgd-appearance-preview { padding: 20px; border: 1px solid #dcdcde; background: #fff; }
.pgd-taxonomy-card h2 { margin-top: 0; }
.pgd-appearance-layout { display: grid; grid-template-columns: minmax(340px, 1fr) minmax(440px, 1.2fr); gap: 24px; align-items: start; }
.pgd-settings-section { margin-bottom: 16px; }
.pgd-settings-section h2 { margin-top: 0; }
.pgd-settings-section .form-table th { width: 210px; padding: 12px 10px 12px 0; }
.pgd-settings-section .form-table td { padding: 12px 0; }
.pgd-settings-section select { max-width: 100%; }
.pgd-appearance-preview { position: sticky; top: 48px; }
.pgd-appearance-preview h2 { margin-top: 0; }
.pgd-preview-placeholder { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: var(--pgd-ratio, 4 / 3); background: #e9edef; transition: transform .3s ease; }
.pgd-preview-placeholder .dashicons { width: 32px; height: 32px; font-size: 32px; color: #626970; }
@media (max-width: 1200px) {
    .pgd-appearance-layout { grid-template-columns: minmax(0, 1fr); }
    .pgd-appearance-preview { position: static; }
}
@media (max-width: 600px) {
    .pgd-organizer-groups { grid-template-columns: minmax(0, 1fr); }
    #pgd-organizer { padding: 16px; }
}
@media (max-width: 900px) {
    .pgd-filters, .pgd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
    .pgd-filters, .pgd-grid { grid-template-columns: minmax(0, 1fr); }
}
