@charset "utf-8";

/* HTML background */
html {
    background-image: url("background.png");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
}

/* Body styling */
body {
    font-family: Verdana, Geneva, sans-serif;
    color: rgb(91, 91, 91);
    background-color: rgb(47, 169, 185);
    width: 90%;
    margin-right: auto;
    margin-left: auto;
}

/* Navigation 
nav {
    background-color: hsl(180, 72%, 53%);
    padding: 15px;
    text-align: center;
}


nav a {
    padding: 0 10px;
    text-decoration: none;
    color: hsl(210, 40%, 20%);
}


nav a:hover {
    text-decoration: underline;
    color: hsl(210, 60%, 30%);
}
*/ 
nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

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

nav a {
    display: block;
    background-color: #4CAF50;  /* Change this to any color you like */
    line-height: 2.8em;
    text-decoration: none;
    text-align: center;
    color: white;               /* You can change this too */
}

nav a:hover {
    background-color: #3e8e41;  /* A darker shade */
    color: #fff;                /* Contrast color */
}

/* Headings */
h2 {
    font-size: 1.3em;
    text-shadow: 4px 6px 5px gray;
}

/* Main content */
main {
    padding: 0 20px;
}

body > img {
    width: 25%;
    padding: 25px;
}


/* Header image */
header img {
    width: 100%;
}

body > img {
    float: right;
}

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

body > footer {
    clear: both;
}

/* Footer */
body > footer {
    background-color: hsl(210, 30%, 70%);
    color: rgba(219, 8, 8, 0.6);
    font-weight: bold;
    font-size: 0.9em;
    line-height: 3em;
    text-align: center;
    margin-top: 10px;
    padding: 10px;
}

/* Education list marker (non-default) */
ul {
    list-style-type: square;
}

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

   body img {
      width: 90%;
      float: none;
   }

}

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

}

.image-grid {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
   gap: 15px;
   margin: 20px 0;
}

.image-grid img {
   width: 100%;
   height: auto;
   display: block;
}

.family-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.family-table th,
.family-table td {
  border: 1px solid #ffffff;
  padding: 10px;
  text-align: left;
}

.family-table thead {
  background-color: rgb(47, 169, 185);
}

.family-table tbody {
  background-color: rgb(47, 169, 185);
}

.family-table tfoot {
  background-color: rgb(47, 169, 185);
  font-weight: bold;
}

@media (max-width: 768px) {
  .family-table,
  .family-table thead,
  .family-table tbody,
  .family-table tfoot,
  .family-table th,
  .family-table td,
  .family-table tr {
    display: block;
  }

  .family-table thead {
    display: none;
  }

  .family-table tr {
    margin-bottom: 15px;
    border: 1px solid #333;
    padding: 10px;
  }

  .family-table td {
    border: none;
    position: relative;
    padding-left: 50%;
  }

  .family-table td::before {
    position: absolute;
    left: 10px;
    font-weight: bold;
    content: attr(data-label);
  }
}

/* 8) Focus rule (7-22a style idea) */
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #000;
  background-color: #ffffcc;
}

/* 9) Valid/Invalid pseudo-classes (7-22b / Fig 7-57 style idea) */
input:valid,
select:valid,
textarea:valid {
  border: 2px solid green;
}

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

/* Optional (helps users): show invalid only after they interact */
input:placeholder-shown {
  border: 1px solid #777;
}

/* 10a) Larger screen widths */
@media screen and (min-width: 701px) {
  form {
    width: 90%;
  }

  fieldset {
    width: 90%;
    padding: 5px;
    margin-right: 10px;
    margin-bottom: 10px;
    position: relative; /* helps absolute-positioned labels */
  }

  /* iii) input and select elements */
  input,
  select {
    display: block;
    position: relative;
    left: 30%;
    padding: 5px;
    height: auto;
    width: 60%;
  }

  /* include textarea too (not required by your list, but usually desired) */
  textarea {
    display: block;
    position: relative;
    left: 30%;
    padding: 5px;
    width: 60%;
  }

  /* iv) label elements */
  label {
    display: block;
    position: absolute;
    padding: 5px;
    width: 30%;
  }

  /* v) radio inputs */
  input[type="radio"] {
    display: inline;
    position: inherit;
    left: 0;
    width: auto;
  }

  /* vi) labels with class radio */
  label.radio {
    display: inline;
    position: inherit;
  }

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

  /* viii) footer clear updated */
  footer {
    clear: both;
  }
}

/* 10b) Mobile screen sizes */
@media screen and (max-width: 700px) {
  form {
    width: 100%;
    font-size: large;
  }

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

  /* iii) input and select elements */
  input,
  select {
    position: inherit;
    display: block;
    height: 50px;
    padding: 5px;
    width: 90%;
    left: auto; /* prevents leftover left:30% from larger rules */
  }

  textarea {
    position: inherit;
    display: block;
    padding: 5px;
    width: 90%;
    left: auto;
  }

  /* iv) label element */
  label {
    position: inherit;
    display: block;
    height: 50px;
    width: 90%;
  }

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