@charset "utf-8";

/* =================================================
   GENERAL STYLES (APPLY TO ALL SCREENS)
   ================================================= */

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

body {
  font-family: Verdana, Geneva, sans-serif;
  color: rgb(91, 91, 91);
  background-color: ivory;
  width: 90%;
  margin: 20px auto;
  padding: 20px;
  text-align: center;
}

header {
  background-color: #4caf50;
  color: white;
  padding: 10px;
  text-align: center;
}

header img {
  max-width: 800px;
  max-height: 200px;
  width: auto;
  height: auto;
  display: block;
  margin: 0 auto;
  padding: 10px 0;
}

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

section {
  margin-top: 20px;
}

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

/* =================================================
   NAVIGATION
   ================================================= */

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

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

nav a {
  display: block;
  background-color: hsl(210, 30%, 60%);
  line-height: 2.8em;
  text-decoration: none;
  text-align: center;
  color: white;
  font-weight: bold;
}

nav a:hover {
  background-color: hsl(210, 40%, 40%);
  color: ivory;
}

/* =================================================
   IMAGES & GALLERY
   ================================================= */

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

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

.gallery img {
  width: 23%; /* 4 columns desktop */
}

/* =================================================
   FOOTER
   ================================================= */

footer {
  clear: both;
  margin-top: 20px;
  background-color: #4caf50;
  color: white;
  padding: 10px;
  font-weight: bold;
  font-size: 0.9em;
  line-height: 3em;
  text-align: center;
}

footer a {
  color: white;
  text-decoration: none;
}

/* =================================================
   DESKTOP MEDIA QUERY (769px and up)
   ================================================= */

@media screen and (min-width: 769px) {
  body {
    background-image: url("background-desktop.jpg");
    background-size: cover;
    background-repeat: no-repeat;
  }
}

/* =================================================
   TABLET MEDIA QUERY (2-column gallery)
   ================================================= */

@media screen and (min-width: 481px) and (max-width: 768px) {
  .gallery img {
    width: 45%;
  }
}

/* =================================================
   MOBILE MEDIA QUERY (768px and below)
   ================================================= */

@media 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;
    padding: 8px 0;
  }

  main > img {
    width: 90%;
    float: none;
    margin: 10px auto;
  }

  .gallery img {
    width: 90%;
  }
}
/* ===========================
   FAMILY TABLE STYLING
   =========================== */
.family-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background-color: #ffffff;
}

.family-table th,
.family-table td {
  border: 2px solid #4caf50;
  padding: 12px;
  text-align: left;
}

.family-table thead {
  background-color: #4caf50;
  color: white;
}

.family-table tfoot {
  background-color: #e8f5e9;
  font-weight: bold;
  text-align: center;
}

/* ---- Responsive Table (Section 6-11) ---- */
@media screen and (max-width: 600px) {
  .family-table thead {
    display: none;
  }

  .family-table,
  .family-table tbody,
  .family-table tr,
  .family-table td {
    display: block;
    width: 100%;
  }

  .family-table tr {
    margin-bottom: 15px;
    border: 2px solid #4caf50;
    padding: 10px;
  }

  .family-table td {
    text-align: right;
    position: relative;
    padding-left: 50%;
  }

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


/* ===== Form Styles ===== */
form {
  width: 90%;
  margin: 20px auto;
}

fieldset {
  width: 90%;
  padding: 5px;
  margin-right: 10px;
  margin-bottom: 10px;
  border: 2px solid #4caf50;
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="date"],
select,
textarea {
  display: block;
  position: relative;
  left: 30%;
  padding: 5px;
  height: auto;
  width: 60%;
  margin-bottom: 10px;
}

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

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;
  width: 40%;
  padding: 10px;
  margin-left: 5%;
  margin-right: 5%;
  margin-bottom: 10px;
  text-align: center;
}

/* ===== Focus, Valid, Invalid Styles ===== */
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #4caf50;
}

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

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

/* ===== Mobile Styles ===== */
@media screen and (max-width: 768px) {
  form {
    width: 100%;
    font-size: large;
  }

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

  input[type="text"],
  input[type="tel"],
  input[type="email"],
  input[type="date"],
  select,
  textarea {
    display: block;
    position: inherit;
    width: 90%;
    height: 50px;
    padding: 5px;
    margin-bottom: 10px;
    left: 0;
  }

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

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


/* ===== Main Top Margin ===== */
main {
  margin-top: 70px; /* ensures spacing between nav and heading */
}

/* ===== Navigation Hover Transition ===== */
nav a:hover {
  font-size: 1.2em;
  transition: 
    background-color 0.5s ease-in 0.2s,
    color 0.5s ease-in 0.2s,
    font-size 1s ease;
}

/* ===== Responsive YouTube Videos ===== */
iframe {
  max-width: 100%;
  height: auto;
}

/* ===== Optional: Maintain ul styling consistency ===== */
main ul {
  padding-left: 20px;
  list-style-type: disc;
}