@charset "utf-8";

/* BASE STYLE */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: hsl(30, 25%, 92%);
  width: 90%;
  margin-left: auto;
  margin-right: auto;
}

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

header h1 {
    color: hsl(22, 95%, 60%);
    font-size: 1.8em;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 20px;
    margin: 0;
    text-shadow: 0 0 12px rgba(255, 110, 20, 0.4);
}

img {
  width: 100%;
  display: block;
}

h2 {
    font-size: 1.3em;
    color: hsl(22, 95%, 60%);
    border-left: 4px solid hsl(22, 95%, 50%);
    padding-left: 10px;
}

/* Navigation */
#navicon {
  display: none;
}

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

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

nav a {
  display: block;
  line-height: 4em;
  text-decoration: none;
  text-align: center;
  color: rgb(220, 210, 200);
  background-color: #1a0f08;
  font-weight: bold;
  border-bottom: 3px solid hsl(22, 95%, 45%);
  letter-spacing: 1px;
  
  
}

nav a:hover {
  background-color: hsl(10, 50%, 45%);
  color: hsl(45, 80%, 80%);
  transition: background-color 0.5s ease-in 0.2s, color 0.4s ease-in 0.2s, transform 0.2s ease;
}

/* Main */
main {
  clear: both;
  padding: 20px;
  margin-top: 20px;
}

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

/* Footer */
footer {
    clear: both;
    background-color: hsl(20, 15%, 25%);
    color: hsl(22, 95%, 60%);
    font-weight: bold;
    font-size: 0.9em;
    line-height: 3em;
    text-align: center;
    margin-top: 20px;
    padding: 10px;
    border-top: 2px solid hsl(22, 95%, 35%);
}

