@charset "utf-8";

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


/* 4) Body styles */
body {
  font-family: Verdana, Geneva, sans-serif;
  color: rgb(91, 91, 91);
  background-color: ivory;

  margin: 0;
  width: 90%;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 0 20px rgba(0,0,0,0.25);
}

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


/* 5) Header section */
header {
  text-align: center;
  padding: 20px;
}

header img {
  width: 100%;
  height: auto;
  display: block;
  padding: 0;
}


/* 6) h2 */
h2 {
  font-size: 1.3em;
}

/* 7) Nav section */
nav {
  float: none;
  width: 100%;
  padding: 0;
  background-color: rgb(205, 220, 230);
}

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

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


nav a {
  display: block;
  text-decoration: none;
  background-color: rgb(142, 174, 230);
  line-height: 2.8em;
  padding: 0 14px;
  color: rgb(91, 91, 91);
  text-align: center;
}


nav a:hover{
  background-color: rgb(7, 93, 146);
  color: ivory;
  font-size: 1.2em;
  transition:
    background-color 0.5s ease-in 0.2s,
    color 0.5s ease-in 0.2s,
    font-size 1s ease;
}


nav a:focus {
  background-color: rgb(7, 93, 146);
  color: ivory;
}


/* 10) main padding */
main {
  float: none;
  width: 100%;
  padding: 20px;
  margin-top: 70px;
  clear:both;
}

/* 11) img styles */
main > img {
  width: 25%;
  padding: 25px;
  float: right;   /* requirement #8 */
}



/* 12) body > footer */
body > footer {
  background-color: rgb(205, 220, 230);
  color: rgba(40, 40, 40, 0.6);
  font-weight: bold;
  font-size: 0.9em;
  line-height: 3em;
  text-align: center;
  margin-top: 10px;
  padding: 10px;
  clear: both;

}

/* 13) Change list marker on education page list */
.school-list {
  list-style-type: square;
}

/* Gallery */

.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.gallery img {
  width: calc(25% - 10px);
  height: auto;
  display: block;
}

/* Tablet: 2 columns */
@media only screen and (max-width: 1024px) {
  .gallery img {
    width: calc(50% - 10px);
  }
}

/* Mobile: 1 column */
@media only screen and (max-width: 768px) {
  .gallery img {
    width: 100%;
  }
}

/*  TABLE (Week 5)
    */

.tableWrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 15px;
}

table {
  width: 100%;
  border: 10px double rgb(9, 153, 243);
  border-collapse: collapse;
}

th, td {
  height: 25px;
  border: 1px solid gray;
  padding: 10px;
  vertical-align: top;
}

thead, tfoot {
  background-color: rgb(7, 93, 146);
  color: rgb(255, 255, 255);
}

tbody tr:nth-of-type(even) {
  background-color: rgb(197, 206, 221);
}

@media (max-width: 700px) {

  .tableWrap {
    overflow-x: visible;
  }

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

  thead, tfoot {
    display: none;
  }

  tbody td {
    position: relative;
    padding-left: 40%;
  }

  tbody td::before {
    content: attr(data-label);
    position: absolute;
    top: 0;
    left: 0;
    width: 40%;
    padding: 10px;
    font-weight: bold;
  }
}


/* ===== Assignment 6 Form Layout ===== */

/* Focus (7-22a) */
input:focus, select:focus, textarea:focus {
  background-color: rgb(220, 255, 220);
  outline: 2px solid rgb(7, 93, 146);
}

/* Valid / Invalid (7-22b) */
input:valid, select:valid, textarea:valid {
  border: 2px solid green;
}

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

/* Row wrapper so absolute labels don’t overlap */
.formRow {
  position: relative;
  margin-bottom: 10px;
  min-height: 40px;
}

/* ===== Larger screens ===== */
@media (min-width: 701px) {

  form { width: 90%; }

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

  input, select, textarea {
    display: block;
    position: relative;
    left: 30%;
    padding: 5px;
    height: auto;
    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 (max-width: 700px) {

  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%;
    left: 0;
  }

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