/* RESET */
/* Box sizing rules */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
    margin: 0;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role='list'],
ol[role='list'] {
    list-style: none;
}

/* Set core root defaults */
html:focus-within {
    scroll-behavior: smooth;
}

/* Set core body defaults */
body {
    min-height: 100dvh;
    text-rendering: optimizeSpeed;
    line-height: 1.5;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
    text-decoration-skip-ink: auto;
}

/* Make images easier to work with */
img,
picture {
    max-width: 100%;
    display: block;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
    font: inherit;
}

/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
    html:focus-within {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* VARIABLES */

:root {
    --container-borders: 40px;
    --container-padding: 20px;
    --container-spacing: calc(var(--container-borders) + var(--container-padding));
    --container-height: calc(100dvh - (2 * var(--container-spacing)));
    --h1-height: 60px;
    --lessons-height: 70px;
    --lesson-page-height: calc(var(--container-height) - (var(--h1-height) + var(--lessons-height)))
}

/* STYLES */

body {
    font-family: Helvetica, sans-serif;
    background-color: white;
    border-width: var(--container-borders);
    border-color: lightblue;
    border-style: solid;
    margin: 0px;
    padding: var(--container-padding);
    width: 100vw;
    height: var(--container-height);
}

h1 {
    height: var(--h1-height);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

h2 {
    margin-block: 1em;
}

#lessons {
    margin-left: 0px;
    height: var(--lessons-height);
    display: flex;
    flex-direction: row;
    align-items: center;
    border: none;
    padding: 0px;
    gap: 5px;
}

#lessons button {
    border: 1px solid lightpink;
    border-radius: 3px;
    background-color: aliceblue;
    width: 100px;
    height: 70px;
    padding: 5px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: break-spaces;
    cursor: pointer;
    font-size: small;
}

#lessons button.lesson-selected {
    background-color: rgb(255, 243, 245);
}

.lesson-page {
    overflow-y: scroll;
    height: var(--lesson-page-height);
}

#next-button {
    border: 1px solid lightpink;
    border-radius: 3px;
    background-color: aliceblue;
    height: 60px;
    padding-inline: 20px;
    cursor: pointer;
}

p {
    line-height: 1.5;
    margin-top: 1em;
    margin-bottom: 1em;
}

label {
    margin-right: 10px;
    display: flex;
    flex-direction: column;
}

fieldset {
    margin: 0px;
    margin-bottom: 10px;
    margin-left: 20px;
    border: 1px lightpink solid;
    border-radius: 3px;
}

fieldset .control-container {
    margin: 0px;
    border: none;
}

fieldset label {
    display: inline;
}

.control-container {
    margin-bottom: 10px;
    margin-left: 20px;
    padding: 10px;
    border: 1px lightpink solid;
    border-radius: 3px;
}

li .control-container,
li fieldset {
    margin-left: 0px;
}

li {
    margin-bottom: 10px;
}

ol {
    padding-left: 20px;
}

.control-invalid {
    background-color: rgba(255, 0, 0, 0.05);
}

.control-valid {
    background-color: rgba(0, 255, 0, 0.05);
}

.control-feedback {
    margin-top: 5px;
    margin-bottom: 0px;
    display: flex;
    flex-direction: row;
}

.control-feedback-fail {
    color: red
}

.control-feedback-fail::before {
    content: "";
    display: inline-block;
    background-color: red;
    -webkit-mask: url('prohibit.svg');
    -webkit-mask-size: 20px;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask: url('prohibit.svg');
    mask-size: 20px;
    mask-position: center;
    mask-repeat: no-repeat;
    width: 20px;
    height: 20px;
    margin-right: 5px;
}

.control-feedback-note {
    color: darkgreen
}

.control-feedback-note::before {
    content: "";
    display: block;
    background-color: darkgreen;
    -webkit-mask: url('question.svg');
    -webkit-mask-size: 20px;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask: url('question.svg');
    mask-size: 20px;
    mask-position: center;
    mask-repeat: no-repeat;
    width: 20px;
    height: 20px;
    margin-right: 5px;
}

pre {
    border: 1px lightblue solid;
    border-radius: 5px;
    padding: 10px;
    background-color: aliceblue;
}

pre code {
    border: none;
    padding: 0px;
}

code {
    border: 1px lightblue solid;
    border-radius: 3px;
    padding: 2px;
    background-color: aliceblue;
}

button[type="submit"] {
    display: none;
}