@charset "utf-8";

body {
   font-family: Verdana, Geneva, sans-serif;
   color: rgb(91, 91, 91);
   background-color: ivory;
   margin-left: auto;
   margin-right: auto;
   width: 90%;
}

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

header img{
   width: 100%;
}

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

h2 {
   font-size: 1.3em;
}

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

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

nav a {
   display: block;
   background-color: rgb(19, 55, 90);
   line-height: 2.8em;
   text-decoration: none;
   text-align: center;
   color: white;
}

nav a:hover {
   background-color: rgb(54, 99, 145);
   color: yellow;
}

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

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

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

ol {
   list-style-type: upper-roman;
}

input:focus, select:focus, textarea:focus {
   background-color: rgb(255, 255, 204);
   border: 2px solid rgb(19, 55, 90);
}

input:invalid {
   border: 2px solid red;
}

input:valid {
   border: 2px solid green;
}

/* Flexbox styles for Vacation Images*/

div.gallery{
   display: flex;
   flex-flow: wrap;
}

div.imgGallery{
   flex: 23%;
   max-width: 25%;
   padding: 0 2px;
}

div.imgGallery img{
   width: 100%;
}

/* Table Styles */

table.familyTable {
   width: 100%;
   border-collapse: collapse;
   background-color: white;
}

table.familyTable th, table.familyTable td {
   border: 1px solid rgb(19, 55, 90);
   padding: 10px;
   text-align: left;
}

table.familyTable thead {
   background-color: rgb(19, 55, 90);
   color: white;
}

table.familyTable tfoot {
   background-color: rgb(200, 220, 235);
   text-align: center;
}

table.familyTable tbody tr:nth-child(even) {
   background-color: rgb(240, 240, 240);
}

/* Media query for Flexbox 50% width */
@media only screen and (max-width:1100px){
   div.imgGallery{
   flex: 48%;
   max-width: 50%;

   }
}

/* Media query for styles for Tablets - screen sizes 0px - 768px */
@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;
   }

   div.imgGallery{
   flex: 100%;
   max-width: 100%;

   }

   table.familyTable, table.familyTable tbody, table.familyTable th, table.familyTable td, table.familyTable tr {
      display: block;
   }

   table.familyTable thead, table.familyTable tfoot {
      display: none;
   }

   table.familyTable tr {
      margin-bottom: 15px;
      border: 1px solid rgb(19, 55, 90);
   }

   table.familyTable td {
      border: none;
      border-bottom: 1px solid rgb(230, 230, 230);
      position: relative;
      padding-left: 50%;
      text-align: right;
   }

   table.familyTable td::before {
      content: attr(data-label);
      position: absolute;
      left: 10px;
      width: 45%;
      text-align: left;
      font-weight: bold;
   }

   form {
      width: 100%;
      font-size: large;
   }

   fieldset {
      width: 100%;
      padding: 5px;
      margin: 0;
   }

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

   label {
      position: inherit;
      display: block;
      height: 50px;
      width: 90%;
   }

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

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

    form {
      width: 90%;
   }

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

   input, select {
      display: block;
      position: relative;
      left: 30%;
      padding: 5px;
      height: auto;
      width: 60%;
   }

   label {
      display: block;
      position: absolute;
      padding: 5px;
      width: 30%;
   }

   input[type="radio"] {
      display: inline;
      position: inherit;
      left: 0;
      width: auto;
   }

   label.radio {
      display: inline;
      position: inherit;
   }

   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;
   }
}