/* Divi row wrap helper (D5 fallback)
 * Usage: add class "linis-wrap-row" to a Row in Divi Builder.
 * Result:
 * - desktop: text/header left aligned
 * - tablet + phone (≤980 px): 1 column per row, text/header centered
 */

/* Desktop default: keep content aligned to the left. */
.linis-wrap-row .et_pb_module_header,
.linis-wrap-row .et_pb_text,
.linis-wrap-row .et_pb_text_inner,
.linis-wrap-row .et_pb_text_inner p {
  text-align: left;
}

@media (max-width: 980px) {
  /* Tablet + phone: center text/header content. */
  .linis-wrap-row .et_pb_module_header,
  .linis-wrap-row .et_pb_text,
  .linis-wrap-row .et_pb_text_inner,
  .linis-wrap-row .et_pb_text_inner p {
    text-align: center;
  }

  /* Full stack: 1 column on tablet and phone. */
  .linis-wrap-row.et_pb_row,
  .linis-wrap-row .et_pb_row,
  .linis-wrap-row .et_pb_row_inner {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: stretch;
  }

  .linis-wrap-row.et_pb_row > .et_pb_column,
  .linis-wrap-row .et_pb_row > .et_pb_column,
  .linis-wrap-row .et_pb_row_inner > .et_pb_column,
  .linis-wrap-row > .et_pb_column {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
    float: none !important;
    clear: both !important;
  }
}

/* ================================================================
 * Divi row FULL-STACK helper (D5 fallback)
 * Usage: add class "linis-stack-row" to a Row in Divi Builder.
 * Result:
 * - desktop: normal column layout (e.g. 1/3 + 1/3 + 1/3)
 * - tablet (768-980px): 1 column per row (full stack)
 * - phone (<768px): 1 column per row (Divi default)
 * - tablet/phone: text/header centered
 * ================================================================ */

@media (max-width: 980px) {
  .linis-stack-row .et_pb_module_header,
  .linis-stack-row .et_pb_text,
  .linis-stack-row .et_pb_text_inner,
  .linis-stack-row .et_pb_text_inner p {
    text-align: center;
  }
}

@media (min-width: 768px) and (max-width: 980px) {
  .linis-stack-row.et_pb_row,
  .linis-stack-row .et_pb_row,
  .linis-stack-row .et_pb_row_inner {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: stretch;
  }

  .linis-stack-row.et_pb_row > .et_pb_column,
  .linis-stack-row .et_pb_row > .et_pb_column,
  .linis-stack-row .et_pb_row_inner > .et_pb_column,
  .linis-stack-row > .et_pb_column {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
    float: none !important;
    clear: both !important;
  }
}
