/* 
=================================================
https://www.joshwcomeau.com/css/custom-css-reset/
================================================= 
*/

/*
  1. Use a more-intuitive box-sizing model.
*/
*,
*::before,
*::after {
  box-sizing: border-box;
}
/*
    2. Remove default margin
  */
* {
  margin: 0;
}
/*
    3. Allow percentage-based heights in the application
  */
html,
body {
  height: 100%;
}
/*
    Typographic tweaks!
    4. Add accessible line-height
    5. Improve text rendering
  */
body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
/*
    6. Improve media defaults
  */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}
/*
    7. Remove built-in form typography styles
  */
input,
button,
textarea,
select {
  font: inherit;
}
/*
    8. Avoid text overflows
  */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}
/*
    9. Create a root stacking context
  */
#root,
#__next {
  isolation: isolate;
}

/* 
=================================================
CUSTOM STYLE
================================================= 
*/

@import url("https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");

:root {
  /* https://materialui.co/colors/ */
  --hue-primary: 180;
  --sat-primary: 30%;
}

/* 
=================================================
https://blog.koley.in/2019/339-bytes-of-responsive-css
https://www.swyx.io/css-100-bytes
https://gist.github.com/JoeyBurzynski/617fb6201335779f8424ad9528b72c41
================================================= 
*/

html,
body {
  padding: 0;
  max-width: 100%;
  color: hsl(var(--hue-primary), var(--sat-primary), 25%);
  font-family: "Roboto", Verdana, serif;
}

body {
  background-color: hsl(var(--hue-primary), var(--sat-primary), 96%);
}

main {
  padding: 1.5rem;
  margin: auto;
  background-color: hsl(var(--hue-primary), var(--sat-primary), 93%);
  min-height: 100%;
}

table {
  border-collapse: collapse;
  font-size: 0.9em;
  margin-bottom: 1em;
}

p,
ul,
ol {
  margin-bottom: 1em;
  color: hsl(var(--hue-primary), var(--sat-primary), 30%);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-bottom: 0.5em;
}

textarea,
input,
select,
.mono {
  font-family: "Roboto Mono", monospace;
}

a {
  color: inherit;
}

@media only screen and (min-width: 768px) {
  main {
    max-width: 42rem;
  }
  table {
    font-size: inherit;
  }
}

/* 
=================================================
APP STYLE
================================================= 
*/

.header {
  margin: 2em 0 1rem;
}

.button {
  display: block;
  width: 100%;
  text-decoration: none;
  padding: 1em;
  margin-bottom: 0.75em;
  color: hsl(var(--hue-primary), var(--sat-primary), 25%);
  border: 1px solid hsl(var(--hue-primary), var(--sat-primary), 50%);
  border-radius: 0.5em;
  background-color: hsl(var(--hue-primary), var(--sat-primary), 96%);
  cursor: pointer;
  font-size: 1.333em;
}

.button.disabled {
  --sat-primary: 0%;
  color: hsl(var(--hue-primary), var(--sat-primary), 40%);
  cursor: not-allowed;
  font-style: italic;
  pointer-events: none;
}

.button:hover {
  background-color: hsl(var(--hue-primary), var(--sat-primary), 90%);
}

svg.lucide {
  display: inline-block;
  vertical-align: text-top;
}

b .lucide,
h1 .lucide,
h2 .lucide,
h3 .lucide,
h4 .lucide,
h5 .lucide,
h6 .lucide {
  stroke-width: 3;
}

.editor {
  display: flex;
  overflow-y: scroll;
  position: relative;
}

.editor textarea {
  margin: 0;
  resize: none;
  outline: none;
  font-size: 13px;
  text-wrap: nowrap;
}

.code {
  flex-grow: 1;
}

.numbers {
  overflow: hidden;
  border: 1px solid #0000;
  background: none;
  text-align: right;
  pointer-events: none;
}

.overlay {
  display: flex;
  position: absolute;
  width: 100%;
  opacity: 50%;
  pointer-events: none;
}

.overlay > textarea {
  border: 1px solid #0000;
  overflow: hidden;
  background: none;
}

.var-container {
  display: flex;
  gap: 0.5em;
}

pre {
  padding: 1em;
  margin-bottom: 1em;
  border: 1px solid hsl(var(--hue-primary), var(--sat-primary), 60%);
  background-color: hsl(var(--hue-primary), var(--sat-primary), 90%);
  border-radius: 0.25em;
}

.admonition {
  padding: 1em;
  margin-bottom: 1em;
  border: 1px solid hsl(var(--hue-primary), var(--sat-primary), 60%);
  background-color: hsl(var(--hue-primary), var(--sat-primary), 90%);
  border-radius: 0.25em;
}

.admonition *:last-child {
  margin-bottom: 0;
}

.admonition-title {
  font-weight: bold;
  border-bottom: 1px solid hsl(var(--hue-primary), var(--sat-primary), 60%);
}

.admonition.danger,
.admonition.error,
.admonition.red {
  --hue-primary: 4.11;
  --sat-primary: 89.62%;
}

.admonition.success,
.admonition.ok,
.admonition.green {
  --hue-primary: 122.42;
  --sat-primary: 39.44%;
}

.admonition.warning,
.admonition.warn,
.admonition.orange {
  --hue-primary: 35.76;
  --sat-primary: 100%;
}

dl dd {
  margin-left: 1em;
}

blockquote {
  padding-left: 1em;
  font-style: italic;
  border-left: 2px solid hsl(var(--hue-primary), var(--sat-primary), 70%);
}

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid hsl(var(--hue-primary), var(--sat-primary), 70%);
  margin-bottom: 1em;
}

.emojione {
  display: inline-flex;
  height: 1.125em;
  vertical-align: text-top;
}

table {
  text-align: center;
  border: 1px solid hsl(var(--hue-primary), var(--sat-primary), 70%);
}

th,
td {
  padding: 0.5em 1em;
  border: 1px solid hsl(var(--hue-primary), var(--sat-primary), 70%);
}

.progress-label {
  position: absolute;
  text-align: center;
  font-weight: 700;
  width: 100%;
  margin: 0;
  line-height: 1.2rem;
  white-space: nowrap;
  overflow: hidden;
}

.progress-bar {
  height: 1.1rem;
  float: left;
  background-color: hsl(var(--hue-primary), var(--sat-primary), 55%);
  border-radius: 0.25em;
}

.progress {
  display: block;
  width: 100%;
  margin-bottom: 1em;
  height: 1.2rem;
  border: 1px solid hsl(var(--hue-primary), var(--sat-primary), 70%);
  border-radius: 0.25em;
  position: relative;
}

.progress.thin {
  margin-top: 0.9rem;
  height: 0.4rem;
}

.progress.thin .progress-label {
  margin-top: -0.4rem;
}

.progress.thin .progress-bar {
  height: 0.4rem;
}

.task-list-item {
  list-style-type: none !important;
}

.task-list-item input[type="checkbox"] {
  margin: 0 4px 0.25em -20px;
  vertical-align: middle;
}
