/* Scope toàn bộ style trong .single-story để tránh đụng theme */
:root { --main: #e11d48; --second: #0ea5e9; }


/* Fix khung trắng của theme: .blog-post-item height:100% -> phá layout */
body.single-story .blog-post-item { height: auto !important; max-height: none !important; overflow: visible !important; }


/* ====== Archive grid cho /truyen/ ====== */
.archive.post-type-archive-story .story-archive-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
gap: 20px;
margin: 20px 0 30px;
}
.archive.post-type-archive-story .story-card {
background: #fff;
border-radius: 12px;
overflow: hidden;
box-shadow: 0 2px 10px rgba(0,0,0,.06);
display: flex; flex-direction: column;
}
.archive.post-type-archive-story .story-card .thumb { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; }
.archive.post-type-archive-story .story-card .thumb--empty { background: #f4f4f5; width:100%; aspect-ratio: 3 / 2; }
.archive.post-type-archive-story .story-card .meta { padding: 12px 14px; }
.archive.post-type-archive-story .story-card .title { font-size: 18px; margin: 0; line-height: 1.45; }
.archive.post-type-archive-story .story-card .title a { text-decoration: none; color: inherit; }


.single-story { margin-top: 30px; margin-bottom: 30px; }


.single-story .story__chapter { margin: 0; padding: 0; list-style: none; }
.single-story .story__chapter li { margin-bottom: 10px; }
.single-story .story__chapter li a { font-size: 22px; text-decoration: none; }
.single-story .story__chapter li a:hover,
.single-story .nav-previous a:hover,
.single-story .nav-next a:hover { text-decoration: none; color: var(--main); }


.single-story .story__title-chapter { padding-left: 10px; border-left: 4px solid var(--main); font-size: 30px; text-transform: uppercase; margin: 16px 0; }
.single-story .story__title { text-align: center; margin-bottom: 15px; }
.single-story .story__title > a { text-transform: uppercase; text-decoration: none; font-weight: bold; font-size: 25px; color: var(--main); }


.single-story .story__form { text-align: center; }
.single-story .story__form select { font-size: 20px; padding: 15px; border: 1px solid #eee; max-width: 100%; }


.single-story .story__pagination { display: flex; justify-content: space-between; align-items: center; flex-direction: row; gap: 12px; margin: 20px 0 25px; }
.single-story .story__pagination > * { flex-basis: 33%; max-width: 33%; text-align: center; }
.single-story .story__pagination-next > a,
.single-story .story__pagination-prev > a { display: inline-block; padding: 15px 30px; background-color: var(--main); color: #fff; border-radius: 50px; }
.single-story .story__pagination-prev > a { background-color: var(--second); }


/* Ẩn ở single post thông thường nếu theme dùng chung class */
.single-post .story__form,
.single-post .story__pagination { display: none; }


@media (max-width: 767px) {
.archive.post-type-archive-story .story-archive-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.single-story .story__pagination { flex-direction: column; justify-content: center; }
.single-story .story__pagination > * { max-width: 100%; flex-basis: 100%; margin: 7px 0; }
}

/* ===== Archive grid ===== */
.story-archive__head { display:flex; justify-content:flex-end; margin: 20px 0 10px; }
.story-archive__title { font-size: 28px; font-weight: 700; }

.story-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.story-card {
  background: #fff;                /* nền trắng */
  border-radius: 12px;             /* bo góc */
  border: 1px solid #eee;          /* viền nhạt */
  box-shadow: 0 3px 8px rgba(0,0,0,0.08); /* đổ bóng nhẹ */
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.story-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.story-card__thumb { display:block; aspect-ratio: 5 / 3; background:#fafafa; }
.story-card__img { width:100%; height:100%; object-fit:cover; display:block; }
.story-card__img--placeholder { width:100%; height:100%; display:flex; align-items:center; justify-content:center; font-size:52px; font-weight:700; color:#fff; background:#ddd; }

.story-card__body { padding:12px; }
.story-card__title { margin:0 0 6px; font-size:18px; line-height:1.35; }
.story-card__title a { text-decoration:none; color:#111; }
.story-card__title a:hover { color: var(--main); }
.story-card__excerpt { margin:0; color:#666; font-size:14px; }

.story-archive__pagination { margin: 22px 0; text-align:center; }

@media (max-width: 991px){
  .story-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px){
  .story-grid { grid-template-columns: 1fr; }
}

/* Bảo đảm ô trắng hiện đúng kể cả khi theme đè */
.archive.post-type-archive-story .story-card{
  background:#fff !important;
  border:1px solid #eee !important;
  box-shadow:0 2px 10px rgba(0,0,0,.06) !important;
  border-radius:12px !important;
}

/* ========== Fix card /truyen/: bìa sách không bị cắt, khung 3:4 ========== */
/* Khung bìa 3:4, canh giữa */
.archive.post-type-archive-story .story-card .thumb,
.archive.post-type-archive-story .story-card__thumb{
  display:flex; align-items:center; justify-content:center;
  width:100%;
  aspect-ratio: 3 / 4;
  background:#f7f7f8;
  overflow:hidden;
  border-radius:12px 12px 0 0;
}

/* Ảnh chỉ thu nhỏ, KHÔNG phóng to (tránh mờ) */
.archive.post-type-archive-story .story-card .thumb img,
.archive.post-type-archive-story .story-card__img{
  width:100%; height:100%;
  object-fit: scale-down !important; /* chỉ scale down, không upscale */
  object-position: center;
  display:block;
}


/* Card tổng thể */
.archive.post-type-archive-story .story-card{
  background:#fff;
  border:1px solid #eee;
  border-radius:12px;
  overflow:hidden;
  box-shadow:0 2px 10px rgba(0,0,0,.06);
  display:flex;
  flex-direction:column;
}

/* Tiêu đề cân đối hơn */
.archive.post-type-archive-story .story-card .meta,
.archive.post-type-archive-story .story-card__body{
  padding:12px 14px;
}
.archive.post-type-archive-story .story-card .title,
.archive.post-type-archive-story .story-card__title{
  margin:0;
  font-size:16px; line-height:1.4; text-align:center;
}

.archive.post-type-archive-story .story-card{ transition: box-shadow .2s ease, transform .2s ease; }
.archive.post-type-archive-story .story-card:hover{
  transform: translateY(-3px);
  box-shadow:0 8px 20px rgba(0,0,0,.12);
}

