/* CSS VARIABLES */
:root{
    --red: #613A43;
    --tan: #837C6F;
    --mint: #AFC0B4;
    --white: #F6F3EA;
    --coral: #CE7871;
    --dk-gray: #222;

    --fonts: 'Trebuchet MS', Verdana, sans-serif;
    --code-fonts: 'Lucida Console', monospace;
}

/* Body Styles */
/* You will need to add more, but this adds a background pattern to the page */
body{
    background: var(--coral) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cg fill='%23613a43' fill-opacity='0.2'%3E%3Cpath d='M12 0h18v6h6v6h6v18h-6v6h-6v6H12v-6H6v-6H0V12h6V6h6V0zm12 6h-6v6h-6v6H6v6h6v6h6v6h6v-6h6v-6h6v-6h-6v-6h-6V6zm-6 12h6v6h-6v-6zm24 24h6v6h-6v-6z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E");
    font-family: var(--fonts);
    color: var(--dk-gray);
    margin: 0;
    line-height: 1.35;
}

/* Styles for the Header, Main, & Footer */
/* Limits the width, adds a background color and padding, and centers them on the page */
header, main, footer{
    padding: 1rem;
    width: calc(1000px - 2rem);
    max-width: 100%;
    margin: 0 auto;
    background-color: var(--white);
}

/* Shared header and footer styles */
header, footer{
    text-align: center;
    background-color: var(--mint);
}

/* Navigation Styles */
nav{
    width: 50%;
    margin: 0 auto;
}

nav ul{
    list-style-type: none;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    padding: 0;
    margin: 1rem 0 0 0;
}

nav a{
    display: block;
    padding: 1rem;
    text-decoration: none;
    font-weight: bold;
    background-color: var(--red);
    color: var(--white);
    border-radius: 6px;
    transition: all 0.2s ease;
}

/* Nav Hover Styles */
nav a:hover{
    color: var(--red);
    background-color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

nav a.active{
    background-color: var(--coral);
    color: var(--white);
}

/* Styles for the Sections in the Main */
main > section{
    padding: 2rem 0;
    border-bottom: 1px solid var(--tan);
}

main > section:last-child{
    border-bottom: none;
}

/* Styles for the h2 & h3 tags */
h2, h3{
    text-align: center;
    color: var(--red);
    margin-bottom: 1.2rem;
}

h1{
    color: var(--dk-gray);
    margin: 0.4rem 0;
}

/* Paragraph Styles */
p{
    max-width: 65ch;
    margin: 0.5rem auto 1.2rem auto;
}

/* Link Styles */
a{
    color: var(--red);
    text-decoration-color: transparent;
    text-decoration-thickness: 2px;
    transition: text-decoration-color 0.2s ease;
}

/* Link Hover Styles */
a:hover{
    text-decoration-color: var(--mint);
}

/* Link Focus Styles */
a:focus{
    outline-color: var(--coral);
    outline-offset: 2px;
    outline-style: solid;
    outline-width: 3px;
}

/* Form Styles */
form{
    width: 380px;
    max-width: 90%;
    padding: 1.5rem;
    margin: 1.5rem auto;
    background-color: rgba(241, 235, 226, 0.6);
    border: 1px solid var(--tan);
    border-radius: 8px;
}

/* Input, Label, and textarea styles  */
input, label, textarea{
    display: block;
}

/* For the asterisks in the form section */
.required{
    color: var(--coral);
}

/* Shared input and textarea Styles */
input, textarea{
    margin: 0.25rem 0 1.2rem 0;
    width: calc(100% - 8px);
    border: 2px solid var(--red);
    border-radius: 4px;
    padding: 0.5rem;
    font-family: var(--fonts);
    font-size: 1rem;
}

/* Input and Textarea Focus Styles */
input:focus, input:focus-visible, textarea:focus, textarea:focus-visible{
    border-color: var(--coral);
    outline: 3px solid var(--coral);
    outline-offset: 2px;
}

/* input styles */
input{
    height: 2.4rem;
    box-sizing: border-box;
}

/* Fieldset Styles */
fieldset{
    display: grid;
    grid-template-columns: auto 1fr auto 1fr;
    gap: 1.2rem 2rem;
    margin: 1.5rem 0 1.8rem 0;
    padding: 1rem;
    border-color: var(--red);
    border-radius: 6px;
    border-width: 2px;
}

legend{
    font-weight: bold;
    color: var(--dk-gray);
    padding: 0 0.8rem;
}

/* Code for Custom Radios - Compare to Your zyBook, I added additional code to make these match my form styles */
input[type=radio] + label {
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 1.05rem;
}

input[type=radio] {
    appearance: none;
    margin: 0;
    padding: 0;
    border: none;
    font-size: 0;
    border-radius: 0;
    width: 0;
    height: 0;
}

input[type=radio] + label::before {
    content: "\00a0";   /* Non-breaking space */
    font-size: 2.75em;
    line-height: 0.3;
    border-radius: 50%;
    display: inline-block;  
    height: 22px;
    width: 22px;
    text-align: center;
    margin-right: 12px;
    border: 2px solid var(--red);
    background-color: var(--white);
    box-sizing: border-box;
    flex-shrink: 0;
}

input[type=radio]:checked + label::before {
    content: "\2022";
    color: var(--white);
    background: var(--red);
    font-size: 2.2em;
    line-height: 0.45;
}

input[type=radio]:focus{
    outline: none;
}

input[type=radio]:focus + label::before {
    box-shadow: 0 0 0 3px var(--coral);
}

/* Textarea Styles */
textarea{
    height: 6rem;
    resize: vertical;
    font-family: var(--fonts);
}

/* Submit Button Styles */
#my-submit{
    padding: 1rem 1.5rem;
    margin: 1.5rem auto 0.5rem auto;
    width: 100%;
    height: auto;
    background-color: var(--red);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 1.15rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Submit Button Hover Styles */
#my-submit:hover{
    background-color: var(--coral);
    color: var(--dk-gray);
    transform: translateY(-2px);
}

/* Figure / Image Styles (very important after reset) */
figure{
    margin: 2rem auto;
    text-align: center;
    max-width: 700px;
}

img{
    max-width: 100%;
    height: auto;
    border: 4px solid var(--tan);
    border-radius: 8px;
    display: block;
    margin: 0 auto 0.8rem auto;
}

figcaption{
    font-style: italic;
    color: var(--dk-gray);
    font-size: 0.95rem;
}

/* Code Styles */
code{
    font-family: var(--code-fonts);
    font-size: 1rem;
    background-color: #f8f5f0;
    padding: 0.15em 0.35em;
    border-radius: 3px;
}

/* for the pre block */
pre{
    font-family: var(--code-fonts);
    margin: 1.5rem auto;
    max-width: 95%;
    overflow-x: auto;
}

pre code{
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 2px solid var(--dk-gray);
    border-radius: 6px;
    background-color: #2a2a2a;
    color: #e0e0e0;
}

code div{
    padding: 1.2rem;
    overflow: auto;
}

/* Footer fine-tuning */
footer p{
    margin: 0.8rem 0;
    font-size: 0.95rem;
}