/**
 * CODA - WPBakery Display Child Pages – grid layout
 */

.child-pages-container {
  display: flex;
  flex-wrap: wrap;
}

.child-page-wrapper {
  background: #eaeaea;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  margin: 0 2% 20px 2%;
  text-align: center;
  box-sizing: border-box;
}

.child-pages-container.child-pages-cols-2 .child-page-wrapper {
  width: 46%;
}

.child-pages-container.child-pages-cols-3 .child-page-wrapper {
  width: 29%;
}

/* Image wrapper (when image is showing) */
.child-pages-container .child-thumb {
  display: block;
  width: 100%;
  height: 180px;
  overflow: hidden;
  flex-shrink: 0;
}

.child-pages-container .child-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
}

.child-page-wrapper h2 {
  margin: 0;
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
}

.child-page-wrapper h2 a {
  color: #333;
  font-size: 23px;
  line-height: 1;
  text-decoration: none;
}

/* Single column on smaller screens */
@media (max-width: 1000px) {
  .child-pages-container.child-pages-cols-2 .child-page-wrapper,
  .child-pages-container.child-pages-cols-3 .child-page-wrapper {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}

/* Responsive: smaller image wrapper on small screens */
@media (max-width: 768px) {
  .child-pages-container .child-thumb {
    height: 140px;
  }
}

@media (max-width: 480px) {
  .child-pages-container .child-thumb {
    height: 120px;
  }

  .child-page-wrapper h2 {
    padding: 15px;
  }

  .child-page-wrapper h2 a {
    font-size: 20px;
  }
}
