/* ============================================================
   Mediateca – tabelle + box risorsa
   ============================================================ */

.sector-table{
  width: 100%;
  table-layout: fixed;
  border: 2px solid rgba(0, 0, 0, 0.25);
}

.sector-table-wrap{
  -webkit-overflow-scrolling: touch;
}

.sector-table > :not(caption) > * > *{
  border: 1px solid rgba(0, 0, 0, 0.25) !important;
}

.sector-table thead tr > *{
  border-bottom: 5px double rgba(0, 0, 0, 0.45) !important;
}

.sector-table thead th,
.sector-table tbody td{
  vertical-align: middle !important;
}

.sector-table thead th{
  background-color: var(--sector-primary) !important;
  color: #fff !important;
  font-size: 1.15rem;
}

.sector-table tbody tr:nth-child(even) > *{
  background-color: var(--sector-secondary) !important;
}

.sector-table td,
.sector-table th{
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sector-table td{
  white-space: normal !important;
}

.sector-table td ul{
  margin-bottom: 0;
  white-space: normal !important;
}

.med-next-action{
  display: inline-block;
  white-space: nowrap;
}

.med-resource-authors-list{
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.med-author-row{
  min-width: 0;
}

.med-publisher-block{
  min-width: 0;
}

.med-publisher-sep{
  display: none;
}

.med-extra-row{
  display: block;
}

.med-extra-label{
  display: inline;
}

.med-extra-value{
  display: inline;
}

.med-extra-item{
  display: inline;
}

.med-mobile-only{
  display: none;
}

.med-table-inv-badge{
  color: #000;
  border: 3.5px solid rgba(0, 0, 0, 0.5);
  border-radius: 1.2rem;
  font-size: 1.15em;
  line-height: 1;
  padding: 0.33rem 0.56rem;
}

.med-inv-mobile{
  display: none;
}

/* Scheda risorsa */
.med-inv-badge{
  background: var(--sector-secondary, #f2f2f2);
  color: #000;
  border: 3.5px solid rgba(0, 0, 0, 0.5);
  border-radius: 1.2rem;
  font-size: 1.2em;
}

.med-sector-box{
  background: var(--sector-secondary, #f2f2f2);
  border-color: var(--sector-primary, #6c757d) !important;
}


/* sotto-intestazioni tabella: micro, ma non muted */
.table-subhead{
  font-size: 1rem;   /* very very small */
  line-height: 1.05;
  font-weight: 400;
  color: inherit;        /* non muted */
}


.sector-table thead th{
  vertical-align: top !important;
}

@media (min-width: 768px){
  .sector-table{
    min-width: 980px;
  }
}

@media (min-width: 768px) and (max-width: 1279.98px){
  .sector-table-wrap{
    overflow-x: visible !important;
  }

  .sector-table{
    min-width: 0;
    table-layout: auto;
    font-size: 0.95rem;
  }

  .sector-table thead th{
    font-size: 1rem;
    white-space: normal;
  }

  .sector-table thead th[style]{
    width: auto !important;
  }

  .sector-table td,
  .sector-table th{
    padding: 0.45rem 0.5rem;
  }
}

@media (max-width: 767.98px){
  .sector-table-wrap{
    overflow: visible;
  }

  .sector-table{
    min-width: 0;
    table-layout: auto;
    border: 0;
    background: transparent;
  }

  .sector-table thead{
    display: none;
  }

  .sector-table tbody{
    display: block;
  }

  .sector-table tbody tr{
    display: block;
    margin-bottom: 0.85rem;
    border: 1px solid rgba(0, 0, 0, 0.25);
    border-radius: 0.65rem;
    overflow: hidden;
    background: #fff;
  }

  .sector-table tbody tr:nth-child(even) > *{
    background-color: transparent !important;
  }

  .sector-table tbody td{
    display: grid;
    grid-template-columns: minmax(5rem, 5.8rem) minmax(0, 1fr);
    gap: 0.55rem;
    align-items: center;
    padding: 0.55rem 0.7rem;
    border: 0 !important;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.2) !important;
    white-space: normal !important;
  }

  .sector-table tbody td:last-child{
    border-bottom: 0 !important;
  }

  .sector-table tbody td::before{
    content: attr(data-label);
    font-size: 0.84rem;
    line-height: 1.2;
    font-weight: 600;
    color: #495057;
  }

  .med-next-action{
    display: inline-block;
    margin-top: 0;
  }

  .med-next-action::before{
    content: "";
  }

  .med-mobile-only{
    display: grid;
  }

  .med-storage-desktop{
    display: none;
  }

  .med-table-inv-badge{
    font-size: 0.95em;
    border-width: 2.5px;
    border-radius: 1rem;
    padding: 0.22rem 0.45rem;
  }

  .sector-table tbody td[data-label="Titolo"] .med-extra-row{
    display: none;
  }

  .sector-table tbody td > *{
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .sector-table tbody td a{
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
  }

  .sector-table tbody td[data-label="Collocazione"]{
    font-size: 0.92rem;
  }

.med-mobile-sep{
    margin: 0.22rem 0;
    border-top: 1px dashed rgba(0, 0, 0, 0.26);
    height: 0;
  }

  .med-publisher-line{
    min-width: 0;
  }

  .med-publisher-sep{
    display: block;
    margin: 0.22rem 0;
    border-top: 1px dashed rgba(0, 0, 0, 0.26);
    height: 0;
  }

  .med-extra-row{
    display: grid;
    grid-template-columns: minmax(6.2rem, 7rem) minmax(0, 1fr);
    gap: 0.45rem;
    align-items: start;
    margin-top: 0.35rem !important;
  }

  .med-extra-label{
    display: block;
    font-size: 0.84rem;
    line-height: 1.2;
    color: #495057;
  }

  .med-extra-value{
    display: block;
    min-width: 0;
  }

  .med-extra-item{
    display: block;
  }

  .sector-table td.text-center{
    text-align: left !important;
  }

  .table-subhead{
    font-size: 0.85rem;
  }
}
