/*
 * サービスLP共通: 「課題（PROBLEM）」「比較（COMPARE）」セクション
 * template-parts/lp-custom/topic-section.php 用。
 * 色は各LPの変数を section の style 属性で --lpt-* に渡している。
 */

.lpt {
  --lpt-text: #2b3540;
}

.lpt-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- 課題 ---- */
.lpt-problems {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.lpt-problem {
  padding: 32px 32px 30px;
  border: 1px solid var(--lpt-line, #dde5e8);
  border-top: 4px solid var(--lpt-accent, #138a74);
  border-radius: 8px;
  background: #fff;
}

.lpt-problem__num {
  margin: 0 0 10px !important;
  color: var(--lpt-accent, #138a74);
  font-family: Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .08em;
}

.lpt-problem h3 {
  margin: 0 0 12px;
  color: var(--lpt-navy, #12283a);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
}

.lpt-problem p:last-child {
  margin: 0;
  color: var(--lpt-text);
  font-size: 15px;
  line-height: 1.95;
}

.lpt-columns {
  max-width: 880px;
  margin: 48px auto 0;
  padding: 26px 30px;
  border-radius: 8px;
  background: var(--lpt-soft, #f3f8f6);
}

.lpt-columns__title {
  margin: 0 0 12px !important;
  color: var(--lpt-navy, #12283a);
  font-size: 16px;
  font-weight: 700;
}

.lpt-columns ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.lpt-columns li + li {
  margin-top: 8px;
}

.lpt-columns a {
  position: relative;
  display: inline-block;
  padding-left: 1.2em;
  color: var(--lpt-accent, #138a74);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.7;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

.lpt-columns a::before {
  position: absolute;
  left: 0;
  content: "›";
}

/* ---- 比較 ---- */
.lpt-compare {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.lpt-compare table {
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  font-size: 15px;
  line-height: 1.75;
}

.lpt-compare th,
.lpt-compare td {
  padding: 18px 20px;
  border-bottom: 1px solid var(--lpt-line, #dde5e8);
  color: var(--lpt-text);
  text-align: left;
  vertical-align: top;
}

.lpt-compare thead th {
  border-bottom: 2px solid var(--lpt-navy, #12283a);
  color: var(--lpt-navy, #12283a);
  font-size: 16px;
  font-weight: 700;
}

.lpt-compare tbody th {
  width: 18%;
  color: var(--lpt-navy, #12283a);
  font-weight: 700;
  white-space: nowrap;
}

.lpt-compare .is-ours {
  background: color-mix(in srgb, var(--lpt-accent, #138a74) 8%, #fff);
  font-weight: 600;
}

.lpt-compare thead .is-ours {
  border-bottom-color: var(--lpt-accent, #138a74);
  background: var(--lpt-accent, #138a74);
  color: #fff;
}

@media (max-width: 782px) {
  .lpt-problems {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .lpt-problem {
    padding: 24px 20px 22px;
  }

  .lpt-problem h3 {
    font-size: 18px;
  }

  .lpt-columns {
    margin-top: 32px;
    padding: 20px;
  }

  /* スマホは横スクロールにせず、比較項目ごとのカードに積む（自社の列が隠れないように） */
  .lpt-compare table,
  .lpt-compare tbody,
  .lpt-compare tr,
  .lpt-compare th,
  .lpt-compare td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .lpt-compare table {
    background: transparent;
    font-size: 14px;
  }

  .lpt-compare thead {
    display: none;
  }

  .lpt-compare tr {
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid var(--lpt-line, #dde5e8);
    border-radius: 8px;
    background: #fff;
  }

  .lpt-compare tbody th {
    width: 100%;
    padding: 12px 16px;
    background: var(--lpt-navy, #12283a);
    color: #fff;
    white-space: normal;
  }

  .lpt-compare td {
    display: grid;
    grid-template-columns: 7.5em 1fr;
    gap: 12px;
    padding: 12px 16px;
  }

  .lpt-compare td::before {
    color: #5a6670;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.75;
    content: attr(data-label);
  }

  .lpt-compare td.is-ours::before {
    color: var(--lpt-accent, #138a74);
  }

  .lpt-compare tr > :last-child {
    border-bottom: 0;
  }
}
