@font-face {
  font-family: "Lora";
  src: url("fonts/Lora-Regular.ttf");
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: "Lora";
  src: url("fonts/Lora-Bold.ttf");
  font-weight: bold;
  font-style: normal;
}
@font-face {
  font-family: "Lora";
  src: url("fonts/Lora-Italic.ttf");
  font-weight: normal;
  font-style: italic;
}
@font-face {
  font-family: "Lora";
  src: url("fonts/Lora-BoldItalic.ttf");
  font-weight: bold;
  font-style: italic;
}

/* Root variables */
:root {
  --text-color: #333;
  /*--border-color: #888;*/
  --border-color: #aaa;
  /*background-color: #a3b1b6;*/
}

/* Global base */
* {
  line-height: 1.5;
  font-family: "Lora", serif;
  text-decoration-thickness: from-font;
  overflow-wrap: break-word;
}

*::selection {
  color: black;
  background-color: #ddddff;
  text-shadow: none !important;
}

/* Hidden helpers */
#fiveserver-info-wrapper,
#url-bar-form,
#backend-json {
  display: none !important;
}

/* Document-level */
html {
  color: var(--text-color);
  font-size: 20px;
  /*background: url("bg3.webp");
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;*/
}

body {
  margin-block: 20vh;
}

/* Layout containers */
#container {
  display: none;
}

.page {
  max-width: 650px;
  margin: auto;
  padding-inline: 30px;
  padding-block: 24px;
  background-color: white;
  border-radius: 8px;
  box-shadow:
    0 0 80px #ffffff,
    0 0 30px #ffffff;
  outline: 1px solid var(--border-color);
  margin-block: 30px;
}

/* Headings & typographic elements */
h1,
h2,
h3 {
  font-size: xx-large;
  margin-block: 0em;
  font-family: "Lora";
  font-weight: normal;
}

h2 {
  /*font-style: italic;*/
}

p {
  margin-block: 0.5em;
}

hr {
  border: none;
  border-top: 1px solid var(--border-color);
  height: 0;
  margin-block: 24px;
  width: calc(100% + 60px);
  transform: translateX(-30px);
}

ul {
  list-style: none;
  padding-left: 0;
  margin-block: 0;
}

li {
  margin-bottom: 0.5em;
  position: relative;
  padding-left: 25px;
}

li::before {
  content: "→";
  position: absolute;
  left: 0;
  margin-right: 10px;
}

#title-picture-container {
  position: absolute;
  width: 80px;
  height: 80px;
  left: calc(50% - 440px);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

#title-picture {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Title specific */
#title > h1 {
  font-family: "Lora", Serif;
  font-weight: normal;
  font-size: 3em;
  margin: auto;
  width: 100%;
  max-width: 700px;
  text-align: start;
  margin-bottom: -20px;
  /*color: white;
  text-shadow:
    0px 0px 3px white,
    -20px -20px 40px #9fa1a3,
    0px 0px 40px #9fa1a3;*/
}

/* Links */
a {
  /*font-style: italic;*/
  color: #000088;
}

a:active,
a:hover {
  color: red;
}

/* Embedded link block */
.embedded-link {
  display: block;
  color: #00000099;
  background-color: #f0f0f0;
  padding: 0.5em;
  padding-inline: 0.8em;
  border-radius: 10px;
}

.embedded-link:hover {
  color: black;
}

/* Image container */
.image-container {
  width: 100%;
  border-radius: 26px;
  overflow: hidden;
  display: inline-block;
  position: relative;
}

.image-container::after {
  content: "";
  position: absolute;
  inset: 0px;
  pointer-events: none;
  border-radius: 26px;
  box-shadow: inset 0 0 8px 10px white;
}

.image-container img {
  width: 100%;
  display: block;
  position: relative;
  border-radius: 30px;
}

/* Comment popover and form */
.comment-popover {
  position: absolute;
  z-index: 9999;
  max-width: 250px;
  width: 100%;
  background: linear-gradient(120deg, #ededf4 0%, #e9eaf4 60%, #e6e9f4 100%);
  border-radius: 8px;
  box-shadow: 0 0 40px #00005522;
  outline: 2px dotted #a6a9af;
  padding: 10px;
  color: black;
}

.comment-popover > div:not(.comment-close) {
  cursor: default;
}

.comment-popover .comment-quote {
  color: #000055;
  font-style: italic;
  display: block;
  border-left: 2px solid #000055;
  padding-left: 7px;
}

.comment-popover form {
  margin-top: 24px;
}

.comment-popover textarea {
  all: unset;
  width: 227px;
  font-size: 1em;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  resize: none;
  height: 100px;
}

.comment-popover .actions :first-child {
  display: none;
}

.comment-popover .actions button {
  all: unset;
  color: blue;
}

.comment-popover .actions button.processing {
  color: transparent;
  background: url("loading.gif");
  background-size: cover;
  border-radius: 20px;
}

/* Comment utilities */
.comment-close {
  /*display: none;*/
  position: absolute;
  right: 14px;
  top: 10px;
  cursor: pointer;
  color: #000055;
}

.comment-marker {
  cursor: pointer;
  color: blue;
  /*font-family: "Times New Roman";*/
  line-height: 0;
  font-weight: bold;
  font-style: normal;
  margin-right: 2px;
  text-decoration: none;
  padding-inline: 2px;
  border-radius: 5px;
  padding-top: 3px;
  padding-bottom: 0px;
}

.comment-marker:hover {
  color: red;
  background-color: #44000011;
}

/* Selection-inject button */
.selection-inject-btn {
  display: inline-block;
  z-index: 9998;
  /*font-family: "Times New Roman";*/
  line-height: 0;
  font-weight: bold;
  font-size: 1em;
  background: transparent;
  color: blue;
  border: none;
  border-radius: 5px;
  padding-inline: 2px;
  padding-top: 3px;
  padding-bottom: 0px;
  margin-right: -2px;
  cursor: pointer;
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;

  /* subtle blue glow on load */
  animation: selection-btn-glow 1s ease-out 1;
  text-shadow: 0 0 0 rgba(0, 0, 255, 0);
}

.selection-inject-btn:hover {
  color: red;
  background-color: #44000011;
}

/* Animation */
@keyframes selection-btn-glow {
  0% {
    text-shadow: 0 0 30px rgb(0, 0, 255);
  }
  50% {
    text-shadow: 0 0 6px rgba(0, 0, 255, 0.25);
  }
  100% {
    text-shadow: 0 0 0 rgba(0, 0, 255, 0);
  }
}

/* Touch/Coarse pointer overrides */
@media (hover: none) and (pointer: coarse) {
  :root {
    /*background-color: black;
    border-radius: 3.5vw;*/
  }

  html {
    padding-block: 0vh;
    background-size: 220%;
  }

  #title > h1 {
    /*text-shadow:
      0px 0px 3px white,
      -10px -10px 30px #000000,
      10px 10px 30px #000000,
      0px 0px 10px #000000;*/
  }

  .comment-marker,
  .selection-inject-btn {
    padding-top: 3px;
    padding-bottom: 0px;
  }

  .comment-marker:hover,
  .selection-inject-btn:hover {
    color: blue;
    background-color: #0000ff44;
  }
}

/* Small screen adjustments */
@media (max-width: 420px) {
  #title > h1 {
    font-size: 10vw;
  }
}
