/* The main CSS for decks. This includes structure.css which contains CSS that
is important for slide and embedded media structure.

Margins, colors, fonts and stuff should be defined here. */

@import url("../vendor/fontawesome/css/all.css");

@import url("./structure.css");
@import url("./style.css");
@import url("./media.css");
@import url("./sizes.css");

:root {
  --root-font-size: 38px;
}

/* Box sizing is much nicer for calculations. */
body.deck {
  box-sizing: border-box;
  font-size: var(--root-font-size);
}

/* Title slide (simple) */

section#title-slide {
  text-align: center;
  font-weight: bold;
}

section#title-slide :is(h1, h2) {
  padding: 0;
}

section#title-slide :is(h2) {
  color: var(--shade6);
  padding: 0;
  margin-bottom: 1em;
}

section#title-slide .alignment {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

section#title-slide .author {
  color: var(--shade5);
}

section#title-slide .affiliation {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--shade5);
}

section#title-slide .date {
  color: var(--shade4);
}

section#title-slide div.authors {
  display: flex;
  flex-flow: row wrap;
  justify-content: space-around;

  height: 20%;
}

/* Title Slide Logo Max Heights */

section#title-slide div.authors img,
section#title-slide div.author img {
  height: calc(var(--slide-height) * 0.1);
}

section#title-slide div.affiliation img {
  height: calc(var(--slide-height) * 0.1);
}

section#title-slide div.teaser img {
  height: calc(var(--slide-height) * 0.2);
}

/* Title Slide Logos */

section#title-slide div.logos {
  position: absolute;
  display: flex;
  flex-direction: row;

  bottom: 0;
  left: 0;
  width: 100%;
  height: calc(var(--slide-height) * 0.1);
  justify-content: space-between;
  align-items: center;
}

section#title-slide .logo {
  display: flex;
  flex: 1 0 0;
  align-items: center;
  justify-content: center;
  height: 100%;
  &:first-child {
    justify-content: start;
  }
  &:last-child {
    justify-content: end;
  }
}

section#title-slide .logo img {
  max-height: 100%;
}

/* Allow for multi-line headers */

section#title-slide h1.title {
  display: flex;
  flex-direction: column;
}

section#title-slide h2.subtitle {
  display: flex;
  flex-direction: column;
}

/* Margins and spacing */

/* Override whatever reveal sets here. */
.reveal-viewport {
  line-height: 1.2;
  color: var(--foreground-color);
  background-color: var(--background-color);
}

/* Blocks can popup somewhere on the slide. */
div.block[popup] {
  /* Positioned relative the div.alignment element. */
  position: absolute;
  box-shadow: 0 0 30px 15px rgba(0, 0, 0, 0.4);
  z-index: 3000;
}

/* A centered block. This is very clever. */
div.block[popup="center"] {
  /* Percentages here are relative to the enclosing `position: relative`
  element. */
  top: 50%;
  left: 50%;
  /* Percentages here are relative to the transformed element. */
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center;
}

/* A centered box that is also tilted up. */
div.block[popup="center-up"] {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-23deg) scale(1);
}

/* A centered box that is also tilted down. */
div.block[popup="center-down"] {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(23deg) scale(1);
}

/* control arrows */
.reveal .controls {
  font-size: calc(var(--icon-size) * 0.4);
  bottom: calc(var(--icon-size) * 0.2);
  right: calc(var(--icon-size) * 0.4);
}
.reveal:not(.has-vertical-slides) .controls .navigate-left {
  right: 6.4em; /* keep this the same as for has-vertical-slides */
}
.reveal:not(.has-vertical-slides) .controls .navigate-right {
  right: 0; /* keep this the same as for has-vertical-slides */
}
.reveal .controls-arrow {
  color: var(--icon-inactive-color);
}
.reveal .controls-arrow:hover {
  color: var(--icon-hover-color);
}

/* slide number centered withing control arrows */
.reveal .slide-number {
  font-size: calc(var(--icon-size) * 0.8);
  pointer-events: none;
  position: fixed;
  padding: 0px;
  top: auto;
  left: auto;
  bottom: 1.75em;
  right: -0em;
  width: 3em;
  text-align: center;
  font-family: sans-serif;
  color: var(--foreground-color);
  background: none;
  transform: translate(-50%, -50%);
}
.reveal:not(.has-vertical-slides) .slide-number {
  bottom: 0.8em;
}
.reveal .slide-number > a {
  display: flex;
  justify-content: center;
  align-items: center;
}
.reveal .slide-number-delimiter {
  margin: 0px 1px;
  padding: 0;
}
.reveal .slide-number a,
.reveal .slide-number a:hover {
  text-decoration: none;
}

div.decker-flash-panel {
  z-index: 1000;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translateX(-50%) translateY(-50%);
  padding: 0;
  margin: 0;
  display: flex;
  flex-flow: column nowrap;
  justify-content: center;
  align-items: center;
  align-content: center;
}

/* This is not display: none so screen readers have time to actually read out the content */
div.decker-flash-panel:not(.flashing) {
  opacity: 0;
}

div.decker-flash-panel div.content {
  font-size: 2rem;
  background-color: var(--shade1);
  color: var(--shade6);
  border: solid 0.1em var(--primary-color);
  border-radius: var(--block-border-radius);
  padding: 0.25em 0.5em;
}

div#continue-dialog {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  gap: 1em;
  position: fixed;
  left: 50%;
  bottom: 1em;
  transform: translate(-50%, 0px);
  padding: 1em;
  background-color: var(--background-color);
  border: 2px solid var(--primary-color);
  border-radius: 0.5em;
  font-size: 1rem;
  z-index: 50;
}

.reveal-viewport:not(.presenter-mode) .presenter-only {
  display: none !important;
}

.reveal > header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  padding-top: 3rem;
  padding-left: 3rem;
  padding-right: 3rem;
  border-bottom: 2px solid var(--primary-color);
}

html.dark img {
  border-radius: 0.5rem;
  background-color: var(--shade7);
}

/* Focus Ping */
a,
button,
input,
select,
li,
textarea {
  transition: outline-offset 0.1s ease !important;
  outline-offset: 30px;
  &:focus-visible {
    outline: solid 3px var(--orangeish) !important;
    outline-offset: -1px !important;
  }
  &:active {
    outline-offset: -3px !important;
  }
}

/*
 * Fixed Position so the watermark is displayed on every slide in print mode
 */
.watermark {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  opacity: 0.5;
  z-index: -1;
  font-weight: bold;
}

/* re-introduce the screen-reader-only settings of FontAwesome <7 */
.sr-only,
.fa-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* search dialog of searchPlugin */
#searchbox {
  font-size: 1.2rem;
  padding: 0.3em;
  border: 2px solid var(--shade2);
  border-radius: 0.25em;
  background: rgb(from var(--shade1) r g b / 0.8);
  color: var(--foreground-color);
  display: flex;
  flex-direction: column;
  height: min-content;
}
#searchrow {
  display: flex;
  align-items: center;
  gap: 0.5em;
}
#searchlabel,
#searchinputlabel {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
}
#searchinput {
  font-size: 1em;
  width: 10em;
  padding: 0.2em 0.3em;
  color: var(--foreground-color);
  background: var(--background-color);
  border: 2px solid var(--icon-active-color);
  border-radius: 0.2em;
}
#searchprev,
#searchnext,
#searchclose {
  border: none;
  background: transparent;
  font-size: 0.8em;
  padding: 0.2em;
  width: 1.5em;
}
#searchprev,
#searchnext {
  color: var(--icon-disabled-color);
}
#searchclose {
  color: var(--icon-active-color);
}
