/* ------------------------------------------------------------------
   GLOBAL TYPOGRAPHY & LAYOUT
   ------------------------------------------------------------------*/
@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Roboto+Mono:wght@300;700&display=swap");

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  width: 100%;
}

body {
  background: #fdfaf4;
  font-family: 'Playfair Display', serif;
  color: #1b1b1b;
}

/* Give padding back to the article body only – not the full‑screen hero */
.page-content {
  padding: 60px 30px
}

/* ------------------------------------------------------------------
      HERO  (always fills viewport – no white bars)
      ------------------------------------------------------------------*/
header.full-page-image {
  height: 100vh;
  width: 100%;
  position: relative;
  overflow: hidden
}

/* 👇 overlay to darken the video */
header.full-page-image .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, .28);
  z-index: -1
}

header.full-page-image .bottom-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40%;
  background: linear-gradient(to top, rgba(0, 0, 0, .8), transparent);
  z-index: 1;
  display: flex;
  align-items: flex-end;
  padding-bottom: 40px;
}

header.full-page-image .bottom-overlay h1 {
  margin: 0;
  color: white;
}

#bg-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease;
  z-index: -1
}

/* ------------------------------------------------------------------
      TABLE‑OF‑CONTENTS  (show on ≥ 1000 px)
      ------------------------------------------------------------------*/
.toc {
  width: 180px;
  font-family: 'Roboto Mono', monospace;
  position: fixed;
  top: 250px;
  left: 25px;
  z-index: 1000;
  display: none;
}

@media(min-width:1000px) {
  .toc {
    display: block
  }
}

.toc h3 {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  margin: 0 0 10px
}

.toc ul {
  list-style: none;
  margin: 0;
  padding: 0
}

.toc li {
  margin: 0 0 10px
}

.toc a {
  color: #333;
  text-decoration: none;
  font-size: 16px
}

.toc a:hover {
  text-decoration: underline;
  color: #000
}

.toc hr {
  border: 0;
  height: 1px;
  background: #ccc;
  margin: 0 0 15px
}

/* ------------------------------------------------------------------
      MAIN ARTICLE BLOCKS
      ------------------------------------------------------------------*/
.main-content {
  max-width: 1280px;
  margin: 0 auto
}

.main-content,
.hero-text,
.sub-hero-text,
.authors,
.quick-links,
.section,
.figure-caption,
.bibtex-code {
  position: relative;
  z-index: 2
}

.hero-text {
  font-size: 60px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.1;
  margin: 0 0 10px
}

.sub-hero-text {
  font-size: 40px;
  font-weight: 400;
  line-height: 1.2;
  margin: 60px 0 50px;
}

/* AUTHORS */
/* AUTHORS */
.authors {
  font-family: 'Roboto Mono', monospace;
  font-size: 16px;
  color: #333;
  line-height: 1.6;
  margin: -32.5px 0 17.5px;
  text-align: left
}

.authors span {
  display: block;
  font-size: 14px;
  color: #555
}

.authors .affiliation {
  font-weight: 600;
  font-size: 16px;
  color: #111
}

.authors a {
  color: inherit;
  text-decoration: none
}

.authors a:hover {
  text-decoration: underline
}

/* TAGLINES / SUBTITLES */
.tagline {
  font-family: 'Roboto Mono', monospace;
  font-size: 24px;
  background: #000;
  color: #fff;
  display: inline-block;
  padding: 8px 16px;
  margin: 40px 0
}

.section-subtitle {
  font-family: 'Roboto Mono', monospace;
  font-size: 20px;
  background: #000;
  color: #fff;
  display: inline-block;
  padding: 6px 14px;
  margin: 30px 0
}

/* QUICK LINKS */
.quick-links {
  text-align: center;
  margin: -10px 0 30px
}

.quick-links a {
  font-family: 'Roboto Mono', monospace;
  font-size: 18px;
  font-weight: bold;
  color: #333;
  margin: 0 36px;
  text-decoration: none
}

.quick-links a:hover {
  text-decoration: underline;
  color: #000
}

/* IMAGE DEFAULTS */
img {
  width: 100%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
  border-radius: 15px;
  margin: 0 20px;
  box-sizing: border-box
}

.main-content>img {
  margin: 0
}

/* VIDEO GALLERY – unchanged core rules (trimmed for brevity) */
.video-gallery-section {
  margin: 40px 0;
  width: 100vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%)
}

.video-gallery-container {
  box-sizing: border-box;
  max-width: 1350px;
  margin: 0 auto;
  overflow-x: auto;
  cursor: grab
}

.video-gallery-container::-webkit-scrollbar {
  display: block
}

.video-gallery {
  display: flex;
  gap: 15px;
  padding: 0 20px 10px;
  width: max-content;
  margin: 0 auto
}

.gallery-video {
  flex: 0 0 auto;
  height: 280px;
  width: auto;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
  background: #fdfaf4
}

/* Single video gallery styles */
.video-gallery-container.single-video .video-gallery {
  width: 100%;
  justify-content: center;
}

.video-gallery-container.single-video .gallery-video {
  height: 480px;
  flex: 0 0 auto;
  max-width: 85%;
}

