/* ==========================================================================
   Devgun Family Law -- Block: SectionContentBlock "Side Image" card
   Figma: Homepage Key Message frames (7115:319 etc.) + Family Law LP
   7138:637/645. Contained rounded card = image half + tinted text panel,
   flat (no shadow), radius --radius-card, per build spec 5.2 "Content Key
   Message card": H4 title, Body-1 copy, primary pill button. Image ratio
   ~42/58 measured from the homepage frames. Stacks image-above-text below
   md (768px) per build spec Section 6.

   The panel tint defaults to --color-bg-card-tint (Light Blue); the
   alternating green-tint row from the design (--color-bg-card-green) can
   be opted into later via the --side-image-card-panel-bg custom property
   without touching this file.
   ========================================================================== */

.side-image {
  padding-top: var(--space-section-y);
  padding-bottom: var(--space-section-y);
}

.side-image-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-gap);
  align-items: stretch;
  max-width: var(--container-max-width);
  margin: 0 auto;
}

/* Image half: rounded, cover-cropped, matches the panel height on desktop. */
.side-image-card__media {
  border-radius: var(--radius-card);
  overflow: hidden;
}

.side-image-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-card);
}

/* Text half: tinted rounded panel, content vertically centered. Colors are
   forced to the on-light defaults so the panel stays readable even when the
   surrounding section band is one of the dark section-bg--* classes. */
.side-image-card__panel {
  background-color: var(--side-image-card-panel-bg, var(--color-bg-card-tint));
  border-radius: var(--radius-card);
  padding: var(--space-card);
  color: var(--color-text-default);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.side-image-card__title {
  margin-bottom: 0.75rem;
}

.side-image-card__subtitle {
  margin-bottom: 0.75rem;
  color: var(--color-text-heading);
}

.side-image-card__body p:last-child {
  margin-bottom: 0;
}

.side-image-card__cta {
  margin-top: var(--space-gap);
}

/* No image uploaded (e.g. the Style Guide demo instance): the panel simply
   spans the full card width -- no empty media column. */
.side-image-card--no-image {
  grid-template-columns: 1fr;
}

/* md+ : two columns, ImageSide flips via order. */
@media (min-width: 768px) {
  .side-image-card--image-left,
  .side-image-card--image-right {
    grid-template-columns: minmax(0, 42fr) minmax(0, 58fr);
  }

  .side-image-card--image-right {
    grid-template-columns: minmax(0, 58fr) minmax(0, 42fr);
  }

  .side-image-card--image-right .side-image-card__media {
    order: 2;
  }

  .side-image-card--image-right .side-image-card__panel {
    order: 1;
  }
}

/* Below md the image stacks above the panel; give it a bounded height so
   portrait uploads do not tower over the text. */
@media (max-width: 767.98px) {
  .side-image-card__img {
    height: auto;
    max-height: 420px;
  }
}
