/* Font Faces */

@font-face {
  font-family: charter;
  font-style: normal;
  font-weight: normal;
  font-stretch: normal;
  src: url('/fonts/charter_regular.woff2') format('woff2');
}

@font-face {
  font-family: charter;
  font-style: italic;
  font-weight: normal;
  font-stretch: normal;
  src: url('/fonts/charter_italic.woff2') format('woff2');
}

@font-face {
  font-family: charter;
  font-style: normal;
  font-weight: bold;
  font-stretch: normal;
  src: url('/fonts/charter_bold.woff2') format('woff2');
}

@font-face {
  font-family: charter;
  font-style: italic;
  font-weight: bold;
  font-stretch: normal;
  src: url('/fonts/charter_bold_italic.woff2') format('woff2');
}

@font-face {
  font-family: 'Berkeley Mono';
  src: url('/fonts/BerkeleyMonoVariable-Regular.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Tailwind's Global Resets and Base Styles */

*,
::before,
::after {
  box-sizing: border-box;
  border-width: 0;
  border-style: solid;
  border-color: #e5e7eb;
}

::before,
::after {
  --tw-content: '';
}

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -moz-tab-size: 4;
  tab-size: 4;
  scroll-padding-top: 40px; /* scrolls anchor links above target */
  font-family: 'charter', serif;
  font-size: 23px;
  font-feature-settings: normal;
  font-variation-settings: normal;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 1rem;
  line-height: inherit;
  text-wrap: pretty;
  background-color: var(--bg);
  color: var(--body);
}

/* :root {
  --bg: #ffffff;
  --body: #374151;
  --headings: #111827;
  --lead: #4b5563;
  --links: #111827;
  --bold: #111827;
  --counters: #6b7280;
  --bullets: #d1d5db;
  --hr: #e5e7eb;
  --quotes: #111827;
  --quote-borders: #e5e7eb;
  --captions: #6b7280;
  --code: #111827;
  --pre-code: #e5e7eb;
  --pre-bg: #1f2937;
  --th-borders: #d1d5db;
  --td-borders: #e5e7eb;
} */

/* @media (prefers-color-scheme: dark) { */
  :root {
    --bg: #0D0F12;
    --body: #f2ece1;
    --headings: #f2ece1;
    --lead: #b4aa9c;
    --links: #f2ece1;
    --bold: #f2ece1;
    --counters: #948d7f;
    --bullets: #2e2a24;
    --hr: #1a1814;
    --quotes: #f2ece1;
    --quote-borders: #31445b;
    --captions: #948d7f;
    --code: #f2ece1;
    --code-bg: #31445b;
    --pre-code: #f2ece1;
    --pre-bg: #232a33;
    --th-borders: #2e2a24;
    --td-borders: #1a1814;
  }
/* } */

/* Tailwind Styles */

input {
  font-size: inherit;
}

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block;
  vertical-align: middle;
}

p {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
}

a {
  color: var(--links);
  text-decoration: underline;
}

strong {
  color: var(--bold);
  font-weight: 700;
}

ol {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
}

ul {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
}

li {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

blockquote {
  font-style: italic;
  color: var(--quotes);
  border-left-width: 0.25rem;
  border-left-color: var(--quote-borders);
  quotes: "\201C""\201D""\2018""\2019";
  margin-top: 1.6em;
  margin-bottom: 1.6em;
  padding-left: 1em;
}

/* ---- Table of Contents ---- */

#toc {
  font-size: 18px;
  line-height: 1.1;
}

#toc a {
  color: #15b886;
}

#toc a:hover {
  color: #65e0ba;
}

#toc ul {
  margin-top: .5em;
  margin-bottom: .5em;
}

#toc .toc-heading {
  font-size: 21px;
  font-weight: bold;
}



/* --------------------------- */

.ql-code-block-container, code {
  padding: 2px 4px;
  font-family: "Berkeley Mono", monospace;
  font-size: 19px;
  font-optical-sizing: auto;
  font-weight: 100;
  color: #fff;
  background-color: var(--code-bg);
  border-radius: 3px;
}

h1 code, h2 code, h3 code {
  font-size: 83%;
}

.ql-code-block-container, pre {
  color: var(--pre-code);
  background-color: var(--pre-bg);
  overflow-x: auto;
  font-size: 19px;
  line-height: 1.7142857;
  margin-top: 1.7142857em;
  margin-bottom: 1.7142857em;
  border-radius: 0.375rem;
  padding-top: 0.8571429em;
  padding-right: 1.1428571em;
  padding-bottom: 0.8571429em;
  padding-left: 1.1428571em;
}

