@charset "utf-8";

/*
   Personal Website
   Author: Austin Stephens
   Course: ITSS232
*/

html {
   background-color: hsl(210, 30%, 90%);
}


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

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

header img {
   width: 100%;
}

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

h2 {
   font-size: 1.3em;
}

/*
nav {
   background-color: hsl(210, 40%, 35%);
   padding: 15px;
   text-align: center;
}

nav > a {
   padding-left: 10px;
   padding-right: 10px;
   text-decoration: none;
   color: white;
}

nav > a:hover {
   text-decoration: underline;
   color: hsl(50, 100%, 75%);
}
*/

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

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

nav a {
   display: block;
   background-color: hsl(210, 40%, 35%);
   line-height: 2.8em;
   text-decoration: none;
   text-align: center;
   color: white;
   transition: background-color 0.5s ease-in 0.2s,
               color 0.5s ease-in 0.2s,
               font-size 1s ease;
}

nav a:hover {
   background-color: hsl(50, 100%, 75%);
   color: black;
   font-size: 1.2em;
}

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

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

body > footer {
   clear: both;
   background-color: hsl(210, 40%, 35%);
   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;
}

main ul {
   list-style-type: square;
}

main iframe {
   max-width: 100%;
   border: 0;
}


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

.gallery img {
   width: 25%;
   padding: 5px;
   box-sizing: border-box;
}


/* Family table */
.table-container {
   width: 100%;
}

.family-table {
   width: 100%;
   border-collapse: collapse;
   background-color: white;
   border: 2px solid hsl(210, 40%, 35%);
}

.family-table caption {
   font-weight: bold;
   padding: 10px;
   text-align: left;
}

.family-table th,
.family-table td {
   border: 1px solid hsl(210, 40%, 35%);
   padding: 10px;
   vertical-align: top;
}

.family-table th {
   background-color: hsl(210, 40%, 35%);
   color: white;
}

.family-table tbody tr:nth-child(even) {
   background-color: hsl(210, 30%, 96%);
}

.family-table tfoot td {
   background-color: hsl(210, 30%, 90%);
   font-weight: bold;
   text-align: center;
}


/* Contact form - all screen sizes */

hr {
   clear: both;
}

input:focus,
select:focus,
textarea:focus {
   background-color: hsl(50, 100%, 90%);
   outline: 2px solid hsl(210, 40%, 35%);
}

input:valid,
select:valid,
textarea:valid {
   border: 2px solid seagreen;
}

input:invalid,
select:invalid,
textarea:invalid {
   border: 2px solid firebrick;
}


/* Mobile */

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

   /* Family table - stacking cards (textbook 6-11) */

   .family-table,
   .family-table caption,
   .family-table thead,
   .family-table tbody,
   .family-table tfoot,
   .family-table tr,
   .family-table th,
   .family-table td {
      display: block;
   }

   .family-table thead {
      display: none;
   }

   .family-table tbody tr {
      margin-bottom: 15px;
      border: 2px solid hsl(210, 40%, 35%);
   }

   .family-table tbody td {
      position: relative;
      padding-left: 45%;
      min-height: 1.5em;
      border: none;
      border-bottom: 1px solid hsl(210, 40%, 35%);
   }

   .family-table td::before {
      content: attr(data-label);
      position: absolute;
      left: 10px;
      width: 38%;
      font-weight: bold;
      color: hsl(210, 40%, 35%);
   }

   .family-table tfoot td {
      padding-left: 10px;
      border: 2px solid hsl(210, 40%, 35%);
   }

   .family-table tfoot td::before {
      content: none;
   }

   .gallery img {
      width: 100%;
   }

   /* Contact form - mobile */

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

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

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

   textarea {
      height: auto;
   }

   input[type="radio"] {
      display: inline;
      height: auto;
      width: auto;
   }

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

   label.radio {
      display: inline;
      height: auto;
   }

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

}


/* 2-column gallery */

@media only screen and (min-width: 501px) and (max-width: 768px) {

   .gallery img {
      width: 50%;
   }

}


/* Desktop */

@media only screen and (min-width: 769px) {

      html {
      background-image: url("background.jpg");
      background-repeat: no-repeat;
      background-position: center center;
      background-size: cover;
   }

   /* Contact form - larger screens */

   form {
      width: 90%;
   }

   fieldset {
      width: 90%;
      padding: 5px;
      margin-right: 10px;
      margin-bottom: 10px;
      position: relative;   /* makes the labels' 30% width relative to the fieldset */
   }

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

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

   input[type="radio"] {
      display: inline;
      position: inherit;
      left: 0;
      width: auto;
      margin-left: 30%;   /* keeps the radio buttons clear of the question label */
      margin-bottom: 25px;
   }

   input[type="radio"] + label.radio + input[type="radio"] {
      margin-left: 10px;
   }

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

}
