/*
 Theme Name:   Astra Child - Bento Design
 Theme URI:    https://css11.xyz
 Description:  Astra 子主题 - 便当盒布局 + 三列卡片
 Author:       You
 Template:     astra
 Version:      1.0.0
 Text Domain:  astra-child-bento
*/

/* ===== 占位符通用 ===== */
.bento-icon-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: linear-gradient(135deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 200%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.bento-card:hover .bento-icon-placeholder {
  background: rgba(255,255,255,.3);
}

.bento-icon-emoji {
  font-size: 28px;
  line-height: 1;
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}
.bento-card:hover .bento-icon-emoji {
  transform: scale(1.2);
}

.image-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 200%;
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ===== 通用标题 ===== */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 28px;
  letter-spacing: -0.02em;
}

/* ===== Bento Grid 分类区（在 header 下方独立区域） ===== */
.categories-section--top {
  padding: 32px 0 16px;
  background: #f8f9fc;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
}

.bento-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 10px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  cursor: pointer;
  transition: transform .35s cubic-bezier(.4,0,.2,1), box-shadow .35s cubic-bezier(.4,0,.2,1), background .35s cubic-bezier(.4,0,.2,1);
  min-height: 90px;
  text-align: center;
  overflow: hidden;
  text-decoration: none;
  color: #1a1a2e;
  border: none;
}
.bento-card:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 12px 40px rgba(0,0,0,.1), 0 4px 12px rgba(0,0,0,.06);
  background: #6366f1;
  color: #fff;
}
.bento-card:active {
  transform: translateY(-2px) scale(.98);
}
.bento-card:hover .bento-count { color: rgba(255,255,255,.8); }

.bento-card--large,
.bento-card--tall {
  grid-column: span 1;
  grid-row: span 1;
}

.bento-icon {
  width: 40px; height: 40px;
  color: #6366f1;
  transition: transform .35s cubic-bezier(.4,0,.2,1), color .35s cubic-bezier(.4,0,.2,1);
}
.bento-card:hover .bento-icon {
  transform: scale(1.15) rotate(-4deg);
  color: #fff;
}
.bento-icon svg { width: 100%; height: 100%; }

.bento-label { font-size: 1rem; font-weight: 600; letter-spacing: .01em; }
.bento-count { font-size: .78rem; color: #6b7280; transition: color .35s; }

/* 筛选激活态 */
.bento-card.active {
  background: #6366f1;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(99,102,241,.12);
  transform: translateY(-3px);
}
.bento-card.active .bento-icon { color: #fff; }
.bento-card.active .bento-count { color: rgba(255,255,255,.8); }

/* ===== 三列网站卡片区 ===== */
.sites-section {
  padding: 32px 0 64px;
}

.site-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.site-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  transition: transform .35s cubic-bezier(.4,0,.2,1), box-shadow .35s cubic-bezier(.4,0,.2,1);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.site-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0,0,0,.1), 0 4px 12px rgba(0,0,0,.06);
}
.site-card:active { transform: translateY(-2px); }

.site-card__image {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: #e5e7eb;
}
.site-card__image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.4,0,.2,1);
}
.site-card:hover .site-card__image img { transform: scale(1.08); }
.site-card__image::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.04), transparent 50%);
  pointer-events: none;
}

.site-card__info {
  padding: 18px 20px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.site-card__title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.4;
}
.site-card__desc {
  font-size: .875rem;
  color: #6b7280;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== 响应式 ===== */
@media (max-width: 960px) {
  .bento-grid { grid-template-columns: repeat(4, 1fr); }
  .bento-card { min-height: 80px; padding: 14px 8px; }
  .site-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .bento-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .bento-card { min-height: 72px; padding: 12px 8px; gap: 4px; }
  .bento-icon-placeholder { width: 24px; height: 24px; border-radius: 5px; }
  .bento-label { font-size: .75rem; }
  .bento-count { font-size: .65rem; }
  .site-grid { grid-template-columns: 1fr; gap: 18px; }
  .site-card__info { padding: 14px 16px 18px; }
  .site-card__title { font-size: 1.05rem; }
}
@media (max-width: 380px) {
  .bento-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .bento-card { min-height: 60px; padding: 10px 6px; }
}
