/* =========================================
   Jinrai Post Grid - Frontend Styles
   ========================================= */

.jpgrid {
  display: grid;
  gap: 30px;
  margin: 40px 0;
}

.jpgrid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.jpgrid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.jpgrid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Card */
.jpgrid-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  text-decoration: none;
  color: #1a1a1a;
  display: block;
}

.jpgrid-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

/* Thumbnail */
.jpgrid-card-thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #f3efe0;
}

.jpgrid-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.jpgrid-card:hover .jpgrid-card-thumb img {
  transform: scale(1.05);
}

/* No thumbnail placeholder */
.jpgrid-card-nothumb {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f3efe0 0%, #e8e0d4 100%);
}

.jpgrid-card-nothumb span {
  font-family: 'Noto Serif JP', serif;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: #c49a6c;
  opacity: 0.7;
}

/* Card body */
.jpgrid-card-body {
  padding: 16px 20px 20px;
}

/* Category label */
.jpgrid-card-cat {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #c49a6c;
  background: rgba(196, 154, 108, 0.1);
  padding: 2px 10px;
  border-radius: 3px;
  margin-bottom: 8px;
}

/* Date */
.jpgrid-card-date {
  font-size: 0.75rem;
  color: #888;
  display: block;
  margin-bottom: 6px;
}

/* Title */
.jpgrid-card-title {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #1a1a1a;
}

/* Excerpt */
.jpgrid-card-excerpt {
  font-size: 0.8rem;
  color: #666;
  line-height: 1.7;
  margin-top: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Empty state */
.jpgrid-empty {
  text-align: center;
  color: #888;
  padding: 40px 0;
}

/* Pagination */
.jpgrid-pagination {
  text-align: center;
  margin-top: 40px;
  display: flex;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}

.jpgrid-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #e0dcd4;
  border-radius: 4px;
  text-decoration: none;
  color: #1a1a1a;
  font-size: 0.85rem;
  transition: all 0.3s;
}

.jpgrid-pagination .page-numbers:hover {
  background: #c49a6c;
  border-color: #c49a6c;
  color: #fff;
}

.jpgrid-pagination .page-numbers.current {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #fff;
}

/* =========================================
   Responsive
   ========================================= */

@media (max-width: 1024px) {
  .jpgrid-cols-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .jpgrid-cols-3,
  .jpgrid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .jpgrid { gap: 16px; }
  .jpgrid-card-body { padding: 12px 14px 16px; }
  .jpgrid-card-title { font-size: 0.85rem; }
}

@media (max-width: 480px) {
  .jpgrid-cols-2,
  .jpgrid-cols-3,
  .jpgrid-cols-4 { grid-template-columns: 1fr; }
  .jpgrid { gap: 20px; }
}
