.jec-calendar-wrap table.custom-tdno0{
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}

.jec-calendar-wrap th.custom-tdno0,
.jec-calendar-wrap td.custom-tdno0{
  border: 1px solid #c3c3c3;
  text-align: left;
  padding: 4px 8px;
  line-height: 1.15;
}

.jec-calendar-wrap thead.custom-tdno0{
  background-color: #f5f5f5;
}

/* Link stile Joomla */
.jec-calendar-wrap #custom-tdno0 a{
  color: #0066cc !important;
  text-decoration: underline !important;
}

/* Icona: niente resize dal tema WP */
.jec-calendar-wrap #custom-tdno0 img{
  max-width: none !important;
  width: 20px !important;
  height: 20px !important;
}

/* Barra mese (Gennaio 2026, ecc.) */
.jec-calendar-wrap #custom-tdno0 thead.custom-tdno0 > th.custom-tdno0[colspan]{
  padding: 8px 12px !important;
}

/* Evita che WP spezzi data/ora su desktop */
.jec-calendar-wrap #custom-tdno0 td[data-title="Data"],
.jec-calendar-wrap #custom-tdno0 td[data-title="Ora"]{
  white-space: nowrap !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

/* ================= MOBILE (UNICO BLOCCO) ================= */
@media only screen and (max-width: 1023px){

  /* trasformo la tabella in "cards" */
  .jec-calendar-wrap #custom-tdno0,
  .jec-calendar-wrap #custom-tdno0 thead,
  .jec-calendar-wrap #custom-tdno0 tbody,
  .jec-calendar-wrap #custom-tdno0 tr,
  .jec-calendar-wrap #custom-tdno0 td{
    display: block !important;
    width: 100% !important;
  }

  /* nascondo intestazioni classiche (Data/Ora/...) */
  .jec-calendar-wrap #custom-tdno0 thead tr{
    position: absolute !important;
    top: -9999px !important;
    left: -9999px !important;
  }

  /* card per ogni evento */
  .jec-calendar-wrap #custom-tdno0 tr{
    border: 1px solid #ccc !important;
    margin: 0 0 12px 0 !important;
  }

  /* celle con spazio per la label a sinistra */
  .jec-calendar-wrap #custom-tdno0 td{
    border: none !important;
    border-bottom: 1px solid #eee !important;
    position: relative !important;
    padding: 10px 12px 10px 44% !important; /* spazio label */
    white-space: normal !important;
  }

  /* label a sinistra */
  .jec-calendar-wrap #custom-tdno0 td:before{
    content: attr(data-title);
    position: absolute !important;
    left: 12px !important;
    top: 10px !important;
    width: 40% !important;
    padding-right: 10px !important;
    white-space: nowrap !important;
    font-weight: 700 !important;
    color: #333 !important;
  }

  /* ultima cella (icona) senza label */
  .jec-calendar-wrap #custom-tdno0 td[data-title=""]:before{
    content: "" !important;
  }

  .jec-calendar-wrap #custom-tdno0 td:last-child{
    border-bottom: none !important;
  }
}