/* Shared styles for paper project pages (talestream/, capsmith/).
   Mirrors the main site: same font, colors, text column and breakpoints.
   Page-specific styles (interactive figures) stay in each page. */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Body text size (Overview text) */
:root {
  --text-size: 19px;
}

body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background-color: #fff;
  color: #333;
  overflow-x: hidden;
}

/* The first screen (header, main figure, links) fills at least the viewport, so the
   Overview always starts below the fold; on tall screens the first screen is centered. */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  /* bottom padding nudges the centered block up a little (still one full screen tall) */
  padding-bottom: clamp(0px, 7vh, 90px);
}

main,
.hero-body {
  padding-left: 25vw;
  padding-right: 25vw;
}

main {
  padding-bottom: 80px;
}

.hero .links {
  margin-bottom: 30px;
}

img {
  display: block;
  width: 100%;
  height: auto;
}

/* Figures extend a little past the text column */
.wide {
  margin-left: -10vw;
  margin-right: -10vw;
}

/* Header is wider than the text column so authors and venue fit on one line */
.header {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(16px, 5vh, 64px) 16px 0;
  text-align: center;
}

.title {
  font-weight: 300;
  font-size: 38px;
  line-height: 1.3;
  text-wrap: balance;
  margin-bottom: 24px;
}

.authors {
  font-size: clamp(15px, calc((100vw - 32px) / 46), 18px);
  line-height: 1.7;
  margin-bottom: 6px;
}

/* Same underline style as links on the main site */
.authors a {
  color: #333;
  text-decoration: none;
  border-bottom: 1px solid rgba(51, 51, 51, 0.3);
  padding-bottom: 1px;
  transition: all 0.3s ease;
}

.authors a:hover {
  border-bottom-color: #333;
  opacity: 0.8;
}

sup {
  font-size: 0.65em;
  line-height: 0;
  color: #777;
}

.authors sup {
  margin-left: 1px;
}

/* Keep each name with its affiliation number when the line wraps on phones */
.author {
  white-space: nowrap;
}

.authors,
.venue {
  text-wrap: balance;
}

.affiliations {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px 20px;
  font-size: 16px;
  line-height: 1.6;
  color: #777;
  margin-bottom: 14px;
}

.affiliations sup {
  margin-right: 2px;
}

.venue {
  font-size: clamp(15px, calc((100vw - 32px) / 36), 19px);
  font-style: italic;
  line-height: 1.6;
  color: #555;
}

/* The main figure sits right under the header; each page sizes it so that the title,
   authors, venue, figure and the chips below all fit on the first screen. */
.teaser {
  margin-top: clamp(16px, 4vh, 50px);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: clamp(12px, 3vh, 40px) 0 70px;
}

/* Always-visible pills; hover matches the "View videography" link */
.links a {
  display: inline-block;
  color: #333;
  background-color: #efefef;
  text-decoration: none;
  font-size: 17px;
  padding: 10px 24px;
  border-radius: 999px;
  transition: all 0.3s ease;
}

.links a:hover {
  color: #f5f5f5;
  background-color: rgba(0, 0, 0, 0.9);
}

.links i {
  margin-right: 9px;
}

.section-heading {
  text-align: center;
  font-weight: 300;
  font-size: 32px;
  line-height: 1.8;
  margin-bottom: 30px;
}

.overview p {
  font-size: var(--text-size);
  line-height: 1.8;
  text-align: justify;
}

figure {
  margin-top: 60px;
}

figcaption {
  margin-top: 20px;
  font-size: 17px;
  line-height: 1.7;
  color: #555;
  text-align: justify;
}

.bibtex {
  margin-top: 70px;
}

.bibtex pre {
  background-color: #f5f5f5;
  border-radius: 8px;
  padding: 20px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: Menlo, Consolas, 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.6;
  color: #333;
}

@media (max-width: 1280px) {
  main,
  .hero-body {
    padding-left: 15vw;
    padding-right: 15vw;
  }

  main {
    padding-bottom: 70px;
  }
}

@media (max-width: 768px) {
  :root {
    --text-size: 16px;
  }

  main,
  .hero-body {
    padding-left: 7vw;
    padding-right: 7vw;
  }

  main {
    padding-bottom: 50px;
  }

  .header {
    padding-top: 20px;
  }

  .teaser {
    margin-top: 20px;
  }

  .links {
    margin-top: 16px;
  }

  .wide {
    margin-left: -4vw;
    margin-right: -4vw;
  }

  .title {
    font-size: 26px;
  }

  .affiliations {
    font-size: 13px;
    gap: 2px 14px;
  }

  .links a {
    font-size: 15px;
    padding: 9px 20px;
  }

  .section-heading {
    font-size: 24px;
  }

  figcaption {
    font-size: 14px;
  }

  .bibtex pre {
    padding: 15px;
    font-size: 12px;
  }
}

@media (max-width: 600px) {
  /* Keep the three chips on one row: tighter chips, row as wide as the figure */
  .links {
    margin-left: -4vw;
    margin-right: -4vw;
    gap: 6px;
  }

  .links a {
    padding: 8px 12px;
  }

  .links i {
    margin-right: 6px;
  }
}

@media (max-width: 380px) {
  .links a {
    font-size: 14px;
    padding: 8px 10px;
  }
}
