/* ================================
   LIST.CSS
   — Styling for the main profile list
   ================================ */

/* ============ LIST CONTAINER ============ */

#list {
  position: absolute;
  top: 0; /* avoid initial gap; JS sets correct top based on header height */
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  background: var(--color-blue-bg);
  -webkit-overflow-scrolling: touch;
  padding: var(--space-xs);
}

/* ============ ROW STYLING ============ */

.row {
  display: flex;
  --row-item-size: calc((100vh / 7) - (var(--space-xs) * 2));
  align-items: center;
  width: 100%;
  height: calc(100vh / 7);
  padding: var(--space-xs) var(--space-sm);
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 8px;
  margin-bottom: var(--space-xxs);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.row.propose-row {
  height: auto !important; /* allow this row to expand with its contents */
  min-height: calc(100vh / 7);
  padding: var(--space-sm) var(--space-sm);
  align-items: flex-start;
}

@media (max-width: 480px) {
  .row.propose-row {
    height: auto;
    padding: var(--space-md) var(--space-sm);
  }
}

.row:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.row:active {
  transform: translateY(0);
}

/* ============ PROFILE IMAGE ============ */

.pic {
  width: var(--row-item-size);
  height: var(--row-item-size);
  border-radius: 8px;
  margin-right: var(--space-sm);
  object-fit: cover;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.pic:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ============ UPVOTE BUTTON ============ */

.upBtn {
  width: calc(var(--row-item-size) - 8px);
  height: calc(var(--row-item-size) - 8px);
  margin-right: var(--space-sm);
  background-size: contain;
  background-repeat: no-repeat;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  background-color: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.upBtn:hover {
  transform: scale(1.1);
  filter: brightness(1.3);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  background-color: rgba(255, 255, 255, 0.2);
}

.upBtn:active {
  transform: scale(0.95);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ============ PROFILE TEXT ============ */

.bio {
  flex: 1;
  font-size: 1.05rem;
  line-height: 1.4em;
  position: relative;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  padding-right: var(--space-sm);
  letter-spacing: 0.01em;
}

/* ============ TEXT COLUMN & NAME STYLING ============ */

.text {
  flex: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0; /* allows truncation/ellipsis */
  height: var(--row-item-size); /* match image height */
}

/* Prominent name line */
.name {
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1.2;
  margin-bottom: 3px;
  color: var(--color-text, #fff); /* high-contrast on dark bg */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  letter-spacing: 0.01em;
  align-self: start; /* top of the text column */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Prevent .bio from stretching vertically inside .text */
.text .bio {
  align-self: center; /* vertically center bio within space below the name */
}

/* ============ LIST FOOTER (SISTER SITES) ============ */
.site-footer {
  margin: var(--space-lg) 0 var(--space-md);
  padding: var(--space-sm);
  color: var(--color-text-subtle);
  font-size: 0.9rem;
  border-top: 1px solid var(--color-border);
  opacity: 0.85;
}

.site-footer a {
  color: inherit;
  text-decoration: underline;
  opacity: 0.9;
}

.site-footer a:hover {
  opacity: 1;
}

/* ================================
   ANIMATION STABILIZATION DURING PAGE ZOOMS
   — Reduce Chrome wide-viewport stutter as rows re-enter view
   ================================ */
html.animating #list {
  will-change: transform, opacity;
  backface-visibility: hidden;
  transform: translateZ(0);
  contain: paint;
}

/* Prevent hover/transition churn while the page zoom is running */
html.animating .row,
html.animating .row .pic,
html.animating .row .upBtn {
  transition: none !important;
  transform: none !important;
  box-shadow: none !important;
}
html.animating .row:hover {
  transform: none !important;
}

/* Block hover/active interactions on list during zoom to avoid rapid state flips */
html.animating #list,
html.animating .row,
html.animating .row .pic,
html.animating .row .upBtn {
  pointer-events: none !important;
}

/* Propose row: allow text column to grow and not be capped to row-item-size */
.row.propose-row .text {
  height: auto !important;      /* override .text height clamp */
  min-height: var(--row-item-size);
  overflow: visible;
}
