@font-face {
  font-family: 'Fira Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/fira-mono.ttf) format('truetype');
}

:root {
  --bg: #fff;
  --contrast-bg: #eee;
  --text: rgb(58, 58, 58);
  --contrast-text: #888;
  --highlight: #ff3399;
  --second-highlight: #ff2968;

  --background: var(--bg);
  --accent: rgb(48, 155, 255);
  --lighter-accent: rgb(99, 180, 255);
}

* {
  box-sizing: border-box;
}

.ProseMirror-menubar {
  min-height: 1em !important;
  padding-top: 4lopx !important; 
}

body {
  padding: 16px;
  background: var(--background);
  font-family: sans-serif;
  max-width: 580px;
  margin: auto;
  color: #3a3a3a;
  font-size: 17px;
  line-height: 1.52;
  box-sizing: content-box;
  position: relative;
  margin: auto;

  background-color: var(--bg);
  color: var(--text);

  &, input, textarea, pre {
    font-family: sans-serif;
  }

  &:not(.blog-post) {
      padding-bottom: 60px;
  }
}

h1, h2 {
  font-size: 1.4rem;
  margin-top: 24px;
}

h1,
h2,
h3,
h4 {
  line-height: 1.1;
  margin-top: 25px;
  margin-bottom: 16px;
}

h1:first-child,
h2:first-child,
h3:first-child,
h4:first-child {
  margin-top: 0;
}

a,
a:visited {
  color: var(--accent);
}

input, textarea, button {
  background: var(--bg);
  border: 1px solid var(--text);
  padding: 10px;
  border-radius: 5px;
  color: var(--text);
}

.page-date {
  padding: 0px;
  margin: 0px;
  font-size: 1rem;
  font-weight: normal;
}

textarea {
  width: 100%;
  min-height: 200px;
}

button {
  background: var(--contrast-bg);
  cursor: pointer;
}

label {
  margin-top: 20px;
  margin-bottom: 6px;
}

form button[type=submit] {
  margin-top: 20px;
}

.title {
  font-family: "Fira Mono", menlo, monospace;
  font-weight: bold;
  margin-bottom: 7px;
  font-size: 1.2rem;
  a {
    color: inherit;
    text-decoration: none;
  }
}



ul, ol {
  margin-top: 0.6rem;
  & ul {
    margin-top: 0rem;
  }
  & p {
    margin: 0px !important;
  }
}

.addendum {
  display: block;
  margin-top: 20px;
}


form > * { 
  display: block;
}


.hidden {
  display: none;
}


/*  */
.flex-row { 
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  gap: 20px;

  & > * { 
    flex: 1;
  }
}

nav.categories {
  margin-top: 12px;

  a {
    display: block;
    --vertical-padding: 8px;
    --vertical-offset: 1px;
    margin: 0;
    padding-right: 4px;
    line-height: 0;
    text-decoration: none;
    padding-top: calc(var(--vertical-padding) + var(--vertical-offset));
    padding-bottom: calc(var(--vertical-padding) - var(--vertical-offset));
    font-family: "Iosevka", "Fira Mono", "menlo", monospace;
    font-weight: normal;
    font-size: 1.05rem;
    border: none;
    border-bottom: 3px solid transparent;
    display: inline-block;
    padding-bottom: 1px;

    &:not(first-child) {
      margin-right:8px;
      margin-bottom:8px;
    }
  }
}

.list-date {
  font-feature-settings: "tnum";
  vertical-align: top;
  -webkit-font-feature-settings: "tnum";
  -moz-font-feature-settings: "tnum";
}

.page-date {
  padding: 0px;
  margin: 0px;
  font-size: 1rem;
  font-weight: normal;
}

.list-link {
  display: inline-block;
  max-width: 55vw;
}


.post-index {
  list-style: none;
  padding-left: 0;
  margin-top: 30px;
}

.static_index .post-index {
  margin-top: 30px;
}

.post-title {
  margin-bottom: 0px;
}

.post-date {
  margin-top: 8px;
  margin-bottom: 6px;
  font-weight: normal;
  font-size: 1rem;
}

@media screen and (max-width: 800px) {
  :root {
    --body-padding: 16px;
  }

  .flex-row { 
    flex-direction: column;
  }

  textarea {
    width: calc(100vw - (var(--body-padding) * 3));
  }
}


