/* ============================================================
   Jeulia Social Feed — Frontend Styles
   ============================================================ */

/* ── Feed Wrapper ──────────────────────── */
.jsf-feed-wrapper {
  padding: 40px 0;
}

.jsf-feed__title {
  font-family: var(--font-heading, "Cormorant Garamond", serif);
  font-size: 2rem;
  font-weight: 500;
  text-align: center;
  margin-bottom: 2.5rem;
}

/* ── Grid ──────────────────────────────── */
.jsf-feed__grid {
  display: grid;
  grid-template-columns: repeat(var(--jsf-columns, 4), 1fr);
  gap: var(--jsf-gap, 12px);
}

@media (max-width: 1024px) {
  .jsf-feed__grid {
    grid-template-columns: repeat(var(--jsf-tablet, 3), 1fr);
  }
}

@media (max-width: 768px) {
  .jsf-feed__grid {
    grid-template-columns: repeat(var(--jsf-mobile, 2), 1fr);
    gap: 8px;
  }

  .jsf-feed__title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }
}

@media (max-width: 480px) {
  .jsf-feed__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
  }
}

/* ── Feed Item ─────────────────────────── */
.jsf-feed__item {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border-radius: var(--radius-md, 8px);
}

.jsf-feed__image-wrapper {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f5f2ed;
}

.jsf-feed__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.jsf-feed__item:hover .jsf-feed__image {
  transform: scale(1.05);
}

/* ── Hover Overlay ─────────────────────── */
.jsf-feed__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.jsf-feed__item:hover .jsf-feed__overlay {
  opacity: 1;
}

.jsf-feed__overlay-content {
  display: flex;
  gap: 24px;
  color: #fff;
}

.jsf-feed__stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1rem;
  font-weight: 600;
}

.jsf-feed__stat svg {
  flex-shrink: 0;
}

/* ── Badges ────────────────────────────── */
.jsf-feed__shop-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: #c9a96e;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.jsf-feed__source-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border-radius: 50%;
  font-size: 0.7rem;
}

.jsf-feed__source-badge svg {
  width: 14px;
  height: 14px;
}

/* ── Load More ─────────────────────────── */
.jsf-feed__load-more-wrapper {
  text-align: center;
  margin-top: 32px;
}

/* ── UGC Grid (simple) ─────────────────── */
.jsf-ugc-grid__inner {
  display: grid;
  grid-template-columns: repeat(var(--columns, 3), 1fr);
  gap: 12px;
}

.jsf-ugc-grid__item {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
}

.jsf-ugc-grid__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.jsf-ugc-grid__title {
  text-align: center;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .jsf-ugc-grid__inner {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Lightbox ───────────────────────────── */
.jsf-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.jsf-lightbox.is-visible {
  opacity: 1;
  visibility: visible;
}

.jsf-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
}

.jsf-lightbox__content {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  width: 100%;
}

.jsf-lightbox__body {
  display: grid;
  grid-template-columns: 1fr 320px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  max-height: 85vh;
}

@media (max-width: 768px) {
  .jsf-lightbox__body {
    grid-template-columns: 1fr;
    max-height: 90vh;
    overflow-y: auto;
  }
}

.jsf-lightbox__image-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  min-height: 400px;
}

.jsf-lightbox__image {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
}

.jsf-lightbox__info {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.jsf-lightbox__author {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.jsf-lightbox__author-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.jsf-lightbox__instagram-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #c9a96e;
}

.jsf-lightbox__stats {
  display: flex;
  gap: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.jsf-lightbox__caption {
  font-size: 0.85rem;
  line-height: 1.7;
  color: #555;
}

.jsf-lightbox__close {
  position: absolute;
  top: -40px;
  right: 0;
  color: #fff;
  font-size: 2rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  cursor: pointer;
}

.jsf-lightbox__prev,
.jsf-lightbox__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 2.5rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  cursor: pointer;
  transition: opacity 0.2s;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
}

.jsf-lightbox__prev:hover,
.jsf-lightbox__next:hover {
  background: rgba(255,255,255,0.2);
}

.jsf-lightbox__prev {
  left: -60px;
}

.jsf-lightbox__next {
  right: -60px;
}

@media (max-width: 768px) {
  .jsf-lightbox__prev { left: 8px; }
  .jsf-lightbox__next { right: 8px; }
  .jsf-lightbox__close { top: 8px; right: 8px; color: #333; }
  .jsf-lightbox__image-container {
    min-height: 300px;
  }
}

/* ── Loading Skeleton ──────────────────── */
.jsf-feed__item.loading {
  animation: jsf-shimmer 1.5s infinite;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
}

@keyframes jsf-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
