/* Fresh page styles */

/* Featured post (large hero post) */
.featured-post {
  display: flex;
  flex-direction: column;
  background: var(--background-component-tertiary, #dee2e6);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

/* Image wrapper with gradient */
.featured-post__preview {
  position: relative;
  width: 100%;
  aspect-ratio: 740 / 417;
  overflow: hidden;
}

.featured-post__preview__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

/* Gradient overlay at bottom of image */
.featured-post__preview::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 24px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--background-component-tertiary, #dee2e6) 100%
  );
  pointer-events: none;
}

/* Content container - overlaps image by -24px */
.featured-post__content {
  margin-top: -24px;
  margin-left: 4px;
  margin-right: 4px;
  margin-bottom: 4px;
  padding: 16px;
  background: var(--background-component-default, #ffffff);
  border-radius: 12px;
  box-shadow: 0 0.5px 1px rgba(33, 37, 41, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  z-index: 1;
}

/* Categories/badges container */
.featured-post__categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.featured-post__badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  padding-right: 6px;
  background: rgba(33, 37, 41, 0.05);
  border-radius: 6px;
  text-decoration: none;
}

.featured-post__badge__avatar {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  object-fit: cover;
}

.featured-post__badge__text {
  font-family: var(--family-body);
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
  color: var(--text-primary);
  padding-left: 2px;
  padding-right: 2px;
}

/* Title */
.featured-post__content__title {
  font-family: var(--family-body);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-primary);
  margin: 0;
}

/* Description */
.featured-post__content__desc {
  font-family: var(--family-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Reactions container */
.featured-post__reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.featured-post__react {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  padding-right: 6px;
  background: rgba(13, 110, 253, 0.08);
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.featured-post__react__emoji {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.featured-post__react__emoji img {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.featured-post__react__count {
  font-family: var(--family-body);
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
  color: var(--text-primary);
  padding-left: 2px;
  padding-right: 2px;
}

/* Posts grid (2 columns) */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.posts-grid .post {
  display: flex;
  flex-direction: column;
  background: var(--background-component-default, #dee2e6);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  box-shadow: var(--shadows-drop-3);
  max-width: 100%;
}

.posts-grid .post__preview {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.posts-grid .post__preview__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.posts-grid .post__content {
  padding: 16px;
}

.posts-grid .post__content__title {
  font-family: var(--family-body);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  /* margin: 0 0 8px 0; */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.posts-grid .post-desc {
  font-family: var(--family-body);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Posts read more container (vertical list) */
.posts-read-more-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.posts-read-more-container .post {
  display: flex;
  flex-direction: row;
  background: var(--background-component-default);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  box-shadow: var(--shadows-drop-3);
  max-width: 100%;
}

.posts-read-more-container .post__preview {
  width: 200px;
  min-width: 200px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.posts-read-more-container .post__preview__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.posts-read-more-container .post__content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.posts-read-more-container .post__content__title {
  font-family: var(--family-body);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  margin: 0 0 8px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.posts-read-more-container .post-desc {
  font-family: var(--family-body);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Active sidebar item */
.sidebar-item__active,
.sidebar-item:hover {
  background: var(--states-primary-secondary);
  box-shadow:
    0px -0.5px 0px 0px rgba(22, 25, 29, 0.12) inset,
    0px 1px 2px -0.5px var(--shadows-drop-2);
}

/* Active footer item */
.footer__item--active {
  color: var(--semantic-primary-default);
}

/* Responsive styles */
@media (max-width: 900px) {
  .main__content {
    width: 100%;
  }

  .posts-grid {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .posts-grid .post {
    width: 100%;
    max-width: 100%;
  }

  .posts-read-more-container .post {
    flex-direction: column;
    width: 100%;
    max-width: 100%;
  }

  .posts-read-more-container .post__preview {
    width: 100%;
    min-width: unset;
  }
}

@media (max-width: 640px) {
  .featured-post__preview {
    height: 204px;
    aspect-ratio: 16 / 10;
  }

  .featured-post__content {
    padding: 12px;
  }

  .featured-post__content__title {
    font-size: 16px;
    line-height: 1.3;
  }

  .featured-post__content__desc {
    font-size: 14px;
  }

  .featured-post__categories {
    gap: 6px;
  }

  .featured-post__badge {
    padding: 3px;
    padding-right: 5px;
  }

  .featured-post__badge__text {
    font-size: 12px;
  }

  .posts-grid .post__content {
    padding: 12px;
  }

  .posts-grid .post__content__title {
    font-size: 16px;
  }
  .posts-grid .post-desc {
    font-size: 14px;
  }

  .posts-read-more-container .post__content {
    padding: 12px;
  }

  .posts-read-more-container .post__content__title {
    font-size: 14px;
  }
}

/* Dark mode adjustments */
html.dark .posts-grid .post,
html.dark .posts-read-more-container .post {
  border-color: var(--border-default, #3d4349);
  background: #15191b;
}

html.dark .featured-post__content {
  background: var(--background-component-default, #1a1d20);
  box-shadow: 0 0.5px 1px rgba(0, 0, 0, 0.3);
}

html.dark .featured-post__badge {
  background: rgba(255, 255, 255, 0.08);
}

html.dark .featured-post__react {
  background: rgba(66, 153, 225, 0.15);
}
