/* ==========================
   QUILL 1.3.7 � CSP SAFE CSS
   ========================== */

.ql-editor {
  white-space: pre-wrap;
  word-break: break-word;
}

.ql-bold { font-weight: bold; }
.ql-italic { font-style: italic; }
.ql-underline { text-decoration: underline; }
.ql-strike { text-decoration: line-through; }

.ql-color-red { color: #d00; }
.ql-color-blue { color: #05c; }
.ql-color-green { color: #0a0; }

.ql-size-small { font-size: 0.8rem; }
.ql-size-large { font-size: 1.4rem; }
.ql-size-huge  { font-size: 2rem; }

.ql-align-center { text-align: center; }
.ql-align-right  { text-align: right; }
.ql-align-justify { text-align: justify; }

.ql-background-yellow { background-color: yellow; }

.rtx-toolbar {
  display: flex;
  flex-wrap: wrap;            
  gap: 6px;
  padding: 8px;
  background: #fafafa;
  border-bottom: 1px solid #e5e5e5;
  align-items: center;
}

.rtx-group {
  display: inline-flex;
  align-items: center;
}

.rtx-toolbar button {
  background: #fff;
  border: 1px solid #ccc;
  padding: 4px 6px;              
  border-radius: 2px;                
  cursor: pointer;
  font-size: 12px;
  height: 30px;                       
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #333;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  line-height: 1;
  margin: 1px;
}

.rtx-toolbar button i {
  font-size: 12px;
}

.rtx-toolbar button:hover {
  background: #f3f3f3;
  border-color: #bbb;
}

.rtx-toolbar button.active {
  background: #e8f0ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}

.rtx-select {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.rtx-select select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: #fff;
  border: 1px solid #ccc;
  padding: 6px !important;          
  border-radius: 2px !important;                  
  font-size: 13px;
  color: #333;
  height: 35px !important;
  width: 85px !important;                  
  line-height: 1;
  cursor: pointer;
  margin-top: 7%
}

.rtx-select select:hover {
  background: #f3f3f3;
  border-color: #bbb;
}

.rtx-editor-short .ql-editor {
    height: 80px !important;
    overflow-y: auto;
}

.rtx-select i.fa-caret-down {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  font-size: 11px;
  pointer-events: none;
}

.ql-snow {
    height: auto;
}

.text-danger {
    color: #d9534f;
    font-weight: bold;
}

.ql-editor img.ql-img-left { float: left; margin: 0 15px 15px 0; }
.ql-editor img.ql-img-right { float: right; margin: 0 0 15px 15px; }
.ql-editor img.ql-img-center { display: block; margin: 10px auto; }

.rtx-image-modal-custom {
	width: 0 !important;
	height: 0 !important;
	padding: 0 !important;
    left: 40% !important;
    margin-top: 5%;
}

.modal.fade.in {
    display: block !important;
    opacity: 1 !important;
    background: rgba(0, 0, 0, 0) !important; 
    z-index: 1050 !important;
}

.modal-dialog {
    width: 400px !important; 
}

.modal-content {
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5) !important;
}

.modal-header .close {
    float: right;
    font-size: 21px;
    font-weight: bold;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    filter: alpha(opacity=20);
    opacity: .2;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.modal-body { 
    padding: 20px; 
}

.modal-body label { 
    font-weight: bold; 
}

.modal-footer { 
    margin: revert !important;
    padding: 15px 100px !important;
}

.modal-footer .btn {
    padding: 6px 16px;
    margin-bottom: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.42857143;
    border-radius: 4px;
    margin: auto; 
}

.modal-footer .btn-success {
    color: #fff;
    background-color: #2e7d32 !important;
    border-color: #1b5e20 !important;
}

.modal-footer .btn-default {
    color: #333;
    background-color: #fff;
    border: 1px solid #ccc;
}

.rtx-radio-group {
    display: flex !important;
    gap: 15px; 
    justify-content: center;
}

.rtx-radio-group .radio-inline {
    display: inline-flex !important;
    align-items: center;
    margin: 0 !important; 
    cursor: pointer;
    font-weight: normal !important; 
}

.rtx-radio-group input[type="radio"] {
    margin-right: 5px !important;
    margin-top: 0 !important; 
    position: relative;
}

.modal-groups {
	margin-top: 3%;
}

.input-didascalia{
	position: static !important;
}

/* ==========================================
   VERSIONE CORRETTA E OTTIMIZZATA PER RESIZE
   ========================================== */

/* Contenitore dell'immagine con didascalia (Contesto Tabella) */
.custom-caption-container {
    display: table !important;
    vertical-align: top;
    margin: 10px;
    max-width: 100%;
    text-align: center;
    border: 1px solid #dcdcdc;
    border-radius: 1px;
    background-color: #ffffff;
    box-sizing: border-box;
    position: relative !important;
    background: #f5f4f4;
}

/* Contenitore dell'immagine semplice */
.custom-simple-container {
    display: inline-block;
    vertical-align: top;
    margin: 10px;
    max-width: 100%;
    text-align: center;
    position: relative !important;
    border-radius: 1px;
}

/* Gestione Allineamenti Sinistra (Left) */
.custom-caption-container.ql-img-left,
.custom-simple-container.ql-img-left {
    float: left !important;
    margin: 0 15px 15px 0 !important;
}

/* Gestione Allineamenti Destra (Right) */
.custom-caption-container.ql-img-right,
.custom-simple-container.ql-img-right {
    float: right !important;
    margin: 0 0 15px 15px !important;
}

/* Gestione Allineamenti Centro (Center) - CORRETTO */
.custom-caption-container.ql-img-center,
.custom-simple-container.ql-img-center {
    display: table !important;        /* Forza il div a stringersi sul raggio reale dell'immagine */
    width: fit-content !important;    /* Evita l'estensione al 100% della larghezza */
    margin: 20px auto !important;     /* Centra il blocco compatto nell'editor */
    float: none !important;
}

/* Configurazione di tutte le immagini interne */
.custom-caption-container img,
.custom-simple-container img {
    max-width: 100% !important;
    height: auto !important;
    margin: 0 auto !important;        /* Centra l'immagine anche in contesti complessi */
    display: block;
}

/* Sotto-rettangolo grigio per la didascalia */
.custom-caption-text {
    display: table-caption !important;
    caption-side: bottom !important;
    background-color: #f4f4f5;
    color: #333333;
    padding: 8px 12px;
    font-size: 0.9em;
    border-top: 1px solid #dcdcdc;
    font-style: italic;
    box-sizing: border-box;
}

.caption-header {
    justify-content: center;
}

.modal-lg {
    width: 900px;
}

hr {
    margin: 1rem 0;
    color: inherit;
    border: 0;
    border-top: 1px solid;
    opacity: .25
}

.iframe#serverImageBrowser {
    border: none;
    background: white;
}

.search-img-modal-right {
    display:flex;
    vertical-align: middle;
    justify-content: space-around;
}

.ckeditor-container{
    display: flow-root;
}

.ckeditor-container p {
    margin-left: 0 !important;
    margin-right: 0 !important;
    clear: none;
}

.ckeditor-container.ql-editor {
    overflow-y: visible !important;
    height: auto !important;
    max-height: none !important;
}

.ql-container {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-family: 'Open Sans';
    font-weight: 400;
    font-stretch: 100%;
}

.ql-editor p, .ql-editor li, .ql-editor h1, .ql-editor h2, .ql-editor h3 {
    margin-top: 0;
    margin-bottom: 0.8em !important;
    font-weight: 500;
    line-height: 1.2;
}

.ql-editor {
    padding: 8px !important;
}

.ql-editor blockquote {
    margin: 1rem;
}

.ql-editor strong {
    font-weight: 600;
}

a {
	color: #2b8804;
	text-decoration: none
}

/* FIX ELENCHI QUILL */
.ql-editor li.ql-indent-1 { padding-left: 4.5em !important; }
.ql-editor li.ql-indent-2 { padding-left: 7.5em !important; }
.ql-editor li.ql-indent-3 { padding-left: 10.5em !important; }
.ql-editor li.ql-indent-4 { padding-left: 13.5em !important; }
.ql-editor li.ql-indent-5 { padding-left: 16.5em !important; }
.ql-editor li.ql-indent-6 { padding-left: 19.5em !important; }
.ql-editor li.ql-indent-7 { padding-left: 22.5em !important; }
.ql-editor li.ql-indent-8 { padding-left: 25.5em !important; }

.ql-editor ul, 
.ql-editor ol {
    margin-bottom: 1em !important;
    padding-left: 1.5em !important;
}

img.ql-img-indent-1, .custom-caption-container.ql-img-indent-1, .custom-simple-container.ql-img-indent-1 { margin-left: 3em !important; }
img.ql-img-indent-2, .custom-caption-container.ql-img-indent-2, .custom-simple-container.ql-img-indent-2 { margin-left: 6em !important; }
img.ql-img-indent-3, .custom-caption-container.ql-img-indent-3, .custom-simple-container.ql-img-indent-3 { margin-left: 9em !important; }
img.ql-img-indent-4, .custom-caption-container.ql-img-indent-4, .custom-simple-container.ql-img-indent-4 { margin-left: 12em !important; }
img.ql-img-indent-5, .custom-caption-container.ql-img-indent-5, .custom-simple-container.ql-img-indent-5 { margin-left: 15em !important; }
img.ql-img-indent-6, .custom-caption-container.ql-img-indent-6, .custom-simple-container.ql-img-indent-6 { margin-left: 18em !important; }
img.ql-img-indent-7, .custom-caption-container.ql-img-indent-7, .custom-simple-container.ql-img-indent-7 { margin-left: 21em !important; }
img.ql-img-indent-8, .custom-caption-container.ql-img-indent-8, .custom-simple-container.ql-img-indent-8 { margin-left: 24em !important; }

.ql-snow .ql-editor h1 {
    font-size: calc(1.375rem + 1.5vw);
}

@media (min-width:1200px) {
    .ql-snow .ql-editor h1 {
       font-size: 2.5rem;
    }
}

.ql-snow .ql-editor h2 {
    font-size: calc(1.325rem + .9vw);
}

@media (min-width:1200px) {
    .ql-snow .ql-editor h2 {
       font-size: 2rem;
    }
}

.ql-snow .ql-editor h2 {
    color: #2b8804;
    margin-bottom: 32px;
    margin-top: 32px;
    font-size: 32px;
    line-height: 1em;
    font-weight: 600;
}

.ql-snow .ql-editor h3 {
    font-size: calc(1.3rem + .6vw);
}

@media (min-width:1200px) {
    .ql-snow .ql-editor h3 {
       font-size: 1.75rem;
    }
}

.ql-snow .ql-editor h3 {
    margin-top: 24px;
    color: #2b8804;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.5em;
}

/* STATO SELEZIONATO (Click) */
.ql-container .custom-simple-container.is-selected,
.ql-container .custom-caption-container.is-selected {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    transition: outline 0.1s ease, box-shadow 0.1s ease;
}

/* STATO IN TRASCINAMENTO (Drag) */
.ql-container .custom-simple-container.is-dragging,
.ql-container .custom-caption-container.is-dragging {
    opacity: 0.5 !important;
    outline: 2px dashed #3b82f6 !important;
    box-shadow: none !important;
}

/* Forza l'ancoraggio relativo per il corretto posizionamento dell'handle */
.custom-caption-container, .custom-simple-container {
    position: relative !important;
}

/* HANDLE DI RIDIMENSIONAMENTO IN BASSO A SINISTRA */
.ql-container .ql-resize-handle-bl {
    position: absolute;
    left: -6px;
    bottom: -6px;
    width: 12px;
    height: 12px;
    background-color: #3b82f6;
    border: 2px solid #ffffff;
    border-radius: 50%;
    cursor: sw-resize;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}