/* =========================================================
   Homepage News Cards (single Divi Blog module)
   Row class: articleRow1
   ========================================================= */

/* --- Layout: force 3-up grid --- */
.articleRow1 .et_pb_ajax_pagination_container{
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  align-items: stretch;
}

/* Undo Divi float/clear layout so grid actually works */
.articleRow1 .et_pb_ajax_pagination_container > article.et_pb_post{
  float: none !important;
  clear: none !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;  /* Grid gap handles spacing */
}

/* Responsive */
@media (max-width: 980px){
  .articleRow1 .et_pb_ajax_pagination_container{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 767px){
  .articleRow1 .et_pb_ajax_pagination_container{
    grid-template-columns: 1fr;
  }
}

/* --- Card structure: equal heights + pinned button --- */
.articleRow1 article.et_pb_post{
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Card feel */
.articleRow1 article.et_pb_post{
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  overflow: hidden;           /* keeps corners clean */
  padding: 10px !important;
  background: #fff;
}

/* Force padding override for all card instances */
.articleRow1 .et_pb_ajax_pagination_container article.et_pb_post,
.articleRow1 article.et_pb_post.et_pb_blog_item_0_0,
.articleRow1 article.et_pb_post.et_pb_blog_item_0_1,
.articleRow1 article.et_pb_post.et_pb_blog_item_0_2{
  padding: 10px !important;
}

/* --- Featured image: perfect 1:1 square --- */
.articleRow1 .et_pb_post .entry-featured-image-url{
  display: block !important;
  width: 100% !important;
  aspect-ratio: 1 / 1 !important;
  overflow: hidden !important;
  margin: 0 0 14px 0 !important;
  border-radius: 12px;
  position: relative !important;
}

/* Image fills square and centers when cropped */
.articleRow1 .et_pb_post .entry-featured-image-url img{
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* --- Title spacing consistency --- */
.articleRow1 .et_pb_post .entry-title{
  margin: 0 0 10px 0;
  line-height: 1.2;
}

/* --- Content symmetry + button baseline --- */
.articleRow1 .et_pb_post .post-content{
  flex: 1;                    /* fills remaining card height */
  display: flex;
  flex-direction: column;
}

.articleRow1 .et_pb_post .post-content-inner{
  flex: 1;                    /* excerpt area grows evenly */
  margin-bottom: 10px;        /* spacing between excerpt and button */
}

/* Pin the button to bottom so all align */
.articleRow1 .et_pb_post a.more-link{
  margin-top: auto;           /* KEY: pushes it to bottom */
  align-self: flex-start;
  display: inline-block;
  padding: 10px 16px;
  border: 2px solid currentColor;
  text-decoration: none;
  transition: color .4s ease, border-color .4s ease, background .4s ease;
}

/* =========================================================
   Card hover: bottom-fill + lift + invert + subtle shadow
   ========================================================= */

/* tweakable brand color */
:root{
  --ifa-navy: #203248; /* change if you have the exact IFA navy */
}

/* make sure card can host the fill layer */
.articleRow1 article.et_pb_post{
  position: relative;
  transition: transform .4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow .4s cubic-bezier(0.4, 0, 0.2, 1),
              border-color .4s ease;
}

/* the “fill from bottom” layer */
.articleRow1 article.et_pb_post::before{
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ifa-navy);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform .5s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
  pointer-events: none;
}

/* keep all card content above the fill */
.articleRow1 article.et_pb_post > *{
  position: relative;
  z-index: 1;
}

/* hover motion + subtle bottom/right shadow */
.articleRow1 article.et_pb_post:hover{
  transform: translateY(-6px);
  box-shadow: 10px 12px 26px rgba(0,0,0,.12);
  border-color: rgba(255,255,255,.25);
}

/* animate the fill in */
.articleRow1 article.et_pb_post:hover::before{
  transform: scaleY(1);
}

/* invert typography + links */
.articleRow1 article.et_pb_post,
.articleRow1 article.et_pb_post .entry-title,
.articleRow1 article.et_pb_post .entry-title a,
.articleRow1 article.et_pb_post .post-content,
.articleRow1 article.et_pb_post .post-content-inner,
.articleRow1 article.et_pb_post .post-content-inner p,
.articleRow1 article.et_pb_post .post-content-inner a{
  transition: color .4s ease, opacity .4s ease;
}

.articleRow1 article.et_pb_post:hover .entry-title,
.articleRow1 article.et_pb_post:hover .entry-title a,
.articleRow1 article.et_pb_post:hover .post-content,
.articleRow1 article.et_pb_post:hover .post-content-inner,
.articleRow1 article.et_pb_post:hover .post-content-inner p,
.articleRow1 article.et_pb_post:hover .post-content-inner a{
  color: #fff !important;
}

/* button invert to match */
.articleRow1 article.et_pb_post:hover a.more-link{
  color: #fff !important;
  border-color: #fff !important;
  background: transparent;
}

/* optional: button gets a slight “pop” on hover */
.articleRow1 article.et_pb_post:hover a.more-link:hover{
  background: rgba(255,255,255,.12);
}
