/* Phase 2 homepage components — TopAcquirers, DirectoryDiscovery,
   LatestAcquisitions, FeaturedAcquisition. All selectors are prefixed
   .hp2- (component-scoped) so nothing collides with global.css or other
   in-flight work on this repo. */

.hp2-heading {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 3rem 0 1rem;
}

/* ---------- TopAcquirers ---------- */

.hp2-top-acquirers {
  margin: 2.5rem 0;
}

.hp2-ta-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.hp2-ta-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.hp2-ta-table thead th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
  white-space: nowrap;
}

.hp2-ta-table tbody tr.hp2-ta-row {
  position: relative;
  border-bottom: 1px solid var(--border);
  transition: background-color 180ms var(--ease-out-cubic, ease);
}
.hp2-ta-table tbody tr.hp2-ta-row:last-child {
  border-bottom: none;
}
.hp2-ta-table tbody tr.hp2-ta-row:hover {
  background: var(--bg-raised);
}

.hp2-ta-table td {
  padding: 0;
  height: 44px;
  vertical-align: middle;
}

.hp2-ta-table td.hp2-ta-count,
.hp2-ta-table td.hp2-ta-year {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.hp2-ta-rank {
  width: 3rem;
  padding-left: 0.85rem !important;
}
.hp2-ta-rank .hp2-ta-row-link {
  display: block;
  padding: 0.5rem 0.5rem 0.5rem 0.85rem;
  font-family: var(--mono);
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
}
/* Stretch the rank link to cover the whole row — one focusable link per
   row for accessibility, whole-row click target visually. */
.hp2-ta-row-link::after {
  content: "";
  position: absolute;
  inset: 0;
}
.hp2-ta-row-link {
  position: relative;
}

.hp2-ta-name {
  position: relative;
  padding: 0.5rem 0.85rem !important;
  font-weight: 600;
}

.hp2-ta-bar {
  display: block;
  margin-top: 0.3rem;
  height: 3px;
  width: var(--pct, 0%);
  max-width: 100%;
  background: var(--border);
  border-radius: 2px;
  transition: background-color 200ms ease;
}
.hp2-ta-row:hover .hp2-ta-bar {
  background: var(--accent);
}

.hp2-ta-count {
  padding: 0.5rem 0.85rem !important;
  text-align: right;
}

.hp2-ta-latest,
.hp2-ta-year {
  padding: 0.5rem 0.85rem !important;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.hp2-ta-arrow {
  padding: 0.5rem 0.85rem !important;
  color: var(--muted);
  text-align: right;
  transition: color 180ms ease, transform 180ms ease;
}
.hp2-ta-row:hover .hp2-ta-arrow {
  color: var(--accent);
  transform: translateX(2px);
}

@media (max-width: 720px) {
  .hp2-ta-table .hp2-ta-latest,
  .hp2-ta-table .hp2-ta-year {
    display: none;
  }
}

/* ---------- DirectoryDiscovery: real listings grouped by type, shown as a
   card grid (a landing-page section, not an embedded table) — reuses the
   .avatar/.pill primitives from global.css so a card still looks like the
   exact same entity the row-based /directory list shows. ---------- */

.hp-groups {
  margin: 2.5rem 0;
}
.hp-group-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.hp-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.hp-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-raised);
  text-decoration: none;
  color: var(--fg);
  transition: border-color 180ms ease, transform 180ms ease;
}
.hp-card:hover {
  border-color: var(--muted);
  transform: translateY(-2px);
}
@media (prefers-reduced-motion: reduce) {
  .hp-card { transition: none; }
  .hp-card:hover { transform: none; }
}
.hp-card-avatar-wrap { display: block; width: 32px; height: 32px; }
.hp-card-avatar-logo { display: block; width: 32px; height: 32px; border-radius: 7px; object-fit: contain; background: var(--bg); }
.hp-card-avatar-fallback { width: 32px; height: 32px; font-size: 0.7rem; }
.hp-card-name {
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hp-card-subtitle {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hp-card-tags {
  margin-top: auto;
  padding-top: 0.15rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
@media (max-width: 900px) {
  .hp-card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .hp-card-grid { grid-template-columns: 1fr; }
}
.hp-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.5rem;
}
.hp-group-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}
.hp-group-count {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
}
.hp-group-viewall {
  flex-shrink: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-dim);
  text-decoration: none;
  white-space: nowrap;
}
.hp-group-viewall:hover {
  text-decoration: underline;
}
.hp-group-alldir {
  display: inline-block;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-dim);
  text-decoration: none;
}
.hp-group-alldir:hover {
  text-decoration: underline;
}

