/* Bearblog guestbook: paper layout, monospace type and the sage/ink palette
   from the original stylesheet. */

/* "html:root" is slightly more specific than the built-in ":root" rules,
   so this palette also wins over the built-in dark mode. */
html:root {
  color-scheme: light;
  --width: 36rem;
  --font-main: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --font-secondary: var(--font-main);
  --font-scale: 0.95em;
  --background-color: #fdfcf7;
  --counter-color: #c9d1cb;
  --heading-color: #16151a;
  --text-color: #2f2d36;
  --link-color: #b2352c;
  --visited-color: #7d4a5c;
  --code-background-color: #efede4;
  --code-color: #2f2d36;
  --blockquote-color: #55525e;
  --em-color: #2f2d36c4;
  --muted-color: #75727d;
  --rule-color: #aeabb4;
  --tooth: 8px;
}

* {
  box-sizing: border-box;
}

html {
  padding: clamp(24px, 6vw, 64px) 12px;
  background: var(--counter-color);
}

body {
  position: relative;
  margin: var(--tooth) auto;
  padding: clamp(28px, 6vw, 44px) clamp(18px, 6vw, 44px) 28px;
  max-width: var(--width);
  background: var(--background-color);
  color: var(--text-color);
  font-family: var(--font-secondary);
  font-size: var(--font-scale);
  line-height: 1.7;
  box-shadow: 0 4px 14px #1c261f1f;
}

body::before,
body::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: var(--tooth);
}

body::before {
  bottom: 100%;
  background: conic-gradient(from 135deg at top, var(--background-color) 90deg, #0000 0) 50% / calc(var(--tooth) * 2) 100%;
}

body::after {
  top: 100%;
  background: conic-gradient(from -45deg at bottom, var(--background-color) 90deg, #0000 0) 50% / calc(var(--tooth) * 2) 100%;
}

::selection {
  color: var(--background-color);
  background: var(--heading-color);
}

:focus-visible {
  outline: 2px dashed var(--link-color);
  outline-offset: 3px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-main);
  color: var(--heading-color);
  line-height: 1.35;
  text-wrap: balance;
}

h1 {
  margin: 0 0 20px;
  font-size: 1.5em;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .06em;
}

h1#title {
  padding-bottom: 20px;
  border-bottom: 2px dashed var(--rule-color);
}

h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 36px 0 14px;
  font-size: 1em;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .12em;
  text-wrap: pretty;
}

h2::before,
h2::after {
  content: "";
  flex: 1 1 1.5em;
  border-top: 2px dashed var(--rule-color);
}

h3 {
  margin: 28px 0 10px;
  font-size: 1em;
  text-transform: uppercase;
  letter-spacing: .06em;
}

h4, h5, h6 {
  margin: 24px 0 8px;
  font-size: 1em;
}

p {
  margin: 0 0 16px;
}

a {
  color: var(--link-color);
  text-decoration: underline dashed;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
}

a:visited {
  color: var(--visited-color);
}

a:hover {
  color: var(--heading-color);
  text-decoration: underline solid;
}

strong, b {
  color: var(--heading-color);
}

em, i {
  color: var(--em-color);
}

main {
  padding: 28px 0 8px;
  line-height: 1.7;
  border-bottom: 2px dashed var(--rule-color);
}

hr {
  height: 8px;
  margin: 28px 0;
  border: 0;
  background: radial-gradient(circle, var(--rule-color) 1.5px, #0000 2px) 0 50% / 10px 8px repeat-x;
}

ul, ol {
  padding-left: 1.5em;
}

ul {
  list-style: square;
}

li {
  margin: 4px 0;
}

code {
  font-family: var(--font-main);
  font-size: .92em;
  padding: 1px 4px;
  background-color: var(--code-background-color);
  color: var(--code-color);
}

blockquote {
  margin: 24px 0;
  padding: 14px 18px;
  border: 2px dashed var(--rule-color);
  color: var(--blockquote-color);
  font-style: normal;
  text-align: center;
}

blockquote p:last-child {
  margin-bottom: 0;
}

img {
  max-width: 100%;
  height: auto;
}

footer {
  margin-top: 8px;
  padding: 20px 0 0;
  color: var(--muted-color);
  font-size: .75em;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .08em;
}

footer a {
  color: inherit;
}

footer::after {
  content: "";
  display: block;
  width: min(100%, 14rem);
  height: 44px;
  margin: 18px auto 0;
  background: repeating-linear-gradient(90deg,
    var(--heading-color) 0 2px, #0000 2px 4px,
    var(--heading-color) 4px 7px, #0000 7px 8px,
    var(--heading-color) 8px 9px, #0000 9px 12px,
    var(--heading-color) 12px 13px, #0000 13px 14px,
    var(--heading-color) 14px 17px, #0000 17px 19px,
    var(--heading-color) 19px 20px, #0000 20px 23px);
}

.inline {
  width: auto !important;
}

.highlight,
.code {
  padding: 14px 16px;
  background-color: var(--code-background-color);
  color: var(--code-color);
  border-left: 3px solid var(--rule-color);
  margin-block: 1em;
  overflow-x: auto;
}

.sr-only {
  display: none;
}

/* Form */
input, textarea, select, button {
  max-width: 100%;
  padding: 6px 10px;
  border: 2px dashed var(--rule-color);
  border-radius: 0;
  background: var(--background-color);
  color: var(--text-color);
  font: inherit;
}

input[type="text"],
input[type="url"],
input[type="email"],
textarea {
  display: block;
  width: 100%;
  margin-bottom: 1em;
}

textarea {
  resize: vertical;
}

input[type="submit"],
button {
  cursor: pointer;
}

input[type="submit"]:hover,
button:hover {
  border-style: solid;
  border-color: var(--heading-color);
}

.button-link,
.button-link:hover {
  padding: 0;
  border: none;
  background: none;
}

.button-link {
  color: var(--link-color);
  text-decoration: underline dashed;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
}

.button-link:hover {
  color: var(--heading-color);
  text-decoration: underline solid;
}

/* Guestbook sections */
#guestbooks___guestbook-made-with {
  text-align: right;
  color: var(--muted-color);
  font-size: .85em;
}

#guestbooks___guestbook-messages-header {
  margin-top: 1em;
}

#guestbooks___guestbook-messages-container {
  margin-top: 1em;
}

/* Reply styling */
.guestbook-message-reply {
  margin-left: 2rem;
  padding-left: 1rem;
  border-left: 3px solid var(--rule-color);
}

.guestbook-message-reply blockquote {
  margin: 0;
  padding: 0;
  border: none;
  text-align: left;
}

/* Proof of Work bot deterrent */
.guestbooks___pow-container {
  margin: 0.75em 0;
}

.guestbooks___pow-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  cursor: pointer;
  user-select: none;
  font-size: 0.95em;
}

.guestbooks___pow-checkbox-label input[type="checkbox"] {
  width: 1.1em;
  height: 1.1em;
  padding: 0;
  cursor: pointer;
  accent-color: var(--heading-color);
}

.guestbooks___pow-label-text--loading {
  opacity: 0.7;
}

.guestbooks___pow-label-text--verified {
  color: #3f7a4a;
}

.guestbooks___pow-label-text--error {
  color: var(--link-color);
}