/* Namespaced styles for mod03 component to avoid global conflicts */

.mod03 {
  position: relative;
  font-family: Poppins, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Grid wrapper for arranging multiple cards (3x5 target layout) */
.mod03-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}

/* 4-column variant for pages that need 4x4 layout */
.mod03-grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

@media (max-width: 575px) {
  .mod03-grid {
    grid-template-columns: 1fr;
  }
}

/* Ensure each component centers within its grid cell */
.mod03-grid .mod03 {
  display: flex;
  justify-content: center;
}

/* Card base styles */
.mod03-card {
  position: relative;
  width: 100%;
  max-width: 378px; /* 10% smaller */
  height: 405px; /* 10% smaller */
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.14);
  transition: box-shadow 0.3s ease;
}

.mod03-card:hover {
  box-shadow: 0 15px 30px rgba(0, 104, 31, 0.23);
}

/* Image box (before hover) */
.mod03-img {
  position: absolute;
  top: 45%;
  left: 0;
  right: 0;
  height: 198px; /* 10% smaller */
  transform: translateY(-50%);
  z-index: 2;
  transition: top 0.3s ease, transform 0.3s ease;
}

/* Image box (on hover) */
.mod03-card:hover .mod03-img {
  top: 5%;
  transform: none;
}

/* Image styles */
.mod03-img img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 330px; /* 10% smaller */
  height: auto;
}

/* Content box (before hover) */
.mod03-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 108px; /* 10% smaller */
  text-align: center;
  padding: 12px 16px;
  z-index: 1;
  transition: height 0.3s ease;
}

/* Content box (on hover) */
.mod03-card:hover .mod03-content {
  height: 198px; /* 10% smaller */
}

/* Title */
.mod03-content h2 {
  position: relative;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #005004;
  margin: 0;
  font-size: 1.25rem;
}

/* Description (before hover) */
.mod03-desc {
  margin-top: 8px;
  transition: opacity 0.3s ease 0.15s, visibility 0.3s ease 0.15s;
  opacity: 0;
  visibility: hidden;
  color: #747474;
  line-height: var(--mod03-desc-line-height, 1.3);
}

/* Description (on hover) */
.mod03-card:hover .mod03-desc {
  opacity: 1;
  visibility: visible;
}

/* "Learn More" link (before hover) */
.mod03-link {
  display: inline-block;
  padding: 10px 20px;
  background: #fff;
  margin-top: 16px;
  text-decoration: none;
  font-weight: 600;
  color: #4AAB3D;
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.3s ease 0.15s, transform 0.3s ease 0.15s, background 0.2s ease, color 0.2s ease;
}

/* "Learn More" link (on hover) */
.mod03-card:hover .mod03-link {
  opacity: 1;
  transform: translateY(0);
  background: #4AAB3D;
  color: #fff;
}

.mod03-link:hover {
  filter: brightness(0.95);
}