/* ============================================================
   easytable.css — стили движка EasyTable (ядро v9.7.12)
   Адаптированы под тёмно-янтарную тему сайта и ограничены
   контейнером .easytable (выводится шорткодом {{< easytable >}}).
   Ключевые классы движка: .cell-root, .split-row, .split-col,
   .align-left/center/right, .rotate-90, .rotate-list-90,
   .cell-list, .highlighted.
   ============================================================ */

.easytable {
  margin: 1.4rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.easytable table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--card-border-color, rgba(255, 220, 180, 0.1));
  border-radius: 12px;
  overflow: hidden;
}

.easytable th,
.easytable td {
  border: 1px solid var(--card-border-color, rgba(255, 220, 180, 0.1));
  padding: 10px 12px;
  color: var(--text-color-light, #f0e0d0);
  font-size: 0.92rem;
  line-height: 1.45;
  vertical-align: middle;
  background: transparent;
}

.easytable th {
  /* Первая строка — такая же, как все остальные: без особых стилей.
     Выделение — только через подсветку % (.highlighted). */
  background: transparent;
  font-family: inherit;
  font-weight: 400;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--text-color-light, #f0e0d0);
}

.easytable th.easy-table-has-split,
.easytable td.easy-table-has-split {
  padding: 0 !important;
  vertical-align: stretch !important;
}

/* ---------- Субячейки (вертикальные/горизонтальные сплиты) ---------- */
.easytable .cell-root {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 60px;
  min-width: 0;
}

.easytable .split-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.easytable .cell-root > .split-row:not(:last-child) {
  border-bottom: 1px solid var(--card-border-color, rgba(255, 220, 180, 0.1));
}

.easytable .split-col {
  display: flex;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 10px 12px;
  align-items: center;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.easytable .split-col > * {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.easytable .split-row > .split-col:not(:last-child) {
  border-right: 1px solid var(--card-border-color, rgba(255, 220, 180, 0.1));
}

/* ---------- Highlight (%) — одинаково для всех строк, включая первую ---------- */
.easytable .highlighted {
  background: rgba(255, 140, 0, 0.12) !important;
}

/* ---------- Hover строки: первая строка (th) реагирует так же, как остальные ---------- */
.easytable tr:hover th,
.easytable tr:hover td {
  background-color: rgba(255, 140, 0, 0.06);
}

/* ---------- Выравнивание ---------- */
.easytable .align-left {
  text-align: left;
  justify-content: flex-start;
}
.easytable .align-center {
  text-align: center;
  justify-content: center;
}
.easytable .align-right {
  text-align: right;
  justify-content: flex-end;
}

/* ---------- Поворот текста ---------- */
.easytable .rotate-90 {
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  white-space: nowrap;
  margin: auto;
  display: inline-block;
}

/* Заголовки внутри ячеек — компактные */
.easytable th h3,
.easytable th h4,
.easytable td h3,
.easytable td h4,
.easytable .split-col h3,
.easytable .split-col h4 {
  font-size: 1rem;
  margin: 0;
  color: var(--primary-gold, #ff8c00);
  font-weight: 700;
  display: inline-block;
  border: 0;
  padding: 0;
  line-height: 1.3;
  font-family: 'Montserrat', sans-serif;
}

/* Изображения внутри ячеек */
.easytable td img,
.easytable th img,
.easytable .split-col img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: auto;
}

/* Ссылки и инлайн-разметка */
.easytable a {
  color: var(--primary-gold, #ff8c00);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.easytable a:hover {
  color: var(--text-color-white, #fff8f0);
}
.easytable del { text-decoration: line-through; opacity: 0.75; }
.easytable ins { text-decoration: underline; }
.easytable sub { vertical-align: sub; font-size: 0.8em; }
.easytable sup { vertical-align: super; font-size: 0.8em; }
.easytable code {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  font-size: 0.9em;
  color: #ffd9a0;
}

/* Списки внутри ячеек: ведут себя как inline-блок,
   поэтому text-align ячейки управляет всем списком целиком. */
.easytable ul.cell-list,
.easytable ol.cell-list {
  display: inline-block;
  width: max-content;
  max-width: 100%;
  margin: 0;
  padding-left: 18px;
  text-align: inherit;
  vertical-align: middle;
  box-sizing: border-box;
}

.easytable .cell-list li {
  margin-bottom: 3px;
  line-height: 1.35;
}

/* Списки в повёрнутых ячейках: вращаем каждый элемент, а не контейнер,
   чтобы сохранить порядок списка 1→2→3. */
.easytable .rotate-list-90 {
  display: inline-block;
  width: max-content;
  max-width: 100%;
  margin: 0;
  vertical-align: middle;
}
.easytable .rotate-list-90 .cell-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: inherit;
}
.easytable .rotate-list-90 .cell-list li {
  position: relative;
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  white-space: nowrap;
  margin: 0;
  padding: 0;
}
.easytable .rotate-list-90 .cell-list li::before {
  writing-mode: horizontal-tb;
  display: inline-block;
  margin-right: 3px;
  font-size: 12px;
  transform: rotate(180deg);
}
.easytable .rotate-list-90 ul.cell-list li::before { content: "•"; }
.easytable .rotate-list-90 ol.cell-list { counter-reset: rotated-item; }
.easytable .rotate-list-90 ol.cell-list li { counter-increment: rotated-item; }
.easytable .rotate-list-90 ol.cell-list li::before { content: counter(rotated-item) "."; }

/* Жирный+курсив внутри ячеек */
.easytable strong.bold-italic em {
  font-weight: normal;
}

/* ---------- Мобильный режим ---------- */
@media (max-width: 768px) {
  .easytable table {
    min-width: 620px;
    margin: 12px 0;
  }
  .easytable th,
  .easytable td {
    padding: 8px;
    font-size: 0.85rem;
  }
  .easytable .split-col {
    padding: 8px;
  }
}
@media (max-width: 420px) {
  .easytable table {
    min-width: 560px;
  }
  .easytable th,
  .easytable td,
  .easytable .split-col {
    padding: 6px;
    font-size: 0.8rem;
  }
}
