/* ==== Comic Grid — Optimized + Gradient Underline ==== */
.all-comics-section {
  background-color: #fff;
  padding: 60px 20px;
}

.comics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Comic Card */
.comic-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  min-height: 320px;
}

/* Gradient frame border */
.comic-card::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 20px;
  background: linear-gradient(135deg, #8a00ff 0%, #ff2aa6 100%);
  z-index: -2;
}
.comic-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: #fff;
  z-index: -1;
}

/* Link + Image setup */
.comic-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.comic-image {
  width: 100%;
  height: 100%;
  display: block;
  overflow: hidden;
  background: #eee;
}

.comic-image img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* fills the frame nicely */
  display: block;
  transition: transform 0.45s ease;
}

.comic-card:hover .comic-image img {
  transform: scale(1.04);
}

/* Overlay (hover effect) */
.comic-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  background: rgba(255, 255, 255, 0.65); /* lighter overlay - lets image show through */
  transition: opacity 0.3s ease;
  border-radius: 16px;
  text-align: center;
}

.comic-card:hover .comic-overlay {
  opacity: 1;
}

/* Title */
.comic-title {
  position: relative;
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
  padding: 0 8px;
  text-align: center;
  transition: color 0.25s ease;
}

/* Hover: darker text + gradient underline */
.comic-card:hover .comic-title {
  color: #2a0044; /* dark purple for contrast */
}

/* Gradient underline on hover */
.comic-card:hover .comic-title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  width: 60%;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, #a200ff, #ff3fa4);
  animation: underlineFadeIn 0.3s ease forwards;
}

@keyframes underlineFadeIn {
  from {
    opacity: 0;
    width: 0;
  }
  to {
    opacity: 1;
    width: 60%;
  }
}

/* Hover lift */
.comic-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
}

/* Accessibility: keyboard focus */
.comic-link:focus {
  outline: 3px solid rgba(138, 0, 255, 0.16);
  outline-offset: 4px;
  border-radius: 12px;
}

/* Responsive */
@media (max-width: 768px) {
  .comics-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
    padding: 0 6px;
  }

  .comic-card {
    min-height: 260px;
    border-radius: 12px;
  }

  .comic-title {
    font-size: 1.1rem;
  }
}
