/* credibility.css — uniform card galleries (factory + certificates) */
#certificates .cred-cert-grid,
#factory-photos .home-factory-grid {
  display: grid !important;
  gap: 1rem !important;
  width: 100% !important;
  align-items: stretch !important;
}

/* Certificates: A4 portrait (210/297), object-fit contain, 3-col desktop */
#certificates .cred-cert-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
#certificates .cred-cert-card {
  margin: 0 !important;
  padding: 10px !important;
  border: 1px solid #d6d3d1 !important;
  border-radius: 8px !important;
  background: #fff !important;
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  height: 100% !important;
}
#certificates .cred-cert-card > a {
  display: block !important;
  position: relative !important;
  width: 100% !important;
  aspect-ratio: 210 / 297 !important;
  height: auto !important;
  max-height: none !important;
  overflow: hidden !important;
  border-radius: 4px !important;
  background: #f5f5f4 !important;
  flex: 0 0 auto !important;
}
#certificates .cred-cert-card img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center top !important;
  display: block !important;
  margin: 0 !important;
}
#certificates .cred-cert-card figcaption {
  margin-top: 10px !important;
  min-height: 2.6em !important;
  text-align: center !important;
  color: #1f2937 !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
}

/* Factory: 3x3 equal tiles; every tile same aspect */
#factory-photos .home-factory-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
#factory-photos .home-factory-large,
#factory-photos .home-factory-grid > .home-factory-large {
  grid-column: auto !important;
  grid-row: auto !important;
}
#factory-photos .home-factory-grid > .service-inline-image,
#factory-photos .home-factory-grid > figure {
  display: flex !important;
  flex-direction: column !important;
  margin: 0 !important;
  min-width: 0 !important;
  height: 100% !important;
  background: #fafafa !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  padding: 0 !important;
}
#factory-photos .home-factory-grid .img-frame,
#factory-photos .home-factory-grid > .service-inline-image > a,
#factory-photos .home-factory-grid > figure > a {
  display: block !important;
  position: relative !important;
  width: 100% !important;
  aspect-ratio: 4 / 3 !important;
  overflow: hidden !important;
  background: #e7e5e4 !important;
}
/* When img is direct child of figure (no anchor), wrap via CSS */
#factory-photos .home-factory-grid > .service-inline-image > img,
#factory-photos .home-factory-grid > figure > img {
  width: 100% !important;
  aspect-ratio: 4 / 3 !important;
  height: auto !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
}
#factory-photos .home-factory-grid figcaption {
  margin: 0 !important;
  padding: 10px 12px 12px !important;
  min-height: 2.6em !important;
  color: #374151 !important;
  font-size: 0.9rem !important;
  line-height: 1.3 !important;
  background: #fff !important;
  text-align: center !important;
}

@media (max-width: 980px) {
  #certificates .cred-cert-grid,
  #factory-photos .home-factory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 640px) {
  #certificates .cred-cert-grid,
  #factory-photos .home-factory-grid {
    grid-template-columns: 1fr !important;
  }
}
