/* ==========================================================================
   Scrolling Cards — vertical scroll list of record cards (firms, cases, reviews)
   ========================================================================== */
.scrolling-cards {
  position: relative;
  width: 100%;
  height: calc(3 * (200px + var(--space-4)));
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-2) 0;
  border-radius: var(--radius-lg);
}

/* Fills the space left under the page header instead of stopping at a fixed
   three-card height, so the list uses the whole viewport. The offset is the
   main-content padding plus everything above the scroller. */
.scrolling-cards--fill {
  --scrolling-cards-offset: 140px;
  height: calc(100vh - var(--topbar-height) - var(--scrolling-cards-offset));
  min-height: 260px;
}

/* With a tab bar between the header and the list (the firm directory's All /
   Renewals Due), the scroller starts ~58px lower. */
.scrolling-cards--fill.scrolling-cards--tabbed {
  --scrolling-cards-offset: 198px;
}

.scrolling-cards__container {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: 0 var(--space-1);
}

/* Slightly tighter stacking so the taller scroller shows another card. */
.scrolling-cards--fill .scrolling-cards__container {
  gap: var(--space-3);
}

.scrolling-cards__card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  width: 100%;
}

.scrolling-cards__card {
  position: relative;
  width: 100%;
  min-height: 120px;
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xs);
  padding: var(--space-5);
  transition: border-color var(--transition-base), box-shadow var(--transition-base),
    transform var(--transition-fast);
  display: flex;
  flex-direction: row;
  gap: var(--space-4);
  justify-content: space-between;
}

.scrolling-cards__card:hover {
  transform: translateY(-2px);
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-md);
}

.scrolling-cards__logo {
  width: 180px;
}

.scrolling-cards__logo-image {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.scrolling-cards__card-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-right: var(--space-4);
}

.scrolling-cards__card-column--wide,
.scrolling-cards__card-column--extra-wide {
  flex: 1;
  min-width: 200px;
}

.scrolling-cards__card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.scrolling-cards__card-title {
  font-size: var(--font-size-large);
  font-family: var(--font-family-bold);
  color: var(--color-primary-dark);
  margin: 0;
}

.scrolling-cards__card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  justify-content: space-between;
}

.scrolling-cards__card-content h4 {
  font-family: var(--font-family-bold);
  color: var(--color-text);
}

.scrolling-cards__card-content p {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--font-size-medium);
}

.scrolling-cards__card-content .sidenav__link-icon {
  min-width: 20px;
  width: 20px;
  height: 20px;
  margin-right: var(--space-2);
  flex-shrink: 0;
  color: var(--color-primary-green);
}

.scrolling-cards__card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-2);
  font-size: var(--font-size-small);
  color: var(--color-text-muted);
}

.scrolling-cards__scroll-indicator {
  position: absolute;
  bottom: var(--space-2);
  right: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
  padding: var(--space-1) var(--space-2);
  background-color: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-sm);
  opacity: 0.8;
}

.scrolling-cards__empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 160px;
  padding: var(--space-8);
  color: var(--color-text-muted);
  background-color: var(--color-surface);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
}

.scrolling-cards__edit-icon {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-full);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  transition: background-color var(--transition-base), transform var(--transition-fast);
  z-index: 1;
}

.scrolling-cards__edit-icon:hover {
  background-color: var(--color-surface-sunken);
  transform: scale(1.05);
}

.scrolling-cards__edit-icon-svg {
  color: var(--color-text-muted);
}

.scrolling-cards__edit-icon:hover .scrolling-cards__edit-icon-svg {
  color: var(--color-primary-dark);
}
