.linkedin-feed {
  position: relative;
  width: 100%;
  margin: 2rem 0;
}

/* Scrollable track with snap points — no JS needed for basic sliding. */
.linkedin-feed__track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  gap: 1.5rem;
  padding: 12px 0 1rem;
  margin: 0 1.5rem;
  /* Hide scrollbar visually but keep it functional. */
  scrollbar-width: none;
}

.linkedin-feed__track::-webkit-scrollbar {
  display: none;
}

/* Default: show 5 slides side by side. */
.linkedin-feed__slide {
  flex: 0 0 calc(20% - 1.2rem);
  scroll-snap-align: start;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.linkedin-feed__slide:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: var(--primary-color);
}

@media (max-width: 768px) {
  .linkedin-feed__slide {
    flex: 0 0 calc(100% - 1rem);
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .linkedin-feed__slide {
    flex: 0 0 calc(33.333% - 1rem);
  }
}

/* Post image. */
.linkedin-feed__image {
  flex-shrink: 0;
  height: 180px;
  overflow: hidden;
  background: #f5f5f5;
}

.linkedin-feed__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Post body. */
.linkedin-feed__body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.linkedin-feed__excerpt {
  margin: 0;
  color: #333;
  font-size: 0.9rem;
  line-height: 1.6;
  flex: 1;
  /* Clamp to 4 lines. */
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.linkedin-feed__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.linkedin-feed__meta time {
  color: #666;
}

.linkedin-feed__link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.linkedin-feed__link:hover,
.linkedin-feed__link:focus {
  color: var(--secondary-color);
  text-decoration: underline;
}

/* Prev/next navigation buttons. */
.linkedin-feed__controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.linkedin-feed__prev,
.linkedin-feed__next {
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.linkedin-feed__prev:hover,
.linkedin-feed__next:hover,
.linkedin-feed__prev:focus,
.linkedin-feed__next:focus {
  background: var(--secondary-color);
  outline: 2px solid var(--secondary-color);
  outline-offset: 2px;
}
