/* ==========================================================================
   Tind-All — BLOG CARDS (matches the hand-built cards on /blog/)
   Scoped to Divi Blog modules with class "custom-blog-cards" (or "tm-blog-cards").
   Safe to remove: delete assets/css/blog.css and its entry in inc/enqueue.php.
   Values measured from the static design: white card, 1px teal-tint border,
   16:10 image, 24px padding, cream pill 12px, Arial 22px title, Roboto 13px date,
   14px excerpt, 1px divider, 15px teal "Read the Article".
   ========================================================================== */

.custom-blog-cards, .tm-blog-cards {
  --tmb-teal: var(--gcid-primary-color, #064f56);
  --tmb-deep: var(--gcid-eqqroitnra, #143f43);
  --tmb-ink: var(--gcid-heading-color, #263437);
  --tmb-body: var(--gcid-body-color, #181818);
  --tmb-cream: var(--gcid-9azvugp92v, #e7e4b5);
  --tmb-line: rgba(6, 79, 86, .25);
  --tmb-ease: cubic-bezier(.22, .61, .36, 1);
}

/* Grid spacing like the static cards */
.custom-blog-cards .et_pb_blog_posts,
.tm-blog-cards .et_pb_blog_posts { gap: 32px 24px !important; }

/* Card */
.custom-blog-cards article.tm-post-card,
.tm-blog-cards article.tm-post-card {
  display: flex !important;
  flex-direction: column !important;
  height: 100%;
  margin: 0 !important;
  padding: 0 !important;
  background: #fff !important;
  border: 1px solid var(--tmb-line) !important;
  border-radius: 0 !important;
  overflow: hidden;
  transition: transform .45s var(--tmb-ease), box-shadow .45s var(--tmb-ease);
}
.custom-blog-cards article.tm-post-card:hover,
.tm-blog-cards article.tm-post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 44px -18px rgba(6, 79, 86, .28);
}

/* Image: fixed 16:10 frame, gentle zoom on hover */
.custom-blog-cards .et_pb_blog_posts.et_grid_module .tm-post-card .et_pb_image_container,
.tm-blog-cards .et_pb_blog_posts.et_grid_module .tm-post-card .et_pb_image_container {
  margin: 0 !important;
  height: auto !important;            /* overrides Divi's fixed 194px/214px */
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #e4ecea;
}
.custom-blog-cards .tm-post-card .et_pb_image_container a,
.tm-blog-cards .tm-post-card .et_pb_image_container a { display: block; height: 100%; }
.custom-blog-cards .tm-post-card .et_pb_image_container img,
.tm-blog-cards .tm-post-card .et_pb_image_container img {
  width: 100% !important; height: 100% !important; object-fit: cover; display: block;
  transition: transform 1.1s var(--tmb-ease);
}
.custom-blog-cards .tm-post-card:hover .et_pb_image_container img,
.tm-blog-cards .tm-post-card:hover .et_pb_image_container img { transform: scale(1.05); }
.custom-blog-cards .tm-post-card .et_overlay,
.tm-blog-cards .tm-post-card .et_overlay { display: none !important; }

/* Body */
.custom-blog-cards .tm-post-body,
.tm-blog-cards .tm-post-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
}

/* Category pills */
.custom-blog-cards .tm-post-cats,
.tm-blog-cards .tm-post-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.custom-blog-cards .tm-post-cats a.tm-post-cat,
.tm-blog-cards .tm-post-cats a.tm-post-cat {
  display: inline-block;
  margin: 0 !important;
  padding: 4px 12px !important;
  border-radius: 10px !important;
  background: var(--tmb-cream) !important;
  color: var(--tmb-deep) !important;
  font-family: 'Roboto', Helvetica, Arial, sans-serif;
  font-size: 12px !important;
  font-weight: 500 !important;
  line-height: 16.8px !important;
  text-decoration: none !important;
  transition: background-color .2s, color .2s;
}
.custom-blog-cards .tm-post-cats a.tm-post-cat:hover,
.tm-blog-cards .tm-post-cats a.tm-post-cat:hover { background: var(--tmb-teal) !important; color: #fff !important; }

/* Title */
.custom-blog-cards .et_pb_blog_posts article.tm-post-card .tm-post-body .entry-title,
.tm-blog-cards .et_pb_blog_posts article.tm-post-card .tm-post-body .entry-title {
  margin: 0 !important;
  padding: 0 !important;
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 22px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  color: var(--tmb-ink) !important;
}
.custom-blog-cards .tm-post-body .entry-title a,
.tm-blog-cards .tm-post-body .entry-title a { color: inherit !important; text-decoration: none; transition: color .2s; }
.custom-blog-cards .tm-post-card:hover .entry-title a,
.tm-blog-cards .tm-post-card:hover .entry-title a { color: var(--tmb-teal) !important; }

/* Date */
.custom-blog-cards .tm-post-date,
.tm-blog-cards .tm-post-date {
  margin: 0 !important;
  padding: 0 !important;
  font-family: 'Roboto', Helvetica, Arial, sans-serif;
  font-size: 13px !important;
  font-weight: 500;
  line-height: 22.1px;
  color: #4a5b5e;
}

/* Excerpt — 3 lines max so cards stay even */
.custom-blog-cards .et_pb_blog_posts article.tm-post-card .tm-post-excerpt,
.tm-blog-cards .et_pb_blog_posts article.tm-post-card .tm-post-excerpt { margin: 0 !important; padding: 0 !important; }
.custom-blog-cards .tm-post-excerpt p,
.tm-blog-cards .tm-post-excerpt p {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 14px !important;
  line-height: 23.8px !important;
  color: var(--tmb-body) !important;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.custom-blog-cards .et_pb_blog_posts.et_grid_module .tm-post-card a.more-link,
.tm-blog-cards .et_pb_blog_posts.et_grid_module .tm-post-card a.more-link { display: none !important; } /* replaced by "Read the Article" */

/* Divider + Read the Article — pinned to the bottom of the card */
.custom-blog-cards .tm-post-footer,
.tm-blog-cards .tm-post-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(6, 79, 86, .2);
}
.custom-blog-cards .tm-post-body .tm-post-excerpt + .tm-post-footer,
.tm-blog-cards .tm-post-body .tm-post-excerpt + .tm-post-footer { margin-top: auto; }
.custom-blog-cards a.tm-post-more,
.tm-blog-cards a.tm-post-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  font-family: 'Roboto', Helvetica, Arial, sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--tmb-teal) !important;
  text-decoration: none !important;
}
.custom-blog-cards .tm-post-arrow,
.tm-blog-cards .tm-post-arrow { display: inline-block; transition: transform .25s var(--tmb-ease); }
.custom-blog-cards .tm-post-card:hover .tm-post-arrow,
.tm-blog-cards .tm-post-card:hover .tm-post-arrow { transform: translate(3px, -3px); }

/* Tablet / phone */
@media (max-width: 980px) {
  .custom-blog-cards .et_pb_blog_posts,
  .tm-blog-cards .et_pb_blog_posts { gap: 24px !important; }
}
@media (max-width: 767px) {
  .custom-blog-cards .tm-post-body,
  .tm-blog-cards .tm-post-body { padding: 20px; }
  .custom-blog-cards .tm-post-body .entry-title,
  .tm-blog-cards .tm-post-body .entry-title { font-size: 20px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .custom-blog-cards article.tm-post-card, .custom-blog-cards .et_pb_image_container img, .custom-blog-cards .tm-post-arrow,
  .tm-blog-cards article.tm-post-card, .tm-blog-cards .et_pb_image_container img, .tm-blog-cards .tm-post-arrow { transition: none !important; }
}
