@charset "utf-8";

/* ========================= */
/* GLOBAL STYLES (ALL SCREENS) */
/* ========================= */

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

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

header img {
   width: 100%;
}

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

h2 {
   font-size: 1.3em;
}

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

nav a {
   display: block;
   background-color: rgb(70, 90, 120);
   line-height: 2.8em;
   text-decoration: none;
   text-align: center;
   color: white;

   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: lightblue;
   color: black;
   font-size: 1.2em;
}

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

/* Base image styling */
main img {
   max-width: 100%;
   height: auto;
}

/* ========================= */
/* VACATION IMAGES & LAYOUTS */
/* ========================= */

.gallery {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
   gap: 12px;
   margin-bottom: 30px;
}

.gallery img {
   width: 100%;
   height: 115px;
   object-fit: cover;
   border-radius: 5px;
   box-shadow: 0 2px 4px rgba(0,0,0,0.12);
}

.destination-images {
   display: flex;
   gap: 15px;
   margin: 15px 0;
}

.destination-images img {
   width: 46%;
   max-width: 320px;
   height: 200px;
   object-fit: cover;
   border-radius: 5px;
   box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

/* ========================= */
/* FOOTER & GENERAL LISTS */
/* ========================= */

body > footer {
   background-color: rgb(70, 90, 120);
   color: rgba(255, 255, 255, 0.7);
   font-weight: bold;
   font-size: 0.9em;
   line-height: 3em;
   text-align: center;
   margin-top: 10px;
   padding: 10px;
}

ul {
   list-style-type: square;
}

/* ========================= */
/* FAMILY TABLE STYLES */
/* ========================= */

.familyTable {
   width: 100%;
   border-collapse: collapse;
   background-color: rgb(245, 245, 245);
   margin: 20px auto;
}

.familyTable caption {
   font-size: 1.2em;
   font-weight: bold;
   margin-bottom: 10px;
}

.familyTable th,
.familyTable td {
   border: 2px solid rgb(70, 90, 120);
   padding: 10px;
   text-align: left;
}

.familyTable thead {
   background-color: rgb(70, 90, 120);
   color: white;
}

.familyTable tbody tr:nth-child(even) {
   background-color: rgb(230, 235, 240);
}

.familyTable tfoot {
   background-color: rgb(210, 225, 235);
   font-style: italic;
   text-align: center;
}

/* ========================= */
/* FORM VALIDATION STYLES */
/* ========================= */

input:focus,
select:focus,
textarea:focus {
   background-color: #e6f2ff;
   border: 2px solid #0077cc;
   outline: none;
}

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

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

/* ========================= */
/* DESKTOP ONLY */
/* ========================= */

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

   html {
      background-color: rgb(210, 225, 235);
      background-image: url("mybackground.jpg");
      background-repeat: no-repeat;
      background-size: cover;
      background-position: center;
   }

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

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

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

   form {
      width: 90%;
   }

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

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

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

   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%;
      margin: 10px 5%;
   }
}

/* ========================= */
/* MOBILE ONLY */
/* ========================= */

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

   header img {
      width: 100%;
      height: auto;
   }

   main {
      padding: 10px;
      margin-top: 70px;
   }

   .destination-images {
      flex-direction: column;
   }

   .destination-images img {
      width: 100%;
      height: auto;
   }

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

   fieldset {
      width: 100%;
   }

   input,
   select {
      width: 90%;
      height: 50px;
   }

   label {
      width: 90%;
   }

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

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

   .familyTable thead {
      display: none;
   }

   .familyTable tr {
      margin-bottom: 15px;
      border: 2px solid rgb(70, 90, 120);
      background-color: white;
   }

   .familyTable td {
      position: relative;
      padding-left: 45%;
   }

   .familyTable td:nth-of-type(1):before { content: "Name:"; }
   .familyTable td:nth-of-type(2):before { content: "Relationship:"; }
   .familyTable td:nth-of-type(3):before { content: "Birthday:"; }
   .familyTable td:nth-of-type(4):before { content: "Interesting Fact:"; }
}