/* ============================================================
   LinkedIn Feed Slider — Frontend Styles
   ============================================================ */

:root {
  --lfs-gap: 12px;
  --lfs-radius: 10px;
  --lfs-btn-size: 40px;
  --lfs-transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --lfs-caption-bg: rgba(0, 0, 0, 0.62);
  --lfs-accent: #0077b5;
}

/* Wrapper */
.lfs-slider-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 0 0 40px;
  margin-top: 20px;
}

/* Track */
.lfs-slider-wrapper {
  /* Prevent text selection while dragging */
  -webkit-user-select: none;
  user-select: none;
}

.lfs-slider-track-wrap {
  overflow: hidden;
  border-radius: var(--lfs-radius);
  /* Prevent any overflow on mobile */
  max-width: 100%;
  -webkit-overflow-scrolling: auto;
}

.lfs-slider-track {
  display: flex;
  gap: var(--lfs-gap);
  transition: transform var(--lfs-transition);
  will-change: transform;
}

/* ── Slides ── */
.lfs-slide {
  flex: 0 0 auto;
  /* Initial width — overridden by JS once layout is measured */
  width: calc( (100% - (var(--lfs-visible, 1) - 1) * var(--lfs-gap)) / var(--lfs-visible, 1) );
  min-width: 0;
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--lfs-radius);
  background: #f0f0f0;
}

.lfs-slide__inner {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.lfs-slide__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.lfs-slide:hover .lfs-slide__img {
  transform: scale(1.05);
}

/* Video badge */
.lfs-slide__video-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 2;
}

/* Caption overlay */
.lfs-slide__caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--lfs-caption-bg);
  color: #fff;
  padding: 12px 14px 14px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 3;
}

.lfs-slide__caption p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lfs-slide:hover .lfs-slide__caption {
  transform: translateY(0);
}

/* Clickable overlay */
.lfs-slide__link {
  position: absolute;
  inset: 0;
  display: block;
  z-index: 4;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
  appearance: none;
}

/* ── Navigation Buttons ── */
.lfs-btn {
  position: absolute;
  top: calc(50% - 24px);      /* vertically centred on the image area */
  transform: translateY(-50%);
  z-index: 10;
  width: var(--lfs-btn-size);
  height: var(--lfs-btn-size);
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  transition: background 0.2s, transform 0.2s, opacity 0.2s;
  opacity: 0.9;
}

.lfs-btn svg {
  width: 18px;
  height: 18px;
  color: #111;
}

.lfs-btn--prev { left: 6px; }
.lfs-btn--next { right: 6px; }

.lfs-btn:hover {
  background: var(--lfs-accent);
  opacity: 1;
}

.lfs-btn:hover svg {
  color: #fff;
}

.lfs-btn:disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* ── Dots ── */
.lfs-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}

.lfs-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0,0,0,0.2); /* overridden by inline CSS from plugin settings */
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s, opacity 0.2s;
}

.lfs-dot.is-active {
  background: var(--lfs-accent);
  transform: scale(1.35);
}

/* ── Lightbox ── */
.lfs-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.lfs-lightbox.is-open {
  display: flex;
  animation: lfs-fade-in 0.25s ease;
}

.lfs-lightbox__inner {
  background: #fff;
  border-radius: 14px;
  max-width: 540px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  position: relative;
  animation: lfs-scale-in 0.28s cubic-bezier(0.34,1.56,0.64,1);
}

.lfs-lightbox__img {
  display: block;
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  background: #000;
}

.lfs-lightbox__caption {
  padding: 14px 16px 0;
  font-size: 14px;
  color: #333;
  line-height: 1.5;
  max-height: 80px;
  overflow-y: auto;
}

.lfs-lightbox__ig-link {
  display: inline-block;
  margin: 12px 16px 16px;
  font-size: 13px;
  color: var(--lfs-accent);
  text-decoration: none;
  font-weight: 600;
}

.lfs-lightbox__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  background: rgba(0,0,0,0.5);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: background 0.2s;
}

.lfs-lightbox__close svg {
  width: 16px;
  height: 16px;
}

.lfs-lightbox__close:hover {
  background: rgba(0,0,0,0.8);
}

/* ── Error ── */
.lfs-error {
  padding: 12px 16px;
  background: #fff3f3;
  border-left: 4px solid #e00;
  color: #a00;
  font-size: 14px;
  border-radius: 4px;
  margin: 16px 0;
}

/* ── Animations ── */
@keyframes lfs-fade-in   { from { opacity: 0 } to { opacity: 1 } }
@keyframes lfs-scale-in  { from { transform: scale(0.88); opacity:0 } to { transform:scale(1); opacity:1 } }

/* ── Responsive ── */
/* Slide widths are fully controlled by JS — no CSS overrides needed.
   Only non-width adjustments belong here. */
@media (max-width: 560px) {
  .lfs-btn {
    width: 34px;
    height: 34px;
  }
}

/* ── Follow Button ── */
.lfs-follow-wrap {
  display: flex;
  justify-content: center;
  margin-top: 24px;
  margin-bottom: 20px;
}

.lfs-follow-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 28px;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.2px;
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  line-height: 1;
}

.lfs-follow-btn:hover {
  opacity: 0.88;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.lfs-follow-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ── LinkedIn text-only slides ── */
.lfs-slide--text-only .lfs-slide__inner {
  aspect-ratio: unset;
  min-height: 200px;
  background: #f3f6f8;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.lfs-slide__no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 0 10px;
}

.lfs-slide__li-logo {
  width: 40px;
  height: 40px;
  color: #0077b5;
  opacity: 0.3;
}

.lfs-slide__text {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.62);
  color: #fff;
  padding: 12px 14px 14px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 3;
}

.lfs-slide--text-only .lfs-slide__text {
  position: relative;
  transform: none;
  background: #f3f6f8;
  color: #333;
  padding: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.lfs-slide:hover .lfs-slide__text {
  transform: translateY(0);
}

.lfs-slide--text-only:hover .lfs-slide__text {
  transform: none;
}

.lfs-slide__text p {
  margin: 0 0 4px;
  font-size: 13px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lfs-slide__date {
  font-size: 11px;
  opacity: 0.65;
}
