/* Slides and Script page: the talk as a document, and as slides. */

.container-talk {
  padding-top: 2.2em; /* room for the fixed layout toggle */
}

.section-header + .talk-head {
  padding-bottom: 1.5em;
  margin-bottom: 1em;
  border-bottom: 1px solid var(--border);
}

.talk-head h1 {
  margin: 1em 0 0.4em;
}

/* 'Presented at…' on the left, 'Contents' on the right, one line */
.talk-head-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1em;
  margin-bottom: 0;
}

.talk-intro {
  font-style: italic;
  color: var(--accent);
}

.contents-label {
  color: var(--accent);
  text-decoration: underline;
  white-space: nowrap;
}

.talk-contents {
  margin-top: 0;
  font-size: 0.9em;
  line-height: 1.9;
  text-align: right;
}

.contents-line {
  display: block;
}

.talk-contents a {
  text-decoration: none;
  white-space: nowrap;
}

.talk-contents a:hover {
  text-decoration: underline;
}

.talk-hint {
  font-size: 0.85em;
  color: var(--accent);
  border: 1px solid var(--border);
  padding: 0.4em 0.8em;
  margin: 1.4em 0 2em;
}

kbd {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 0.9em;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 0.3em;
  white-space: nowrap;
}

/* One slide, and the words said over it */
section.slide {
  margin: 2.4em 0;
}

section.slide figure {
  margin: 0 -2.5em; /* slides read better a little wider than the column */
}

section.slide img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
}

section.slide .script p:first-child {
  margin-top: 0.35em;
}

/* What the AI reads, on request */
.alt-text {
  display: none;
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 0.75em;
  line-height: 1.65;
  color: #777;
  white-space: pre-wrap;
  border-left: 2px solid var(--border);
  padding: 0.1em 0 0.1em 0.9em;
  margin: 0.7em 0 0;
}

body.show-alt .alt-text {
  display: block;
}

/* Slide anchors, after the manner of the question anchors on the Answers page */
.slide-anchor {
  float: right;
  font-size: 0.9em;
}

.slide-anchor a {
  text-decoration: none;
  color: var(--accent);
}

.slide-anchor a:hover {
  color: var(--text);
}

.slides-end {
  clear: both;
}

@media (max-width: 46em) {
  section.slide figure { margin: 0; }
}

/* --- Slide layout --- */

.layout-picker {
  position: fixed;
  top: 0.8em;
  right: 0.9em;
  z-index: 20;
  display: flex;
  align-items: baseline;
  gap: 0.55em;
  font-size: 0.8em;
  color: var(--accent);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.25em 0.7em;
}

.layout-picker .picker-label {
  color: #999;
}

.layout-picker label {
  cursor: pointer;
  white-space: nowrap;
}

.layout-picker label:hover {
  color: var(--text);
}

.layout-picker input {
  margin-right: 0.15em;
  vertical-align: middle;
  accent-color: var(--text);
}

.layout-picker label:has(input:checked) {
  color: var(--text);
}

body.slide-layout {
  overflow: hidden;
}

#overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--bg);
}

body.slide-layout #overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#overlay .topbar {
  flex: 0 0 auto;
  width: 100%;
  min-height: 2.9em; /* keeps the stage clear of the toggle button */
  padding: 0.55em 1.2em 0;
}

#overlay .section-header {
  margin: 0 auto;
  width: 19em;
  /* stay centred, but never reach under the layout picker */
  max-width: calc(100vw - 28em);
}

#overlay .title-grid-mini span {
  font-size: min(1.7vw, 0.72em);
}

#overlay .stage {
  flex: 0 0 auto;
  padding: 0.75em 1.5em 0;
}

#overlay .stage img {
  display: block;
  max-height: 62vh;
  max-width: calc(100vw - 3em);
  width: auto;
  height: auto;
  border: 1px solid var(--border);
}

#overlay .words {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  width: 100%;
  max-width: var(--max-width);
  padding: 0.1em 1em 3em;   /* room for the fixed bar below */
}

#overlay .words p:first-child {
  margin-top: 0.4em;
}

#overlay .words .slide-anchor {
  margin-top: 0.35em;
}

#overlay .corner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.4em 1em 0.7em;   /* an opaque strip, so words do not scroll through it */
  background: var(--bg);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1em;
  font-size: 0.8em;
  color: var(--accent);
}

#overlay .corner-help {
  color: #777;
  line-height: 2.1;
}

@media (max-width: 34em) {
  #overlay .corner-help { display: none; }
}

#overlay .corner a {
  color: inherit;
  text-decoration: none;
}

#overlay .corner a:hover {
  color: var(--text);
}

/* Narrow screens: a centred grid would run into the button, so drop below it */
/* Media-query em is always 16px, so this bites at 736px, not 828px. */
@media (max-width: 46em) {
  #overlay .topbar { padding-top: 2.8em; }
  #overlay .section-header { max-width: 60vw; }
}
