/* CSN Series Grid — Full-bleed image with glassmorphism overlay
 * [csn_series_grid] shortcode
 * ================================================== */

.csn-sg-wrap {
  padding: 20px 0;
}

.csn-sg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* Card — defined above with cover image */

.csn-sg-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Cover image — full bleed, cover fit */
.csn-sg-cover {
  width: 100%;
  height: 100%;
  min-height: 500px;
  object-fit: cover;
  object-position: center;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  transition: transform 0.4s ease;
}

.csn-sg-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  min-height: 500px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
}

.csn-sg-card:hover .csn-sg-cover {
  transform: scale(1.05);
}

/* Content — overlay at bottom with gradient starting at 50% */
.csn-sg-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px 18px 20px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.7) 40%, transparent 100%);
  top: 50%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* Title + badge row */
.csn-sg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.csn-sg-title {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.csn-sg-title a {
  color: #ffffff;
  text-decoration: none;
}

.csn-sg-badge {
  padding: 3px 9px;
  background: var(--wpcasterpro-btn-background-color--default--hover);
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
}

/* Tags — glassmorphism pills */
.csn-sg-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 14px;
}

.csn-sg-tag {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  transition: background 0.15s;
}

.csn-sg-card:hover .csn-sg-tag {
  background: rgba(255, 255, 255, 0.2);
}

/* View button */
.csn-sg-btn {
  display: inline-block;
  align-self: flex-start;
  padding: 8px 16px;
  background: #7323dc;
  border-radius: 8px;
  color: #ffffff !important;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background 0.2s, transform 0.15s;
}

.csn-sg-btn:hover {
  background: #5a1aad;
  transform: translateX(3px);
}

/* Pinterest-style: vary heights + masonry offset */
.csn-sg-card:nth-child(3n+1) { min-height: 500px; }
.csn-sg-card:nth-child(3n+1) .csn-sg-cover { min-height: 500px; }
.csn-sg-card:nth-child(3n+2) { min-height: 500px; }
.csn-sg-card:nth-child(3n+2) .csn-sg-cover { min-height: 500px; }
.csn-sg-card:nth-child(3n+3) { min-height: 500px; }
.csn-sg-card:nth-child(3n+3) .csn-sg-cover { min-height: 500px; }

/* Masonry offset: second column shifted up on desktop */
@media (min-width: 901px) {
  .csn-sg-grid {
    align-items: start;
  }
  .csn-sg-card:nth-child(3n+2) {
    transform: translateY(-30px);
  }
  .csn-sg-card:nth-child(3n+2):hover {
    transform: translateY(-36px) scale(1.02);
  }
}

/* Responsive */
@media (max-width: 900px) {
  .csn-sg-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .csn-sg-card {
    min-height: 380px !important;
  }

  .csn-sg-cover {
    min-height: 380px !important;
  }
}

@media (max-width: 600px) {
  .csn-sg-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .csn-sg-card {
    min-height: 350px !important;
  }

  .csn-sg-cover {
    min-height: 350px !important;
  }

  .csn-sg-title {
    font-size: 18px;
  }

  .csn-sg-content {
    padding: 20px 16px 18px;
  }

  .csn-sg-tag {
    font-size: 9px;
    padding: 3px 8px;
  }

  .csn-sg-btn {
    padding: 7px 14px;
    font-size: 11px;
  }
}
