/* =========================================================
   HOME / TEMPLATES - Latest Articles (Divi Blog module + Theme Builder)
   Focus: Title hover must be smooth, same weight, same everywhere
   ========================================================= */

:root{
  --fff-blue: #4267b2;
  --fff-blue-dark: #314c8a;
  --fff-text: #111827;
  --fff-excerpt: #4b5563;
  --fff-meta: #6b7280;
  --fff-border: #e5e7eb;
  --fff-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
  --fff-shadow-hover: 0 16px 30px rgba(15, 23, 42, 0.12);
}

/* =========================================================
   1) Layout grid only (safe to keep .et_pb_blog_grid here)
   ========================================================= */

.fff-home-blog .et_pb_blog_grid .et_pb_ajax_pagination_container,
.fff-home-blog .et_pb_blog_grid .et_pb_salvattore_content{
  display: block !important;
  margin: 0 !important;
}

.fff-home-blog .et_pb_blog_grid .column{
  padding: 0 1rem 2.5rem;
  box-sizing: border-box;
}

/* 4 columns desktop */
@media (min-width: 981px){
  .fff-home-blog .et_pb_salvattore_content[data-columns]::before{
    content: "4 .column.size-1of4" !important;
  }
  .fff-home-blog .column.size-1of4{
    width: 24% !important;
    margin-right: 1%;
  }
}

/* Mobile spacing */
@media (max-width: 767px){
  .fff-home-blog .et_pb_blog_grid .column{
    padding: 0 0 1.75rem;
  }
}

/* =========================================================
   2) Card styles (DO NOT depend on .et_pb_blog_grid)
   Works in Theme Builder loops too
   ========================================================= */

#page-container .fff-home-blog .et_pb_post{
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--fff-border);
  box-shadow: var(--fff-shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

/* Hover card */
#page-container .fff-home-blog .et_pb_post:hover{
  transform: translateY(-4px);
  border-color: rgba(66, 103, 178, 0.45);
  box-shadow: var(--fff-shadow-hover);
}

/* Image */
#page-container .fff-home-blog .et_pb_image_container,
#page-container .fff-home-blog .entry-featured-image-url{
  margin: 0 !important;
}

#page-container .fff-home-blog .et_pb_image_container img,
#page-container .fff-home-blog .entry-featured-image-url img{
  display: block;
  width: 100%;
  height: auto;
}

/* Shared inner padding */
#page-container .fff-home-blog .et_pb_post .entry-title,
#page-container .fff-home-blog .et_pb_post .post-meta,
#page-container .fff-home-blog .et_pb_post .post-content{
  padding-left: 1.15rem;
  padding-right: 1.15rem;
}

/* =========================================================
   3) Title: smooth hover, NO weight jump, consistent in Theme Builder
   Key idea: lock font-weight on both states and animate only color
   ========================================================= */

#page-container .fff-home-blog .et_pb_post .entry-title{
  margin: 1.1rem 0 0.45rem;
  font-size: 1.02rem;
  line-height: 1.15;
  font-weight: 700;
  text-align: justify;
}

/* Base link style */
#page-container .fff-home-blog .et_pb_post .entry-title a{
  color: var(--fff-text) !important;
  text-decoration: none !important;

  /* Lock weight to avoid Divi changing it on hover */
  font-weight: 700 !important;

  /* Smooth transition (this is what you are missing in Theme Builder) */
  transition: color 0.18s ease !important;

  /* Some Divi templates apply text-shadow or other effects */
  text-shadow: none !important;
}

/* Hover via card hover OR link hover */
#page-container .fff-home-blog .et_pb_post:hover .entry-title a,
#page-container .fff-home-blog .et_pb_post .entry-title a:hover{
  color: var(--fff-blue) !important;
  font-weight: 700 !important; /* keep exact same thickness */
}

/* Optional: nicer accessibility focus */
#page-container .fff-home-blog .et_pb_post .entry-title a:focus-visible{
  outline: 2px solid rgba(66, 103, 178, 0.55);
  outline-offset: 2px;
  border-radius: 3px;
}

/* =========================================================
   4) Meta row
   ========================================================= */

#page-container .fff-home-blog .et_pb_post .post-meta{
  margin-bottom: 0.75rem;
  padding-bottom: 0.55rem;
  font-size: 0.7rem;
  line-height: 1.1rem;
  color: var(--fff-meta) !important;
  border-bottom: 1px solid var(--fff-border);
  --meta-icon: var(--fff-blue);
}

/* =========================================================
   5) Excerpt
   ========================================================= */

#page-container .fff-home-blog .et_pb_post .post-content{
  flex: 1 1 auto;
  margin: 0 0 0.4rem;
  padding: 0 1.15rem 0.5rem;
  font-size: 0.84rem;
  text-align: justify;
  line-height: 1.5;
  color: var(--fff-excerpt);
}

#page-container .fff-home-blog .et_pb_post .post-content p{
  margin: 0 0 0.3rem;
}

#page-container .fff-home-blog .et_pb_post .post-content p:first-of-type{
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

#page-container .fff-home-blog .et_pb_post .post-content p:not(:first-of-type){
  display: none;
}

/* =========================================================
   6) Read more
   ========================================================= */

#page-container .fff-home-blog .et_pb_post .more-link,
#page-container .fff-home-blog .et_pb_post a.more-link{
  align-self: flex-start;
  margin: 0 1.15rem 0.1rem;
  padding: 0.4rem 0;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fff-blue) !important;
  border-bottom: 1px solid rgba(66, 103, 178, 0.4);
  text-decoration: none !important;
  transition: color 0.18s ease, border-color 0.18s ease !important;
}

#page-container .fff-home-blog .et_pb_post .more-link:hover,
#page-container .fff-home-blog .et_pb_post a.more-link:hover{
  color: var(--fff-blue-dark) !important;
  border-bottom-color: rgba(49, 76, 138, 0.9);
}

/* =========================================================
   7) Meta icons (date, author, categories)
   ========================================================= */

#page-container .fff-home-blog .post-meta .author a::before,
#page-container .fff-home-blog .post-meta > a::before,
#page-container .fff-home-blog .post-meta .published::before{
  margin-right: 4px;
  font-family: "ETmodules";
  font-weight: 400;
  color: var(--meta-icon);
  speak: none;
}

/* author */
#page-container .fff-home-blog .post-meta .author a::before{ content: "\e08a"; }
/* category */
#page-container .fff-home-blog .post-meta > a::before{ content: "\e078"; }
/* date */
#page-container .fff-home-blog .post-meta .published::before{ content: "\e023"; }

/* =========================================================
   8) Pagination (WP PageNavi)
   ========================================================= */

#page-container .fff-home-blog .wp-pagenavi{
  float: none !important;
  clear: both;
  width: 100% !important;
  max-width: 100%;
  margin: 1.5rem auto 0;
  padding: 0 0 0.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  text-align: center !important;
}

#page-container .fff-home-blog .wp-pagenavi a,
#page-container .fff-home-blog .wp-pagenavi span{
  float: none !important;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 0.4rem;
  font-size: 0.78rem;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #4b5563;
  text-decoration: none;
  box-sizing: border-box;
}

#page-container .fff-home-blog .wp-pagenavi span.current{
  background: var(--fff-blue);
  border-color: var(--fff-blue);
  color: #ffffff;
  font-weight: 600;
}

#page-container .fff-home-blog .wp-pagenavi a:hover{
  background: #e5ecfb;
  border-color: var(--fff-blue);
  color: #1f2933;
}
