/* ========================================
   HOME PAGE STYLES
   ======================================== */

/* Profile Section */
.profile-section {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

:where(.dark, .dark *) .profile-section {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.profile-avatar {
  flex-shrink: 0;
}

.profile-avatar img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(0, 0, 0, 0.08);
}

:where(.dark, .dark *) .profile-avatar img {
  border-color: rgba(255, 255, 255, 0.08);
}

.profile-info {
  flex: 1;
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}

.profile-bio {
  font-size: 0.95rem;
  color: rgba(0, 0, 0, 0.6);
  margin: 0;
}

:where(.dark, .dark *) .profile-bio {
  color: rgba(255, 255, 255, 0.6);
}

/* Posts Sections */
.posts-section {
  margin-bottom: 3.5rem;
  padding: 1.5rem;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-heading {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

.section-link {
  font-size: 0.9rem;
  color: rgba(0, 0, 0, 0.6);
  text-decoration: none;
  transition: color 0.2s;
}

.section-link:hover {
  color: rgba(0, 0, 0, 1);
}

:where(.dark, .dark *) .section-link {
  color: rgba(255, 255, 255, 0.6);
}

:where(.dark, .dark *) .section-link:hover {
  color: rgba(255, 255, 255, 1);
}

/* Grid Layout Cards */
.cards-scroll-container {
  position: relative;
  width: 100%;
}

.cards-scroll {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  padding: 0.5rem 0;
  margin: -0.5rem 0;
}

/* Compact Cards */
.compact-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  background: white;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  cursor: pointer;
}

.compact-card:hover {
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  transform: scale(1.02);
}

:where(.dark, .dark *) .compact-card {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

:where(.dark, .dark *) .compact-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.compact-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.compact-card-title {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-label {
  flex-shrink: 0;
  padding: 0.25rem 0.625rem;
  font-size: 0.7rem;
  border-radius: 6px;
  font-weight: 500;
  white-space: nowrap;
}

.series-label {
  background: rgba(59, 130, 246, 0.1);
  color: rgb(59, 130, 246);
}

.standalone-label {
  background: rgba(16, 185, 129, 0.1);
  color: rgb(16, 185, 129);
}

.series-count-label {
  background: rgba(139, 92, 246, 0.1);
  color: rgb(139, 92, 246);
}

:where(.dark, .dark *) .series-label {
  background: rgba(59, 130, 246, 0.2);
  color: rgb(96, 165, 250);
}

:where(.dark, .dark *) .standalone-label {
  background: rgba(16, 185, 129, 0.2);
  color: rgb(52, 211, 153);
}

:where(.dark, .dark *) .series-count-label {
  background: rgba(139, 92, 246, 0.2);
  color: rgb(167, 139, 250);
}

.compact-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.compact-tag {
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 4px;
  color: rgba(0, 0, 0, 0.7);
}

:where(.dark, .dark *) .compact-tag {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.7);
}

.compact-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: rgba(0, 0, 0, 0.5);
  margin-top: auto;
}

:where(.dark, .dark *) .compact-card-footer {
  color: rgba(255, 255, 255, 0.5);
}

.series-latest-title {
  font-size: 0.85rem;
  color: rgba(0, 0, 0, 0.6);
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

:where(.dark, .dark *) .series-latest-title {
  color: rgba(255, 255, 255, 0.6);
}

/* Series description in home page cards */
.series-card .series-description {
  font-size: 0.85rem;
  color: rgba(0, 0, 0, 0.6);
  margin: 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

:where(.dark, .dark *) .series-card .series-description {
  color: rgba(255, 255, 255, 0.6);
}

/* Override prose styles for home page */
.prose h1,
.prose h2,
.prose h3 {
  margin-top: 0;
}

/* Increase home page content width */
.prose {
  max-width: 90rem;
}

@media (min-width: 1280px) {
  .prose {
    max-width: 100rem;
  }
}

@media (min-width: 1536px) {
  .prose {
    max-width: 110rem;
  }
}

/* Responsive Design */
@media (max-width: 640px) {
  .cards-scroll {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }

  .section-heading {
    font-size: 1.25rem;
  }

  .profile-name {
    font-size: 1.25rem;
  }

  .profile-avatar img {
    width: 64px;
    height: 64px;
  }

  .posts-section {
    padding: 0.5rem;
  }
}

@media (min-width: 1024px) {
  .cards-scroll {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
  }
}
