@charset "utf-8";

/* Styles for ALL devices */

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

header {
padding: 0;
}

header img {
width: 100%;
}

h1,
h2 {
color: rgb(70, 90, 120);
text-shadow: 4px 6px 5px gray;
}

hr {
border: 1px solid rgb(70, 90, 120);
margin: 25px 0;
}

nav {
background-color: rgb(70, 90, 120);
overflow: hidden;
}

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

nav a {
display: block;
background-color: rgb(70, 90, 120);
line-height: 2.8em;
text-decoration: none;
text-align: center;
color: white;
font-weight: bold;
}

nav a:hover {
background-color: rgb(255, 230, 150);
color: rgb(70, 90, 120);
}

main {
padding: 20px;
margin-top: 35px;
line-height: 1.7em;
min-height: 625px;
font-size: 1.05em;
}

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

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

/* Vacation Gallery */

.gallery {
display: flex;
flex-wrap: wrap;
gap: 15px;
margin-bottom: 25px;
}

.gallery img {
flex: 1 1 calc(25% - 15px);
max-width: calc(25% - 15px);
height: 275px;
object-fit: cover;
}

/* Family Table */

table {
width: 100%;
border-collapse: collapse;
background-color: white;
margin-top: 20px;
}

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

th {
background-color: rgb(70, 90, 120);
color: white;
}

tfoot {
background-color: rgb(230, 230, 230);
font-weight: bold;
text-align: center;
}

/* Assignment 6 Form Styles */

form {
   width: 90%;
}

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

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

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

/* Radio Buttons */

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

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

label.radio {
   margin-right: 15px;
}


/* Submit and Reset Buttons */

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

/* Focus Style */

*:focus {
   background-color: rgb(255, 255, 200);
}

/* Valid and Invalid Styles */

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

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

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

body {
width: 90%;
margin: 0 auto;
}

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

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

/* Tablet Gallery */

@media only screen and (max-width: 1024px) {

   .gallery img {
      flex: 1 1 calc(50% - 10px);
      max-width: calc(50% - 10px);
   }

   label {
      width: 40%;
   }

   input,
   select,
   textarea {
      left: 40%;
      width: 55%;
   }
}

/* Mobile */

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

body {
width: 100%;
margin: 0;
}

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

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

main > img {
width: 90%;
float: none;
display: block;
margin: auto;
padding: 0;
}

.gallery img {
flex: 1 1 100%;
max-width: 100%;
}

/* Responsive Family Table - Chapter 6-11 */

table,
thead,
tbody,
tfoot,
tr,
th,
td {
display: block;
}

thead {
display: none;
}

tr {
margin-bottom: 15px;
border: 1px solid rgb(70, 90, 120);
}

td {
border: none;
border-bottom: 1px solid rgb(70, 90, 120);
position: relative;
padding-left: 50%;
text-align: left;
}

td::before {
content: attr(data-label);
position: absolute;
left: 10px;
width: 45%;
font-weight: bold;
color: rgb(70, 90, 120);
}

tfoot td {
padding-left: 10px;
}

/* Assignment 6 Mobile Form */

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

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

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

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

textarea {
   height: 120px;
   margin-bottom: 15px;
}

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

}
