@charset "utf-8";


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

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

header img {
  width: auto;
  max-height: 110px;
  display: block;
  margin: 0 auto 5px auto;
}

header h1 {
  margin: 5px 0 0 0;
  text-align: center;
}

h1, h2 {
  text-shadow: 2px 3px 4px gray;
}

h2 {
  font-size: 1.3em;
}

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

nav a {
  display: block;
  background-color: #506d88;
  line-height: 2.8em;
  text-decoration: none;
  text-align: center;
  color: #ffffff;
}

nav a:hover {
  background-color: #2f4a63;
  color: #fff2b3;
}

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

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

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


.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 15px 0 30px;
}

.gallery .tile {
  flex: 0 0 calc(25% - 12px);
  height: 200px;
  overflow: hidden;
}

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  background-color: #f8f8f8;
}

thead {
  background-color: #506d88;
  color: white;
}

th, td {
  border: 1px solid #888;
  padding: 8px;
  text-align: left;
}

tfoot {
  background-color: #e6e6e6;
  font-style: italic;
  text-align: center;
}


form {
  margin: 20px auto;
}

fieldset {
  border: 2px solid #506d88;
  padding: 10px;
  background-color: #f2f2f2;
}

legend {
  font-weight: bold;
  padding: 5px 10px;
}

label {
  font-weight: bold;
}

input,
select,
textarea {
  border: 1px solid #999;
  box-sizing: border-box;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  background-color: #fff8dc;
  outline: 2px solid #506d88;
}

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

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

hr.clear {
  clear: both;
}


@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;
    padding: 10px;
    margin: 0 auto;
    display: block;
  }

  .gallery .tile {
    flex: 0 0 100%;
    height: 240px;
  }

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

  thead {
    display: none;
  }

  td {
    border: none;
    border-bottom: 1px solid #ccc;
    position: relative;
    padding-left: 50%;
  }

  td::before {
    position: absolute;
    left: 10px;
    width: 45%;
    font-weight: bold;
  }

  td:nth-of-type(1)::before { content: "Name"; }
  td:nth-of-type(2)::before { content: "Relation"; }
  td:nth-of-type(3)::before { content: "DOB"; }
  td:nth-of-type(4)::before { content: "DOD"; }
  td:nth-of-type(5)::before { content: "Interesting Fact"; }



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

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

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

  input,
  select,
  textarea {
    position: inherit;
    display: block;
    height: 50px;
    padding: 5px;
    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.png");
    background-repeat: repeat-y;
    background-position: center top;
    background-size: cover;
  }

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

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

  .gallery .tile {
    flex: 0 0 calc(25% - 12px);
  }


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

  fieldset {
    width: 90%;
    padding: 10px;
    margin: 10px auto;
    position: relative;
  }

  label {
    display: block;
    width: 30%;
    float: left;
    padding: 5px 0;
  }

  input,
  select,
  textarea {
    display: block;
    width: 65%;
    float: left;
    padding: 5px;
    margin-bottom: 10px;
  }

  textarea {
    height: auto;
    min-height: 120px;
  }

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

  label.radio {
    display: inline;
    float: none;
    width: auto;
  }

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

  body > footer {
    clear: both;
  }
}
