/* ==========================================================================
   Kipling's Trains - Horizontal Magazine Slideshow
   Each image+caption is a full slide, with peek showing next slide
   ========================================================================== */

/* ==========================================================================
   Fixed Header and Footer - Kipling page specific
   ========================================================================== */

body.project-kipling {
  overflow: hidden;
  height: 100vh;
}

.project-kipling .site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: #0a0a0a;
}

.project-kipling .site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  margin-top: 0;
  background: #0a0a0a;
}

.project-kipling .project-page {
  position: fixed;
  top: 52px;
  bottom: 52px;
  left: 0;
  right: 0;
  overflow: hidden;
}

.project-kipling .project-page article {
  height: 100%;
}

/* ==========================================================================
   Horizontal Scroll Container
   ========================================================================== */

.kipling-content {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  height: 100%;
  width: 100%;
  gap: 0;
  background: #0a0a0a;

  /* Hide scrollbar but keep functionality */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.kipling-content::-webkit-scrollbar {
  display: none;
}

/* ==========================================================================
   Title Slide - First slide in horizontal flow
   ========================================================================== */

.kipling-title-slide {
  flex: 0 0 auto;
  width: 55vw;
  min-width: 55vw;
  height: 100%;
  background: #0a0a0a;

  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 6vw 4vh;
  box-sizing: border-box;
}

.kipling-title {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 10vw, 8rem);
  font-weight: var(--font-bold);
  line-height: 1;
  color: #fff;
  margin: 0 0 var(--space-8) 0;
}

.kipling-intro {
  max-width: 55ch;
}

.kipling-intro p {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  font-weight: 300;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 var(--space-3) 0;
}

.kipling-intro p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   Photo Slides - Each image fills the slide with peek
   ========================================================================== */

.kipling-content > figure {
  flex: 0 0 75vw;
  min-width: 75vw;
  height: 100%;
  position: relative;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 8vh;
  background: #0a0a0a;
  box-sizing: border-box;
}

.kipling-content > figure img {
  max-height: 65vh;
  max-width: 70vw;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Caption below image, not overlapping */
.kipling-content figure .slide-caption {
  margin-top: 2.5vh;
  width: 90%;
  max-width: 65ch;
  padding: 0;

  font-family: var(--font-body);
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  font-weight: 300;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
}

/* ==========================================================================
   Hide original intro paragraphs and dividers
   ========================================================================== */

.kipling-content > p {
  display: none;
}

.kipling-content > hr {
  display: none;
}

/* ==========================================================================
   Focus state for keyboard nav
   ========================================================================== */

.kipling-content:focus {
  outline: none;
}

/* ==========================================================================
   Responsive - Vertical scroll on mobile
   ========================================================================== */

@media (max-width: 768px) {
  body.project-kipling {
    overflow: auto;
    height: auto;
  }

  .project-kipling .site-header {
    position: static;
  }

  .project-kipling .project-page {
    position: static;
    overflow: visible;
  }

  .project-kipling .project-page article {
    height: auto;
  }

  .kipling-content {
    display: block;
    overflow: visible;
    height: auto;
    width: 100%;
    padding: 0 5vw;
  }

  .kipling-title-slide {
    display: block;
    width: 100%;
    height: auto;
    padding: 8vh 0 6vh;
  }

  .kipling-title {
    font-size: clamp(2.5rem, 10vw, 3.5rem);
    margin-bottom: var(--space-4);
  }

  .kipling-intro {
    max-width: none;
  }

  .kipling-intro p {
    font-size: 1rem;
  }

  .kipling-content > figure {
    width: 100%;
    height: auto;
    padding: 0;
    margin: 0 0 6vh;
    display: block;
  }

  .kipling-content > figure img {
    max-height: none;
    max-width: 100%;
    width: 100%;
    height: auto;
  }

  .kipling-content figure .slide-caption {
    margin-top: 1.5vh;
    width: 100%;
    font-size: 0.95rem;
    text-align: left;
  }
}

/* ==========================================================================
   Print - Show all slides stacked
   ========================================================================== */

@media print {
  .kipling-content {
    display: block;
    overflow: visible;
    height: auto;
    background: #fff;
  }

  .kipling-title-slide {
    height: auto;
    background: #fff;
    color: #000;
    page-break-after: always;
  }

  .kipling-title {
    color: #000;
  }

  .kipling-intro p {
    color: #333;
  }

  .kipling-content > figure {
    height: auto;
    background: #fff;
    page-break-after: always;
  }

  .kipling-content > figure img {
    max-height: 70vh;
  }

  .kipling-content figure .slide-caption {
    position: static;
    transform: none;
    color: #333;
    text-shadow: none;
    margin-top: var(--space-4);
  }
}
