/* ── Instagram Carousel — Untitled UI style ──────────────── */

/* ── Carousel wrapper ────────────────────────────────────── */
.ig-carousel {
  position: relative;
  width: calc(100% - 32px);
  overflow: hidden;
  border-radius: 12px;
  margin: 16px 16px;
}

/* ── Scroll track ────────────────────────────────────────── */
.ig-track {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  gap: 12px;
  padding: 0 8%;

  /* hide scrollbar */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.ig-track::-webkit-scrollbar { display: none; }

/* ── Individual slide ────────────────────────────────────── */
.ig-slide {
  flex: 0 0 84%;
  aspect-ratio: 1.5;
  scroll-snap-align: center;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
}

.ig-slide-link {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  text-decoration: none;
}

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

/* ── Video badge ─────────────────────────────────────────── */
.ig-video-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  pointer-events: none;
  backdrop-filter: blur(6px);
  z-index: 2;
}

/* ── Caption overlay on hover ────────────────────────────── */
.ig-slide-caption {
  position: absolute;
  bottom: 16px;
  left: 16px;
  max-width: calc(100% - 32px);
  padding: 12px 14px;
  background: rgba(0,0,0,0.6);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}

.ig-slide-link:hover .ig-slide-caption {
  opacity: 1;
  transform: translateY(0);
}

.ig-slide-date {
  font-family: var(--_fonts---font-family--ibm-plex-mono);
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  color: rgba(255,255,255,0.9);
  display: block;
  opacity: 0.95;
}

.ig-slide-text {
  font-family: var(--_fonts---font-family--ibm-plex-mono);
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.95);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Title overlay styling to ensure visibility on any background */
.ig-slide-title {
  font-family: var(--_fonts---font-family--instrument-serif);
  color: #fff;
  font-size: 16px;
  line-height: 1.15;
  text-shadow: 0 2px 8px rgba(0,0,0,0.85);
  display: block;
  margin-bottom: 2px;
  font-weight: 400;
}

/* ── Nav buttons (prev / next) ───────────────────────────── */
.ig-nav {
  position: absolute;
  top: 50%;
  z-index: 10;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--black);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: background 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
  opacity: 0;
}

.ig-carousel:hover .ig-nav {
  opacity: 1;
}

.ig-nav:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.06);
}

.ig-nav:disabled {
  opacity: 0 !important;
  cursor: default;
}

.ig-nav-prev { left: 12px; }
.ig-nav-next { right: 12px; }

/* ── Dot indicators ──────────────────────────────────────── */
.ig-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 100px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
}

.ig-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  padding: 0;
  /* enlarge touch target without changing visual size */
  box-sizing: content-box;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  transition: background 0.25s ease, transform 0.25s ease;
}

.ig-dot::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
}

.ig-dot.active {
  background: #fff;
  transform: scale(1.25);
}

.ig-dot:hover:not(.active) {
  background: rgba(255, 255, 255, 0.7);
}

/* ── Loading / empty states ──────────────────────────────── */
.instagram-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 12px;
}

.ig-empty {
  text-align: center;
  padding: 60px 20px;
  font-family: var(--_fonts---font-family--ibm-plex-mono);
  font-size: 0.85em;
  opacity: 0.5;
  color: rgba(255, 255, 255, 0.5);
}

/* ── Responsive ──────────────────────────────────────────── */
@media screen and (max-width: 767px) {
  .ig-track {
    gap: 10px;
    padding: 0 6%;
  }
  .ig-slide {
    flex: 0 0 88%;
    aspect-ratio: 1.2;
  }
  .ig-nav {
    width: 32px;
    height: 32px;
  }
  .ig-nav-prev { left: 8px; }
  .ig-nav-next { right: 8px; }
}

/* ── Modal for blog post detail ─────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.modal {
  width: 86%;
  max-width: 820px;
  background: linear-gradient(180deg, #0b1220 0%, #0f1724 100%);
  color: #fff;
  border-radius: 12px;
  padding: 28px 28px 24px;
  box-shadow: 0 18px 60px rgba(5,8,12,0.75);
  border: 1px solid rgba(255,255,255,0.04);
}
.modal h3 { margin: 0 0 8px 0; font-size: 1.2rem; font-weight:700; text-transform:uppercase; letter-spacing:0.06em; }
.modal .post-body { color: rgba(255,255,255,0.95); margin-bottom: 14px; font-size: 0.98rem; line-height:1.5; }

/* Ensure post descriptions are not forced uppercase by global styles */
.modal .post-body,
.modal .post-body * {
  text-transform: none !important;
}
.modal .modal-actions { display:flex; justify-content:flex-end; gap:8px; }

