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

html {
  display: flex;
  flex-direction: row;
  justify-content: center;
  font-size: 18px;
  margin: 0rem 0.5rem;
}

body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 700px;
  width: 100%;
  flex: 1 1 700px;
  gap: .5rem;
  padding: .5rem;
  background-color: #F7F1E8; /* cream */
  font-family: "Nunito", sans-serif;
  color: black;
}

header {
  border-bottom: 2px solid;
  border-color: #8B5E34; /* oak */
  color: #8B5E34; /* oak */
}

h1 {
  font-family: "Playwrite US Trad", serif;
  font-size: 1.8em;
  color: #A8570C;
}

h2, h3, h4, h5, h6 {
  font-family: "Playwrite US Trad", serif;
  font-size: 1.25em;
  color: #A8570C ; /* cast iron */
}

a { text-decoration: none; color: #8B5E34; /* oak */ }

a:hover {
  color: #A8570C;   /* cacao */
  text-decoration: underline;
}

ul {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  list-style-type: none;
}

.header-container {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  text-align: right;
}
.header-profile{
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}
.nav-container {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  padding-bottom: 3rem;
  flex-wrap: wrap;
}
.nav-container form * { padding: .25rem;}

.dishbook {
  font-family: "Playwrite US Trad", serif;
  font-size: 1.8em;
  color: #8B5E34; /* oak */
}

.home-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1rem;
  gap: 2rem;
  max-width: 700px;
  width: 100%;
  background-color: #F7F1E8; /* paper */
  border: 1px solid #888;   /* ash */
  border-radius: 30px;
}

.welcome-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-wrap: wrap;
}

.main-section {
  border: 1px solid;
  border-color: #888;   /* ash */
  border-radius: 30px;
  background-color: #F7F1E8; /* paper */
  padding: 1rem;
}

/* Home page buttons */
.main-btns {
  display: flex;
  justify-content: center;
  gap: 1rem 1rem;
}

.main-btns a {
  background-color: #8B5E34;   /* oak */
  color: #F7F1E8;              /* cream */
  padding: .5em 1em;
  border: none;
  border-radius: 20px;
  text-align: center;
}

.main-btns a:hover {
  background-color: #A8570C;  /* cacao */
  color: #FFF9F1;            /* paper */
}

.featured-recipe-section {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  /*padding: 1rem;*/
}
.featured-recipe-section h2 { font-size: 1.25rem;}

/**** Card Layout *****/
.card-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding: 1rem 0;
  align-items: flex-start;
  max-width: 700px;
}

/* each card */
.card {
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
  box-shadow: 0px 1px 3px #888;
  border-radius: 10px;
  background-color: #FFFF;
  min-width: 0;
}

/* Title */
.card-title {
  margin: 0 0 0.5rem;
}

.card-title-a {
  display: block;
  margin-top: 0.75rem;
  font-size: 1rem;
  white-space: wrap;
  color: #A8570C;
}

.card-img {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 0.5rem;
}

/* Tags row */
.tags-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.tags-label {
  white-space: nowrap;
  font-weight: 600;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  row-gap: 0;
  column-gap: 0.5rem;
}

.tag-list a {
  white-space: nowrap;
  color: #8B5E34;   /* oak */
  text-decoration: none;
}

.tag-list a::before {
  content: "#";
  color: grey;
  margin-right: 2px;
}

.tag-list a:hover {
  color: #A8570C;  /* cacao */
}

/* Responsive breakpoints */
@media (max-width: 700px) {
  .card-title a {
    font-size: clamp(0.7rem, 2.5vw, 1rem);
  }
}

@media (max-width: 550px) {
  .card-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 400px) {
  .card-layout {
    grid-template-columns: 1fr;
  }
}

/* Login Form */
.login-form {
   width: auto;
   font-size: 1.25em;
   border: 2px solid #888;  /* ash */
   border-radius: 40px 40px 0px 0px;
   border-bottom: 0.5px solid #FFF9F1;
   padding:1rem;
  }
.login-form h2 { padding-bottom: 1rem;}
.form-row {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: no wrap;
  padding: .5rem;
}
label.form-row-label {
    display: block;
    width: auto;
  }
.form-row input[type="text"],
.form-row input[type="password"] {
  padding: 0.25rem;
  width: 80%;
  text-align: right;
}
.form-row button {
    font-size: 1.25rem;
    width: 50%;
    min-width =: 200px;
    padding: .25rem;
    margin: 0 auto;
    align-items: center;
}

@media (max-width: 700px) {
    .form-row { flex-direction: column; gap: 0;}
    form-row input {
       width: 100%;
       margin-left: 0;
  }

  .login-form h2 { padding-bottom: 1rem;}

}

.recipe-heading h1 { color: #A8570C ; /* cast iron */}


/******** Recipe  **********/
#ingredients { padding-left: 1rem; text-indent: -1rem; gap: 0; margin: 0;}

.tags-row a::before {
  content: "#";
  color: #888;
  margin-right: .15rem;
}
.tags-row {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  flex-wrap:wrap;
}


.recipe-meta-cntnr {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1rem;
  max-width: 700px;
  line-height: 1.25;
 }
.recipe-meta-cntnr .row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1rem;
  width: 100%;
  flex-wrap: nowrap;
}

