/* ============================================================
   Comparison cards — layout only. All type / colour / badge / icon
   / quickfeat / rtext styling is inherited from the Act3 (Neambo)
   theme components. This file lives in the module so it always loads
   with the module (no external stylesheet path to break).
   Instance-specific values (card colour, radius, padding, image
   size) are injected per module via the inline <style> in module.html.
   ============================================================ */

.cmpr {
  --cmpr-gap: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;           /* max 2 comparison sides */
  /* 9 shared rows: header / hr / pros-head / pros / hr / cons-head / cons / hr / footer */
  grid-template-rows: repeat(9, auto);
  gap: 0 var(--cmpr-gap);
  align-items: start;
}

.cmpr__side {
  display: grid;
  grid-row: 1 / -1;
  grid-template-rows: subgrid;               /* keeps Pros/Cons equal height across sides */
}

.cmpr__row {
  min-width: 0;
}

/* Neutralise Act3's default per-module bottom margin inside the grid. */
.cmpr .module {
  margin-bottom: 0;
}
.cmpr .module__inner {
  width: auto;
}

/* --- Header: fixed square image to the LEFT of badge + title --- */
.cmpr__header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 8px;
}
.cmpr__header-img {
  flex: 0 0 auto;
}
.cmpr__header-img img {
  display: block;
  object-fit: cover;                         /* keep it square without distortion */
}
.cmpr__header-intro {
  flex: 1 1 auto;
  min-width: 0;
}

/* --- Cons icons: fixed orange fill with a white glyph --- */
.cmpr__list--cons .icon.icon--fill {
  background: #FF8D4B;
  color: #ffffff;
}
.cmpr__list--cons .icon.icon--fill .icon__glyph svg {
  fill: #ffffff;
}

/* --- Dividers (match the original <hr> separators) --- */
.cmpr__hr {
  padding: 20px 0;
}
.cmpr__hr hr {
  border: 0;
  border-top: 1px solid currentColor;
  opacity: 0.18;
  margin: 0;
}

/* --- Footer: fixed icon to the left of the summary text --- */
.cmpr__footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 4px;
}
.cmpr__footer-icon {
  flex: 0 0 auto;
}
.cmpr__footer-text {
  flex: 1 1 auto;
  min-width: 0;
}
.cmpr__footer-text .rtext__content > :last-child {
  margin-bottom: 0;
}

/* --- Card shadow (background / radius / padding set per module) --- */
.cmpr--shadow .cmpr__side {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* --- Fallback for browsers without subgrid --- */
@supports not (grid-template-rows: subgrid) {
  .cmpr__side {
    display: flex;
    flex-direction: column;
  }
  .cmpr__list {
    flex: 1 1 auto;
  }
}

/* --- Mobile: stack the two sides --- */
@media (max-width: 767px) {
  .cmpr {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    gap: var(--cmpr-gap);
  }
  .cmpr__side {
    display: flex;
    flex-direction: column;
    grid-row: auto;
  }
}
