/* ─────────────────────────────────────────────────────────
   AniHive — Category & Tag archive (Layout C · Sidebar Index)
   Reuses .ah-work-card from anihive-homepage.css.
   ───────────────────────────────────────────────────────── */

.ah-archive { background: var(--ah-paper); color: var(--ah-ink); max-width: 1400px; margin: 0 auto; }
.ah-archive * { box-sizing: border-box; }

/* ── INTRO ── */
.ah-archive__intro { padding: 64px 60px 24px; }
.ah-archive__back {
  display: inline-block; margin-bottom: 28px;
  font-size: 13px; font-weight: 600; color: var(--ah-honey-dark);
  text-decoration: none; transition: color .2s;
}
.ah-archive__back:hover { color: var(--ah-honey-deep); }

.ah-archive__title {
  font-family: "Fraunces", Georgia, serif; font-weight: 500;
  font-size: clamp(56px, 7vw, 88px); line-height: .95;
  letter-spacing: -0.03em; margin: 0; color: var(--ah-ink);
}
.ah-archive__title em { font-style: italic; color: var(--ah-honey-deep); font-weight: 500; }

.ah-archive__lede {
  margin: 18px 0 0; font-size: 16px; line-height: 1.55;
  color: #3A2E22; max-width: 48ch;
}

/* ── SPLIT ── */
.ah-archive__split {
  padding: 40px 60px 100px;
  display: grid; grid-template-columns: 260px 1fr;
  gap: 48px; align-items: flex-start;
}

/* ── SIDEBAR ── */
.ah-archive__sidebar { position: sticky; top: 32px; }

.ah-archive__counter {
  display: inline-block; padding: 10px 16px;
  background: var(--ah-honey); color: var(--ah-ink);
  border: 2px solid var(--ah-ink); border-radius: 14px;
  font-size: 12px; font-weight: 700;
  transform: rotate(-2deg);
  box-shadow: 3px 3px 0 var(--ah-ink);
  margin-bottom: 28px;
}

.ah-archive__sub-eyebrow {
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  font-weight: 700; color: var(--ah-honey-dark);
  margin-bottom: 14px;
}

.ah-archive__list { list-style: none; padding: 0; margin: 0 0 32px; }
.ah-archive__list-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(26,20,16,.10);
  font-family: "Fraunces", Georgia, serif; font-size: 17px;
  color: #3A2E22; font-weight: 500;
}
.ah-archive__list-item a {
  flex: 1; color: inherit; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
  transition: color .2s;
}
.ah-archive__list-item a:hover { color: var(--ah-honey-deep); }
.ah-archive__list-item.is-active { color: var(--ah-ink); font-weight: 700; }
.ah-archive__list-item.is-active a .ah-archive__list-name { font-style: italic; }
.ah-archive__list-arrow { color: var(--ah-honey); font-weight: 700; }
.ah-archive__list-count {
  font-family: Inter, sans-serif; font-size: 11px;
  color: #7A6850; font-weight: 600; letter-spacing: .04em;
}

.ah-archive__tagcloud {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 32px;
}
.ah-archive__chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--ah-cream);
  border: 1.5px solid rgba(26,20,16,.14);
  font-size: 12px; font-weight: 600; color: var(--ah-ink);
  text-decoration: none;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), background .2s, border-color .2s;
}
.ah-archive__chip:hover { transform: rotate(-2deg) scale(1.06); background: var(--ah-paper); border-color: var(--ah-ink); }
.ah-archive__chip.is-active {
  background: var(--ah-honey); border-color: var(--ah-ink);
  box-shadow: 2px 2px 0 var(--ah-ink); transform: rotate(-1deg);
}
.ah-archive__chip-count { font-size: 10px; color: #7A6850; }
.ah-archive__chip.is-active .ah-archive__chip-count { color: var(--ah-honey-dark); }

.ah-archive__hint {
  display: block;
  padding: 20px 18px; background: var(--ah-cream);
  border: 1.5px dashed rgba(26,20,16,.30); border-radius: 14px;
  font-size: 13px; color: #3A2E22; line-height: 1.5;
  text-decoration: none; transition: transform .25s, box-shadow .25s, background .2s;
}
a.ah-archive__hint:hover { transform: translateY(-2px); box-shadow: 4px 4px 0 var(--ah-ink); background: var(--ah-paper); }
.ah-archive__hint-title {
  font-family: "Fraunces", Georgia, serif; font-style: italic;
  font-size: 18px; color: var(--ah-ink); margin-bottom: 6px;
}

/* ── GRID ── */
.ah-archive__grid-wrap { min-width: 0; } /* prevent grid blowout */
.ah-archive__grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px;
}
.ah-archive__grid .ah-work-card:nth-child(2n):hover { transform: translateY(-10px) rotate(1deg) scale(1.02); }

/* ── INFINITE SCROLL SENTINEL ── */
.ah-archive__more {
  margin-top: 56px;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  min-height: 80px;
}
.ah-archive__more-btn {
  padding: 18px 32px; background: transparent;
  border: 2.5px solid var(--ah-ink); border-radius: 999px;
  font-size: 14px; font-weight: 700; color: var(--ah-ink);
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--ah-ink);
  display: inline-flex; gap: 8px; align-items: center;
  transition: transform .2s, box-shadow .2s, background .2s, color .2s;
  cursor: pointer;
}
.ah-archive__more-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ah-ink);
  background: var(--ah-honey); color: var(--ah-ink);
}
.ah-archive__more.is-loading .ah-archive__more-btn { opacity: .35; pointer-events: none; }

.ah-archive__more-loading { display: none; gap: 8px; align-items: center; }
.ah-archive__more.is-loading .ah-archive__more-loading { display: inline-flex; }
.ah-archive__dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--ah-honey);
  box-shadow: 0 0 0 1.5px var(--ah-ink);
  animation: ah-archive-pulse 1.2s ease-in-out infinite;
}
.ah-archive__dot:nth-child(2) { animation-delay: .15s; }
.ah-archive__dot:nth-child(3) { animation-delay: .30s; }
@keyframes ah-archive-pulse {
  0%, 100% { transform: scale(.6); opacity: .4; }
  50%      { transform: scale(1);  opacity: 1; }
}

.ah-archive__more-end {
  font-family: "Fraunces", Georgia, serif; font-style: italic;
  font-size: 20px; color: var(--ah-honey-dark);
  text-align: center;
}

/* ── EMPTY ── */
.ah-archive__empty {
  padding: 80px 40px; text-align: center;
  background: var(--ah-cream); border-radius: 18px;
}
.ah-archive__empty-emoji { font-size: 56px; animation: ah-bob 4s ease-in-out infinite; display: inline-block; }
.ah-archive__empty-title {
  font-family: "Fraunces", Georgia, serif;
  font-size: 36px; font-weight: 500; letter-spacing: -.02em;
  margin: 16px 0 8px; color: var(--ah-ink);
}
.ah-archive__empty-body { font-size: 14px; color: #5A4A38; margin: 0 auto 24px; max-width: 42ch; }

/* ── RESPONSIVE ── */
@media (max-width: 960px) {
  .ah-archive__split { grid-template-columns: 1fr; gap: 32px; }
  .ah-archive__sidebar { position: static; }
  .ah-archive__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .ah-archive__intro { padding: 40px 24px 16px; }
  .ah-archive__split { padding: 24px 24px 60px; }
  .ah-archive__title { font-size: 44px; }
  .ah-archive__grid { grid-template-columns: 1fr; gap: 24px; }
}
