:root {
  --cream: #f7f1e8;
  --cast-iron: #2e261c;
  --cacao: #a8570c;
  --paper: #fff9f1;
  --ash: #888;
  --oak: #8b5e34;
  --pure-white: #fff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

* {
  font-family: "Nunito", sans-serif;
}

html {
  font-size: 18px;
}

body {
  background-color: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 0 0.5rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Playwrite US Trad", cursive;
  font-size: 1.25rem;
  color: var(--cacao);
}

.brand {
  font-family: "Playwrite US Trad", cursive;
  font-size: 1.25rem;
}

h1 {
  font-size: 1.8rem;
}

.login-form {
  font-size: 1.25rem;
}

.login-form button,
.login-form input {
  font-size: 1.25rem;
}

dl dt {
  font-weight: 600;
}

.line-height p,
.line-height ul li,
.line-height ol li {
  line-height: 1.25rem;
}

a {
  color: var(--oak);
  text-decoration: none;
}

a:hover {
  color: var(--cacao);
  text-decoration: underline;
}

ul li a span {
  color: var(--ash);
}

.sign-in,
.browse {
  background-color: var(--oak);
  color: var(--cream);
  padding: 0.5em 1em;
  border-radius: 1rem;
}

.sign-in:hover,
.browse:hover {
  background-color: var(--cacao);
  color: var(--paper);
}

.recipe-img {
  transform: rotate(2deg);
  border: 5px solid white;
  max-width: 100%;
  margin-bottom: 0.5rem;
}

main {
  background-color: var(--paper);
  width: 100%;
  max-width: 700px;
  border: 1px solid var(--ash);
  border-radius: 30px;
  padding: 1rem;
  margin-top: 3rem;
}

header.main-header {
  border-bottom: 2px solid var(--oak);
  width: 100%;
  max-width: 700px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 1rem;
}

header.main-header > section {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}

ul {
  list-style-type: none;
}

nav {
  width: 100%;
  max-width: 700px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav ul {
  display: flex;
  gap: 1rem;
}

nav form {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

nav form input,
nav form button {
  padding: 0.25rem;
}

.visually-hidden {
  display: none;
}

main section {
  margin-bottom: 2rem;
}

main article header {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: baseline;
}

main article header > * {
  margin: 0;
}

main article header ul {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0;
}

main article header ul li {
  margin: 0;
}

dl {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.25rem;
  margin: 0;
}

dt {
  width: calc(25% - 0.25rem);
  margin: 0;
}

dd {
  width: calc(75% - 0.25rem);
  margin: 0;
}

.line-height ul {
  padding-left: 1rem;
  text-indent: -1rem;
}

.line-height ol {
  padding-left: 1em;
}

main section p {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

section ul {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1rem 0;
}

section ul li {
  margin: 0;
}

section ul li article {
  background-color: var(--pure-white);
  padding: 0.5rem;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

section ul li article img {
  max-width: 100%;
  width: 100%;
  height: auto;
}

section ul li article ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  grid-template-columns: none;
}

section ul li article ul li {
  white-space: nowrap;
}

main section form {
  width: 100%;
}

main section form input {
  width: 100%;
  padding: 0.25rem;
}

main > header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

main > header img {
  width: 5rem;
  height: 5rem;
  flex-shrink: 0;
}

main article {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 500px) {
  main article {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
  }

  main article > header {
    width: calc(33.333% - 0.5rem);
  }

  main article > section {
    width: calc(66.666% - 0.5rem);
  }
}

@media (max-width: 500px) {
  body {
    padding: 0;
  }

  main {
    border-left: none;
    border-right: none;
    border-radius: 0;
  }

  header.main-header {
    padding: 0 0.5rem;
    position: relative;
    border-bottom: none;
  }

  header.main-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background-color: var(--oak);
  }
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-form label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.login-form input {
  width: 100%;
  padding: 0.25rem;
}

.login-form button {
  width: 50%;
  min-width: 200px;
  align-self: center;
}

.login-form .checkbox-label {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.login-form .checkbox-label input {
  width: auto;
}

@media (max-width: 700px) {
  .login-form label {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .login-form label {
    margin-bottom: 1rem;
  }

  .login-form label + label {
    margin-bottom: 0;
  }

  .login-form input {
    width: 100%;
  }
}

@media (max-width: 600px) {
  section ul {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 400px) {
  section ul {
    grid-template-columns: 1fr;
  }
}

.title-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
  gap: 0.5rem;
}

.title-header .title-input {
  flex-grow: 1;
  font-family: "Playwrite US Trad", cursive;
  font-size: 1.8rem;
  color: var(--cacao);
  border: 1px solid var(--ash);
  border-radius: 5px;
  padding: 0.25rem;
  min-width: 0;
}

.title-header .save-btn {
  flex-shrink: 0;
  background-color: var(--oak);
  color: var(--cream);
  padding: 0.5em 1em;
  border-radius: 1rem;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.title-header .save-btn:hover {
  background-color: var(--cacao);
  color: var(--paper);
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--ash);
  border-radius: 5px;
  padding: 0.25rem;
  font-family: "Nunito", sans-serif;
}

.recipe-details ol > li {
  padding-bottom: 1rem;
}

.recipe-details ul {
  padding-left: 2rem;
  margin-top: 0.5rem;
}

.recipe-details ul li {
  padding-bottom: 0.25rem;
}

.recipe-details textarea {
  vertical-align: top;
}

.error-list {
  color: red;
}
