/* ================================
   ANIME X NOVEL - MANGA GRID 3.0.0
   Layout aprimorado e responsivo
   ================================ */

/* ================================
   ANIME X NOVEL - MANGA GRID 3.0.1
   Layout aprimorado e responsivo
   ================================ */

/* GRID CONTROL */
.manga-grid {
  display: grid;
  grid-template-columns: repeat(var(--columns, 4), 1fr);
  gap: 12px;
  align-items: stretch;
}

/* CARD */
.manga-card {
  background: #111;
  border: 1px solid #b22222;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease-in-out;
}
.manga-card:hover {
  transform: scale(1.03);
}

/* THUMB */
.manga-thumb {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}
.manga-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-bottom: 2px solid #b22222;
}

/* OVERLAY */
.manga-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 6px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.85),
    rgba(0, 0, 0, 0.35) 60%,
    rgba(0, 0, 0, 0) 100%
  );
  text-align: center;
}
.manga-cat {
  display: inline-block;
  background: #007bff;
  color: #fff;
  font-weight: 700;
  font-size: clamp(9px, 1vw, 13px);
  padding: 3px 7px;
  border-radius: 6px;
  margin-bottom: 4px;
  white-space: nowrap;
}
.manga-title {
  color: #fff;
  font-size: clamp(11px, 1.2vw, 15px);
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* CHAPTER LIST */
.manga-chapters {
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: auto;
}
.manga-chapters .chapter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 123, 255, 0.95);
  color: #fff;
  text-decoration: none;
  padding: clamp(3px, 0.6vw, 7px) clamp(5px, 0.8vw, 10px);
  border-radius: 6px;
  font-weight: 700;
  font-size: clamp(9px, 0.9vw, 13px);
  box-sizing: border-box;
  line-height: 1.1;
  transition: background 0.2s ease;
}
.manga-chapters .chapter-item:hover {
  background: rgba(0, 123, 255, 1);
}

/* --- Capítulo e Data --- */
.chapter-item .chapter-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin-right: 4px;
  font-weight: 800;
  color: #fff !important;
  font-size: clamp(9px, 0.9vw, 13px) !important;
}

/* Uniformiza Light-Novel e Web-Novel */
.manga-card.light-novel .chapter-item .chapter-title,
.manga-card.web-novel .chapter-item .chapter-title {
  font-size: clamp(9px, 0.9vw, 13px) !important;
  color: #fff !important;
  font-weight: 800 !important;
}

/* Data com contraste mais claro */
.chapter-item .chapter-date {
  font-size: clamp(8px, 0.8vw, 11px);
  color: #ececec !important; /* cinza muito claro */
  opacity: 1;
  margin-left: 5px;
  flex: 0 0 auto;
  font-weight: 600;
}

.chapter-item .new-badge {
  background: #e60023;
  color: #fff;
  font-size: clamp(7px, 0.7vw, 10px);
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 4px;
  line-height: 1.2;
  flex: 0 0 auto;
}

/* --- Correções para mobile --- */
@media (max-width: 600px) {
  .chapter-item {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .chapter-item .chapter-title {
    flex: 1 1 100%;
    font-size: clamp(11px, 3.2vw, 14px) !important;
    color: #fff;
    margin-bottom: 2px;
  }

  .manga-card.light-novel .chapter-item .chapter-title,
  .manga-card.web-novel .chapter-item .chapter-title {
    font-size: clamp(11px, 3.2vw, 14px) !important;
  }

  .chapter-item .chapter-date {
    flex: 0 0 auto;
    font-size: clamp(8px, 2.6vw, 11px);
    color: #f0f0f0 !important; /* ainda mais claro no mobile */
    margin-left: 0;
    opacity: 0.95;
  }

  .chapter-item .new-badge {
    font-size: clamp(7px, 2.3vw, 9px);
    margin-left: 6px;
  }
}

/* --- Responsividade extra (tablets) --- */
@media (max-width: 900px) {
  .manga-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 600px) {
  .manga-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 400px) {
  .manga-grid {
    grid-template-columns: repeat(1, 1fr);
  }
}