#pm-editor {
  margin-top: 40px;
  /* line-height: 1.8; */
  /* border: 1px solid var(--text); */
  border-radius: 5px;

  .ProseMirror-menubar {
    padding-top: 5px;
    border-radius: 5px 5px 5px 5px;
    border: 1px solid black;
  }

  .ProseMirror {
    margin-top: 40px;
    margin-bottom: 40px;
    padding-top: 8px;
    padding-left: 16px;
    padding-right: 6px;
    padding-bottom: 4px;
    border-left: 1px solid black;
    position: relative;
    left: -10px;
  }

  .ProseMirror-focused {
    /* border: none; */
    outline: none;
  }

  p {
    /* margin: 0; */
  }
}

p:first-child {
  margin-top: 0px;
}

p:last-child {
  margin-bottom: 0px;
}


body .ProseMirror blockquote, body blockquote {
  margin: 0;
  padding: 6px 14px;
  padding-left: 18px;
  margin-left:35px;
  border-left: 1px solid black;
  position: relative;;
  
  &::before {
    content:"‟";
    display: inline;
    position: absolute;
    top: -10px;
    left: -22px;
    font-size: 30px;
  }
}


.post-content {
  margin-top: 20px;

  p {
    /* margin: 0; */
  }

   & > p > img {
     max-width: 100%;
     cursor: zoom-in;
  }

  .zoomed {
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    text-align: center;
    width: 100vw;

    img {
      max-width: 100%;
      max-height: 100vh;
      margin: auto;
      display: inline-block;
      cursor: zoom-out;
    }
  }
}

.ProseMirror p > img { 
    max-width: 100%;
}

body.something-zoomed {
  background: black;
  overflow: hidden;

  * {
    background: black;
    color: black;
  }

  p:not(.zoomed) {
    opacity: 0;
  }
}

.post-folders {
  & > * {
    display: inline-block;
  }
}

.return a {
  padding-top: 0.625rem;
  display: inline-block;
  text-decoration: none;
  color: #3a3a3a;
  border-bottom: 2px solid transparent;
  padding-bottom: 0px;
}

.return a:hover {
    border-bottom: 2px solid var(--accent);
}

#on-the-run {
  background: #eee;
  border-radius: 6px;
  width: 220px;
}


.deploy {
  position: fixed;
  top: 20px;
  right: 20px;
}


.deploy input[type="submit"] {
  background: var(--accent);
  color: var(--text);
  cursor: pointer;
}

code {
  font-family: "Fira Mono", "Iosevka", "menlo", monospace;
  font-size: 0.9em;
  color: var(--second-highlight);

  &:before {
    content: "`";
  }

  &:after {
    content: "`";
  }
}

s {
  text-decoration: line-through;
}

pre {
  margin: 0px;
}

pre code {
  color: var(--text);

  &:before {
    content: "";
  }

  &:after {
    content: "";
  }
}

.subscribe {
  margin-top: 26px;
  form {
    margin: 4px 0px;
    position: relative;
    min-height: 20px;

    input[type='email'] {
        border: 1.5px solid var(--contrast-text);
        outline: none;
        border-radius: 4px;
        padding: 4px 6px;
        width: 150px;

        &:focus {
            border-color: var(--accent);
        }
    }

    button[type='submit'] {
        /* border: 1.5px solid var(--contrast-text); */
        outline: none;
        margin-top: 0px;
        border-radius: 4px;
        padding-top: 4px;
        height: 25px;
        font-weight: 500;
        cursor: pointer;
        background: #eee;
        color: #3a3a3a;
        font-size: 0.8rem;
        position: absolute;
        left: 160px;

        &:hover {
            background: #ddd;
        }

        &:active {
            background: var(--lighter-accent);
            border-color: #444;
        }
    }

    & > * { 
      display: inline-block;
      margin-top: 0px;
      position: absolute;
      top: 0px;
    }
  }
}

.delete-form {
  margin-top: 280px;
  margin-bottom: 20px;
  float: right;
  display: none;
}

.local-edit .delete-form {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #222;
    --contrast-bg: #333;
    --text: #fff;
    --contrast-text: #bbb;
    --second-highlight: #ffcc00;
  }

  #on-the-run {
    background: #181818;
  }
}

.folder {
  margin-top: 20px;
  margin-bottom: 20px;
}