/*
 * SEO-PUBLISHER-006
 * AI-002-VISUAL-001 — Responsive CMS tables
 *
 * Desktop: standard 3-column table.
 * Mobile: same table displayed as cards.
 * No content duplication.
 *
 * Scope: Tilda CMS post text molecules.
 * Pattern: 3-column tables only.
 */

/* DESKTOP AND TABLET */
@media screen and (min-width: 641px) {

  .t-cms__page__molecule_txt
  .t-redactor__tte-view
  .t-table__viewport:has(
    .t-table__cell[data-column="2"]
  ):not(:has(
    .t-table__cell[data-column="3"]
  )) {
    max-width: 100% !important;
    overflow-x: visible !important;
  }

  .t-cms__page__molecule_txt
  .t-redactor__tte-view
  .t-table__viewport:has(
    .t-table__cell[data-column="2"]
  ):not(:has(
    .t-table__cell[data-column="3"]
  )) .t-table__wrapper {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .t-cms__page__molecule_txt
  .t-redactor__tte-view
  .t-table__viewport:has(
    .t-table__cell[data-column="2"]
  ):not(:has(
    .t-table__cell[data-column="3"]
  )) .t-table__table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: fixed !important;
  }

  .t-cms__page__molecule_txt
  .t-redactor__tte-view
  .t-table__viewport:has(
    .t-table__cell[data-column="2"]
  ):not(:has(
    .t-table__cell[data-column="3"]
  )) .t-table__cell,
  .t-cms__page__molecule_txt
  .t-redactor__tte-view
  .t-table__viewport:has(
    .t-table__cell[data-column="2"]
  ):not(:has(
    .t-table__cell[data-column="3"]
  )) .t-table__cell-content {
    min-width: 0 !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
  }

  .t-cms__page__molecule_txt
  .t-redactor__tte-view
  .t-table__cell {
    vertical-align: top !important;
  }
}

