/* Archive page — blog index + tag pages.
   Reuses .more-posts__* row styles from home.css for the post list. */

.archive { padding: 3.5rem 0 4rem; }

.archive__header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}
.archive__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-text-label);
  margin-bottom: 0.5rem;
}
.archive__title {
  font-family: var(--font-title);
  font-weight: 500;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -0.005em;
  line-height: 1.2;
  margin-bottom: 0.4rem;
}
.archive__subtitle {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--color-text-label);
}

.archive__filters {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

/* Inline variant — used by the /blog/ archive: search left, tag pills
   wrap on a single horizontal axis. Falls back to stacked on narrow
   widths via the existing 600px breakpoint below. */
.archive__filters--inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
}
.archive__filters--inline .archive__search-wrap {
  flex: 1 1 240px;
  min-width: 0;
}
.archive__filters--inline .archive__tags {
  flex: 1 1 auto;
  justify-content: flex-end;
}

/* Wrap establishes a positioning context for the placeholder overlay
   and the vanish canvas. Width behavior matches the bare input it
   replaced — flex item in the inline filter row, full width on mobile. */
.archive__search-wrap {
  position: relative;
  width: 100%;
}

.archive__search {
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 300;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  outline: none;
  transition: border-color var(--transition-fast);
}

/* Cycling placeholder overlay — sits on top of the input, hidden when
   the input has focus + content. Single-line, ellipsised so a long
   prompt never overflows the rounded shell. */
.archive__search-placeholder {
  position: absolute;
  left: 1.1rem;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--color-text-muted);
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.18s ease;
}

/* Two-stage cycle: exit slides up + fades out, enter slides up from
   below + fades in. Names are scoped (-arsp-) so they can't collide
   with any other keyframes elsewhere in the stylesheet bundle. */
.archive__search-placeholder.is-exiting {
  animation: arsp-exit 0.28s ease forwards;
}
.archive__search-placeholder.is-entering {
  animation: arsp-enter 0.3s ease forwards;
}
@keyframes arsp-exit {
  from { transform: translate(0, -50%); opacity: 1; }
  to   { transform: translate(0, calc(-50% - 14px)); opacity: 0; }
}
@keyframes arsp-enter {
  from { transform: translate(0, calc(-50% + 10px)); opacity: 0; }
  to   { transform: translate(0, -50%); opacity: 1; }
}

/* Vanish canvas — covers the input exactly. Invisible at rest; the
   JS sets opacity to 1 when the particle storm starts, back to 0
   once every particle has faded. pointer-events: none so the canvas
   doesn't block input focus or selection. */
.archive__search-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s linear;
}
.archive__search:focus { border-color: var(--color-red); }
.archive__search::placeholder { color: var(--color-text-muted); }

.archive__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.archive__tags-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-right: 0.25rem;
}

/* Tag filter pill button — extends .tag-pill behavior with an active state */
.archive__tag-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text-muted);
  background: transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.archive__tag-pill:hover {
  border-color: var(--color-red);
  color: var(--color-text);
}
.archive__tag-pill.active {
  background: var(--color-red);
  border-color: var(--color-red);
  color: var(--color-text);
  box-shadow: 0 0 12px var(--color-red-glow);
}

.archive__count {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 0.6rem;
}

.archive__empty {
  padding: 2.5rem 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.archive__loading {
  padding: 3rem 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

@media (max-width: 600px) {
  .archive { padding: 2.5rem 0 3rem; }
  .archive__filters { gap: 0.75rem; }
  .archive__filters--inline {
    flex-direction: column;
    align-items: stretch;
  }
  /* Reset the desktop flex rule — in a column container, flex-grow now
     operates on the vertical axis and would stretch the wrap to fill
     the column height, which combined with border-radius: 999px gives
     the giant-oval bug. */
  .archive__filters--inline .archive__search-wrap { flex: 0 0 auto; }
  .archive__filters--inline .archive__tags { justify-content: flex-start; }
}
