/* ===================================================================
   Paisley Carousel – Frontend Styles
   =================================================================== */

/* ── Wrapper ──────────────────────────────────────────────────────── */
.pc-carousel-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;         /* clips items beyond the edges          */
  user-select: none;
  -webkit-user-select: none;
}

/* ── Track ────────────────────────────────────────────────────────── */
.pc-track {
  position: relative;
  width: 100%;
  /* Height is set dynamically by JS based on center-item dimensions  */
}

/* ── Individual slide items ───────────────────────────────────────── */
.pc-item {
  position: absolute;
  top: 0;
  left: 0;
  /* width / height / transform set by JS */
  border-radius: 10px;
  overflow: hidden;
  background: #111;
  will-change: transform, opacity;
  transform-origin: center center;
  /* Transition is applied by JS so it can be toggled per-frame      */
  cursor: pointer;
}

/* ── Image ────────────────────────────────────────────────────────── */
.pc-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  /* Subtle brightness lift so non-centre items don't look too dark  */
  transition: filter 0.6s ease;
}

.pc-item--interactive .pc-image {
  transition: filter 0.5s ease, transform 0.5s ease;
}

/* Slight zoom on hover for interactive items */
.pc-item--interactive:hover .pc-image {
  transform: scale(1.04);
}

/* ── Dark overlay (interactive items only) ────────────────────────── */
.pc-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  opacity: 0;
  transition: opacity 0.38s ease;
  pointer-events: none;
  z-index: 1;
}

.pc-item--interactive:hover .pc-overlay {
  opacity: 1;
}

/* ── Info panel (interactive) ─────────────────────────────────────── */
.pc-info {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(12px, 5%, 32px);
  text-align: center;
  z-index: 2;
  pointer-events: none;

  opacity: 0;
  transition: opacity 0.3s ease 0.18s;  /* slight delay so overlay leads */
}

.pc-item--interactive:hover .pc-info {
  opacity: 1;
}

.pc-info .pc-title {
  font-size: clamp(13px, 2.2vw, 22px);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffffff;
  margin: 0 0 10px;
  line-height: 1.25;
  text-shadow: 0 1px 6px rgba(0,0,0,0.4);
}

.pc-info .pc-text {
  font-size: clamp(12px, 1.4vw, 16px);
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.55;
  margin: 0;
  max-width: 90%;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.pc-info .pc-text p {
  margin: 0;
}

/* ── Caption (non-interactive items) ─────────────────────────────── */
.pc-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px 16px 14px;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 100%);
  z-index: 2;
  pointer-events: none;
}

.pc-caption .pc-title {
  font-size: clamp(12px, 1.6vw, 18px);
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  line-height: 1.3;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* ── Navigation buttons ───────────────────────────────────────────── */
.pc-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #222;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  outline: none;
}

.pc-nav:hover {
  background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.22);
  transform: translateY(-50%) scale(1.08);
}

.pc-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.pc-nav svg {
  width: 20px;
  height: 20px;
  display: block;
}

.pc-prev { left: 16px; }
.pc-next { right: 16px; }

/* ── Edge fade gradients (infinite illusion) ──────────────────────── */
.pc-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 18%;
  z-index: 20;
  pointer-events: none;
}

.pc-fade--left {
  left: 0;
  background: linear-gradient(
    to right,
    var(--pc-bg, #ffffff) 0%,
    rgba(255,255,255,0) 100%
  );
}

.pc-fade--right {
  right: 0;
  background: linear-gradient(
    to left,
    var(--pc-bg, #ffffff) 0%,
    rgba(255,255,255,0) 100%
  );
}

/* ── Focus / keyboard accessibility ──────────────────────────────── */
.pc-nav:focus-visible {
  outline: 3px solid #0078d4;
  outline-offset: 2px;
}

.pc-carousel-wrapper:focus-within .pc-nav {
  /* keep nav visible when keyboard-navigating */
}

/* ── Lightbox ─────────────────────────────────────────────────────── */
.pc-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.pc-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.pc-lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
}

.pc-lb-content {
  position: relative;
  z-index: 1;
  background: #111;
  border-radius: 12px;
  overflow: hidden;
  width: min(90vw, 900px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.7);
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.34, 1.36, 0.64, 1);
}

.pc-lightbox.is-open .pc-lb-content {
  transform: scale(1);
}

.pc-lb-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.18s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.pc-lb-close:hover {
  background: rgba(0, 0, 0, 0.82);
}

.pc-lb-close svg {
  width: 18px;
  height: 18px;
  display: block;
}

.pc-lb-img {
  display: block;
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  background: #000;
  flex-shrink: 0;
}

.pc-lb-body {
  padding: 20px 24px 24px;
  overflow-y: auto;
}

.pc-lb-title {
  font-size: clamp(15px, 2.2vw, 24px);
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 10px;
  line-height: 1.3;
}

.pc-lb-text {
  font-size: clamp(13px, 1.4vw, 16px);
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.65;
  margin: 0;
}

.pc-lb-text p         { margin: 0 0 8px; }
.pc-lb-text p:last-child { margin-bottom: 0; }

/* ── Responsive tweaks ────────────────────────────────────────────── */
@media (max-width: 600px) {
  .pc-nav {
    width: 36px;
    height: 36px;
  }
  .pc-nav svg {
    width: 16px;
    height: 16px;
  }
  .pc-prev { left: 6px; }
  .pc-next { right: 6px; }
  .pc-fade { width: 12%; }
}
