/* Allgemein */

body {
  margin: 0;
  max-width: none;
  padding: 0;
}

header {
  position: static;
  min-height: calc(3.5rem + 1em)
}

header:after {
  content: none;
}

.hamburger {
    position: fixed;
    width: 5rem;
    height: 5rem;
    right: .5em;
    top: .5em;
  }

button, .button, input[type="submit"] {
  color: currentColor;
}

body.post-type-archive-chapter main,
body.single-proofreader main,
body.single-testleser main {
  max-width: 100rem;
  width: calc(100% - var(--gap) * 2);
  margin: 0 auto;
}

body.post-type-archive-chapter main > *,
.single-proofreader main > *,
.single-testleser main > * {
  margin-left: 0;
  margin-right: 0;
}

body.post-type-archive-chapter main > a {
  margin: 0 auto
}

.single-proofreader main > *,
.single-testleser main > * {
  width: 100%
}

.single-proofreader main > ul,
.single-testleser main > ul {
  margin-left: 1em;
}

.single-testleser main {
  hyphens: auto;
}

.single-chapter .h1 {
  margin-bottom: -1rem;
  margin-left: 0;
  margin-right: 0;
}

/* Formulare */

.acf-form-fields {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap, 3rem) 2rem;
}

.acf-form-fields > * {
  flex-grow: 1
}

.acf-checkbox-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  list-style: none;
  margin: 0
}

.acf-checkbox-list label {
  font-weight: inherit;
}

.acf-label label {
  font-weight: 700;
}

.acf-field {
  width: 30rem;
  max-width: 100%;
  align-self: flex-end;
}

.acf-form-submit,
.acf-field-textarea,
.acf-input {
  width: 100%
}

.acf-input-wrap > *,
.acf-input > * {
  width: 100%
}

.acf-hidden {
  width: 100%;
  display: none
}

.acf-range-wrap {
  display: flex;
  gap: 1em;
}

.acf-range-wrap [type="number"] {
  min-width: 5em
}

main .acf-field picture:after {
  content: none;
}

main .acf-field picture {
  float: left;
  margin: 0 1em 0 0;
  max-width: 45%;
  width: 25rem
}

[data-name="end_cover"] {
  clear: both;
}

[data-name="end_cover"] .acf-input {
  display: flow-root;
  width: auto;
  min-width: 300px;
  max-width: 100%;
}

[data-type="message"] {
  width: 100%
}

[data-type="message"] label {
    font: inherit;
    font-family: var(--serif, serif);
    text-align: center;
    font-size: 1.5em;
    margin-top: 2em;
    position: relative;
    margin-bottom: var(--gap);
    line-height: 1.3;
    display: block;
    width: 100%;
}

[data-type="message"] label:before,
[data-type="message"] label:after {
    content: '';
    display: block;
    width: 100%;
    height: .1rem;
    background-image: var(--gradient);
    position: absolute;
    left: 0;
}

#feedback-form {
  gap: 5rem var(--gap);
  flex-direction: column;
}

input {
  accent-color: var(--highlight, default);
}

input[type="range"] {
  width: 100%;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  --progress: calc((var(--val, 50) - var(--min, 0)) / (var(--max, 100) - var(--min, 0)) * 100%);
  /* background:
    linear-gradient(var(--highlight, blue), var(--highlight, blue)) 0 0 / var(--progress, 50%) 100% no-repeat,
    #ddd; */
    border-radius: 0.75rem;
    margin: 1.5rem 0;
    padding: 0
}

/* Track MUSS Höhe haben */
input[type="range"]::-webkit-slider-runnable-track {
  height: 1.5rem;
  background: transparent;
  background:
    linear-gradient(var(--highlight, blue), var(--highlight, blue)) 0 0 / var(--progress) 100% no-repeat,
    #ddd;
    /* opacity: .5; */
    border-radius: 0.75rem;
  -webkit-appearance: none;
}

input[type="range"]::-moz-range-track {
  height: 1.5rem;
  background: transparent;
  background:
    linear-gradient(var(--highlight, blue), var(--highlight, blue)) 0 0 / var(--progress) 100% no-repeat,
    #ddd;
    /* opacity: .5; */
    border-radius: 0.75rem;
}

/* Thumb */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 3.5rem;
  height: 3.5rem;
  cursor: grab;
  background: var(--highlight, blue); /* testweise sichtbar */
  pointer-events: auto;
  border-radius: 50%;
  margin-top: -1rem;
  box-shadow: var(--shadow);
  /* transform: translateY(-50%); */
}

input[type="range"]::-moz-range-thumb {
  width: 3.5rem;
  height: 3.5rem;
  cursor: grab;
  background: var(--highlight, blue);
  pointer-events: auto;
  border-radius: 50%;
  margin-top: -1rem;
  box-shadow: var(--shadow);
  /* transform: translateY(-50%); */
}

input[type="range"]::-moz-range-progress {
  height: 10px;
  background: var(--highlight, blue);
  border-radius: 0.75rem;
}

/* Kapitel */

p em {
	font-style: italic
}

.chapter-content .text {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  grid-gap: .5em;
}

.chapter-content .text > p + p {
  text-indent: 1em
}

.chapter-content {
  background-color: #fff;
  color: #000;
  padding: 3em var(--gap);
  width: 100%;
  margin: 0;

  --bg: #fff;
  --txt: #000;
}

.chapter-content .text {
  max-width: 39em;
  margin: auto;
}

.chapter-content .text > p {
  position: relative;
  text-align: justify;
  hyphens: auto;
}

.comment-btn {
  border: none;
  background-color: #888;
  border-radius: 3px;
  background-image: url('../img/comment.svg');
  height: 1em;
  aspect-ratio: 1;
  color: currentColor;
  background-size: 80%;
  background-repeat: no-repeat;
  background-position: center;
  display: none;
  margin-left: .5em;
  transition: none;
}