.modal .post-meta { color: rgba(191,199,209,0.9); font-family: var(--_fonts---font-family--ibm-plex-mono); font-size:0.92rem; margin:6px 0 12px 0; }
.modal .modal-actions .btn { background: rgba(255,255,255,0.06); color: #fff; border: 1px solid rgba(255,255,255,0.04); padding: 8px 12px; border-radius:6px; }
.modal .modal-actions .btn:hover { background: rgba(255,255,255,0.09); }

/* Animated modal variants */
.modal-animated { opacity: 0; transition: opacity 260ms ease; }
.modal-animated.show { opacity: 1; }
.modal-animated .modal-animated-content { transform: translateY(16px) scale(0.985); opacity: 0; transition: transform 320ms cubic-bezier(0.22,1,0.36,1), opacity 260ms ease; }
.modal-animated .modal-animated-content.open { transform: translateY(0) scale(1); opacity: 1; }
.modal-animated .modal-animated-content { max-height: 78vh; overflow-y: auto; }

/* Responsive tweaks */
@media screen and (min-width: 1100px) {
  .modal { width: 76%; max-width: 1000px; padding: 32px; }
  .modal h3 { font-size: 1.4rem; }
}

/* Modal media carousel */
.modal-media-carousel { display:flex; align-items:center; gap:12px; margin-top:12px; }
.modal-media-carousel .m-track-wrapper { overflow-x:auto; overflow-y:hidden; flex:1; border-radius:8px; -webkit-overflow-scrolling: touch; scroll-behavior: smooth; }
.modal-media-carousel .m-track { display:flex; gap:12px; }
.modal-media-carousel .m-slide { min-width:72%; box-sizing:border-box; padding:6px; display:flex; align-items:center; justify-content:center; scroll-snap-align:center; }
.modal-media-carousel img, .modal-media-carousel video { width:100%; height:260px; object-fit:cover; border-radius:6px; display:block; box-shadow:0 6px 18px rgba(0,0,0,0.45); }
.modal-media-carousel .m-prev, .modal-media-carousel .m-next { width:40px; height:40px; border-radius:50%; border:none; background: rgba(255,255,255,0.06); color:#fff; display:flex; align-items:center; justify-content:center; cursor:pointer; }
.modal-media-carousel .m-prev:disabled, .modal-media-carousel .m-next:disabled { opacity:0.4; cursor:default; }

@media screen and (max-width: 479px) {
  .modal-media-carousel img, .modal-media-carousel video { height:220px; }
  .modal { padding:18px; }
}

/* Fullscreen lightbox styles */
.fs-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.9); display:flex; align-items:center; justify-content:center; z-index:4000; opacity:0; transition:opacity 220ms ease; }
.fs-overlay.open { opacity:1; }
.fs-container { position:relative; max-width:95%; max-height:95%; display:flex; align-items:center; justify-content:center; }
.fs-media { max-width:100%; max-height:100%; border-radius:6px; box-shadow:0 20px 60px rgba(0,0,0,0.6); }
.fs-close { position:absolute; top:10px; right:10px; width:36px; height:36px; border-radius:50%; border:none; background:rgba(255,255,255,0.06); color:#fff; cursor:pointer; font-size:18px; }
.fs-close:hover { background:rgba(255,255,255,0.12); }


@media screen and (max-width: 479px) {
  .ig-track {
    gap: 8px;
    padding: 0 4%;
  }
  .ig-slide {
    flex: 0 0 92%;
    aspect-ratio: 1;
  }
  .ig-nav {
    display: none;
  }
  .ig-slide-caption {
    opacity: 1;
    transform: translateY(0);
    padding: 32px 16px 16px;
  }
  .ig-slide-text {
    -webkit-line-clamp: 1;
  }
  .ig-dots {
    bottom: 8px;
  }
}
