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

nav a:hover {
   background-color: lightblue;
   color: black;
}

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

/* Base image styling to prevent any photo from overflowing its container */
main img {
   max-width: 100%;
   height: auto;
}

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

/* Grid layout for your main top gallery section */
.gallery {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); /* Compact columns */
   gap: 12px;
   margin-bottom: 30px;
}

.gallery img {
   width: 100%;
   height: 115px; /* Clean thumbnail height */
   object-fit: cover; /* Crops images evenly so they match perfectly */
   border-radius: 5px;
   box-shadow: 0 2px 4px rgba(0,0,0,0.12);
}

/* Flexible row layout for the destination specific photos */
.destination-images {
   display: flex;
   gap: 15px;
   margin: 15px 0;
}

.destination-images img {
   width: 46%; /* Keeps them side-by-side cleanly */
   max-width: 320px; /* Rigid ceiling prevents them from ballooning on big screens */
   height: 200px; /* Perfectly balanced portrait height */
   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 (min-width: 769px) */
/* ========================= */

@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 STYLES - DESKTOP */
   /* ========================= */

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

/* ========================= */
/* MOBILE ONLY (max-width: 768px) */
/* ========================= */

@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 > img {
      float: none;
      width: 90%;
      padding: 10px 0;
   }

   main {
      padding: 10px;
   }

   /* Stack destination images vertically on smaller mobile screens */
   .destination-images {
      flex-direction: column;
   }
   
   .destination-images img {
      width: 100%;
      max-width: 100%;
      height: auto;
   }

   /* ========================= */
   /* FORM STYLES - MOBILE */
   /* ========================= */

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

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

   /* ========================= */
   /* FAMILY TABLE MOBILE FIX */
   /* ========================= */

   .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 {
      border: none;
      position: relative;
      padding-left: 45%;
      padding-top: 8px;
      padding-bottom: 8px;
   }

   .familyTable td:nth-of-type(1):before {
      content: "Name:";
      position: absolute;
      left: 10px;
      font-weight: bold;
   }

   .familyTable td:nth-of-type(2):before {
      content: "Relationship:";
      position: absolute;
      left: 10px;
      font-weight: bold;
   }

   .familyTable td:nth-of-type(3):before {
      content: "Birthday:";
      position: absolute;
      left: 10px;
      font-weight: bold;
   }

   .familyTable td:nth-of-type(4):before {
      content: "Interesting Fact:";
      position: absolute;
      left: 10px;
      font-weight: bold;
   }

   .familyTable tfoot {
      display: block;
      text-align: center;
   }
}