p.has_comment .comment-btn,
/* p:hover .comment-btn, */
/* p:focus .comment-btn, */
/* p:focus-within .comment-btn, */
.comment-btn:focus {
  display: inline-block;
}

p.has_comment .comment-btn {
  background-color: var(--highlight);
  transition: none;
}

p.comment_open .comment-btn {
  position: fixed;
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  z-index: 2;
  background: var(--txt);
  opacity: .9;
  margin: 0;
  display: block;
}

.comment-btn:after {
  content: none
}

.comment-box {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--bg);
  padding: 1em;
  border-radius: 3px;
  box-shadow: var(--shadow);
  z-index: 3;
  width: 40rem;
  max-width: calc(100% - var(--gap) * 2);
  text-indent: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: left;
  height: max-content;
  max-height: calc(100vh - 5em);
  overflow: auto;
}

.comment-box textarea {
  border: 1px solid var(--highlight);
  min-height: 10rem
}

#feedback-submit:disabled {
  display: none
}

input, select, textarea, form button:not(.comment-btn) {
  width: -webkit-fill-available;
    padding: calc(.333em + 2px) calc(0.667em + 2px);
    border: 1px solid var(--highlight);
    /* font-size: 1.2em; */
    line-height: 1;
    display: block;
}

input[type="submit"],
label input {
  width: auto;
  flex-grow: 0;
  display: inline-block;
}

input[type="submit"] {
  margin: 0 auto;
}

.wp-block-buttons .wp-block-button__link,
button:not(.comment-btn):not(.hamburger), .button, input[type="submit"],
[type="submit"] {
  padding: calc(.333em + 2px) calc(1.333em + 2px);
  background-color: var(--highlight);
  border: none;
  color: var(--bg) !important;
  font-weight: 400;
  font-family: var(--sans);
  font-size: 1.2em
}

button:after, .button:after, input[type="submit"]:after {
  content: none;
}

label {
  font-weight: 700
}
.range_slider p:last-child:not(:first-child) label {
  font-weight: inherit;
}

.chapter-content .wp-block-spacer {
  background-image: url('../img/space.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12.5em auto;
}

.existing-comment {
  background-color: var(--highlight);
  color: var(--bg);
  border-radius: 3px;
  padding: .25em;
  margin-bottom: .25em;
  width: 100%
}

form {
  display: flex;
  /* flex-direction: column; */
  flex-wrap: wrap;
  gap: var(--gap);
  width: 100%;
  align-self: stretch;
}

form > * {
  flex-grow: 1
}

form > :last-child {
  align-self: flex-end;
}

#chapter-feedback {
  padding: 2em var(--gap);
  max-width: calc(39em + var(--gap) * 2);
  margin: auto;
  width: 100%
}

#chapter-feedback > a {
  margin: 0 auto
}

#chapter-feedback > .h2:not(:first-child) {
  margin-top: 2em
}

input[type="range"] {
  width: 100%
}

.slider-value {
  display: none
}

.new_pw_wrapper {
  position: fixed;
  left: 0;
  top: 0;
  padding: 5rem var(--side, 5rem);
  height: 100%;
  width: 100%;
  background-color: rgba(0,0,0,.9);
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2rem;
}

.new_pw_wrapper > * {
  width: 50rem !important;
  max-width: 100%;
  padding: 5rem var(--gap, 2rem) 3rem;
  box-shadow: var(--shadow);
  background-color: var(--bg);
  color: var(--txt);
  height: auto;
  align-self: center;
}

.msg,
.login_msg,
#feedback-success,
#proofreader-response,
#finish-response {
  padding: var(--gap);
  border: 1px solid var(--highlight);
  margin: var(--gap) auto;
  width: 100%;
}

#finish-response:empty,
#proofreader-response:empty {
  display: none
}

.pw-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 100%
}

.pw-wrapper input[type=password],
.pw-wrapper input[type=text] {
    padding-right: 3em; /* Platz für das Auge */
}

.pw-wrapper button.pw-toggle {
    position: absolute;
    right: 0px;
    /* background: none; */
    border: none;
    cursor: pointer;
    font-size: 16px;
    opacity: .6;
    width: auto;
    padding: .25em .5em;
    height: 100%
}
.pw-wrapper button.pw-toggle:hover {
    opacity: 1;
}

/* Übersicht */

.testleser-info {
  margin: .5em 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1em;
  justify-content: center;
  align-items: center;
}

.testleser-info a {
  font-size: 1.2em;
}

@media screen and (max-width: 768px) {
  .testleser-info {
    flex-direction: column;
    margin-top: 2em
  }
}

.post-type-archive-chapter .h1 {
  width: calc(100% - var(--gap) * 2);
  margin-left: var(--gap);
  margin-right: var(--gap);
}

.chapter-archive {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .5em;
  padding: .5em 0 .5em 0;
  width: 100%;
}

.chapter-archive .chapter-archive {
  width: 100%;
  margin: 0;
  padding: .5em 0 .5em 1em;
}

.disabled .chapter-archive,
.chapter-archive:empty {
  display: none
}

.chapter-archive li .link {
  padding: .5em;
  background: #888;
  color: #000;
  display: block;
  border-radius: 3px;
  text-decoration: none
}

.chapter-archive li .link[data-comments]:not([data-comments="0"]):after {
  content: ' (' attr(data-comments) ' Kommentar/e)';
  opacity: .5;
  font-size: .75em;
}

.chapter-archive li.done > .link {
  background-color: lightgreen;
}

.chapter-archive li.current > .link {
  background-color: lightyellow;
}
