/* ============================================================
   Kahani Gallery Widget — Marquee CSS  v1.1.0
   ============================================================ */

/* ── Section wrapper ── */
.kahani-gallery-section {
  overflow: hidden;
  background: #0E0C12;
}

/* ── Section heading ── */
.kahani-gallery-section .kg-heading-wrap {
  text-align: center;
  padding: 0 64px 72px;
}

.kahani-gallery-section .kg-eyebrow {
  font-family: 'Jost', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: #C9A84C;
  margin-bottom: 18px;
  display: block;
}

.kahani-gallery-section .kg-heading {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 300;
  line-height: 1.1;
  color: #EDE8DC;
  margin: 0 0 20px;
}

.kahani-gallery-section .kg-heading em {
  font-style: italic;
  color: #E8C46A;
}

.kahani-gallery-section .kg-subtext {
  font-family: 'Jost', sans-serif;
  font-size: 15px;
  font-weight: 300;
  color: rgba(237,232,220,.65);
  line-height: 1.7;
  max-width: 520px;
  margin: 0 auto;
}

/* ── Outer wrapper — edge fade mask ── */
.kg-mg-outer {
  display: flex;
  flex-direction: column;
  -webkit-mask-image: linear-gradient(
    to right, transparent 0%, #000 7%, #000 93%, transparent 100%
  );
  mask-image: linear-gradient(
    to right, transparent 0%, #000 7%, #000 93%, transparent 100%
  );
}

/* ── One row ── */
.kg-mg-row {
  overflow: hidden;
}

/* ── Scrolling track ── */
.kg-mg-track {
  display: flex;
  width: max-content;
  will-change: transform;
}

.kg-mg-track.kg-r1 {
  animation: kg-scroll-left  var(--kg-speed-r1, 45s) linear infinite;
}
.kg-mg-track.kg-r2 {
  animation: kg-scroll-right var(--kg-speed-r2, 50s) linear infinite;
}

/* Pause on hover */
.kg-mg-row:hover .kg-mg-track {
  animation-play-state: paused;
}

/* ── Individual photo card ── */
.kg-mg-item {
  flex: none;
  overflow: hidden;
  position: relative;
  cursor: default;
  isolation: isolate; /* own stacking context — keeps z-index predictable */
}

.kg-mg-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;                   /* base layer */
  filter: brightness(.7) saturate(.85);
  transition:
    filter    var(--kg-hover-dur, .5s) ease,
    transform var(--kg-hover-dur, .5s) ease;
}

.kg-mg-item:hover img {
  filter: brightness(var(--kg-hover-brightness, .9)) saturate(var(--kg-hover-saturate, 1.05));
  transform: scale(var(--kg-hover-scale, 1.05));
}

/* ── Gold shimmer overlay ── */
.kg-mg-item::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;                   /* above image */
  background: linear-gradient(
    135deg,
    rgba(201,168,76, var(--kg-shimmer-opacity, .12)) 0%,
    transparent 60%
  );
  opacity: 0;
  transition: opacity var(--kg-hover-dur, .4s) ease;
  pointer-events: none;
}

.kg-mg-item:hover::after {
  opacity: 1;
}

/* ── Caption overlay ── */
.kg-mg-cap {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;                   /* always on top of img + shimmer */
  padding: 40px 14px 13px;
  background: linear-gradient(
    to top,
    rgba(0,0,0, var(--kg-cap-overlay-opacity, .70)) 0%,
    transparent 100%
  );
  color: var(--kg-cap-color, #EDE8DC);
  font-family: 'Jost', sans-serif;
  font-size: var(--kg-cap-size, 12px);
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  line-height: 1;
  transition: opacity .35s ease, transform .35s ease;
  pointer-events: none;
}

/* Caption — hover-only mode */
.kg-cap-on-hover .kg-mg-cap {
  opacity: 0;
  transform: translateY(6px);
}
.kg-cap-on-hover .kg-mg-item:hover .kg-mg-cap {
  opacity: 1;
  transform: translateY(0);
}

/* ── Keyframes ── */
@keyframes kg-scroll-left {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes kg-scroll-right {
  0%   { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .kahani-gallery-section .kg-heading-wrap {
    padding: 0 24px 52px;
  }
  .kg-mg-outer        { gap: 12px !important; }
  .kg-mg-track.kg-r1  { animation-duration: 30s; }
  .kg-mg-track.kg-r2  { animation-duration: 34s; }
  .kg-mg-cap          { font-size: 11px; padding: 30px 10px 10px; }
}
