/* #region Body */
body {
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
body[data-theme="dark"] {
  color: #f4f4f4;
  background-color: #262626;
}
/* #endregion */

/* #region Image Container */
.imageContainer {
  position: relative;
  width: max-content;
}

.imageContainer > img {
  width: 100% !important;
  object-fit: cover;
  object-position: center;
}
.imageContainer > div {
  background-color: transparent;
  position: absolute;
  right: 0.5rem;
  left: 0.5rem;
  bottom: 0.5rem;
  border-radius: 0.465rem;
}
.imageContainer > div > figcaption {
  background-color: rgba(0, 0, 0, 0.5);
  width: fit-content;
  padding: 0.5rem;
  color: white;
}
/* #endregion */
/* Image Container */

/* #region Table */
table.table-texteditor {
  max-width: 100%;
  border: solid 1px #999;
  border-spacing: 0;
  border-collapse: collapse;
  table-layout: auto;
  position: relative;
  transition: border-color 0.15s ease, border-width 0.15s ease;
}

table.table-texteditor > tbody > tr > td,
table.table-texteditor > tbody > tr > th,
table.table-texteditor > tr > td,
table.table-texteditor > tr > th {
  padding: 4px 6px;
  vertical-align: top;
  border: solid 1px #ccc;
  transition: background-color 0.15s ease;
  overflow: hidden;
  word-wrap: break-word;
  position: relative;
  min-width: 12px;
}

/* Hücre içindeki blok elemanların varsayılan margin'i satırı 32px şişiriyor */
table.table-texteditor td > p,
table.table-texteditor th > p,
table.table-texteditor td > div,
table.table-texteditor th > div {
  margin: 0;
}

/* Tablo hücre hover efekti */
table.table-texteditor > tbody > tr > td:hover,
table.table-texteditor > tbody > tr > th:hover,
table.table-texteditor > tr > td:hover,
table.table-texteditor > tr > th:hover {
  background-color: rgba(0, 123, 255, 0.05);
}

/* Seçili hücre stili */
table.table-texteditor > tbody > tr > td.selected,
table.table-texteditor > tbody > tr > th.selected,
table.table-texteditor > tr > td.selected,
table.table-texteditor > tr > th.selected {
  background-color: rgba(0, 123, 255, 0.15) !important;
  outline: 2px solid #007bff;
  outline-offset: -2px;
}

/* Resize cursor - sınırlara yaklaşınca body'de cursor değişir */
table.table-texteditor td,
table.table-texteditor th {
  cursor: text;
}

/* Hücre sınırında resize göstergesi - box-shadow ile layout kaymaz */
table.table-texteditor td.border-resize-col,
table.table-texteditor th.border-resize-col {
  box-shadow: inset -3px 0 0 0 #007bff;
  cursor: col-resize !important;
}

table.table-texteditor td.border-resize-row,
table.table-texteditor th.border-resize-row {
  box-shadow: inset 0 -3px 0 0 #007bff;
  cursor: row-resize !important;
}

/* Tablo wrapper - tablonun boyutunu takip eder.
   display:block şart: inline seviye kutuda tarayıcı imleci tablonun etrafından
   geçiremediği için tablodan sonra yazı yazmak mümkün olmuyor. */
.table-wrapper {
  position: relative;
  display: block;
  /* Genislik yuzde olarak inline yazilir (TableWidth.normalize); burasi yalnizca
     henuz normalize edilmemis icerik icin guvenli varsayilandir. */
  width: 100%;
  max-width: 100%;
  margin-bottom: 20px;
}

/* Yuzde genislikte hucreler cok daralabilir; okunur bir taban birakilir. */
table.table-texteditor > tbody > tr > td,
table.table-texteditor > tbody > tr > th,
table.table-texteditor > tr > td,
table.table-texteditor > tr > th {
  min-width: 12px;
}

/* Tablo sağ-alt köşe resize handle - sadece editörde görünür */
.table-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  cursor: nwse-resize;
  background: transparent;
  z-index: 10;
}

.table-resize-handle::before {
  content: "";
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 12px 12px;
  border-color: transparent transparent #bbb transparent;
  transition: border-color 0.15s ease;
}

.table-resize-handle:hover::before {
  border-color: transparent transparent #007bff transparent;
}

/* Resize handle hover'da tablo border kalınlaşsın */
.table-wrapper:has(.table-resize-handle:hover) table.table-texteditor {
  border: solid 2px #007bff;
}

/* PDF/Print için resize handle gizle */
@media print {
  .table-resize-handle {
    display: none !important;
  }
  .table-wrapper {
    display: block !important;
  }
}

/* Resize sırasında tablo seçimi */
.table-wrapper.resizing table {
  outline: 2px dashed #007bff;
  outline-offset: 2px;
}
/* #endregion */
/* Table */