/* ---------- LatestAcquisitions ---------- */

.hp2-latest {
  margin: 2.5rem 0;
}

.hp2-la-list {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.hp2-la-row {
  display: grid;
  grid-template-columns: 2.2fr auto auto auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.85rem;
  min-height: 40px;
  border-bottom: 1px solid var(--border);
  font-size: 0.83rem;
  transition: background-color 180ms ease;
}
.hp2-la-row:last-child {
  border-bottom: none;
}
.hp2-la-row:hover {
  background: var(--bg-raised);
}

.hp2-la-parties {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  overflow: hidden;
}

.hp2-la-buyer {
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hp2-la-buyer:hover {
  color: var(--accent-dim);
}

.hp2-la-arrow {
  color: var(--muted);
  flex-shrink: 0;
}

.hp2-la-target {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hp2-la-date {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
  white-space: nowrap;
}

.hp2-la-industry {
  font-size: 0.76rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.hp2-la-price {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
  text-align: right;
}

.hp2-la-source {
  font-size: 0.76rem;
  color: var(--accent-dim);
  text-decoration: none;
  white-space: nowrap;
  text-align: right;
}
.hp2-la-source:hover {
  text-decoration: underline;
}
.hp2-la-source-empty {
  min-width: 1px;
}

.hp2-la-viewall {
  display: inline-block;
  margin-top: 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-dim);
  text-decoration: none;
}
.hp2-la-viewall:hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .hp2-la-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "parties price"
      "meta    source";
    row-gap: 0.15rem;
    padding: 0.4rem 0.85rem;
    min-height: unset;
  }
  .hp2-la-parties { grid-area: parties; }
  .hp2-la-price { grid-area: price; }
  .hp2-la-source { grid-area: source; }
  .hp2-la-date,
  .hp2-la-industry {
    grid-area: meta;
    display: inline;
  }
  .hp2-la-date::after {
    content: " · ";
  }
}

/* ---------- FeaturedAcquisition ---------- */

.hp2-featured {
  margin: 2.5rem 0;
}

.hp2-fa-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem;
  background: var(--bg-raised);
}

.hp2-fa-parties {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.hp2-fa-buyer,
.hp2-fa-target {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.hp2-fa-target {
  color: var(--accent-dim);
}

.hp2-fa-down {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  margin: 0.1rem 0;
}

.hp2-fa-meta {
  margin-top: 0.85rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.hp2-fa-dot {
  opacity: 0.6;
}

.hp2-fa-line {
  margin: 0.75rem 0 1.25rem;
  font-size: 0.92rem;
  color: var(--fg);
}

.hp2-fa-strip {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, black 92%, transparent 100%);
  mask-image: linear-gradient(to right, black 92%, transparent 100%);
}
.hp2-fa-strip::-webkit-scrollbar {
  display: none;
}

.hp2-fa-strip-card {
  flex: 0 0 auto;
  min-width: 150px;
  max-width: 190px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.hp2-fa-strip-target {
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hp2-fa-strip-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.hp2-fa-cta {
  display: inline-block;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .hp2-ta-table tbody tr.hp2-ta-row,
  .hp2-ta-bar,
  .hp2-ta-arrow,
  .hp2-dd-block,
  .hp2-la-row,
  .hp2-la-viewall {
    transition: none !important;
  }
  .hp2-ta-row:hover .hp2-ta-arrow {
    transform: none;
  }
}
