@charset "utf-8";

/*
   Assignment 5 - Personal Website
   Author: Evan Barth
   Date:   06/03/2026
   Filename: personal.css
*/


/* ============================================================
   ALWAYS APPLY — regardless of screen size
   ============================================================ */

html {
   background-color: hsl(140, 30%, 75%);
}

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

header {
   text-align: center;
   padding: 0;
}

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;
   overflow: hidden;
}

nav li {
   display: block;
}

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

nav a:hover {
   background-color: rgb(204, 85, 0);
   color: rgb(255, 255, 255);
}

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

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

body > footer a {
   color: rgba(255, 255, 255, 0.6);
}

ol {
   list-style-type: upper-roman;
}

/* Gallery — always apply base structure */
.gallery {
   display: flex;
   flex-wrap: wrap;
   gap: 10px;
   padding: 10px 0;
}

.gallery-item {
   overflow: hidden;
}

.gallery-item img {
   width: 100%;
   height: 200px;
   object-fit: cover;
   display: block;
}

/* ============================================================
   TABLE STYLES — always apply
   ============================================================ */

table {
   width: 100%;
   border-collapse: collapse;
   margin-top: 20px;
}

th, td {
   border: 1px solid rgb(45, 90, 45);
   padding: 12px 15px;
   text-align: left;
}

thead {
   background-color: rgb(45, 90, 45);
   color: rgb(255, 255, 255);
}

thead th {
   border-color: rgb(30, 65, 30);
}

tbody tr:nth-child(odd) {
   background-color: ivory;
}

tbody tr:nth-child(even) {
   background-color: rgb(220, 235, 215);
}

tbody tr:hover {
   background-color: rgb(255, 235, 200);
}

tfoot {
   background-color: rgb(204, 85, 0);
   color: rgb(255, 255, 255);
   font-style: italic;
   font-size: 0.9em;
   text-align: center;
}

tfoot td {
   border-color: rgb(160, 65, 0);
   text-align: center;
}


/* ============================================================
   DESKTOP — min-width 769px
   ============================================================ */

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

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

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

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

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

   /* Gallery: 4-column layout */
   .gallery-item {
      width: calc(25% - 8px);
   }

}


/* ============================================================
   MOBILE — max-width 768px
   ============================================================ */

@media only screen and (max-width: 768px) {

   body {
      width: 100%;
      margin: 0;
   }

   nav li {
      float: none;
      font-size: x-large;
      width: 100%;
   }

   nav a {
      border-bottom: 1px solid black;
   }

   main > img {
      width: 90%;
      float: none;
   }

   /* Gallery: 2-column layout */
   .gallery-item {
      width: calc(50% - 5px);
   }

   /* Responsive table — stack into card layout */
   table, thead, tbody, tfoot, tr, th, td {
      display: block;
   }

   /* Hide the header row visually but keep it accessible */
   thead tr {
      position: absolute;
      top: -9999px;
      left: -9999px;
   }

   tbody tr {
      border: 2px solid rgb(45, 90, 45);
      margin-bottom: 15px;
      background-color: ivory;
   }

   tbody tr:nth-child(even) {
      background-color: rgb(220, 235, 215);
   }

   td {
      border: none;
      border-bottom: 1px solid rgb(200, 225, 200);
      position: relative;
      padding: 10px 10px 10px 50%;
      min-height: 40px;
   }

   td::before {
      content: attr(data-label);
      position: absolute;
      left: 10px;
      width: 44%;
      font-weight: bold;
      color: rgb(45, 90, 45);
   }

   /* Keep tfoot visible and styled */
   tfoot tr {
      position: static;
      border: 2px solid rgb(160, 65, 0);
      background-color: rgb(204, 85, 0);
   }

   tfoot td {
      padding: 10px;
      color: rgb(255, 255, 255);
      text-align: center;
   }

   tfoot td::before {
      content: none;
   }

}


/* ============================================================
   SMALL MOBILE — max-width 480px
   Gallery drops to 1-column
   ============================================================ */

@media only screen and (max-width: 480px) {

   .gallery-item {
      width: 100%;
   }

}
