body {
    /* width: 90%; */
    /* margin: 1rem auto; */
    margin: 1.3rem 1.5rem 2rem;
    background-color: rgb(0, 82, 78);
    --default-color: gainsboro;
    color: var(--default-color);
}

body, button, mtext:not(.math-font) {
    font-family: Verdana;
}

h1 {
    /* color: rgb(255, 214, 81); */
    color: rgb(239, 193, 67);
    font-size: 3rem;
    /* Remove default margins. */
    margin: 0;
    /* font-family: 'Brush Script MT', cursive; */
}

h2 {
    /* color: rgb(60, 200, 255); */
    font-size: 1.6rem;
    /* Can put bottom margin on this instead of a top margin for both home and section content. */
    margin: 1.2rem 0 0.5rem;
}

h1, h2 {
    font-family: Georgia;
}

h3 {
    font-size: 1.2rem;
}

h1, h2, h3, h4 {
    text-align: center;
}

button {
    font-size: 1rem;
}

#section-btns-div {
    max-width: 55rem;
    margin: 1.1rem auto 0;
    display: flex;
    justify-content: center;
    gap: 0.9rem 1.1rem;
    /* 1.1rem 1.2rem; */
    flex-wrap: wrap;
}

#section-btns-div > button {
    /* background-color: rgb(19, 0, 126); */
    background-color: rgb(16, 0, 105);
    /* color: #ebebeb; */
    color: white;
    /* min-width: 5rem; */
    /* min-height: 3rem; */
    padding: 0.7rem 0.8rem;
    /* 0.8rem; */
}

#section-btns-div > button:hover {
    color: greenyellow;
    /* color: rgb(255, 190, 100); */
    cursor: pointer;
}

ol {
    padding-left: 2rem;
}

a {
    color: #90c2ff;
}

summary {
    font-size: 1.15rem;
    width: max-content;
    margin: 0 auto 0.6rem;
}

/* .non-answer-info-div ol, , ol:not(.answer-normal-ol) */
h3, h4, p, .non-answer-info-div, .narrow-text-div, .answer-flex-ol {
    max-width: 40rem;
}

h3, h4, p, ol, table, .non-answer-info-div, .narrow-text-div {
    margin: 0 auto;
}

math {
    font-size: 1.1rem;
}

table {
    text-align: center;
    border-collapse: collapse;
}

th, td {
    padding: 0.4rem 0.7rem;
}

table, th, td {
    border: 0.15rem solid var(--default-color);
}

.non-answer-info-div > :not(:first-child) {
    margin-top: 0.7rem;
    /* 0.8rem; */
}

/*.div-with-info-and-ol is used for divs with at least 1 p and an ol that relates to the p(s) and is used for the
second child of home-content-div and the first child of section-info-div when the current section is the ancient
Egyptian multiplication section.*/

/* .div-with-info-and-ol > :not(:first-child) {
    margin-top: 0.4rem */
    /* 0.3rem; */
/* } */

.div-with-info-and-ol > ol {
    margin-top: 0.3rem;
    margin-bottom: 0.3rem;
}

.div-with-info-and-ol li:not(:first-child) {
    margin-top: 0.3rem;
    /* 0.2rem; */
}

/* .div-with-info-and-ol {
    margin-bottom: 0.9rem;
} */
/* For divs other than a div-with-p-and-ol that are within a non-answer-info-div, the first child is a heading. */
/* Put spacing starting after the 2nd child. */
.non-answer-info-div > div > h3 {
    margin-top: 0.8rem;
}

/* Space between heading and first paragraph. */
/* maybe change to section-div */
.non-answer-info-div > div:not(.div-with-info-and-ol) > :nth-child(2) {
    margin-top: 0.3rem;
}

.non-answer-info-div > div:not(.div-with-info-and-ol) > :nth-child(n + 3) {
    margin-top: 0.7rem
    /* 0.8rem; */
}

/*Some things that this rule does:
~~1. Make the section directions appear 0.8 rem below the section info details summary element when that details element is closed?
~~2. Make the section info div appear 0.8 rem below the details summary element when that details element is open.*/
#section-content-div > :nth-child(n + 3):not(#answer-div) {
/* #section-content-div > :not(#answer-div) { */
    margin-top: 1rem;
}

#divis-rules-example-p {
    margin-top: 0.2rem;
}

/* Space between section info and directions. */
#section-info-div {
    margin-bottom: 1.5rem;
}


#input-div-div {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.input-div {
    display: grid;
    gap: 0.3rem;
}

.input-div > .text-field {
    margin: auto;
    /* Make a little wider than "1,000,000,000,000,000" (1 quadrillion), the largest max input. */
    width: 9rem;
    grid-column: 1 / 3;
    grid-row: 1;
    text-align: center;
}

.input-div > .randomize-btn {
    grid-column: 1 / 3;
    grid-row: 2;
    margin: auto;
}

