/* ==================================================
   DOCUMENT SEARCH – FORM (HOME)
   ================================================== */

.ds-fields {
  width: 100%;
}

/* righe */
.ds-fields .ds-row {
  margin-bottom: 0.75em;
}

/* input full */
.ds-fields .ds-row-full input[type="text"] {
  width: 100%;
  padding: 0.6em 0.75em;
  border: 1px solid #bbb;
  border-radius: 0.25em;
  font: inherit;
  box-sizing: border-box;
}

/* riga a 3 colonne */
.ds-fields .ds-row-3 {
  display: flex;
  gap: 0.75em;
}

.ds-fields .ds-row-3 select {
  width: 100%;
  padding: 0.6em 2.5em 0.6em 0.75em;
  border: 1px solid #bbb;
  border-radius: 0.25em;
  background-color: #fff;
  font: inherit;
  appearance: none;
  box-sizing: border-box;
  background-image:
    linear-gradient(45deg, transparent 50%, #666 50%),
    linear-gradient(135deg, #666 50%, transparent 50%);
  background-position:
    calc(100% - 16px) center,
    calc(100% - 11px) center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

/* riga azioni */
.ds-fields .ds-row-actions {
  display: flex;
}


/* ==================================================
   DOCUMENT SEARCH – ACTION GROUP
   Bottone composto Search + Reset
   ================================================== */

.ds-action-group {
  display: inline-flex;
  border: 1px solid #f36e21;
  border-radius: 0.25em;
  overflow: hidden;
}

/* stile base comune */
.ds-action-group .ds-btn {
  padding: 0.6em 1.4em;
  font: inherit;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  background-color: #fff;
  color: #f36e21;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* SEARCH – parte primaria */
.ds-action-group .ds-btn-search {
  background-color: #f36e21;
  color: #fff;
}

/* RESET – parte secondaria */
.ds-action-group .ds-btn-reset {
  border-left: 1px solid #f36e21;
}

/* hover / focus */
.ds-action-group .ds-btn-search:hover,
.ds-action-group .ds-btn-search:focus {
  background-color: #d95f1d;
}

.ds-action-group .ds-btn-reset:hover,
.ds-action-group .ds-btn-reset:focus {
  background-color: #fff4ee;
}


/* ==================================================
   DOCUMENT SEARCH – FORM (RICERCA)
   layout sempre verticale
   ================================================== */

.ds-form form {
  display: flex;
  flex-direction: column;
  gap: 0.75em;
}

/* campi con stesso stile della home */
.ds-form input[type="text"],
.ds-form select {
  width: 100%;
  padding: 0.6em 0.75em;
  border: 1px solid #bbb;
  border-radius: 0.25em;
  background-color: #fff;
  font: inherit;
  box-sizing: border-box;
}

/* select: stessa freccia della home */
.ds-form select {
  padding-right: 2.5em;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #666 50%),
    linear-gradient(135deg, #666 50%, transparent 50%);
  background-position:
    calc(100% - 16px) center,
    calc(100% - 11px) center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

/* action group allineato a sinistra */
.ds-form .ds-action-group {
  align-self: flex-start;
}


/* ==================================================
   DOCUMENT SEARCH – RESULT DETAIL
   ================================================== */

.ds-result-description {
  margin: 1em 0 1.5em;
  font-size: 1rem;
  line-height: 1.6;
}


/* ==================================================
   MOBILE – Divi breakpoint
   ================================================== */

@media (max-width: 980px) {

  .ds-fields .ds-row-3 {
    flex-direction: column;
  }

  .ds-action-group {
    width: 100%;
  }

  .ds-action-group .ds-btn {
    flex: 1;
    justify-content: center;
  }
}

/* ===============================
   INPUT CON TOOLTIP
   =============================== */

.ds-input-help {
  position: relative;
  width: 100%;
}

.ds-input-help input {
  width: 100%;
  padding-right: 2.8em; /* spazio per ? */
}

/* icona ? */
.ds-help-icon {
  position: absolute;
  top: 50%;
  right: 0.6em;
  transform: translateY(-50%);
  width: 1.3em;
  height: 1.3em;
  border-radius: 50%;
  border: 1px solid #f36e21;
  color: #f36e21;
  font-size: 0.8em;
  font-weight: bold;
  line-height: 1.2em;
  text-align: center;
  cursor: help;
  background: #fff;
  z-index: 5;
}

/* ===============================
   TOOLTIP – SEMPRE SOPRA A TUTTO
   =============================== */

.ds-help-tooltip {
  position: fixed;
  z-index: 999999;

  background: #333;
  color: #fff;

  font-size: 0.95rem;
  line-height: 1.6;

  padding: 1em 1.2em;
  border-radius: 6px;

  width: 340px;
  max-width: calc(100vw - 24px);

  box-sizing: border-box;

  white-space: normal;
  overflow-wrap: break-word;

  opacity: 0;
  pointer-events: none;

  transition: opacity 0.15s ease;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);

  isolation: isolate;
  background-clip: padding-box;
	
  mix-blend-mode: normal;
  filter: none;
  backdrop-filter: none;
}

/* visibile */
.ds-help-tooltip.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* freccetta */
.ds-help-tooltip::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 14px;
  border-width: 7px;
  border-style: solid;
  border-color: transparent transparent #333 transparent;
}

/* ===============================
   STILE ESEMPI UDI
   =============================== */

.ds-help-tooltip code {
  display: inline-block;
  max-width: 100%;
  background: #222;
  color: #ffcf9f;
  padding: 0.25em 0.45em;
  border-radius: 4px;
  font-size: 0.9em;
  margin-top: 0.25em;
  word-break: break-all;
}

/* ==================================================
   Eccezioni
   ================================================== */
.home .ds-action-group {
    display: inline-flex;
    border: 1px solid #ffffff;
    border-radius: 0.25em;
    overflow: hidden;
}

/* ==================================================
   Info card – STRUTTURA ONLY (stile gestito da Divi)
   ================================================== */

.ds-info-card {
  max-width: 760px;
  margin: 2rem auto 0;
  padding: 1.2rem 1.4rem;
}

/* titolo */
.ds-info-card h3 {
  margin: 0 0 0.6rem;
  font-size: 1.05rem;
  font-weight: 600;
}

/* testo */
.ds-info-card p {
  margin: 0.4rem 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* esempio */
.ds-info-example {
  margin-top: 0.9rem;
  display: flex;
  align-items: center;     
  gap: 0.6rem;
  font-size: 0.9rem;
  flex-wrap: wrap;
}

/* label */
.ds-info-label {
  font-weight: 500;
  white-space: nowrap;
}

/* finto <code> */
.ds-info-code {
  display: inline-flex;    
  align-items: center;     
  padding: 0.25em 0.45em;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.85rem;
  line-height: 1;          
  white-space: nowrap;
}

/* puoi lasciare colori a Divi */
.ds-info-code-original {}
.ds-info-code-clean {}

/* freccia */
.ds-info-arrow {
  display: inline-flex;
  align-items: center;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.8;
}

@media (max-width: 768px) {

  .ds-info-example {
    flex-wrap: wrap;           
    row-gap: 0.4rem;
  }

  /* label sempre sopra */
  .ds-info-label {
    width: 100%;
  }

  /* codici su righe proprie */
  .ds-info-example code {
    max-width: 100%;
    overflow-x: auto;          
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  /* freccia su riga separata */
  .ds-info-arrow {
    width: 100%;
    text-align: center;
    opacity: 0.6;
  }
}

/* ==================================================
   DOCUMENT SEARCH – RESULTS (2 COLONNE)
   ================================================== */

.ds-item {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.2rem 0;
  border-bottom: 1px solid #e5e5e5;
}

/* colonna sinistra */
.ds-item-main {
  flex: 1;
  min-width: 0;
}

/* titolo */
.ds-title {
  margin: 0 0 0.3rem;
  font-size: 1.4rem;
  font-weight: 600;
  color: #f36e21;
}

/* description */
.ds-description {
  margin: 0.3rem 0 0.6rem;
  font-size: 0.95rem;
  line-height: 1.5;
  opacity: 0.85;
  max-width: 70ch;
}

/* meta */
/*.ds-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem 1rem;
  font-size: 0.9rem;
}*/

.ds-meta-row {
  white-space: normal;
}

.ds-meta-label {
  font-weight: 600;
  margin-right: 0.25em;
}

/* colonna destra */
.ds-item-action {
  display: flex;
  align-items: flex-start;
}

/* bottone download */
.ds-download-btn {
  display: inline-block;
  padding: 0.45em 0.9em;
  font-size: 0.85rem;
  border: 1px solid #f36e21;
  border-radius: 4px;
  color: #f36e21;
  background: #fff;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.ds-download-btn:hover {
  background: #f36e21;
  color: #fff;
}

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

@media (max-width: 768px) {
  .ds-item {
    flex-direction: column;
  }

  .ds-meta {
    grid-template-columns: 1fr;
  }

  .ds-item-action {
    align-self: flex-start;
    margin-top: 0.5rem;
  }
}
/* ==================================================
   DOCUMENT SEARCH – META (UNA COLONNA)
   ================================================== */

.ds-meta {
  display: flex;
  flex-direction: column;
  gap: 0.4em;
}

.ds-meta-row {
  display: flex;
  gap: 0.35em;
  align-items: baseline;
}

.ds-meta-label {
  font-weight: 600;
  white-space: nowrap;
}
/* ==================================================
   DOCUMENT TITLE – FONT UFFICIALE
   ================================================== */

.ds-result-title,
.ds-title {
  font-family: Thesans-5, Arial, sans-serif;
  font-size: 28px;
  color: #f36e21;
  line-height: 1.15;
  margin: 0 0 0.4em;
}
/* ==================================================
   DOCUMENT PDF – DOWNLOAD
   ================================================== */
/* wrapper scrollabile */
.ds-pdf-wrapper {
  width: 100%;
  height: 80vh;                 
  overflow-y: auto;           
  -webkit-overflow-scrolling: touch; 
}

/* iframe */
.ds-pdf-wrapper iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.et_pb_module,
.et_pb_column,
.et_pb_text,
.et_pb_code {
  overflow: visible !important;
}
