@charset "utf-8";

html {
   background-color: rgb(184, 202, 219);
}

body {
   font-family: Verdana, Geneva, sans-serif;
   color: rgb(91, 91, 91);
   background-color: ivory;
}

header {
   text-align: center;
   padding: 20px;
}

header img {
   width: 100%;
   max-height: 220px;
   object-fit: contain;
   padding: 0;
}

h1, h2 {
   text-shadow: 4px 6px 5px gray;
}

h2 {
   font-size: 1.3em;
}

nav ul {
   list-style: none;
   margin: 0;
   padding: 0;
   overflow: hidden;
}

nav li {
   display: block;
}

nav a {
   display: block;
   background-color: rgb(70, 95, 120);
   line-height: 2.8em;
   text-decoration: none;
   text-align: center;
   color: ivory;
}

nav a:hover {
   background-color: gray;
   color: white;
   font-size: 1.2em;
   transition: background-color 0.5s ease-in 0.2s, color 0.5s ease-in 0.2s, font-size 1s ease;
}

main {
   padding: 20px;
   margin-top: 70px;
}

body > footer {
   clear: both;
   background-color: rgb(70, 95, 120);
   color: rgba(255, 255, 255, 0.7);
   font-weight: bold;
   font-size: 0.9em;
   line-height: 3em;
   text-align: center;
   margin-top: 10px;
   padding: 10px;
}

ul {
   list-style-type: square;
}

.gallery {
   display: flex;
   flex-wrap: wrap;
   justify-content: center;
   gap: 10px;
}

.gallery img {
   width: 23%;
   height: 200px;
   object-fit: cover;
}

@media only screen and (max-width: 768px) {
   body {
      width: 100%;
      margin: 0;
   }

   nav li {
      float: none;
      font-size: x-large;
      width: 100%;
   }

   nav a {
      border-bottom: 1px solid black;
   }

   main > img {
      width: 90%;
      float: none;
   }

   .gallery img {
      width: 48%;
   }
}

@media only screen and (max-width: 480px) {
   .gallery img {
      width: 100%;
   }
}

@media only screen and (min-width: 769px) {
   html {
      background-image: url("background.jpg");
      background-repeat: no-repeat;
      background-position: center center;
      background-size: cover;
      background-attachment: fixed;
   }

   body {
      width: 90%;
      margin-left: auto;
      margin-right: auto;
      margin-top: 0;
      margin-bottom: 0;
   }

   nav li {
      width: 20%;
      float: left;
   }

   main > img {
      width: 25%;
      padding: 25px;
      float: right;
   }
}

/* Family Table Styles */

.familyTable {
   width: 100%;
   border-collapse: collapse;
   background-color: white;
   border: 2px solid rgb(70, 95, 120);
}

.familyTable th,
.familyTable td {
   border: 1px solid rgb(70, 95, 120);
   padding: 10px;
   text-align: left;
}

.familyTable thead {
   background-color: rgb(70, 95, 120);
   color: ivory;
}

.familyTable tbody tr:nth-child(even) {
   background-color: rgb(230, 238, 245);
}

.familyTable tfoot {
   background-color: rgb(184, 202, 219);
   font-weight: bold;
   text-align: center;
}

/* Assignment 6 Form Styles */

hr {
   clear: both;
}

form {
   width: 90%;
}

fieldset {
   width: 90%;
   padding: 5px;
   margin-right: 10px;
   margin-bottom: 10px;
   position: relative;
}

input,
select,
textarea {
   display: block;
   position: relative;
   left: 30%;
   padding: 5px;
   height: auto;
   width: 60%;
   margin-bottom: 10px;
   box-sizing: border-box;
}

label,
.formLabel {
   display: block;
   position: absolute;
   padding: 5px;
   width: 30%;
   box-sizing: border-box;
}

textarea {
   height: 100px;
}

input:focus,
select:focus,
textarea:focus {
   background-color: rgb(230, 238, 245);
}

input:valid,
select:valid {
   background-color: rgb(220, 255, 220);
}

input:invalid,
select:invalid {
   background-color: rgb(255, 220, 220);
}

.radioRow {
   clear: both;
   position: relative;
   margin-bottom: 15px;
   min-height: 35px;
}

.radioOptions {
   position: relative;
   left: 30%;
   width: 60%;
   padding: 5px;
   box-sizing: border-box;
}

.radioOptions input[type="radio"] {
   display: inline;
   position: static;
   left: 0;
   width: auto;
   margin-right: 5px;
   margin-bottom: 0;
}

.radioOptions label.radio {
   display: inline;
   position: static;
   width: auto;
   padding-right: 20px;
}

input[type="submit"],
input[type="reset"] {
   display: block;
   float: left;
   left: 0;
   text-align: center;
   width: 40%;
   padding: 10px;
   margin-left: 5%;
   margin-right: 5%;
   margin-bottom: 10px;
}

body > footer {
   clear: both;
}

@media only screen and (max-width: 768px) {
   form {
      width: 100%;
      font-size: large;
   }

   fieldset {
      width: 100%;
      padding: 5px;
      margin: 0;
      box-sizing: border-box;
   }

   input,
   select,
   textarea {
      position: inherit;
      display: block;
      height: 50px;
      padding: 5px;
      width: 90%;
      left: 0;
   }

   textarea {
      height: 100px;
   }

   label,
   .formLabel {
      position: inherit;
      display: block;
      height: auto;
      width: 90%;
   }

   .radioOptions {
      position: inherit;
      left: 0;
      width: 90%;
   }

   input[type="submit"],
   input[type="reset"] {
      float: none;
      width: 90%;
      margin: 10px;
      font-size: 1.2em;
   }
}