/* General styling */
body #content-cont {
  max-width: 65em;
  width: auto;
  /* adding extra padding to allow audio element */
  padding-bottom: 5em;
}
body #content-cont h1 {
  margin-top: 1.5em;
  margin-bottom: 0.33em;
}
body #content-cont .speaker-subtitle {
  font-size: 1.25em;
  margin-top: 0.4em;
  margin-bottom: 1em;
}

/* Back to text home link styling */
#back-to-home-cont {
  position: relative;
  margin-top: 1em;
  margin-bottom: 1.5em;
}
#back-to-home-cont a {
  padding-left: 1.5em;
}
#back-to-home-cont span {
  position: relative;
  background-image: linear-gradient(var(--link), var(--link));
  background-size: 0% 1px;
  background-position: 0% 100%;
  background-repeat: no-repeat;
  transition: var(--trans) ease;
}
#back-to-home-cont a:hover span,
#back-to-home-cont a:focus span {
  background-size: 100% 1px;
}
#back-to-home-cont a {
  background: none;
  border-bottom: none;
}
#back-to-home-cont span::after { /*back arrow*/
  content: "";
  display: block;
  position: absolute;
  width: 0.35em;
  height: 0.35em;
  border: 2px solid transparent;
  border-left-color: var(--link);
  border-bottom-color: var(--link);
  top: 50%;
  left: -1em;
  transform-origin: center center;
  transform: translate(0%, -50%) rotate(45deg);
  pointer-events: none;
  transition: var(--trans) ease;
}
#back-to-home-cont a:hover span::after,
#back-to-home-cont a:focus span::after {
  transform: translate(-25%, -50%) rotate(45deg);
}

/* Error / no text styling */
#error-heading {
  text-align: center;
}

/* Audio styling */
#audio-element {
  width: 100%;
  max-width: inherit;
  margin: 0;
  box-sizing: border-box;
}
#audio-element audio {
  width: 100%;
  box-shadow: 0 0.25em 1em rgba(0, 0, 0, 0.1);
  border-radius: 2em;
}
/* only float the audio at the bottom when there is a transcript */
.has-transcript #audio-element {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  padding: inherit;
  padding-top: 1em;
  padding-bottom: 1em;
}
/* when there is no transcript, keep it within the page */
.no-transcript #audio-element {
  margin-top: 1.25em;
  padding: 1em 0;
}

/* Download buttons + show gloss checkbox styling */
#text-controls {
  display: flex;
  gap: 1.5em;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
#download-buttons {
  display: flex;
  gap: 0.5em;
  flex-wrap: wrap;
}
#download-buttons button {
  margin: 0;
}

/* General transcript annotation layout */
.transcript-annotation-cont {
  margin: 1.5em 0;
}
.transcript-annotation-cont p {
  margin: 0.5em 0;
}
.transcript-annotation-cont .timestamp {
  flex: 0 0 auto;
}
.transcript-annotation-cont .transcript-annotation {
  max-width: 100%;
  flex: 1 1 0;
}
@media (min-width: 30em){
  .transcript-annotation-cont {
    display: flex;
    gap: 1.5em;
    margin: 0;
    align-items: flex-start;
  }
}

/* Flex annotations layout */
.flex-annotations {
  display: flex;
  gap: 1.5em;
  flex-wrap: wrap;
  overflow: hidden;
  /*
  Note: some content may overflow because
  morphemes/words have flex-basis: auto
  and cannot shrink (to force everything to be
  on one line only), so having overflow-x
  to hidden may hide *some* things
  */
}
.flex-annotations .flex-word {
  position: relative;
}
.flex-annotations .flex-word::after {
  content: "";
  position: absolute;
  top: 0;
  right: -0.75em;
  background: var(--light-bg);
  width: 1px;
  height: 100%;
}
.flex-annotations .flex-word:last-child::after {
  background: transparent;
}
.flex-annotations .flex-word > p {
  margin: 0.5em 0;
}
.flex-annotations .flex-word-morphemes {
  display: flex;
  flex-wrap: nowrap;
  gap: 1em;
}
.flex-annotations .flex-word-morphemes .flex-morpheme p {
  margin: 0.25em 0;
}

/* Annotations styling */
.timestamp {
  transition: var(--trans);
}
.timestamp:hover {
  cursor: pointer;
  color: var(--main-col);
}
.translation {
  font-style: italic;
  color: var(--light-text);
}
.flex-word {
  color: var(--light-text);
}
.flex-word .lubukusu {
  color: var(--med-text);
}
.highlighted {
  background-color: var(--highlight);
}