/* =========================
   Google Fonts
========================= */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;800&family=Playwrite+US+Trad:wght@400;600&display=swap');

/* =========================
   Global Reset
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 18px;
  display: flex;
  justify-content: center;
  padding: 0 0.5rem;
}

body {
  font-family: 'Nunito', Arial, sans-serif;
  color: #2E261C;
  background-color: #F7F1E8;
  max-width: 900px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  line-height: 1.4;
}

/* =========================
   Header
========================= */
header {
  display: flex;
  flex-direction: column;
  padding-bottom: 0.25rem;
  gap: 0.4rem;
  background-color: #F7F1E8;
}

header > div:first-child {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0.25rem 0;
  border-bottom: 2px solid #8B5E34;
}

header h1 a{
  font-family: 'Playwrite US Trad', serif;
  font-size: 1.8rem;
  color: #8B5E34;
  font-weight: 400;
  text-decoration: none;

}

header a.signin-link {
  text-decoration: none;
  font-weight: 600;
  color: #8B5E34;
}

header a.signin-link:hover {
  text-decoration: underline;
}

header nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.2rem;
}

nav ul {
  display: flex;
  gap: 1rem;
  list-style: none;
  padding-left: 0;
}

nav a {
  text-decoration: none;
  color: #8B5E34;
  font-weight: 500;
}

nav a:hover {
  color: #A8570C;
}

