/* === Gallery Layout === */

.timed-gallery-cat {
  display: flex;
  flex-direction: row-reverse;
  gap: 20px;
}

.timed-gallery-cat .timed-gallery-stack {
  flex: 2;
  /* display: flex; */
  flex-direction: column;
  /* gap: 15px; */
}

.timed-gallery-cat .timed-gallery-main-post {
  flex: 3;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  height: 500px;
}

.timed-gallery-cat .timed-gallery-cat-title span.td-pulldown-size {
  background: #404040;
}

.timed-gallery-cat .timed-gallery-cat-title .block-title {
  border-bottom: 2px solid #404040;
}

.timed-gallery-cat .cfp-posts-button-ctr span.tdm-btn-icon.tdm-btn-icon-svg svg {
  width: 19px;
  height: 10px;
}

.timed-gallery-cat a.timed-btn.cfp-load-more {
  display: flex;
  gap: 15px;
  align-items: center;
}

/* === Main Post Image & Animation === */

.timed-gallery-cat .timed-gallery-main-post img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.timed-gallery-cat .timed-gallery-main-post img.active {
  opacity: 1;
}

/* === Overlay & Category Label === */

.timed-gallery-cat .timed-gallery-main-post .overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1rem;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
}

.timed-gallery-cat .timed-gallery-main-post .category {
  display: inline-block;
  background: #000000a3;
  padding: 0.3rem 0.6rem;
  font-size: var(--smaller-para);
  margin-bottom: 0.5rem;
}

/* === Main Post Titles & Text === */

.timed-gallery-cat .timed-gallery-main-post h3 {
  font-size: var(--title-h3);
  color: white;
  line-height: var(--title-h3-lh);
  margin: 0;
  padding-bottom: 20px;
}

.timed-gallery-cat .timed-gallery-main-post p {
  margin: 0 16px 12px;
  color: var(--lg-grey);
}

/* === Progress Bars === */

.timed-gallery-cat .progress-bar-wrapper {
  display: flex;
  gap: 10px;
  width: 100%;
  height: 4px;
}

.timed-gallery-cat .progress-bar {
  flex: 1;
  background: rgba(255, 255, 255, 0.4);
  position: relative;
  overflow: hidden;
}

.timed-gallery-cat .progress-fill {
  background: #fff;
  height: 100%;
  width: 0%;
  transition: none;
}

.timed-gallery-cat .progress-fill.active {
  animation: fillBar 5s linear forwards;
}

@keyframes fillBar {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

/* === Stack Thumbnails with Text === */

.timed-gallery-cat .timed-gallery-thumb-with-text {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  /* box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); */
  padding: 8px 0;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid var(--lg-grey);
}

.timed-gallery-cat .timed-gallery-thumb-with-text:hover {
  background-color: #f0f0f0;
}

body.custom-dark-mode .timed-gallery-cat .timed-gallery-thumb-with-text:hover p,
body.custom-dark-mode .timed-gallery-cat .timed-gallery-thumb-with-text:hover h4 {
  color: #333 !important;
}

.timed-gallery-cat .timed-gallery-thumb-with-text img {
  width: 90px;
  height: 60px;
  object-fit: cover;
  flex-shrink: 0;
}

.timed-gallery-cat .timed-gallery-thumb-text h3 {
  margin: 0 0 4px;
  font-size: var(--title-h3);
  line-height: var(--title-h3-lh);
  font-weight: 500;
}

body .timed-gallery-cat .timed-gallery-thumb-text h3 {
  font-size: var(--title-h4);
}

/* .timed-gallery-cat-title h4.block-title.td-block-title {
  display: none;
} */

.timed-gallery-cat .timed-gallery-thumb-text p {
  margin: 0;
  font-size: var(--small-para);
  color: var(--lg-grey);
  font-family: "Roboto";
  font-weight: 400;
}

.timed-gallery-cat .timed-gallery-stack .cfp-posts-button-ctr {
  padding-top: 10px;
}

/* === Optional: Individual Thumbnails === */

.timed-gallery-cat .timed-gallery-thumb {
  display: block;
  overflow: hidden;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
  height: 90px;
  cursor: pointer;
}

.timed-gallery-cat .timed-gallery-thumb img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  display: block;
}

/* === Mobile Styles === */

@media (max-width: 1020px) {
  .timed-gallery-cat {
    flex-direction: column-reverse;
  }

  .timed-gallery-cat .timed-gallery-thumb-with-text img {
    display: none;
  }

  .timed-gallery-cat .timed-gallery-thumb-with-text:nth-of-type(2),
  .timed-gallery-cat .timed-gallery-thumb-with-text:nth-of-type(3) {
    display: none;
  }

  .timed-gallery-cat .timed-gallery-main-post {
    flex: 300px;
  }
}
