/*
 * SPDX-License-Identifier: GPL-2.0-or-later
 * Project-specific extensions for the archive-style reader.
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

#header .heading {
  float: none;
}

#header::after {
  content: "";
  display: block;
  clear: both;
  width: 100%;
  height: 2.25em;
  background: #900;
  box-shadow:
    inset 0 -6px 10px rgba(0, 0, 0, 0.35),
    1px 1px 3px -1px rgba(0, 0, 0, 0.25),
    inset 0 -1px 0 rgba(0, 0, 0, 0.85);
}

.unofficial-notice {
  clear: both;
  margin: 0 0 1.5em;
  padding: 0.643em;
  color: #333;
  background: #eee;
  border: 1px solid #ccc;
}

.work.navigation {
  min-height: 2.5em;
  margin: 0 0 0.643em;
}

.work.navigation::after {
  content: " ";
  display: block;
  clear: both;
}

#work-skin.wrapper {
  box-shadow: none;
  margin-bottom: 0;
  padding: 0;
}

.commas li:not(:last-child)::after {
  content: ",";
  color: #2a2a2a;
}

.meta .stats .stat-pair {
  display: contents;
}

.meta .stats dl dt {
  font-weight: normal;
}

a.tag,
a.tag:link,
a.tag:visited {
  padding: 0;
  color: #111;
  line-height: 1.5;
  text-decoration: none;
  border-bottom: 1px dotted;
}

a.tag:hover,
a.tag:focus,
a.tag:visited:hover {
  color: #fff;
  background: #900;
}

.chapter .title {
  text-align: center;
}

.work-text {
  margin: 3em auto 4em;
  padding: 0 3em;
}

.story-paragraph {
  position: relative;
  scroll-margin-top: 1em;
}

.story-paragraph + .story-paragraph {
  margin-top: 1.286em;
}

.story-paragraph > p:first-child {
  margin-bottom: 0;
}

.placeholder-story {
  color: #777;
  font-style: italic;
  text-align: center;
}

.paragraph-actions {
  margin: 0.25em 0 0;
  text-align: right;
}

.paragraph-comment-toggle {
  height: auto;
  padding: 0.15em 0.5em;
  font-size: 0.75em;
  opacity: 0.72;
}

.paragraph-comment-toggle:hover,
.paragraph-comment-toggle:focus {
  opacity: 1;
}

.paragraph-comment-panel,
.placeholder {
  margin: 0.643em 0 1.286em;
  padding: 0.643em;
  color: #555;
  background: #eee;
  border: 1px dashed #aaa;
}

.comment-thread {
  margin: 0.643em 0 1.286em;
}

.comment-state,
.comment-empty,
.comment-form-note,
.comment-status {
  color: #555;
}

.comment-state-error,
.comment-status-error {
  color: #900;
}

.comment-list {
  margin: 1em 0;
}

.comment-item {
  margin: 0.75em 0;
  padding: 0.75em;
  background: #f7f7f7;
  border: 1px solid #ddd;
  border-left: 3px solid #900;
}

.comment-byline,
.comment-reply-context,
.comment-body {
  margin: 0;
}

.comment-author {
  font-weight: bold;
}

.comment-author-badge {
  display: inline-block;
  margin-left: 0.5em;
  padding: 0.05em 0.4em;
  color: #fff;
  background: #900;
  border-radius: 0.2em;
  font-size: 0.8em;
}

.comment-time {
  margin-left: 0.75em;
  color: #666;
  font-size: 0.85em;
}

.comment-reply-context {
  margin-top: 0.35em;
  color: #666;
  font-size: 0.85em;
}

.comment-body {
  margin-top: 0.5em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.comment-children {
  margin: 0.75em 0 0 1.5em;
}

.comment-reply {
  border-left-color: #777;
}

.comment-form {
  margin-top: 1.25em;
  padding-top: 1em;
  border-top: 1px solid #ccc;
}

.comment-form-note {
  margin-top: 0;
}

.comment-label {
  display: block;
  margin-bottom: 0.25em;
  font-weight: bold;
}

.comment-form textarea {
  width: 100%;
  min-height: 7em;
  resize: vertical;
}

.comment-form-footer {
  display: flex;
  gap: 0.75em;
  align-items: center;
  justify-content: flex-end;
  margin-top: 0.5em;
}

.comment-character-count {
  color: #666;
  font-size: 0.85em;
}

.comment-submit {
  height: auto;
  padding: 0.35em 0.75em;
}

.comment-status {
  min-height: 1.25em;
  margin: 0.5em 0 0;
}

.bottom-actions {
  float: none;
  min-height: 2.5em;
  margin: 1em 0 2em;
  text-align: center;
}

.feedback-zone,
.kudos-zone {
  clear: both;
  margin: 2em 0;
  padding: 1em;
  border-top: 3px double #999;
}

.feedback-zone > .heading,
.kudos-zone > .heading {
  display: block;
  margin-bottom: 0.643em;
}

.feedback-count {
  color: #555;
}

.kudos-zone .actions {
  float: none;
  text-align: left;
}

#footer .actions {
  float: none;
  text-align: left;
}

#footer {
  color: #fff;
  background: #900;
  border-top-color: #600;
  box-shadow: inset 0 6px 10px rgba(0, 0, 0, 0.28);
}

#footer p {
  clear: both;
  margin: 0.643em 0;
}

.error-page {
  display: grid;
  min-height: 100vh;
  place-content: center;
  justify-items: center;
  padding: 2em;
  text-align: center;
}

.error-page .error-code {
  color: #900;
  font: 400 5em/1 Georgia, serif;
}

.error-page .button {
  display: inline-block;
  margin-top: 1em;
  padding: 0.5em 1em;
  color: #444;
  background: linear-gradient(#fff 2%, #ddd 95%, #bbb 100%);
  border: 1px solid #bbb;
  border-radius: 0.25em;
  text-decoration: none;
}

@media only screen and (max-width: 42em) {
  #header .heading {
    float: none;
    padding-bottom: 0;
  }

  #header .primary {
    display: flex;
  }

  #header .primary li {
    float: none;
    flex: 1;
    text-align: center;
  }

  #header .primary a {
    padding-right: 0.35em;
    padding-left: 0.35em;
  }

  div.preface {
    margin-right: 0.75em;
    margin-left: 0.75em;
  }

  .work-text {
    padding-right: 0.5em;
    padding-left: 0.5em;
  }

  .meta .stats dl {
    display: flex;
    float: none;
    flex-wrap: wrap;
    gap: 0.25em 0.75em;
    align-items: baseline;
  }

  .meta .stats .stat-pair {
    display: flex;
    gap: 0.25em;
    align-items: baseline;
    white-space: nowrap;
  }

  .meta .stats dl dt,
  .meta .stats dl dd {
    float: none;
    display: inline;
    width: auto;
    margin: 0;
    padding: 0;
  }

  .work.navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35em;
    justify-content: flex-end;
  }

  .work.navigation li {
    padding: 0;
  }

  .work.navigation a {
    height: auto;
    white-space: normal;
  }

  .bottom-actions {
    justify-content: center;
  }

  .comment-children {
    margin-left: 0.5em;
  }
}