/* Search form */
nav form {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

nav input[type="search"] {
  padding: 0.25rem 0.5rem;
  border: 1px solid #8B5E34;
  border-radius: 3px;
  background-color: #fff;
  font-size: 0.95rem;
}

nav button {
  background-color: #fff;
  border: 1px solid #8B5E34;
  border-radius: 3px;
  padding: 0.25rem 0.6rem;
  font-size: 0.9rem;
  cursor: pointer;
  color: #2E261C;
  transition: 0.2s ease;
}

nav button:hover {
  background-color: #8B5E34;
  color: #fff;
}


/* =========================
   Main Content
========================= */
main {
  background-color: #FFF9F1;
  border: 1px solid #CBBFA8;
  border-radius: 10px;
  padding: 1.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* =========================
   Title + Edit Button
========================= */
h1 {
  font-family: 'Playwrite US Trad', Georgia, serif;
  font-size: 2.2rem;
  color: #8B4513;
  font-weight: 500;
  margin-bottom: 0.5rem;
}
/* 
main > form {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
} */

/* main > form button {
  background-color: #F7F1E8;
  color: #8B5E34;
  border: 1px solid #CBBFA8;
  border-radius: 8px;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: 0.2s ease;
} */

main > form button:hover {
  background-color: #A8570C;
  color: #FFF9F1;
}

/* =========================
   Recipe Metadata
========================= */
.recipe-metadata {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.95rem;
}

.recipe-metadata a {
  color: #8B5E34;
  text-decoration: none;
}

.recipe-metadata a:hover {
  text-decoration: underline;
  color: #A8570C;
}

.recipe-metadata p {
  margin: 0;
}

/* =========================
   Layout Columns
========================= */
.recipe-sidebar-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

/* =========================
   Left Sidebar (photo + ingredients)
========================= */
.recipe-sidebar-left {
  flex: 1;
  max-width: 260px;
}

.recipe-photo {
  width: 100%;
  border: 5px solid #FFF;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transform: rotate(2deg);
  margin-bottom: 1.25rem;
}

dl {
  display: grid;
  grid-template-columns: 70px 1fr;
  row-gap: 0.4rem;
  column-gap: 0.75rem;
  margin-bottom: 1rem;
}

dt {
  font-weight: bold;
}

.ingredients {
  margin-top: 0.5rem;
}

.ingredients h2 {
  font-family: 'Playwrite US Trad', Georgia, serif;
  font-size: 1.4rem;
  color: #8B4513;
  margin-bottom: 0.5rem;
}

.ingredients ul {
  list-style: none;
  padding-left: 0;
}

.ingredients li {
  margin-bottom: 0.3rem;
}

/* =========================
   Right Sidebar (description + steps)
========================= */
.recipe-sidebar-right {
  flex: 2;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.recipe-description {
  font-size: 1rem;
}

.recipe-description div {
  border: 1px solid #CBBFA8;
  background-color: #FFF;
  padding: 0.75rem;
  border-radius: 5px;
}

.steps h2 {
  font-family: 'Playwrite US Trad', Georgia, serif;
  font-size: 1.4rem;
  color: #8B4513;
  margin-bottom: 0.5rem;
}

.steps ol {
  padding-left: 1.25rem;
}

.steps li {
  margin-bottom: 0.8rem;
}

/* =========================
   Tags
========================= */
.tags a {
  color: #8B5E34;
  font-size: 0.9rem;
}

.tags a:hover {
  color: #A8570C;
}

/* =========================
   Accessibility
========================= */
.visually-hidden {
  display: none;
}

/* =========================
   Home Page Styling
========================= */

/* Welcome section */
main {
  background-color: #FFF9F1;
  border: 1px solid #CBBFA8;
  border-radius: 12px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

main h1 {
  font-family: 'Playwrite US Trad', Georgia, serif;
  font-size: 2rem;
  color: #8B4513;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

main > p {
  font-size: 1rem;
  color: #3B2C20;
  line-height: 1.6;
}

/* Buttons */
main a.button {
  display: inline-block;
  background-color: #8B5E34;
  color: #fff;
  font-weight: 600;
  padding: 0.5rem 1.4rem;
  border-radius: 20px;
  margin-right: 0.5rem;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

main a.button:hover {
  background-color: #A36A3A;
}

/* Subheadings */
main h2 {
  font-family: 'Playwrite US Trad', Georgia, serif;
  font-size: 1.5rem;
  color: #8B4513;
  margin-top: 0.5rem;
}

main h2 + p {
  font-size: 1rem;
  color: #3B2C20;
  margin-bottom: 0.75rem;
}
/* =========================
   Recipe Cards Grid - FIXED VERSION
========================= */
.recipe-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  list-style: none;
  padding: 0;
}

.recipe-list li {
  display: flex;
  justify-content: center;
}

.recipe-list article {
  background-color: #fff;
  border: 1px solid #D3C3AA;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
  max-width: 260px;
  display: flex;
  flex-direction: column;
}

.recipe-list article:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.recipe-list a {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
  flex: 1;
}

.recipe-list img {
  width: 100%;
  height: 160px; 
  object-fit: cover;
  border-bottom: 1px solid #E6D8C3;
  background-color: #f8f5f0;
  flex-shrink: 0;
}

/* Card text block */
.recipe-list article div {
  padding: 0.75rem 1rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.recipe-list h3 {
  font-family: 'Playwrite US Trad', Georgia, serif;
  font-size: 1.1rem;
  color: #8B4513;
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
}

/* Tags */
.recipe-list .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.recipe-list .tags li a {
  color: #8B5E34;
  font-size: 0.85rem;
  text-decoration: none;
}

.recipe-list .tags li a:hover {
  text-decoration: underline;
}

/* =========================
   Edit Page Styling
========================= */

/* Edit/Save button in top right corner */
h1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.save-btn {
  background-color: #F7F1E8;
  color: #8B5E34;
  border: 1px solid #CBBFA8;
  border-radius: 8px;
  padding: 0.4rem 1rem;
  cursor: pointer;
  font-size: 1rem;
  transition: 0.2s ease;
}

.save-btn:hover {
  background-color: #A8570C;
  color: #FFF9F1;
}

/* Recipe title input styling */
.recipe-title-input {
  font-family: 'Playwrite US Trad', Georgia, serif;
  font-size: 2.2rem;
  color: #8B4513;
  border-radius:5px;
  width: 70%;
  outline: none;
  padding-bottom: 0.2rem;
}


/* Inputs in the sidebar (time/servings) */
dl input[type="number"] {
  border: 1px solid #CBBFA8;
  border-radius: 4px;
  padding: 0.25rem;
  width: 5rem;
  background-color: #FFF;
  font-size: 0.95rem;
}

/* Textarea styling */
textarea {
  width: 100%;
  border-radius: 5px;
  padding: 0.5rem;
  background-color: #FFF;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  resize: vertical;
  line-height: 1.4;
}

/* Step section formatting */
.steps ol {
  padding-left: 1.25rem;
}

.steps li {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Step ingredients under each step */
.step-ingredients {
  list-style-type: disc;
  padding-left: 2rem;
  margin-top: 0.5rem;
}

.step-ingredients li {
  display: flex;
  flex-direction:row;
  gap: 0.5rem;
  padding: 0.25rem 0;
}

/* Ingredient input fields */
.step-ingredients input[type="number"],
.step-ingredients input[type="text"] {
  border-radius: 5px;
  padding: 0.25rem 0.4rem;
  font-size: 0.95rem;
  background-color: #FFF;
}

.step-ingredients input[type="number"] {
  width: 4rem;
}

/* Align step number properly with multi-line textareas */
.steps li {
  vertical-align: top;
}

/* Readonly total time styling */
input[readonly] {
  background-color: #f3eee6;
  color: #5c4c3a;
}

/* Visually hidden labels (for accessibility) */
.visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}