.col-left  { flex: 0 0 calc((100% - 1rem) / 3);  min-width: 0; }
.col-right { flex: 0 0 calc((100% - 1rem) * 2/3); min-width: 0; }
.recipe-meta-cntnr .col-left {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 1.5rem;
  row-gap: 0;
}

.recipe-meta-cntnr img {
  display: block;
  max-width: 100%;
  transform: rotate(2deg);
  border: 5px solid;
  border-color: #FFF9F1;        /* paper */
  border-radius: 3px;
  height: auto;
  width: 200px;
  margin-bottom: .5rem;
}

.recipe-meta {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 200px;
  white-space: nowrap;
}
.recipe-meta .dt {
    flex:none;
    margin:0;
    font-weight: 600;
    white-space: nowrap;
    width: calc((100% - .5rem) * 0.25);
}
.recipe-meta dd {
    flex:none;
    margin:0;
    width: calc((100% - .5rem) * .75);
    min-width: 100px;
}

.recipe-info-container {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.recipe-info-container ul {
 width: 100%;
flex-wrap:wrap;
}
.recipe-info-container ol {
  width: 100%;
  padding-left: 1em;
}

@media (max-width: 500px) {
  .header-container { width: 100vw}
  .main-section {
    padding:0;
    border-right: none;
    border-left:none;
    }
  .header-container {
    padding: 0.5rem;
    margin-left: 0;
    margin-right: 0;
  }
  .row {
    flex-direction: column;
    gap: 2rem;
  }
.col-left,
  .col-right {
    width: 100%;
    flex: initial;
    min-width: 0;
  }
 .recipe-meta-cntnr {
    padding: 0;
  }
  img {
    max-width: 100%;
    height: auto;
    }
}
.visually-hidden { display: none; }

/* Search Page */
.card-layout-search {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  max-width: 700px;
  align-items: flex-start;
}
.card-layout-search article {
  border: 1px solid #888;
  border-radius: 10px;
  box-shadow: 0 1px 3px #888;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  align-items: start;
  text-wrap:wrap;
  padding: .5rem;
}

.card-layout-search img {
  display: block;
  width: 100%;
}

.card-layout-search h3 {
  font-size: 1rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: clamp(0.75rem, 2.5vw, 1rem);
}

.card-layout-search ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.profile-main {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap:1rem;
  min-width: 0;
  margin-bottom: 2rem;
}
.profile-meta-row {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  flex-wrap: wrap;
}
.profile-descr {
  margin-bottom: 2rem;
}

.profile-photo {
  flex: 0 0 auto;
  width: 110px;
  object-fit: cover;
  align-self: stretch;
}

span.profile-name { color: black; }

#search-tags {
  padding: .25rem;
  font-size: 1rem;
  margin-bottom: 1rem;
  width: 100%;
}

@media (max-width: 600px) {
  .card-layout-search {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .main-section { border-bottom: none;}
}

@media (max-width: 400px) {
  .card-layout-search {
    grid-template-columns: 1fr;
  }
  .main-section { border-bottom: none;}
  .profile-main {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .profile-photo {
    width: 140px;
    align-self: center;
  }
  .profile-meta-row {
    justify-content: center;
  }
}

/******** Edit Form  **********/
.in-title{
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 1rem;
}
.in-title input {
    font-size: 1.25rem;
    font-family: "Playwrite US Trad", serif;
  font-size: 1.8em;
  color: #A8570C;
  width: 95%;
  align-content: flex-start
}
.form-btn {
  height: 30px;
  padding: .25rem;
}

.in-step-descr {
  text-align: left;
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 6px;
  resize: vertical;
  vertical-align: top;
}

input[type="number"]{
  padding: 0.25rem;
  font-variant-numeric: tabular-nums;
  width: calc(3 * 1ch + 2rem);
  max-width: 100%;
}
.in-unit{
  padding: 0.25rem;
  max-width: 100%;
}
.in-name {
  padding: 0.25rem;
  width: 100%;
}

.step-ingredients-edit {
    gap:0;
    list-style-type: circle;
    margin: 0;
    padding: 0;
    width: 100%;
}
.step-ingredients-edit li{
  display: grid;
  grid-template-columns: minmax(3ch, 5ch) minmax(1ch, 8ch) 1fr; /* amt | unit | name */
  column-gap: .25rem;
  align-items: baseline;
  width: 100%;
  padding: 0.25rem;
}

.in-steplist {
    padding-bottom: 1rem;
    width:100%;
}
.in-steplist ul { margin-left: 1.15rem; padding:0;}

label {width:100%;}

.error-msg {
    display: flex;
    flex-direction: column;
    margin: .5rem;

    width: 100%;
    color: red;

}
.error-msg li {display: list-item;
 list-style-type: circle;
  margin-left: 1rem;}

.form-row-right {
    display: flex;
    justify-content: right;
    width: auto;
    margin-left: auto;
    gap: 0.25rem;
    align-items:center;
}
.form-row-right label{
    width:auto;
    font-size: 0.9rem;}

.step-ingredients-recipe {
    gap:0;
    list-style-type: circle;
    margin: 0;
    padding: 0;
    width: 100%;
}
.step-ingredients-recipe li{
    column-gap: .25rem;
    align-items: baseline;
    width: 100%;
}
.recipe-hdr{
  margin: 0;
  line-height: 1.4;
}