/* Blog archive page extras — featured-latest hero card + year-grouped
   post rows. Loaded by all pages (cheap; only renders if matching DOM
   is present), but the markup is only emitted by ArchiveView (/blog/).
   Tag pages and collection pages keep the plain .more-posts__list. */


/* ---------- Featured (latest) ----------
   Translucent dark well with a red border halo, mirroring the
   sidebar-panel / super-featured aesthetic from home.css/featured.css
   so the card reads as part of the same visual family. */

.archive-featured {
  margin-bottom: 2.2rem;
}

.archive-featured__card {
  position: relative;
  display: block;
  background: rgba(36, 26, 28, 0.45);
  border: 1px solid rgba(179, 0, 0, 0.22);
  border-radius: 14px;
  padding: 1.6rem 1.8rem 1.5rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 0 18px rgba(139, 0, 0, 0.12);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform var(--transition-base),
              border-color var(--transition-base),
              box-shadow var(--transition-base);
}
.archive-featured__card:hover {
  border-color: rgba(179, 0, 0, 0.45);
  box-shadow: 0 0 28px rgba(139, 0, 0, 0.22);
  transform: translateY(-2px);
}

/* Left-edge red accent bar that pulses bright on hover — same red-on-
   dark vocabulary as the analytics card accents. */
.archive-featured__accent {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--color-red-bright) 0%, var(--color-red) 60%, transparent 100%);
  opacity: 0.85;
  transition: opacity var(--transition-base);
}
.archive-featured__card:hover .archive-featured__accent { opacity: 1; }

.archive-featured__body { position: relative; }

.archive-featured__eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-label);
}

.archive-featured__badge {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  background: var(--color-red);
  color: var(--color-text);
  border-radius: 999px;
  letter-spacing: 0.16em;
  box-shadow: 0 0 10px var(--color-red-glow);
}

.archive-featured__date { color: var(--color-date); }

.archive-featured__readtime {
  position: relative;
  padding-left: 0.85rem;
  color: var(--color-text-muted);
}
.archive-featured__readtime::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 4px;
  background: var(--color-text-muted);
  border-radius: 50%;
  transform: translateY(-50%);
  opacity: 0.6;
}

.archive-featured__title {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  letter-spacing: -0.01em;
  line-height: 1.22;
  color: var(--color-text);
  margin: 0 0 0.7rem;
  transition: color var(--transition-fast);
}
.archive-featured__card:hover .archive-featured__title { color: var(--color-text); }

.archive-featured__tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.85rem;
}

.archive-featured__excerpt {
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 300;
  line-height: 1.65;
  color: var(--color-text-secondary);
  margin: 0 0 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Scramble-reveal chars inside the excerpt. Unrevealed chars share
   the same body font so geometry stays stable — only color + a faint
   blur differs, so the line doesn't reflow as chars settle. */
.archive-featured__excerpt .encrypted-text-char {
  color: var(--color-red-bright);
  opacity: 0.55;
  filter: blur(0.4px);
  transition: color 180ms ease, opacity 180ms ease, filter 180ms ease;
}
.archive-featured__excerpt .encrypted-text-char.revealed {
  color: inherit;
  opacity: 1;
  filter: none;
}

.archive-featured__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-red-bright);
  transition: color var(--transition-fast), transform var(--transition-fast);
}
.archive-featured__card:hover .archive-featured__cta {
  color: var(--color-text);
  transform: translateX(3px);
}


/* ---------- Year-grouped list ----------
   Wrapped in the same translucent well used by the featured card +
   sidebar panels, so the archive reads as a contained surface rather
   than rows floating on the dot field. */

.archive__list-grouped {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: rgba(36, 26, 28, 0.4);
  border: 1px solid rgba(179, 0, 0, 0.18);
  border-radius: 14px;
  padding: 1.2rem 1.3rem 1.4rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 0 18px rgba(139, 0, 0, 0.1);
}

.archive-year {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.archive-year__header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.4rem 0 0.5rem;
  margin-bottom: 0.25rem;
}

.archive-year__label {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-text);
  white-space: nowrap;
}

.archive-year__line {
  flex: 0 0 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-red) 60%, var(--color-red-bright));
}

.archive-year__count {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-left: auto;
}

.archive-year__items {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* Single row in the grouped list. Variant of .more-posts__item with
   a left accent bar that slides into view on hover. */
.archive-row {
  position: relative;
  display: grid;
  grid-template-columns: 75px 1fr auto auto;
  align-items: baseline;
  gap: 1.1rem;
  padding: 0.85rem 1.1rem 0.85rem 1rem;
  border: 1px solid transparent;
  border-radius: 4px;
  text-decoration: none;
  transition: background var(--transition-base),
              border-color var(--transition-base),
              padding var(--transition-base);
}

.archive-row__bar {
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 2px;
  background: var(--color-red-bright);
  border-radius: 2px;
  opacity: 0;
  transform: scaleY(0.4);
  transform-origin: center;
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.archive-row:hover {
  background: var(--color-red-subtle);
  border-color: var(--color-border);
  padding-left: 1.4rem;
}
.archive-row:hover .archive-row__bar {
  opacity: 1;
  transform: scaleY(1);
}

.archive-row__date {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--color-date);
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.archive-row__title {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--color-text-secondary);
  line-height: 1.4;
  transition: color var(--transition-fast);
}
.archive-row:hover .archive-row__title { color: var(--color-text); }

.archive-row__tags {
  display: inline-flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.archive-row__arrow {
  font-size: 0.85rem;
  color: var(--color-red);
  opacity: 0;
  transform: translateX(-5px);
  transition: opacity var(--transition-base), transform var(--transition-base);
}
.archive-row:hover .archive-row__arrow {
  opacity: 1;
  transform: translateX(0);
}


/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  .archive-featured__card { padding: 1.3rem 1.3rem 1.2rem; }
  .archive-featured__eyebrow { gap: 0.55rem; font-size: 0.58rem; }
  .archive-featured__readtime { padding-left: 0.6rem; }
}

@media (max-width: 600px) {
  .archive-featured { margin-bottom: 1.5rem; }
  /* Stack date / title / tags vertically on mobile. The previous
     1fr auto layout squeezed long titles into the title column when
     tags were present, breaking words mid-syllable. Single-column
     gives the title the full row width; tags hang below, left-aligned
     under the title where they read like meta data rather than
     competing with it for horizontal space. */
  .archive-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
    padding: 0.8rem 0.9rem;
  }
  .archive-row:hover { padding-left: 1.1rem; }
  .archive-row__title { font-size: 0.95rem; line-height: 1.35; }
  .archive-row__tags {
    justify-content: flex-start;
    margin-top: 0.1rem;
  }
  .archive-row__arrow { display: none; }
  .archive-year__header { gap: 0.6rem; }
  .archive-year__label { font-size: 0.9rem; }
}
