/* === PODSTAWY === */
.custom-gallery-posts {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.custom-gallery-posts li,
.custom-gallery-posts article {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.custom-gallery-posts.processed li,
.custom-gallery-posts.processed article {
  opacity: 1;
  transform: translateY(0);
}

/* RESETY STYLÓW KADENCE */
.wp-block-kadence-posts.kb-posts ul.kadence-posts-list.kb-posts-style-unboxed > li.kb-post-list-item,
.wp-block-kadence-posts.kb-posts ul.kadence-posts-list.kb-posts-style-unboxed li.kb-post-list-item article.entry {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

/* KONTEKST POZYCJONOWANIA MINIATURY */
.post-thumbnail-inner {
  position: relative !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  z-index: 1 !important;
}

/* OBRAZEK */
.post-thumbnail-inner img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  position: relative !important;
  z-index: 1 !important;
}

/* === GRADIENT === */
.post-thumbnail-inner .custom-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 65%);
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 2;
  pointer-events: none;
}

.kb-post-list-item:hover .custom-gradient,
.kb-post-list-item:focus-within .custom-gradient {
  opacity: 1;
}

/* === TEKST === */
.custom-title-overlay {
  position: absolute;
  bottom: 16px;
  left: 0;
  width: 100%;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  z-index: 3;
}

.custom-title-link {
  color: #fff;
  font-weight: 300;
  font-size: 13px;
  text-decoration: none;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
  pointer-events: auto;
}

.kb-post-list-item:hover .custom-title-overlay,
.kb-post-list-item:focus-within .custom-title-overlay {
  opacity: 1;
  transform: translateY(0);
}

/* UKRYJ DOMYŚLNE NAGŁÓWKI */
.entry-header {
  display: none !important;
}

/* === RESPONSYWNOŚĆ === */
@media (max-width: 1024px) {
  .custom-gallery-posts { grid-template-columns: repeat(3,1fr) !important; }
}
@media (max-width: 768px) {
  .custom-gallery-posts { grid-template-columns: repeat(2,1fr) !important; }
}
@media (max-width: 480px) {
  .custom-gallery-posts { grid-template-columns: 1fr !important; }
}