/* Table */
table {
    width: 100%;
    border: 4px inset hsl(22, 60%, 30%);
    border-collapse: collapse;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

caption {
    font-size: 1.5em;
    font-weight: bold;
    padding: 12px;
    color: hsl(22, 95%, 65%);
    letter-spacing: 1px;
    text-transform: uppercase;
}

th, td {
    height: 50px;
    border: 1px solid hsl(22, 30%, 25%);
    text-align: center;
    padding: 10px;
    color: rgb(220, 210, 200);
}

thead {
    background-color: hsl(22, 70%, 22%);
}

thead th {
    color: white;
    font-size: 1em;
    letter-spacing: 1px;
}

tfoot {
    background-color: #1a0f08;
}

tfoot td {
    height: auto;
    text-align: left;
    padding: 15px;
}

tfoot p {
    margin: 0;
    line-height: 1.7;
    color: rgb(180, 170, 160);
}

tbody tr:nth-child(even) {
    background-color: #1f1208;
}

tbody tr:nth-child(odd) {
    background-color: #170e06;
}


/* Lists */
ul {
    list-style-type: square;
    color: black
}

ol {
    color: black;
}

ul li, ol li {
    margin-bottom: 10px;
    line-height: 1.8;
}


/* Flexbox Gallery */
div.gallery {
    display: flex;
    flex-flow: row wrap;
    gap: 10px;
    margin: 20px 0;
}

div.imgGallery {
    flex: 30%;
    max-width: 32%;
    padding: 8px;
    background-color: #1a0f08;
    border: 1px solid hsl(22, 70%, 30%);
    text-align: center;
    box-sizing: border-box;
}

div.imgGallery img {
    width: 100%;
    display: block;
}

div.imgGallery p {
    margin: 6px 0 0 0;
    font-size: 0.9em;
    color: hsl(22, 95%, 65%);
    font-style: italic;
}

/* Iframe */
iframe {
    display: block;
    width: 100%;
    max-width: 600px;
    aspect-ratio: 16/9;
    margin-bottom: 40px;
    border: 2px solid hsl(22, 70%, 35%);
}

/* Form Validation */
input:focus, select:focus, textarea:focus {
    background-color: hsl(45, 80%, 95%) !important;
    outline: 2px solid hsl(10, 50%, 45%);
}

input:valid, select:valid, textarea:valid {
    border-left: 5px solid rgb(80, 170, 80);
}

input:invalid, select:invalid, textarea:invalid {
    border-left: 5px solid rgb(220, 80, 80); 
}

/* Media Query for Mobile (max 768px) */
@media screen and (max-width: 768px) {
html {
      background-color: #0d0a08;
  }

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

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

  /* Mobile Menu */
  nav ul {
      display: none;
  }

  #navicon {
      display: block;
      background-color: hsl(22, 95%, 30%);
      color: white;
      text-align: center;
      font-size: 2em;
      line-height: 2em;
      text-decoration: none;
  }

    nav:hover ul {
      display: block;
  }

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

  nav a {
      border-bottom: 1px solid hsl(22, 70%, 25%);
  }

  /* Mobile gallery collapses into a single column */
  div.imgGallery {
      flex: 100%;
      max-width: 100%;
  }

  article p {
      font-size: 1.1em;
  }

  /* Mobile Responsive Table */
  table, thead, tbody, th, td, tr {
      display: block;
  }

  thead tr {
      position: absolute;
      top: -9999px;
      left: -9999px;
  }

  tr {
      margin-bottom: 1em;
      border: 1px solid hsl(22, 50%, 25%);
  }

  tbody td {
      border: none;
      position: relative;
      padding-left: 50%;
      text-align: left;
      height: auto;
  }

  tbody td::before {
      content: attr(data-label);
      position: absolute;
      left: 0px;
      top: 0px;
      padding: 10px;
      width: 45%;
      font-weight: bold;
      color: hsl(22, 95%, 60%);
  }

  tfoot td {
      padding: 15px;
      text-align: justify;
  }

  tfoot td::before {
      display: none;
  }

  /* Mobile Form */
  form {
      width: 100%;
      font-size: large;
  }

  fieldset {
      width: 100%;
      padding: 25px;
      padding: 5px;
      margin: 0 0 10px 0;
      border-color: hsl(22, 70%, 30%);
      box-sizing: border-box;
      display: block;
      
  }

  input, select, textarea {
      position: inherit;
      display: block;
      height: 50px;
      width: 90%;
      margin-bottom: 8px;
      background-color: #1f1208;
      color: rgb(220, 210, 200);
      border: 1px solid hsl(22, 70%, 35%);
  }

  label {
      position: inherit;
      display: block;
      height: auto;
      padding: 6px 0;
      width: 90%;
      color: hsl(22, 80%, 65%);
  }

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

/* Media Query: Desktop min 769px */
@media screen and (min-width: 769px) {
  html {
      background-color: #080604;
  }
  
  /* 2-Column Article */
  article {
    column-count: 2;
    column-gap: 40px;
    column-rule: 1px solid hsl(22, 60%, 30%);
    margin-top: 20px;
  }

  article h2 {
    column-span: all;
    text-align: center;
    margin-bottom: 15px;
    widows: 3;
    font-weight: bold;
    color: hsl(22, 95%, 60%);
    border-bottom: 2px solid hsl(22, 70%, 30%);
    border-left: none;
    padding-bottom: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
  }

  article p {
    text-align: justify;
    line-height: 1.9;
    margin: 0;
    padding: 0 10px;
    orphans: 3;
    font-size: 1.05em;
    color: #1a0f08; 
  }

  /* Desktop Form */
  form {
    width: 90%;
  }

  fieldset {
    width: 90%;
    padding: 20px;
    margin-right: 10px;
    margin-bottom: 15px;
    border: 1px solid hsl(22, 70%, 30%);
    background-color: #130c05;
    overflow: hidden; 
  }

  legend {
    color: hsl(22, 95%, 60%);
    font-weight: bold;
    padding: 0 10px;
    letter-spacing: 1px;
    margin-bottom: 10px;
  }

  label {
    display: inline-block;
    float: left;
    width: 30%;
    padding: 0;
    margin: 0;
    line-height: 42px;
    vertical-align: middle;
    clear: left; 
    color: hsl(22, 80%, 65%);
    
  }

  input, select, textarea {
    display: block;
    float: left;
    width: 65%;
    padding: 10px;
    margin-bottom: 15px;
    background-color: #1f1208;
    color: rgb(220, 210, 200);
    border: 1px solid hsl(22, 60%, 30%);
    box-sizing: border-box; 
    line-height: 20px; 
    vertical-align: middle;
  }

  input[type="radio"] {
    display: inline-block;
    float: none;
    width: auto;
    margin-top: 12px;
  }

  label.radio {
    display: inline-block;
    float: none;
    width: auto;
    padding: 10px 15px 10px 5px;
    clear: none;
    color: rgb(200, 190, 175);
  }

  form p {
    clear: both; 
    padding-top: 15px;
    margin-bottom: 10px;
    color: rgb(200, 190, 175);
  }

  input[type="submit"] {
    display: block;
    float: left;
    width: 40%;
    padding: 12px;
    margin-top: 10px;
    margin-left: 5%;
    margin-right: 2%;
    margin-bottom: 10px;
    background-color: hsl(22, 95%, 40%);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    letter-spacing: 1px;
    clear: left; 
  }

  input[type="reset"] {
    display: block;
    float: left;
    width: 40%;
    padding: 12px;
    margin-top: 10px;
    margin-left: 2%;
    margin-right: 5%;
    margin-bottom: 10px;
    background-color: #2a1a0a;
    color: rgb(220, 210, 200);
    border: 1px solid hsl(22, 70%, 35%);
    cursor: pointer;
  }

  input[type="submit"]:hover {
    background-color: hsl(22, 95%, 30%);
    transition: background-color 0.3s ease;
  }

  input[type="reset"]:hover {
    background-color: #3a2510;
    transition: background-color 0.3s ease;
  }
}