/* ============================================
   Comparison Table — Anthem
   Namespace: .anthem-compare
   ============================================ */

.anthem-compare {
  --anthem-accent: #3CB4E5;
  --anthem-accent-soft: #E6F4FB;
  --anthem-accent-softer: #F2F9FD;
  --anthem-accent-hover: #D6ECF6;
  --anthem-accent-glow: rgba(60, 180, 229, 0.22);
  --anthem-bg: #ffffff;
  --anthem-fg: #0c1116;
  --anthem-fg-muted: rgba(12, 17, 22, 0.62);
  --anthem-fg-faint: rgba(12, 17, 22, 0.42);
  --anthem-line: rgba(12, 17, 22, 0.08);
  --anthem-row-zebra: rgba(12, 17, 22, 0.02);

  position: relative;
  padding: 96px 24px;
  background: var(--anthem-bg);
  color: var(--anthem-fg);
  font-family: inherit;
  -webkit-font-smoothing: antialiased;
}

.anthem-compare--dark {
  --anthem-bg: #0a0e13;
  --anthem-fg: #f4f6f8;
  --anthem-fg-muted: rgba(244, 246, 248, 0.7);
  --anthem-fg-faint: rgba(244, 246, 248, 0.45);
  --anthem-line: rgba(244, 246, 248, 0.1);
  --anthem-row-zebra: rgba(255, 255, 255, 0.025);
}

.anthem-compare__inner {
  max-width: 1180px;
  margin: 0 auto;
}

/* ---------- Header ---------- */
.anthem-compare__header {
  max-width: 760px;
  margin: 0 auto 56px;
  text-align: center;
}

.anthem-compare__title {
  margin: 0 0 18px;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--anthem-fg);
}

.anthem-compare__lede {
  font-size: clamp(15px, 1.4vw, 17px);
  line-height: 1.6;
  color: var(--anthem-fg-muted);
}

.anthem-compare__lede p { margin: 0; }
.anthem-compare__lede p + p { margin-top: 12px; }

/* ---------- Table grid ---------- */
.anthem-compare__table {
  position: relative;
  display: grid;
  grid-template-columns: minmax(160px, 1.1fr) minmax(220px, 1.45fr) minmax(220px, 1.45fr);
  border: 1px solid var(--anthem-line);
  border-radius: 20px;
  overflow: hidden;
  background: var(--anthem-bg);
}

.anthem-compare__row {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
}

/* graceful fallback for the small % of browsers without subgrid */
@supports not (grid-template-columns: subgrid) {
  .anthem-compare__row {
    grid-template-columns: minmax(160px, 1.1fr) minmax(220px, 1.45fr) minmax(220px, 1.45fr);
  }
}

.anthem-compare__cell {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid var(--anthem-line);
  font-size: 15px;
  line-height: 1.5;
  color: var(--anthem-fg);
  transition: background-color 0.25s ease;
}

/* zebra + hover effects — desktop/tablet only (mobile uses card layout) */
@media (min-width: 768px) {
  .anthem-compare__row:not(.anthem-compare__row--head):nth-of-type(even) .anthem-compare__cell {
    background: var(--anthem-row-zebra);
  }
  .anthem-compare__row:not(.anthem-compare__row--head):hover .anthem-compare__cell {
    background: var(--anthem-accent-softer);
  }
}

/* first data row sits below header; header itself has no top border */
.anthem-compare__row--head .anthem-compare__cell {
  border-top: none;
  padding-top: 28px;
  padding-bottom: 22px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--anthem-fg-muted);
  align-items: center;
}

.anthem-compare__col-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.005em;
  text-transform: none;
  color: var(--anthem-fg);
}

.anthem-compare__row--head .anthem-compare__cell--highlight .anthem-compare__col-name {
  color: var(--anthem-accent);
  font-size: 16px;
}

/* ---------- Highlight column ---------- */
.anthem-compare__cell--highlight {
  position: relative;
  background: var(--anthem-accent-soft);
  flex-direction: row;
  align-items: flex-start;
  flex-wrap: wrap;
}

.anthem-compare__row--head .anthem-compare__cell--highlight {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

@media (min-width: 768px) {
  .anthem-compare__row:not(.anthem-compare__row--head):nth-of-type(even) .anthem-compare__cell--highlight {
    background: var(--anthem-accent-soft);
  }
  .anthem-compare__row:not(.anthem-compare__row--head):hover .anthem-compare__cell--highlight {
    background: var(--anthem-accent-hover);
  }
}

/* accent rail running down the highlight column */
.anthem-compare__cell--highlight::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--anthem-accent);
}

