/* =========================================================
   TXTImpact Tables
   Responsive comparison / feature table
   ========================================================= */

/* ---------------------------------------------------------
   Wrapper — enables horizontal scroll on tablet if needed
   --------------------------------------------------------- */
.txtimpact-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---------------------------------------------------------
   Base table — desktop
   --------------------------------------------------------- */
.txtimpact-table {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
  color: #182230;
  background: #fff;
}

.txtimpact-table th,
.txtimpact-table td {
  padding: 13px 18px;
  border-bottom: 1px solid #edf0f5;
  vertical-align: middle;
  text-align: left;
  overflow-wrap: anywhere;
  word-break: normal;
}

.txtimpact-table thead th {
  background: #fff;
  color: #7b8494;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* TXTImpact highlighted column */
.txtimpact-table .txtimpact-column {
  padding-left: 14px;
  text-align: left;
  color: #162a78;
  font-weight: 600;

}

.txtimpact-table thead .txtimpact-column {
  position: relative;
  color: #fff;
  background: #06155d;
  border: 0;
  border-radius: 6px 6px 0 0;
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
}

.txtimpact-table tbody tr:last-child td {
  border-bottom: 0;
}

/* Other-provider column */
.txtimpact-table th:last-child,
.txtimpact-table td:last-child {
  color: #a0a8b5;
}

/* Checks / status text */
.txtimpact-table .check,
.txtimpact-table .yes {
  color: #2885f3;
  font-weight: 700;
}

.txtimpact-table .dash,
.txtimpact-table .muted {
  color: #a0a8b5;
}

.txtimpact-table .no-wrap {
  white-space: nowrap;
}

/* Smooth corners on highlighted column */
.txtimpact-table tbody tr:last-child .txtimpact-column {
  border-radius: 0 0 6px 6px;
}

/* ---------------------------------------------------------
   Tablet — tighten spacing, keep columns visible
   --------------------------------------------------------- */
@media (max-width: 900px) {
  .txtimpact-table {
    font-size: 13px;
  }

  .txtimpact-table th,
  .txtimpact-table td {
    padding: 12px 14px;
  }
}

/* ---------------------------------------------------------
   Mobile — stacked card layout WITH visible column headings
   
   How it works:
   • The real <thead> is visually hidden (screen-reader accessible)
   • Each <td> shows its column heading via a ::before pseudo-element
     that reads the data-label="…" attribute set on the td in HTML
   • Each <tr> becomes a self-contained card
   • Column heading labels sit above each value inside the card row

   Required HTML pattern:
   <table class="txtimpact-table">
     <thead>
       <tr>
         <th>Feature</th>
         <th class="txtimpact-column">TXTImpact</th>
         <th>Textedly</th>
       </tr>
     </thead>
     <tbody>
       <tr>
         <td data-label="Feature">Two-way messaging</td>
         <td data-label="TXTImpact" class="txtimpact-column check">✔ Yes</td>
         <td data-label="Textedly">✔ Yes</td>
       </tr>
     </tbody>
   </table>
   --------------------------------------------------------- */
@media (max-width: 680px) {

  /* ── Hide real thead but keep it accessible ── */
  .txtimpact-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  /* ── Make table elements block so rows stack ── */
  .txtimpact-table,
  .txtimpact-table tbody,
  .txtimpact-table tr,
  .txtimpact-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  .txtimpact-table {
    table-layout: auto;
    border-spacing: 0;
    background: transparent;
  }

  /* ── Each row = a card ── */
  .txtimpact-table tbody tr {
    margin: 0 0 14px;
    border: 1px solid #e0e6f5;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 12px rgba(20, 35, 70, .06);
  }

  .txtimpact-table tbody tr:last-child {
    margin-bottom: 0;
  }

  /* ── Each cell = a labelled row inside the card ── */
  .txtimpact-table td {
    position: relative;
    padding: 0;
    border: 0;
    border-bottom: 1px solid #edf0f5;
    display: flex;
    flex-direction: column;        /* label stacks above value */
    align-items: flex-start;
    gap: 2px;
    min-height: unset;
  }

  .txtimpact-table td:last-child {
    border-bottom: 0;
  }

  /* ── Column heading label (::before) ── */
  .txtimpact-table td::before {
    content: attr(data-label);
    display: block;
    width: 100%;
    padding: 8px 14px 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: #9aa3b2;
    line-height: 1.2;
  }

  /* ── Cell value sits below the label ── */
  .txtimpact-table td > span,
  .txtimpact-table td {
    padding-bottom: 10px;
  }

  /* Wrap cell text content with padding */
  .txtimpact-table td::after {
    /* spacer so value has bottom breathing room */
    content: '';
    display: block;
    height: 2px;
  }

  /* Inner value padding — applied via wrapper span if present,
     otherwise we shift all direct text with padding on the td itself */
  .txtimpact-table td {
    padding: 0 0 10px;
  }

  /* Value text padding */
  .txtimpact-table td > * {
    padding-left: 14px;
    padding-right: 14px;
  }

  /* When td has only a text node (no child element), give it
     left/right padding via pseudo-content trick */
  .txtimpact-table td[data-label]::before {
    padding-left: 14px;
    padding-right: 14px;
  }

  /* Manually apply inner left/right padding to td so bare text nodes
     (not wrapped in a span) are also indented */
  .txtimpact-table td {
    padding-left: 0;
    padding-right: 0;
  }

  /* ── Feature name row (first td) — card header ── */
  .txtimpact-table td:first-child {
    background: #f7f9fc;
    border-bottom: 1px solid #e0e6f5;
    font-size: 14px;
    font-weight: 700;
    color: #182230;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 12px;
  }

  .txtimpact-table td:first-child::before {
    color: #b0b8c8;
    font-size: 9px;
    padding-bottom: 2px;
  }

  /* ── TXTImpact column — highlighted row ── */
  .txtimpact-table td.txtimpact-column {
    background: #eef3ff;
    border-left: 3px solid #2885f3;
    color: #162a78;
    font-weight: 700;
    font-size: 14px;
    border-radius: 0;
    border-right: 0;
    width: 100%;
    text-align: left;
  }

  .txtimpact-table td.txtimpact-column::before {
    color: #2885f3;
    font-size: 9px;
  }

  /* ── Competitor column — de-emphasised ── */
  .txtimpact-table td:last-child:not(:first-child) {
    background: #fafbfc;
    color: #7b8494;
    font-size: 14px;
  }

  .txtimpact-table td:last-child:not(:first-child)::before {
    color: #b0b8c8;
  }

  /* ── Utility classes ── */
  .txtimpact-table .no-wrap {
    white-space: normal;
  }

  .txtimpact-table .check,
  .txtimpact-table .yes {
    color: #2885f3;
    font-weight: 700;
  }

  .txtimpact-table .dash,
  .txtimpact-table .muted {
    color: #a0a8b5;
  }
}

/* ---------------------------------------------------------
   Very small phones
   --------------------------------------------------------- */
@media (max-width: 380px) {
  .txtimpact-table td {
    font-size: 13px;
  }

  .txtimpact-table td::before {
    font-size: 9px;
  }
}

/* ---------------------------------------------------------
   My improvisations
   --------------------------------------------------------- */

@media (max-width: 680px) {
    .txtimpact-table td {
        padding-left: 0;
        padding-right: 0;
        background-color: #f3f6ff;
        border-left: 1px solid #e8edfa;
        border-right: 1px solid #e8edfa;
    }
}

@media (max-width: 680px) {
  .txtimpact-table td {
    padding-left: 14px;
    padding-right: 14px;
  }

  .txtimpact-table td::before {
    padding-left: 0;
    padding-right: 0;
  }
}
  @media (max-width: 680px) {
    .txtimpact-table td.txtimpact-column {
        width: 100%;
    }
}