.gallery-nav {
  background: rgba(40, 40, 40, .8);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  font: 700 20px/35px sans-serif;
  cursor: pointer;
  margin: 0 5px
}

.gallery-nav:hover {
  background: #000
}

.gallery-caption-container {
  max-width: 1280px;
  margin: 15px auto 0;
  padding: 0 20px;
  display: flex;
  align-items: flex-start;
  justify-content: center
}

.figure-caption.gallery-caption {
  flex: 1;
  margin: 0;
  text-align: left;
  font-family: 'Roboto Mono', monospace;
  font-size: 14px;
  color: #555
}

.figure-caption {
  font-family: 'Roboto Mono', monospace;
  font-size: 14px;
  color: #555;
  text-align: left;
  margin-top: 1px;
  /* Space above caption */
  margin-bottom: 36px;
  /* Space below caption, before next element */
  padding: 0 20px;
  /* Add some horizontal padding */
}

/*.gallery-caption-row {*/
/*    display: flex;*/
/*    gap: 15px; !* Should match the gap in .r2s-video-row *!*/
/*    justify-content: center; !* Should match justify-content in .r2s-video-row *!*/
/*    margin-top: -15px; !* Small space between videos and captions *!*/
/*}*/

/*.gallery-caption-item {*/
/*    flex-grow: 1; !* Allow caption item to grow, similar to video slots *!*/
/*    flex-basis: 0;*/
/*    text-align: center; !* Center text within its slot *!*/
/*    font-size: 13px; !* Adjust as needed *!*/
/*    color: #555; !* Adjust as needed *!*/
/*    font-family: 'Roboto Mono', monospace;*/
/*    !* Optional: to better align with video slots if they have borders/padding *!*/
/*    !* padding: 0 5px; *!*/
/*}*/

/* R2S LAYOUT – kept (unchanged) */
.r2s-vertical-layout {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 5px;
  box-sizing: border-box
}

/* (other r2s rules unchanged…) */

.section {
  font-size: 20px;
  line-height: 1.7;
  margin: 0 0 40px
}

.pull-quote {
  font-size: 32px;
  font-style: italic;
  font-weight: 400;
  margin: 60px 0 20px;
  color: #333
}

/* FOOTER */
.footer {
  font-size: 14px;
  font-family: 'Roboto Mono', monospace;
  color: #666;
  margin: 80px 0 0;
  border-top: 1px solid #ccc;
  padding: 30px;
  text-align: center
}

/* BIBTEX BOX */
.bibtex-code {
  background: rgba(80, 80, 80, .8);
  color: #f1f1f1;
  padding: 20px;
  border-radius: 8px;
  max-width: 1280px;
  margin: 80px auto 0;
  font-size: 14px;
  box-sizing: border-box
}

.bibtex-title {
  font-family: 'Courier New', Courier, monospace;
  font-weight: 700;
  font-size: 1.15em;
  margin: 0 0 10px;
  color: #f1f1f1
}

.bibtex-code pre {
  white-space: pre-wrap;
  overflow-wrap: break-word;
  margin: 0
}

.bibtex-code code {
  font-family: 'Courier New', Courier, monospace;
  overflow-wrap: break-word
}

/* Scroll indicator arrow */
.scroll-indicator {
  position: absolute;
  bottom: 30px;
  right: 30px;
  z-index: 10;
  color: white;
  font-size: 64px;
  animation: bounce 2s infinite;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.scroll-indicator:hover {
  opacity: 1;
}

@keyframes bounce {

  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-10px);
  }

  60% {
    transform: translateY(-5px);
  }
}

/* Video Headers */
.video-wrapper {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-right: 5px;
}

.video-title {
  font-family: 'Roboto Mono', monospace;
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-bottom: 8px;
  text-align: center;
}

/* VIDEO COMPARISON SLIDER */
.video-compare-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 20px auto;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}

.video-compare-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-clipped {
  z-index: 2;
  /* Initial clip state (50%) */
  clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
}

.slider-control {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #fff;
  z-index: 3;
  cursor: col-resize;
}

.slider-handle {
  position: absolute;
  top: 50%;
  left: -15px;
  width: 30px;
  height: 30px;
  background: #fff;
  border-radius: 50%;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transform: translateY(-50%);
  pointer-events: none;
  /* Let clicks pass to the range input */
}

/* Invisible range input covering the slider area */
.slider-input {
  position: absolute;
  top: 50%;
  /* Center vertically to overlay the handle */
  left: -10px;
  /* Slight offset */
  width: calc(100% + 20px);
  height: 100%;
  transform: translateY(-50%);
  opacity: 0;
  z-index: 5;
  cursor: ew-resize;
  margin: 0;
}

.compare-label {
  position: absolute;
  bottom: 20px;
  color: white;
  background: rgba(0, 0, 0, 0.6);
  padding: 5px 10px;
  border-radius: 5px;
  font-family: 'Roboto Mono', monospace;
  font-size: 14px;
  z-index: 4;
  pointer-events: none;
}

.label-left {
  left: 20px;
}

.label-right {
  right: 20px;
}