/* FCS Magazine — Archive (tag.hbs + author.hbs) styles.
 *
 * Spec: Doc #163 §2c (tag) + §2d (author).
 * Shared shell — both templates render the same .archive-item rows; only
 * the .archive-header treatment differs (tag → paper-deep + eyebrow,
 * author → paper-soft + avatar).
 *
 * Inheritance principles (Doc #163 §0):
 *   - Lift V7 tokens, fonts, eyebrow, .blog-all arrow vocabulary verbatim.
 *   - Chronological list, NOT card grid (Doc #163 §2c — archives need
 *     browsing, not curation; the homepage carries the grid vocabulary).
 *   - No reveal animations on list rows; static archives feel calmer
 *     without staged reveals.
 */

/* ─── 1. ARCHIVE HEADER ────────────────────────────────────
 * Tag header sits on paper-deep, author header on paper-soft. The eyebrow
 * partial fronts both. Title scale clamp(2.5rem, 5vw, 4rem) per Doc #163 §2c
 * — half a step below the page hero so a tag archive never competes with
 * a static page's masthead.
 */
.archive-header {
  background: var(--paper-deep);
  padding: 7rem 0 4.5rem;
  position: relative;
  overflow: hidden;
}

.archive-header--author {
  background: var(--paper-soft);
}

.archive-header::before {
  /* Subtle ambient gradient — same vocabulary as page-hero/cover-spread,
   * tuned down so archive heads feel quieter than static-page heads. */
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 22% 30%, rgba(207, 125, 95, 0.05) 0%, transparent 45%),
    radial-gradient(circle at 78% 75%, rgba(91, 140, 106, 0.04) 0%, transparent 45%);
  pointer-events: none;
}

.archive-header-inner {
  position: relative;
  z-index: 2;
}

.archive-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--ink);
  margin-top: 1.25rem;
}

.archive-description {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--ink-mute);
  margin-top: 1.25rem;
  max-width: 640px;
}

.archive-count {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-whisper);
  margin-top: 1.5rem;
}

/* Author-header overrides — avatar + supporting links */
.archive-author-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1.5rem;
  display: block;
  background: var(--sage-wash);
  border: 2px solid var(--paper);
  box-shadow: var(--shadow-soft);
}

.archive-author-avatar--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--copper);
  background: var(--copper-pale);
}

.archive-author-location {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-mute);
  margin-top: 0.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.archive-author-links {
  display: flex;
  gap: 1.25rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.archive-author-links a {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--copper-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.2s ease;
}

.archive-author-links a:hover {
  color: var(--copper);
}

/* ─── 2. ARCHIVE LIST ──────────────────────────────────────
 * Chronological rows. Each row: 220×140 image rail (left), title +
 * excerpt + meta (right). Row padding 2rem 0, hairline rule between rows,
 * last row no rule.
 */
.archive-list {
  background: var(--paper);
  padding: 4rem 0 5rem;
  position: relative;
  z-index: 2;
}

.archive-item {
  position: relative;
  border-bottom: 1px solid var(--rule);
}

.archive-item:last-child {
  border-bottom: none;
}

.archive-item-link {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  padding: 2rem 0;
  color: inherit;
  align-items: flex-start;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.archive-item-link:hover {
  /* Whole-row lift — subtle. The image scale + title color shift carry
   * most of the affordance. */
  transform: translateX(2px);
}

.archive-item-image {
  width: 220px;
  height: 140px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--sage-wash);
  position: relative;
}

.archive-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.archive-item-link:hover .archive-item-image img {
  transform: scale(1.02);
}

.archive-item-image-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--copper);
  background: var(--copper-pale);
}

.archive-item-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.25rem;
}

.archive-item-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.archive-item-date {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-whisper);
}

.archive-item-category {
  /* Lifts .blog-card-category vocabulary from blog.css */
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(207, 125, 95, 0.12);
  color: var(--copper);
}

.archive-item-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--ink);
  transition: color 0.2s ease;
}

.archive-item-link:hover .archive-item-title {
  color: var(--copper-dark);
}

.archive-item-excerpt {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink-mute);
  margin-top: 0.5rem;
  /* 2-line clamp keeps row rhythm consistent across long/short excerpts. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.archive-empty {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--paper-soft);
  border: 1px dashed var(--rule);
  border-radius: 4px;
  font-family: var(--font-body);
  color: var(--ink-mute);
}

/* ─── 3. PAGINATION ────────────────────────────────────────
 * Lifts the .blog-all arrow vocabulary so prev/next reads continuous with
 * the homepage "View All Articles" CTA. Doc #163 §2c.
 */
.archive-pagination {
  background: var(--paper);
  padding: 1rem 0 6rem;
  position: relative;
  z-index: 2;
}

.archive-pagination-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.archive-pagination-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  background: white;
  color: var(--copper);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--rule);
  white-space: nowrap;
}

.archive-pagination-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-float);
  color: var(--copper-dark);
}

.archive-pagination-prev:hover svg { transform: translateX(-3px); }
.archive-pagination-next:hover svg { transform: translateX(3px); }
.archive-pagination-link svg { transition: transform 0.3s ease; }

.archive-pagination-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.archive-pagination-status {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* ─── 4. RESPONSIVE ────────────────────────────────────────
 * Doc #163 §3: at <640px, image stacks above text; image becomes 100%×200px.
 */
@media (max-width: 768px) {
  .archive-header { padding: 5.5rem 0 3rem; }
  .archive-list { padding: 2.5rem 0 3rem; }
}

@media (max-width: 640px) {
  .archive-item-link {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .archive-item-image {
    width: 100%;
    height: 200px;
  }
  .archive-pagination-inner {
    justify-content: center;
  }
  .archive-pagination-status {
    order: -1;
    width: 100%;
    text-align: center;
  }
}
