/* ==========================================================
   PATCH: Program cards PRO layout
   File: assets/css/chashka-program-cards-pro-patch.css
   Usage: include AFTER chashka-pro.css and program-section.css.
   Purpose:
   - 4 cards in one row on desktop
   - 2 cards per row on tablets
   - 1 card per row on mobile
   - stable 16:9 images
   - equal height cards
   ========================================================== */

/* Remove/override any inline or previous compressed grid rules */
.ch-program-card-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 28px !important;
  align-items: stretch !important;
  margin-top: 42px;
}

/* Equal-height PRO cards */
.ch-program-pro-card {
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
  height: 100% !important;
  overflow: hidden;
  border-radius: 32px;
}

/* 16:9 visual frame */
.ch-program-pro-card__image {
  position: relative;
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 3px solid var(--ch-black);
  background: #111;
}

/* Image covers frame safely */
.ch-program-pro-card__image img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  transition: transform .28s ease;
}

.ch-program-pro-card:hover .ch-program-pro-card__image img {
  transform: scale(1.055);
}

/* Tag badge */
.ch-program-pro-card__image span {
  left: 14px;
  top: 14px;
  padding: 8px 12px;
  max-width: calc(100% - 28px);
  white-space: nowrap;
}

/* Body uses remaining card height */
.ch-program-pro-card__body {
  flex: 1 1 auto;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0;
  padding: 24px;
}

.ch-program-pro-card h3 {
  overflow-wrap: anywhere;
  hyphens: auto;
}

.ch-program-pro-card p {
  overflow-wrap: anywhere;
}

/* Push bullet list to the bottom for equal visual rhythm */
.ch-program-pro-card__body ul {
  margin-top: auto !important;
  padding-top: 20px;
}

/* Desktop / laptop: 4 in row stays until tablet */
@media (min-width: 1200px) {
  .ch-program-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

/* Tablet: 2 x 2 */
@media (max-width: 1199px) {
  .ch-program-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .ch-program-pro-card__body {
    padding: 24px;
  }

  .ch-program-pro-card h3 {
    font-size: 26px;
  }
}

/* Mobile: 1 per row */
@media (max-width: 767px) {
  .ch-program-card-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  .ch-program-pro-card {
    width: 100%;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
  }

  .ch-program-pro-card__body {
    padding: 24px;
  }

  .ch-program-pro-card h3 {
    font-size: 26px;
    line-height: .95;
  }

  .ch-program-pro-card p {
    font-size: 15px;
    line-height: 1.45;
  }
}

/* Small iPhone */
@media (max-width: 420px) {
  .ch-program-card-grid {
    gap: 22px !important;
  }

  .ch-program-pro-card {
    max-width: 100%;
    border-radius: 28px;
  }

  .ch-program-pro-card__body {
    padding: 20px;
  }

  .ch-program-pro-card h3 {
    font-size: 24px;
  }

  .ch-program-pro-card p {
    font-size: 14px;
  }

  .ch-program-pro-card li {
    font-size: 13px;
  }
}
