@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: 0 auto;
}

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

/* Navigation */
nav {
  margin-bottom: 20px; /* space between nav and main heading */
}

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

nav li {
  flex: 1;
}

nav a {
  display: block;
  background-color: #4caf50;
  line-height: 2.8em;
  text-decoration: none;
  text-align: center;
  color: #fff;
  font-size: 1em;

  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: #3e8e41;
  color: #fff;
  font-size: 1.2em;

  transition: background-color 0.5s ease-in 0.2s,
              color 0.5s ease-in 0.2s,
              font-size 1s ease;
}

/* Headings */
h2 {
  font-size: 1.3em;
  text-shadow: 4px 6px 5px gray;
  margin-top: 0; /* prevents extra top spacing */
}

/* Main content */
main {
  padding: 20px;
  margin-top: 0; /* prevents pushing content down */
}

/* Images directly under body (if you use them) */
body > img {
  width: 25%;
  padding: 25px;
  float: right;
}

/* Footer */
body > footer {
  clear: both;
  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;
}

/* Responsive layout (nav + images) */
@media only screen and (max-width: 768px) {
  body {
    width: 100%;
    margin: 0;
  }

  nav ul {
    flex-direction: column; /* stack menu items */
  }

  nav li {
    width: 100%;
  }

  nav a {
    border-bottom: 1px solid black;
    font-size: x-large;
  }

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

/* Image grid */
.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 */
.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,
.family-table tbody,
.family-table tfoot {
  background-color: rgb(47, 169, 185);
}

.family-table tfoot {
  font-weight: bold;
}

/* Responsive family table */
@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);
  }
}

/* Focus rule */
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #000;
  background-color: #ffffcc;
}

/* Valid/Invalid pseudo-classes */
input:valid,
select:valid,
textarea:valid {
  border: 2px solid green;
}

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

/* Optional: neutral border before user types */
input:placeholder-shown {
  border: 1px solid #777;
}

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

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

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

  textarea {
    display: block;
    position: relative;
    left: 30%;
    padding: 5px;
    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;
  }

  footer {
    clear: both;
  }
}

/* Mobile screens */
@media screen and (max-width: 700px) {
  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%;
    left: auto;
  }

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

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

/* Embedded videos */
iframe {
  border: none;
}