/* Ders kitabı tabloları ve etkinlik şablonu, iki site için ortak. */

.text-content .ders-kitabi-tablo {
  max-width: 100%;
  overflow-x: auto;
}

.text-content .ders-kitabi-tablo:focus-visible {
  outline: 2px solid #245c97;
  outline-offset: 2px;
}

.text-content .odev-teslim {
  margin: 1rem 0;
  padding: .85rem 1rem;
  border: 1px solid #cbd9e6;
  border-radius: .4rem;
  background: #f4f8fc;
  color: #20364d;
}

.text-content .odev-teslim h4 {
  margin-top: 0;
  margin-bottom: .5rem;
  color: inherit;
  font-size: 1.05rem;
}

.text-content .odev-teslim > :last-child {
  margin-bottom: 0;
}

@media (max-width: 767px) {
  .text-content:where(:has(.kitap-ana-kutu, .kitap-cevap-listesi, .soru-cevap, .odev-teslim, .ders-kitabi-tablo)) :is(.ders-kitabi-tablo, div.table-responsive, .eski-haber-tablo-kapsayici):has(> table.table-bordered:is(.table-responsive, .table.table-striped)) {
    max-width: 100%;
    overflow-x: auto;
  }

  .text-content:where(:has(.kitap-ana-kutu, .kitap-cevap-listesi, .soru-cevap, .odev-teslim, .ders-kitabi-tablo)) table.table-bordered:is(.table-responsive, .table.table-striped) {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    table-layout: auto;
    font-size: 14px !important;
  }

  .text-content:where(:has(.kitap-ana-kutu, .kitap-cevap-listesi, .soru-cevap, .odev-teslim, .ders-kitabi-tablo)) table.table-bordered:is(.table-responsive, .table.table-striped)
    > :is(thead, tbody, tfoot) > tr > :is(th, td) {
    padding: 6px 7px !important;
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
  }

  /* Dört veya daha fazla sütunlu eski tablolarda kaydırma tablonun içinde kalır. */
  .text-content:where(:has(.kitap-ana-kutu, .kitap-cevap-listesi, .soru-cevap, .odev-teslim, .ders-kitabi-tablo)) table.table-bordered:is(.table-responsive, .table.table-striped):has(
    > :is(thead, tbody, tfoot) > tr > :is(th, td):nth-child(4)
  ) {
    display: block;
    overflow-x: auto;
  }

  /* Geniş bir tablonun kapsayıcısı varsa kaydırmayı kapsayıcı üstlenir. */
  .text-content:where(:has(.kitap-ana-kutu, .kitap-cevap-listesi, .soru-cevap, .odev-teslim, .ders-kitabi-tablo)) :is(.ders-kitabi-tablo, div.table-responsive, .eski-haber-tablo-kapsayici)
    > table.table-bordered:is(.table-responsive, .table.table-striped):has(
      > :is(thead, tbody, tfoot) > tr > :is(th, td):nth-child(4)
    ) {
    display: table;
    max-width: none;
    overflow: visible;
  }

  .text-content:where(:has(.kitap-ana-kutu, .kitap-cevap-listesi, .soru-cevap, .odev-teslim, .ders-kitabi-tablo)) table.table-bordered:is(.table-responsive, .table.table-striped):has(
    > :is(thead, tbody, tfoot) > tr > :is(th, td):nth-child(4)
  ) > :is(thead, tbody, tfoot) > tr > :is(th, td):not([colspan]) {
    min-width: 6rem;
  }

  .text-content:where(:has(.kitap-ana-kutu, .kitap-cevap-listesi, .soru-cevap, .odev-teslim, .ders-kitabi-tablo)) :is(figure, .soru-cevap, .odev-teslim) img {
    max-width: 100%;
    height: auto;
  }
}