/* ---------- Category label cell ---------- */
.anthem-compare__cell--label {
  color: var(--anthem-fg-muted);
  font-weight: 600;
}

@media (min-width: 768px) {
  .anthem-compare__row:not(.anthem-compare__row--head) .anthem-compare__cell--label {
    color: var(--anthem-fg);
    font-size: 14px;
    letter-spacing: 0.02em;
  }
}

.anthem-compare__category {
  display: inline-block;
}

/* ---------- Comparison (de-emphasized) column ---------- */
.anthem-compare__cell--compare .anthem-compare__value {
  color: var(--anthem-fg-muted);
}

/* ---------- Icons ---------- */
.anthem-compare__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 1px;
}

.anthem-compare__icon--check {
  color: var(--anthem-accent);
  filter: drop-shadow(0 2px 6px var(--anthem-accent-glow));
}

.anthem-compare__icon--dash {
  color: var(--anthem-fg-faint);
}

.anthem-compare__value {
  flex: 1;
  min-width: 0;
}

/* ---------- Reveal animation (JS-enhanced) ---------- */
.anthem-compare.has-js .anthem-compare__row:not(.anthem-compare__row--head) .anthem-compare__cell {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease, background-color 0.25s ease;
  transition-delay: calc(var(--row-index, 0) * 60ms);
}

.anthem-compare.has-js .anthem-compare__row.is-visible:not(.anthem-compare__row--head) .anthem-compare__cell {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .anthem-compare.has-js .anthem-compare__row:not(.anthem-compare__row--head) .anthem-compare__cell {
    opacity: 1;
    transform: none;
    transition: background-color 0.25s ease;
  }
}

/* ============================================
   Tablet
   ============================================ */
@media (max-width: 991px) {
  .anthem-compare { padding: 72px 20px; }
  .anthem-compare__table {
    grid-template-columns: minmax(120px, 0.9fr) minmax(180px, 1fr) minmax(180px, 1fr);
  }
  .anthem-compare__cell { padding: 18px 18px; font-size: 14px; }
}

/* ============================================
   Mobile — single-column stack per row
   ============================================ */
@media (max-width: 767px) {
  .anthem-compare { padding: 56px 16px; }

  .anthem-compare__header { margin-bottom: 32px; }

  .anthem-compare__table {
    display: flex;
    flex-direction: column;
    gap: 14px;
    border: none;
    border-radius: 0;
    background: transparent;
    overflow: visible;
  }

  /* hide the desktop header row on mobile */
  .anthem-compare .anthem-compare__row--head { display: none; }

  /* each row becomes a single-column card */
  .anthem-compare__row {
    display: flex;
    flex-direction: column;
    grid-column: auto;
    grid-template-columns: none;
    border: 1px solid var(--anthem-line);
    border-radius: 14px;
    overflow: hidden;
    background: var(--anthem-bg);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  }

  .anthem-compare__cell {
    border-top: none;
    background: transparent;
  }

  /* Category label — dark header bar */
  .anthem-compare__cell--label {
    background: var(--anthem-fg);
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #fff;
  }

  /* UVP block — cyan, "UVP" mini-label + icon + value */
  .anthem-compare__cell--highlight {
    background: var(--anthem-accent-soft);
    padding: 14px 16px 16px;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "label label"
      "icon  value";
    column-gap: 10px;
    row-gap: 4px;
  }

  .anthem-compare__cell--highlight::before {
    content: "UVP";
    grid-area: label;
    position: static;
    display: block;
    width: auto;
    height: auto;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--anthem-accent);
    background: transparent;
  }

  .anthem-compare__cell--highlight .anthem-compare__icon {
    grid-area: icon;
    margin-top: 2px;
  }

  .anthem-compare__cell--highlight .anthem-compare__value {
    grid-area: value;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--anthem-fg);
  }

  /* Traditional block — own section, muted */
  .anthem-compare__cell--compare {
    padding: 14px 16px;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "label label"
      "icon  value";
    column-gap: 10px;
    row-gap: 4px;
  }

  .anthem-compare__cell--compare::before {
    content: "Traditional";
    grid-area: label;
    display: block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--anthem-fg-faint);
  }

  .anthem-compare__cell--compare .anthem-compare__icon {
    grid-area: icon;
    margin-top: 2px;
  }

  .anthem-compare__cell--compare .anthem-compare__value {
    grid-area: value;
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--anthem-fg-faint);
  }

  /* drop old data-attr column labels */
  .anthem-compare__cell--highlight::after,
  .anthem-compare__cell--compare::after {
    content: none;
  }

  .anthem-compare__icon { width: 18px; height: 18px; }
  .anthem-compare__icon--check { filter: none; }
}
