*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  display: flex;
  flex-direction: column;

  max-width: 700px; 
  margin: 0 auto;
  padding: .5rem;

  background-color:floralwhite;
  font-family: Arial, sans-serif;
  overflow-wrap: break-word;
}

p {
  line-height: 1.5;
}

/* Header */

.head{
  padding-top: 1rem;
  border-bottom: 1px solid black;
}

.top {
    display: flex;
    flex-direction: row;
    justify-content: center;
}

.head-title a{
  text-decoration: none;
  color: black;  
}

a {
  color: #982fa6;
}

.nav-bar{
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 1rem;
  padding-bottom: 1.5rem;
}

a:hover {
  background-color:antiquewhite;
  color: black;          
  cursor: pointer;
}

h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.5rem;
}

/* Main */

.cards-area{
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card{
  border: 2px solid palegoldenrod;
  padding: 1rem;
  background-color: ivory;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.recipe-info{
  border: 2px solid palegoldenrod;
  padding: 1rem;
  margin-bottom: 1rem;
  background-color: ivory;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.recipe-columns{
  display: flex;
  flex-direction: column;
  gap: 1rem;

  padding: 1rem;

  border: 2px solid palegoldenrod;
  background-color: ivory;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Side Bar */

.sidebar {
  position: fixed;
  right: 0;
  top: 0;
  width: 300px;
  height: 100%;

  background: floralwhite;

  padding: 20px;
  box-shadow: -2px 0 5px rgba(0,0,0,0.2);
  overflow-y: auto;
}

.sidebar button{
  background: floralwhite;
  font-weight: bold;
  box-shadow: -2px 0 5px rgba(57, 57, 57, 0.2);
  border: 2px solid palegoldenrod;
  border-radius: 6px;
  cursor: pointer;
}

.sidebar #listTitle{
  background: floralwhite;
  border: 0px solid palegoldenrod;
  border-radius: 5px;

  text-decoration: underline;
}

.sidebar #listInput{
  background: floralwhite;
  border: 1px solid rgb(244, 232, 104);
  border-radius: 5px;
  box-shadow: -2px 0 5px rgba(57, 57, 57, 0.2);

  height: 50vh;
  min-height: 200px;
  max-height: 70vh;
  resize: vertical;
}


.hidden {
  display: none;
}

#sidebarToggle {
  position: fixed;
  right: 10px;
  top: 10px;

  background: rgb(91, 64, 0);
  color: aliceblue;

  font-size: 24px;
  padding: 10px;
  cursor: pointer;
}

body.sidebar-open #sidebarToggle {
  display: inline-block;
  transform: scaleX(-1);
  right: 320px;
}

/* List Page */

.grocery-list button{
  background: floralwhite;
  font-weight: bold;
  box-shadow: -2px 0 5px rgba(57, 57, 57, 0.2);
  border: 2px solid palegoldenrod;
  border-radius: 6px;
  cursor: pointer;
}

.grocery-list{
  display: flex;
  flex-direction: column;
  gap: 1rem;

  padding: 1rem;

  border: 2px solid palegoldenrod;
  background-color: ivory;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.grocery-list ul{
  list-style-type: none;
}

.check-form span{
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
}

.check-form {
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    background: none;
}

.check-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

.checked {
    text-decoration: line-through;
    opacity: 0.6;
}

.grocery-list h2 {
  margin: 0;
}

/* Edit Lists */

.edit-list button{
  background: floralwhite;
  font-weight: bold;
  box-shadow: -2px 0 5px rgba(57, 57, 57, 0.2);
  border: 2px solid palegoldenrod;
  border-radius: 6px;
  cursor: pointer;
}

.edit-list #listInput{
  background: floralwhite;
  border: 1px solid rgb(244, 232, 104);
  border-radius: 5px;
  box-shadow: -2px 0 5px rgba(57, 57, 57, 0.2);

  height: 50vh;
  min-height: 200px;
  max-height: 70vh;
  resize: vertical;
}

.edit-list input{
  background: floralwhite;
  border: 0px solid palegoldenrod;
  border-radius: 5px;

  text-decoration: underline;
}

.edit-list #listInput{
  display: flex;
  flex-direction: column;
  gap: 1rem;

  padding: 1rem;

  border: 2px solid palegoldenrod;
  background-color: ivory;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ---------- Media Queries ---------- */
@media (max-width: 600px) {
  .head {
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px solid black;
  }

  .nav {
    flex: 1;
    align-items: center;
    justify-content: center;
  }
}