/* public/css/archiveRankingBoard.css
   Phase 6.4 — dedicated stylesheet for the shared, read-only archive
   ranking renderer (View/Shared/archiveRankingBoard.ejs), used by both the
   public Shared Personal Archive ranking page
   (View/Public/creatorPublication.ejs) and the private Personal Archives
   preview (View/Accounts/PersonalArchivePreview.ejs).

   Every selector is scoped under .archive-ranking-board, mirroring the
   existing .public-rankings-page / public/css/publicRankings.css
   convention -- nothing here can affect the authenticated, editable board
   (View/RankingsV2/RankingsBoard.ejs's .player-row/.rank-cell__pill/
   .position-chip/... classes in style.css), which this file never selects
   or overrides. Position-chip colors are copied from style.css's
   .position-chip--* palette for visual consistency, not inherited or
   shared, so an editable-board color change can never leak here and a
   change here can never leak there. Reuses the site's existing --df-*
   custom properties. */

.archive-ranking-board {
  color: var(--df-text-light);
}

.archive-ranking-board__meta {
  margin-bottom: 1rem;
}

.archive-ranking-board__source-label {
  margin: 0 0 .25rem;
  font-weight: 600;
  color: var(--df-text-light);
}

.archive-ranking-board__source-explainer {
  font-weight: 400;
  font-size: .85rem;
  color: rgba(219, 211, 190, .65);
}

.archive-ranking-board__description {
  margin: .5rem 0 0;
  color: rgba(219, 211, 190, .85);
}

.archive-ranking-board__empty,
.archive-ranking-board__empty-filter {
  padding: 1.25rem .25rem;
  color: rgba(219, 211, 190, .7);
}

/* Filter / section pills — visually identical pattern to
   public/css/publicRankings.css's .pr-filter-btn, copied rather than
   shared so either can evolve independently. */
.archive-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1rem;
}

.archive-filter-pill {
  border: 1px solid rgba(141, 240, 176, .24);
  background: rgba(255, 255, 255, .03);
  color: rgba(244, 239, 226, .84);
  border-radius: 999px;
  padding: .35rem .85rem;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.archive-filter-pill:hover {
  border-color: rgba(141, 240, 176, .44);
  color: #f4efe2;
}

.archive-filter-pill:focus-visible {
  outline: 2px solid var(--df-GoblinGold);
  outline-offset: 2px;
}

.archive-filter-pill[aria-pressed="true"] {
  background: rgba(141, 240, 176, .16);
  border-color: rgba(141, 240, 176, .48);
  color: #8df0b0;
}

/* Sections (grouped layout) */
.archive-ranking-section {
  margin-bottom: 1.5rem;
}

.archive-ranking-section[hidden] {
  display: none;
}

.archive-ranking-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .5rem;
}

.archive-ranking-section__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: var(--df-text-light);
}

.archive-ranking-section__count {
  font-size: .8rem;
  color: rgba(219, 211, 190, .6);
}

/* Rows */
.archive-player-rows {
  border-top: 1px solid rgba(219, 211, 190, .1);
}

.archive-player-row {
  display: grid;
  grid-template-columns: 48px 1fr 90px;
  align-items: center;
  gap: .75rem;
  padding: .65rem .5rem;
  border-bottom: 1px solid rgba(219, 211, 190, .08);
}

.archive-player-row[hidden] {
  display: none;
}

.archive-player-row__rank {
  display: inline-flex;
  min-width: 40px;
  justify-content: center;
  padding: .3rem .4rem;
  border-radius: 999px;
  background: rgba(141, 240, 176, .12);
  border: 1px solid rgba(141, 240, 176, .18);
  font-weight: 700;
  color: #8df0b0;
  font-size: .85rem;
}

.archive-player-row__identity {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
}

.archive-player-row__image,
.archive-player-row__image-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: none;
  object-fit: cover;
  background: rgba(255, 255, 255, .06);
}

.archive-player-row__name-block {
  min-width: 0;
}

.archive-player-row__name {
  display: block;
  font-weight: 600;
  color: var(--df-text-light);
  text-decoration: none;
  overflow-wrap: anywhere;
}

a.archive-player-row__name:hover,
a.archive-player-row__name:focus-visible {
  color: #8df0b0;
}

a.archive-player-row__name:focus-visible {
  outline: 2px solid var(--df-GoblinGold);
  outline-offset: 2px;
}

.archive-player-row__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
  margin-top: .2rem;
}

.archive-player-row__pill {
  font-size: .78rem;
  color: rgba(219, 211, 190, .65);
}

.archive-player-row__value {
  display: inline-flex;
  justify-self: end;
  min-width: 54px;
  justify-content: center;
  padding: .3rem .55rem;
  border-radius: 999px;
  background: var(--df-accent);
  font-weight: 700;
  color: var(--df-text-light);
  font-size: .85rem;
}

/* Position chips — copied palette from style.css's .position-chip--*,
   never referencing that class so the editable board's own chip styling
   can change independently. */
.archive-position-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.3rem;
  padding: .1rem .4rem;
  border-radius: 999px;
  border: 1px solid rgba(219, 211, 190, .16);
  background: rgba(255, 255, 255, .04);
  color: #f4efe2;
  font-size: .68rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.archive-position-chip--qb { background: rgba(115, 185, 255, .14); border-color: rgba(115, 185, 255, .28); color: #cfe6ff; }
.archive-position-chip--rb { background: rgba(141, 240, 176, .12); border-color: rgba(141, 240, 176, .28); color: #c9f5d8; }
.archive-position-chip--wr { background: rgba(255, 174, 117, .12); border-color: rgba(255, 174, 117, .28); color: #ffd8b6; }
.archive-position-chip--te { background: rgba(233, 174, 255, .12); border-color: rgba(233, 174, 255, .28); color: #f2d6ff; }
.archive-position-chip--dl { background: rgba(255, 120, 120, .12); border-color: rgba(255, 120, 120, .28); color: #ffc9c9; }
.archive-position-chip--lb { background: rgba(255, 214, 102, .12); border-color: rgba(255, 214, 102, .28); color: #ffe8ad; }
.archive-position-chip--db { background: rgba(88, 224, 216, .12); border-color: rgba(88, 224, 216, .28); color: #bdf7f2; }
.archive-position-chip--picks { background: rgba(205, 236, 30, .14); border-color: rgba(205, 236, 30, .34); color: var(--df-GoblinGold); }

/* Mobile — stacked rows instead of a horizontally-scrolled grid.
   Verified against 375x812 in browser QA (see final report). */
@media (max-width: 576px) {
  .archive-player-row {
    grid-template-columns: 40px 1fr;
    grid-template-areas:
      "rank identity"
      "rank value";
    row-gap: .35rem;
    padding: .75rem .5rem;
  }

  .archive-player-row__rank {
    grid-area: rank;
    align-self: start;
  }

  .archive-player-row__identity {
    grid-area: identity;
  }

  .archive-player-row__value {
    grid-area: value;
    justify-self: start;
  }

  .archive-filter-bar {
    gap: .4rem;
  }
}
