.ehcg-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  direction: inherit;
}

.ehcg-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: #fff;
  isolation: isolate;
  outline: none;
}

.ehcg-card__media {
  position: relative;
  flex: 0 0 auto;
  min-width: 0;
  overflow: hidden;
}

.ehcg-card__image {
  display: block;
  width: 100%;
  height: 480px;
  object-fit: cover;
  object-position: center;
}

.ehcg-card__content {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 8px;
  text-align: center;
  background: #dceaea;
}

.ehcg-card__title,
.ehcg-card__overlay-title {
  padding: 0;
  margin: 0;
}

.ehcg-card__title {
  margin-bottom: 22px;
  color: #111;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
}

.ehcg-card__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 5px;
  color: #fff;
  background: #72ad9f;
  text-decoration: none;
  transition: color .2s ease, background-color .2s ease, transform .2s ease;
}

.ehcg-card__button:hover {
  color: #fff;
  transform: translateY(-1px);
}

.ehcg-card__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  width: 100%;
  height: 100%;
  color: #fff;
  background: rgba(0, 0, 0, .76);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .3s ease, visibility .3s ease, transform .3s ease;
}

.ehcg-card__overlay-inner {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 18px 8px;
  overflow-y: auto;
  text-align: center;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.65) transparent;
}

.ehcg-card__overlay-title {
  margin-bottom: 12px;
  color: #fff;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.15;
}

.ehcg-card__overlay-text,
.ehcg-card__overlay-text * {
  color: #fff;
}

.ehcg-card__overlay-text {
  font-size: 18px;
  line-height: 1.55;
}

.ehcg-card__overlay-text > :first-child { margin-top: 0; }
.ehcg-card__overlay-text > :last-child { margin-bottom: 0; }

@media (hover: hover) and (pointer: fine) {
  .ehcg-card:hover .ehcg-card__overlay,
  .ehcg-card:focus-within .ehcg-card__overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }
}

.ehcg-card.is-open .ehcg-card__overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

@media (max-width: 1024px) {
  .ehcg-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ehcg-card__image { height: 300px; }
  .ehcg-card__title { font-size: 22px; }
  .ehcg-card__overlay-title { font-size: 22px; }
  .ehcg-card__overlay-text { font-size: 15px; line-height: 1.45; }
}

@media (max-width: 767px) {
  .ehcg-grid { gap: 10px; }
  .ehcg-card__image { height: 220px; }
  .ehcg-card__content { padding: 16px 8px; }
  .ehcg-card__title { margin-bottom: 16px; font-size: 17px; }
  .ehcg-card__button { padding: 8px 18px; font-size: 15px; }
  .ehcg-card__overlay-inner { padding: 18px 8px; }
  .ehcg-card__overlay-title { margin-bottom: 12px; font-size: 16px; line-height: 1.2; }
  .ehcg-card__overlay-text { font-size: 14px; line-height: 1.25; }
}

@media (prefers-reduced-motion: reduce) {
  .ehcg-card__overlay,
  .ehcg-card__button { transition: none; }
}
