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

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

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

/* Track */
.ifs-slider-track-wrap {
  overflow: hidden;
  border-radius: var(--ifs-radius);
}

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

/* ── Slides ── */
.ifs-slide {
  flex: 0 0 auto;
  /* width set dynamically by JS via CSS variable */
  width: calc( (100% - (var(--ifs-visible, 4) - 1) * var(--ifs-gap)) / var(--ifs-visible, 4) );
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--ifs-radius);
  background: #f0f0f0;
}

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

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

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

/* Video badge */
.ifs-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 */
.ifs-slide__caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--ifs-caption-bg);
  color: #fff;
  padding: 12px 14px 14px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 3;
}

.ifs-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;
}

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

/* Clickable overlay */
.ifs-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 ── */
.ifs-btn {
  position: absolute;
  top: calc(50% - 24px);      /* vertically centred on the image area */
  transform: translateY(-50%);
  z-index: 10;
  width: var(--ifs-btn-size);
  height: var(--ifs-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;
}

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

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

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

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

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

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

.ifs-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0,0,0,0.2);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}

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

/* ── Lightbox ── */
.ifs-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);
}

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

.ifs-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: ifs-scale-in 0.28s cubic-bezier(0.34,1.56,0.64,1);
}

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

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

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

.ifs-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;
}

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

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

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

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

/* ── Responsive ── */
@media (max-width: 900px) {
  .ifs-slide {
    width: calc( (100% - var(--ifs-gap)) / 2 );
  }
}

@media (max-width: 560px) {
  .ifs-slide {
    width: calc(100% - 0px);
  }
  .ifs-btn {
    width: 34px;
    height: 34px;
  }
}

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

.ifs-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;
}

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

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