.input-div > .plus-btn {
    grid-column: 1;
    grid-row: 3;
    margin-left: auto;
}

.input-div > .minus-btn {
    grid-column: 2;
    grid-row: 3;
    margin-right: auto;
}

#calculate-btn {
    display: block;
    margin: auto;
}


#answer-div {
    margin-top: 1.2rem;
    
    /*
    Put min height for 2 reasons:
    1. A user can scroll to the bottom when the answer div is empty and generate an answer and then will
       probably be able to see the whole answer without having to scroll down.
    2. After generating an answer, the user can generate another answer and if the content for that answer takes
       up less vertical space, the page probably won't get smaller.
    */
    min-height: 25rem;
}

/* #answer-div >
div:not(#pf-section-answer-div, #two-square-theorem-answer-div, #fibo-like-sequence-ratios-div, #ancient-mult-tables-div) {
    margin-top: 0.7rem;} */
/* Invalid input div and request error div. */
.answer-error-div {
    text-align: center;
}

.non-bold-answer-h3 {
    font-weight: normal;
}

#answer-div h4 {
    margin-bottom: 0.4rem;
}

/* For GCD and LCM PFs info, Pythagorean triples, and Fibonacci-like sequence division results. */
.answer-normal-ol {
    margin-top: 0.4rem;
    width: max-content;
}

.answer-normal-ol > li:not(:first-child) {
    margin-top: 0.3rem;
}

/*
For primes, semiprimes, twin prime pairs, divisibility info factors and PFs, Goldbach prime pairs,
and Fibonacci-like sequence numbers.
*/
.answer-flex-ol {
    margin-top: 0.7rem;
    display: flex;
    justify-content: center;
    /* --answer-flex-ol-row-gap: 0.8rem; */
    gap: 0.7rem 1.3rem;
    flex-wrap: wrap;
    /* align-items: center; */
}

.answer-normal-ol:not(#pythag-triples-ol), .answer-flex-ol {
    list-style-type: none;
    padding: 0;
}

#pf-section-answer-div, #two-square-theorem-answer-div {
    margin-top: 0.4rem;
    text-align: center;
}

/* #pf-section-answer-div {margin-top: 0.3rem;}
#two-square-theorem-answer-div {margin-top: 0.4rem; } */
/* #divis-answer-factors-ol { margin-top: var(--answer-flex-ol-row-gap);} */
/* :is(.divis-answer-div, .gcd-and-lcm-answer-div):nth-of-type(1) {margin-top: 0.7rem;}
:is(.divis-answer-div, .gcd-and-lcm-answer-div):nth-of-type(2) {margin-top: 1rem; } */

/* For the divisibility and GCD and LCM sections, the answer elements are an h3 and 2 divs, each of which have an h4. */

#divis-rules-answer-div, .euclidean-answer-table-div {
    margin-top: 0.7rem;
}

#divis-pf-answer-div, #gcd-and-lcm-pf-answer-div {
    margin-top: 0.9rem;
}

.euclidean-example-table-div > table, .gcd-message-div {
    /* at least change answer to 0.6rem */
    margin-top: 0.5rem;
}

.euclidean-answer-table-div > table {
    margin-top: 0.6rem;
}

.gcd-message-div {
    text-align: center;
}

#fibo-like-sequence-division-div {
    margin-top: 1.2rem;
}

#fibo-like-sequence-division-div li {
    margin-top: 0.7rem;
    
    /* The quotient is the last part of the text in each li. Align the quotients. */
    text-align: right;
}

#ancient-mult-tables-div {
    margin: 1rem 0 0.8rem;
    display: flex;
    justify-content: center;
    gap: 1.4rem;
    flex-wrap: wrap;
}

#ancient-mult-tables-div > table {
    /* Margin needs to be this to make tables always be 1.4 rem from each other when they're in 1 row. */
    margin: 0;
    
    /* Prevent the shorter table from expanding to be the same height as the taller one. */
    height: max-content;
}

#ancient-mult-tables-div th {
    width: 10rem;
}

/*
This rule for #ancient-mult-steps-ol overrides the margin rule from the
"h3, h4, p, .narrow-text-div, #ancient-mult-steps-ol, .answer-flex-ol" selector
since this selector is after that other one.?
*/
/* .nonAnswerInfoDiv { */
    /* flex layout causes ancient mult product sentence to get width of max content */
    /* display: flex;
    flex-direction: column;
    gap: 1rem; */
/* } */
/* Spacing between paragraphs
section info pragraphs. :nth-child(n + 2)*/
/* #onlyInputDiv { */
    /* margin: auto; */
    /* margin-left: auto;
    margin-right: auto; */
/* } */
/* #leftInputDiv { */
    /* margin-right: min(1rem, 1%); */
    /* margin-right: 1%;
    margin-left: auto; */
/* } */
/* #rightInputDiv { */
    /* margin-left: min(1rem, 1%); */
    /* margin-left: 1%; */
    /* margin-right: auto; */
/* } */