pre code {
  background-color: transparent;
  border-width: 0;
  border-radius: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

pre code::before,
pre code::after {
  content: none;
}

/* Quill Editor Styles (Adjusted for Tailwind) */

/* Container for the editor */
.ql-container {
  font-family: inherit; /* Use the same font as the rest of the page */
  font-size: inherit;
  margin: 0px;
  position: relative;
}

/* Editor area */
.ql-editor {
  min-height: 100vh;
  white-space: pre-wrap;
  overflow-y: auto;
  padding: 0; /* Remove padding to match the rest of the page */
  word-wrap: break-word;
  line-height: 1.5; /* Match Tailwind's line-height */
  outline: none;
  tab-size: 4;
  -moz-tab-size: 4;
  text-align: left;
  font-family: inherit; /* Use the same font */
  font-size: inherit;
  color: inherit;
}

ol > li,
ul > li {
  list-style-type: none;
  padding-left: 0;
}

/* Reset default list styles */
ul, ol {
  list-style-type: none;
  padding-left: 0;
  margin-left: 1.2em; /* Adjust this value to control the space between marker and content */
}

/* Quill's list markers */
li {
  position: relative;
  padding-left: 1.2em; /* Space for the marker */
}

li::before {
  position: absolute;
  left: -1.2em; /* Moves marker outside of content */
  display: inline-block;
  white-space: nowrap;
  width: 1.2em;
}

ul > li::before,
ol > li[data-list="bullet"]::before {
  content: '\2022';
}

.ql-indent-1 {
  padding-left: 1.2em;
}
.ql-indent-2 {
  padding-left: 2.4em;
}
.ql-indent-3 {
  padding-left: 3.6em;
}

li.ql-indent-1 {
  padding-left: 1.2em;
}
li.ql-indent-2 {
  padding-left: 2.4em;
}
li.ql-indent-3 {
  padding-left: 3.6em;
}

li.ql-indent-1::before {
  left: 0em;
}
li.ql-indent-2::before {
  left: 1.2em;
}
li.ql-indent-3::before {
  left: 2.4em;
}

li[data-list=ordered] {
  counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;
  counter-increment: list-0;
}
li[data-list=ordered].ql-indent-1 {
  counter-increment: list-1;
}
li[data-list=ordered].ql-indent-2 {
  counter-increment: list-2;
}
li[data-list=ordered].ql-indent-3 {
  counter-increment: list-3;
}

/* List counter content */
li > .ql-ui:before {
  position: absolute;
  display: inline-block;
  margin-left: -1.5em;
  margin-right: 0.3em;
  text-align: right;
  white-space: nowrap;
  width: 1.2em;
}

li[data-list=ordered] > .ql-ui:before {
  content: counter(list-0, decimal) '. ';
}
li[data-list=ordered].ql-indent-1 > .ql-ui:before {
  content: counter(list-1, lower-alpha) '. ';
}
li[data-list=ordered].ql-indent-2 > .ql-ui:before {
  content: counter(list-2, lower-roman) '. ';
}
li[data-list=ordered].ql-indent-3 > .ql-ui:before {
  content: counter(list-3, decimal) '. ';
}

/* List counter reset */
li[data-list].ql-indent-1 {
  counter-reset: list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;
}
li[data-list].ql-indent-2 {
  counter-reset: list-3 list-4 list-5 list-6 list-7 list-8 list-9;
}
li[data-list].ql-indent-3 {
  counter-reset: list-4 list-5 list-6 list-7 list-8 list-9;
}

/* Blockquotes in Quill */
blockquote {
  border-left: 0.25rem solid var(--quote-borders);
  color: var(--quotes);
  font-style: italic;
  margin-top: 1.6em;
  margin-bottom: 1.6em;
  padding-left: 1em;
}

/* Headings */
h1 {
  font-size: 1.9em;
  margin-top: 0;
  margin-bottom: 0.8888889em;
  line-height: 1.1111111;
  font-weight: 800;
  color: var(--headings);
}

h2 {
  font-size: 1.5em;
  margin-top: 2em;
  margin-bottom: 1em;
  line-height: 1.3333333;
  font-weight: 700;
  color: var(--headings);
}

h3 {
  font-size: 1.25em;
  margin-top: 1.6em;
  margin-bottom: 0.6em;
  line-height: 1.6;
  font-weight: 600;
  color: var(--headings);
}

/* @media (max-width: 640px) {
  h1 {
    font-size: 1.8em;
  }

  h2 {
    font-size: 1.4em;
  }

  h3 {
    font-size: 1.15em;
  }
} */

/* Images and Videos */
img,
video {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.25em auto;
}

/* Alignments */
.ql-align-center {
  text-align: center;
}

.ql-align-right {
  text-align: right;
}

.ql-align-justify {
  text-align: justify;
}

a {
  color: var(--links);
  text-decoration: underline;
}

/* Hide Quill's placeholder if content is present */
.ql-editor.ql-blank::before {
  color: rgba(0, 0, 0, 0.6);
  content: attr(data-placeholder);
  font-style: italic;
  left: 15px;
  pointer-events: none;
  position: absolute;
  right: 15px;
}

/* Non-editor Quill Styles (Unchanged) */

/* Quill Toolbar Styles */
.ql-toolbar.ql-snow {
  position: sticky;
  top: 20px;
  margin-bottom: 20px;
  z-index: 10;
  background-color: var(--bg);
}

.ql-toolbar.ql-snow .ql-formats {
  display: flex;
  flex-wrap: wrap;
  /* margin-right: 15px; */
}

.ql-toolbar.ql-snow .ql-picker-label {
  border: 1px solid transparent;
}

.ql-toolbar.ql-snow .ql-picker-options {
  border: 1px solid transparent;
  box-shadow: rgba(0, 0, 0, 0.2) 0 2px 8px;
}

.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label {
  border-color: #ccc;
}

.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-options {
  border-color: #ccc;
}

.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item.ql-selected,
.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item:hover {
  border-color: #000;
}

.ql-toolbar.ql-snow + .ql-container.ql-snow {
  border-top: 0px;
}

/* Quill Toolbar Buttons */
.ql-snow.ql-toolbar button,
.ql-snow .ql-toolbar button {
  background: none;
  border: none;
  cursor: pointer;
  display: inline-block;
  float: left;
  padding: 3px 5px;
  width: 31px;
}

.ql-snow.ql-toolbar button {
  filter: invert(1) !important;
  margin-right: 5px;
  transform: scale(1.1);
  border-radius: 5px;
}

.ql-snow.ql-toolbar button.ql-active,
.ql-snow.ql-toolbar button.ql-active:hover {
  border: 1px solid #000;
}

.ql-snow.ql-toolbar button:hover {
  color: #000;
  background-color: rgba(0, 0, 0, 0.1);
}

.ql-snow .ql-fill {
  fill: #000 !important;
}

.ql-snow .ql-stroke {
  stroke: #000 !important;
}

/* Essential Quill Toolbar Icon Styles */
.ql-snow .ql-stroke {
  fill: none;
  stroke: #444;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.ql-snow .ql-fill,
.ql-snow .ql-stroke.ql-fill {
  fill: #444;
}

.ql-snow .ql-picker {
  color: #444;
  display: inline-block;
  float: left;
  font-size: 14px;
  font-weight: 500;
  height: 24px;
  position: relative;
  vertical-align: middle;
}

/* Quill Tooltip Styles */
.ql-snow .ql-tooltip {
  position: absolute;
  transform: translateY(10px);
  padding: 3px 10px;
  font-size: 15px;
  background-color: #303150;
  color: var(--body);
  white-space: nowrap;
  border-radius: 5px;
}

.ql-snow .ql-tooltip input[type="text"] {
  display: none;
  width: 170px;
  height: 24px;
  margin: 0px;
  padding: 3px 5px;
  font-family: "Berkeley Mono", monospace;
  font-weight: 100;
  border: none;
}

.ql-snow .ql-tooltip input[type="text"]:active,
.ql-snow .ql-tooltip input[type="text"]:focus {
  outline: none;
}

.ql-snow .ql-tooltip::before,
.ql-snow .ql-tooltip::after,
.ql-action::before,
.ql-action::after {
  font-family: "Berkeley Mono", monospace;
  font-weight: 100;
}

.ql-snow .ql-tooltip a {
  text-decoration: none;
}

.ql-snow .ql-tooltip::before {
  content: "Visit URL:";
  line-height: 26px;
  margin-right: 8px;
}

.ql-snow .ql-tooltip a.ql-preview {
  display: inline-block;
  max-width: 200px;
  overflow-x: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
}

.ql-snow .ql-tooltip a.ql-action::after {
  border-right: 1px solid #ccc;
  content: "Edit";
  margin-left: 16px;
  padding-right: 8px;
}

.ql-snow .ql-tooltip a.ql-remove::before {
  content: "Remove";
  margin-left: 8px;
}

.ql-snow .ql-tooltip a {
  line-height: 26px;
}

.ql-snow .ql-tooltip.ql-editing a.ql-preview,
.ql-snow .ql-tooltip.ql-editing a.ql-remove {
  display: none;
}

.ql-snow .ql-tooltip.ql-editing input[type="text"] {
  display: inline-block;
}

.ql-snow .ql-tooltip.ql-editing a.ql-action::after {
  border-right: 0px;
  content: "Save";
  padding-right: 0px;
}

.ql-snow .ql-tooltip[data-mode="link"]::before {
  content: "Link:";
}

.ql-snow .ql-tooltip[data-mode="formula"]::before {
  content: "Enter formula:";
}

.ql-snow .ql-tooltip[data-mode="video"]::before {
  content: "Video URL:";
}

.ql-snow .ql-tooltip[data-mode="image"]::before {
  content: "Image URL:";
}

.ql-snow .ql-hidden {
  display: none;
}

.ql-snow.ql-toolbar input.ql-image[type="file"], .ql-snow .ql-toolbar input.ql-image[type="file"] {
  display: none;
}

/* Additional Styles */

.page-container {
  max-width: 690px;
  margin: 0 auto;
}

@media (max-width: 640px) {
  html {
    font-size: 17px;
  }

  .ql-code-block-container, code, pre {
    font-size: 15px;
  }
}
