@charset "utf-8";

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

body {
  font-family: Verdana, Geneva, sans-serif;
  color: rgb(70, 55, 40);
  background-color: hsl(40, 50%, 97%);
  width: 90%;
  margin: auto;
}

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

header img {
  width: 100%;
}

h1,
h2 {
  text-shadow: 4px 6px 5px hsl(30, 15%, 75%);
  margin-left: 10px;
}

h2 {
  font-size: 1.3em;
  text-align: left;
  margin-left: 10px;
}

h3 {
  margin-left: 10px;
}

p {
  margin-left: 10px;
}

body > h1 {
  text-align: left;
  margin-left: 10px;
}

/* ── Navigation ── */

.navicon {
  display: none;
  font-size: 2em;
  padding: 10px;
  cursor: pointer;
  background: hsl(30, 35%, 70%);
  text-align: center;
}

nav {
  overflow: hidden;
}

nav::after {
  content: "";
  display: block;
  clear: both;
}

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

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

nav a {
  display: block;
  background-color: hsl(30, 35%, 70%);
  line-height: 2.8em;
  text-decoration: none;
  text-align: center;
  color: rgb(50, 35, 20);
}

nav a:hover {
  background-color: hsl(25, 45%, 50%);
  color: #fff;
  font-size: 1.2em;
  transition:
    background-color 0.5s ease-in 0.2s,
    color 0.5s ease-in 0.2s,
    font-size 1s ease;
}

/* ── Main Content ── */

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

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

main ul {
  list-style-type: square;
}

/* ── Multi-Column Layout ── */

.columns {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 15px;
}

.column {
  flex: 1 1 250px;
  background-color: hsl(35, 40%, 93%);
  padding: 15px;
  border-radius: 6px;
  border: 1px solid hsl(30, 30%, 82%);
}

/* ── Image Gallery ── */

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

.gallery img {
  width: 23%;
  margin: 1%;
  object-fit: cover;
}

/* ── Table Styles ── */

table {
  width: 100%;
  border-collapse: collapse;
  border: 2px solid hsl(30, 30%, 65%);
  margin-top: 15px;
}

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

th {
  padding: 12px 15px;
  text-align: left;
  border: 1px solid hsl(30, 30%, 65%);
  color: rgb(50, 35, 20);
  font-weight: bold;
}

td {
  padding: 10px 15px;
  border: 1px solid hsl(30, 25%, 82%);
}

tbody tr:nth-child(even) {
  background-color: hsl(35, 30%, 94%);
}

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

tbody tr:hover {
  background-color: hsl(30, 35%, 88%);
}

tfoot {
  background-color: hsl(30, 35%, 70%);
  font-style: italic;
}

tfoot td {
  padding: 10px 15px;
  text-align: center;
  border: 1px solid hsl(30, 30%, 65%);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

/* ── Multimedia ── */

iframe {
  max-width: 100%;
}

/* ── Clear Floats ── */

.clear {
  clear: both;
}

/* ── Form Focus / Valid / Invalid ── */

input:focus,
select:focus,
textarea:focus {
  background-color: hsl(35, 50%, 92%);
}

input:valid,
select:valid,
textarea:valid {
  background-color: rgb(220, 255, 220);
}

input:invalid,
select:invalid,
textarea:invalid {
  background-color: rgb(255, 232, 233);
}

/* ── Footer ── */

body > footer {
  background-color: hsl(30, 35%, 70%);
  color: rgba(50, 35, 20, 0.7);
  font-weight: bold;
  font-size: 0.9em;
  line-height: 3em;
  text-align: center;
  margin-top: 10px;
  padding: 10px;
  clear: both;
}

/* ══════════════════════════════════════
   Mobile (max-width: 768px)
   ══════════════════════════════════════ */

@media only screen and (max-width: 768px) {
  body {
    width: 100%;
    margin: 0;
  }

  .navicon {
    display: block;
  }

  nav ul {
    display: none;
  }

  nav:hover ul {
    display: block;
  }

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

  nav a {
    border-bottom: 1px solid hsl(30, 20%, 50%);
  }

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

  .gallery img {
    width: 48%;
  }

  .columns {
    flex-direction: column;
  }

  /* Responsive Table */
  table {
    border: 0;
  }

  thead {
    display: none;
  }

  tbody tr {
    display: block;
    margin-bottom: 15px;
    border: 2px solid hsl(30, 30%, 65%);
  }

  tbody td {
    display: block;
    text-align: right;
    padding: 10px;
    border-bottom: 1px solid hsl(30, 25%, 88%);
  }

  tbody td::before {
    content: attr(data-label);
    float: left;
    font-weight: bold;
    color: rgb(50, 35, 20);
  }

  tfoot tr {
    display: block;
  }

  tfoot td {
    display: block;
    text-align: center;
  }

  /* Form layout for mobile */
  form {
    width: 100%;
    font-size: large;
  }

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

  form input,
  form select,
  form textarea {
    position: inherit;
    display: block;
    height: 50px;
    padding: 5px;
    width: 90%;
  }

  form textarea {
    height: auto;
    min-height: 80px;
  }

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

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

/* ══════════════════════════════════════
   Desktop (min-width: 769px)
   ══════════════════════════════════════ */

@media only screen and (min-width: 769px) {
  .navicon {
    display: none;
  }

  nav ul {
    display: block;
  }

  html {
    background-image: url("images/background.png");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
  }

  .gallery img {
    width: 23%;
  }

  /* Form layout for larger screens */
  form {
    width: 90%;
  }

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

  form .form-group {
    position: relative;
  }

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

  form textarea {
    min-height: 80px;
  }

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

  form input[type="radio"] {
    display: inline;
    position: inherit;
    left: 0;
    width: auto;
  }

  form label.radio {
    display: inline;
    position: inherit;
  }

  form input[type="submit"],
  form 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;
  }

  body > footer {
    clear: both;
  }
}
