/* ===== /recent-saves page (recentSavesPage.js) =====
   Layout modeled directly on the People page (.people-page/.people-body/.people-rows/
   .people-sidebar, people.css) -- own class names here (same "each page gets its own
   semantically-named classes with the same shared layout mechanics" convention profile.js's own
   .profile-body/.profile-main/.profile-sidebar already follows), per direct request ("2/3 1/3
   layout... so the list is in the 2/3 like the people page"). */

.recent-saves-page {
  display: block; /* overrides .cards-grid's default 2-column grid, same fix .people-page needs */
  padding-left: 40px;
  padding-bottom: 24px;
}

.recent-saves-body {
  display: flex;
  gap: clamp(24px, 4vw, 56px);
  align-items: flex-start;
}

.recent-saves-main {
  flex: 1;
  min-width: 0;
  max-width: 760px;
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.recent-saves-sidebar {
  flex-shrink: 0;
  width: clamp(260px, 28%, 360px);
  margin-top: 40px;
}

.recent-saves-empty {
  color: var(--text-secondary);
  font-size: 14px;
}

.recent-saves-month-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.recent-saves-day {
  margin-bottom: 18px;
}
.recent-saves-day:last-child {
  margin-bottom: 0;
}

.recent-saves-day-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.recent-saves-day-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.recent-saves-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  background: none;
  border: none;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  color: var(--text-primary);
}
.recent-saves-row:hover {
  background: var(--hover-bg);
}

.recent-saves-row-thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.recent-saves-row-thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.recent-saves-row-title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-saves-row-category {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Same gray-outline recipe as .recent-saves-filter-select/the sidebar's existing surface controls
   -- a secondary action, not the page's primary button. */
.recent-saves-load-more {
  align-self: center;
  margin-top: 4px;
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.recent-saves-load-more:hover {
  background: var(--hover-bg);
  border-color: var(--primary);
}

/* Sidebar filters -- plain labeled <select>s/checkbox, not a custom dropdown component like
   #sort-select -- this is a one-off filter panel, not the app's shared sort control. */
.recent-saves-filters {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.recent-saves-filter-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.recent-saves-filter-select {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 400;
}

.recent-saves-filter-row--toggle {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.recent-saves-filter-toggle {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Mobile "Filter" trigger + full-screen popup -- same pattern/recipe as the Cause Curated page's
   .bare-list-filter-trigger/.bare-list-filter-modal (cards.css), own class names here per this
   file's established "own semantically-named classes, shared layout mechanics" convention. Hidden
   outright on desktop, where the inline sidebar (above) is used instead. */
.recent-saves-filter-trigger {
  display: none;
}

.recent-saves-filter-modal {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: var(--surface);
}
.recent-saves-filter-modal[hidden] {
  display: none;
}
.recent-saves-filter-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
}
.recent-saves-filter-modal-close:hover {
  background: var(--hover-bg);
}
.recent-saves-filter-modal-body {
  height: 100%;
  overflow-y: auto;
  padding: 20px;
}
/* The modal body's own copy of .recent-saves-filters needs no extra top margin -- it's the first
   thing in the sheet, not sitting below a list like the desktop sidebar's copy is. */
.recent-saves-filter-modal-body .recent-saves-filters {
  margin-top: 0;
}

@media (max-width: 768px) {
  .recent-saves-page {
    padding-left: 16px;
  }
  /* .bare-list-hero's own desktop default (-40px / 0, cards.css) is sized for that breakpoint's
     40px-left-only page padding -- here it's a smaller 16px, still left-only (no right padding
     gets added at this width), so just the magnitude needs to shrink to match. */
  .recent-saves-page .bare-list-hero {
    margin-left: -16px;
    margin-right: 0;
  }
  .recent-saves-body {
    flex-direction: column;
  }
  .recent-saves-main {
    width: 100%;
    max-width: none;
  }
  /* The sidebar's own inline filters move into the Filter modal at this width instead of
     stacking below the list, per direct request ("put the dropdowns into a popup... the same way
     we do it on the cause curated page"). */
  .recent-saves-sidebar {
    display: none;
  }
  .recent-saves-filter-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 16px;
    padding: 13px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
  }
  .recent-saves-filter-trigger:hover {
    border-color: var(--primary);
  }
}