/* MOBILE: SAME TABLE, CARD PRESENTATION */
@media screen and (max-width: 640px) {

  .t-cms__page__molecule_txt
  .t-redactor__tte-view
  .t-table__viewport:has(
    .t-table__cell[data-column="2"]
  ):not(:has(
    .t-table__cell[data-column="3"]
  )) {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
  }

  .t-cms__page__molecule_txt
  .t-redactor__tte-view
  .t-table__viewport:has(
    .t-table__cell[data-column="2"]
  ):not(:has(
    .t-table__cell[data-column="3"]
  )) .t-table__wrapper,
  .t-cms__page__molecule_txt
  .t-redactor__tte-view
  .t-table__viewport:has(
    .t-table__cell[data-column="2"]
  ):not(:has(
    .t-table__cell[data-column="3"]
  )) .t-table__table {
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: visible !important;
  }

  .t-cms__page__molecule_txt
  .t-redactor__tte-view
  .t-table__viewport:has(
    .t-table__cell[data-column="2"]
  ):not(:has(
    .t-table__cell[data-column="3"]
  )) .t-table__table {
    border: 0 !important;
    border-collapse: separate !important;
  }

  .t-cms__page__molecule_txt
  .t-redactor__tte-view
  .t-table__viewport:has(
    .t-table__cell[data-column="2"]
  ):not(:has(
    .t-table__cell[data-column="3"]
  )) .t-table__row {
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* Hide the desktop header row */
  .t-cms__page__molecule_txt
  .t-redactor__tte-view
  .t-table__viewport:has(
    .t-table__cell[data-column="2"]
  ):not(:has(
    .t-table__cell[data-column="3"]
  )) .t-table__row:first-child {
    display: none !important;
  }

  /* Cards */
  .t-cms__page__molecule_txt
  .t-redactor__tte-view
  .t-table__viewport:has(
    .t-table__cell[data-column="2"]
  ):not(:has(
    .t-table__cell[data-column="3"]
  )) .t-table__row:not(:first-child) {
    margin: 0 0 16px !important;
    padding: 16px !important;
    background: #fff !important;
    border: 1px solid #dedede !important;
    border-radius: 12px !important;
  }

  .t-cms__page__molecule_txt
  .t-redactor__tte-view
  .t-table__viewport:has(
    .t-table__cell[data-column="2"]
  ):not(:has(
    .t-table__cell[data-column="3"]
  )) .t-table__cell {
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    padding: 0 !important;
    border: 0 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  .t-cms__page__molecule_txt
  .t-redactor__tte-view
  .t-table__viewport:has(
    .t-table__cell[data-column="2"]
  ):not(:has(
    .t-table__cell[data-column="3"]
  )) .t-table__cell + .t-table__cell {
    margin-top: 14px !important;
  }

  
  .t-cms__page__molecule_txt
  .t-redactor__tte-view
  .t-table__viewport:has(
    .t-table__cell[data-column="2"]
  ):not(:has(
    .t-table__cell[data-column="3"]
  )) .t-table__cell-content {
    width: auto !important;
    min-width: 0 !important;
    padding-left: 0 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    line-height: 1.5 !important;
  }


  /* Card title */
  .t-cms__page__molecule_txt
  .t-redactor__tte-view
  .t-table__viewport:has(
    .t-table__cell[data-column="2"]
  ):not(:has(
    .t-table__cell[data-column="3"]
  )) .t-table__cell[data-column="0"]
  .t-table__cell-content {
    font-weight: 700 !important;
    font-size: 17px !important;
  }

  /* Column labels */
  .t-cms__page__molecule_txt
  .t-redactor__tte-view
  .t-table__viewport:has(
    .t-table__cell[data-column="2"]
  ):not(:has(
    .t-table__cell[data-column="3"]
  )) .t-table__cell[data-column="1"]::before {
    content: "\041A\043E\0433\0434\0430\0020 \043E\043D\0430\0020 \0440\0430\0431\043E\0442\0430\0435\0442";
  }

  .t-cms__page__molecule_txt
  .t-redactor__tte-view
  .t-table__viewport:has(
    .t-table__cell[data-column="2"]
  ):not(:has(
    .t-table__cell[data-column="3"]
  )) .t-table__cell[data-column="2"]::before {
    content: "\0427\0442\043E\0020 \043F\043E\043B\0443\0447\0430\0435\0442\0020 \043F\043E\043B\044C\0437\043E\0432\0430\0442\0435\043B\044C";
  }

  .t-cms__page__molecule_txt
  .t-redactor__tte-view
  .t-table__viewport:has(
    .t-table__cell[data-column="2"]
  ):not(:has(
    .t-table__cell[data-column="3"]
  )) .t-table__cell[data-column="1"]::before,
  .t-cms__page__molecule_txt
  .t-redactor__tte-view
  .t-table__viewport:has(
    .t-table__cell[data-column="2"]
  ):not(:has(
    .t-table__cell[data-column="3"]
  )) .t-table__cell[data-column="2"]::before {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
  }

  /* Hide horizontal scroll indicator */
  .t-cms__page__molecule_txt
  .t-redactor__tte-view
  .t-table__viewport:has(
    .t-table__cell[data-column="2"]
  ):not(:has(
    .t-table__cell[data-column="3"]
  )) .t-table__viewport-overlying {
    display: none !important;
  }
}


/*
 * SEO-PUBLISHER-006
 * CMS article links
 * Classic blue underlined hyperlinks
 */

.t-cms__page__molecule_txt
.t-redactor__tte-view
.t-redactor__text a:link,
.t-cms__page__molecule_txt
.t-redactor__tte-view
.t-redactor__text a:visited {
  color: #0000EE !important;
  text-decoration-line: underline !important;
  text-decoration-color: #0000EE !important;
  text-underline-offset: 2px;
}

.t-cms__page__molecule_txt
.t-redactor__tte-view
.t-redactor__text a:hover {
  color: #0000CC !important;
  text-decoration-color: #0000CC !important;
}

