body {
  font-family: 'Montserrat', sans-serif;
  background: #faf7f2;
  color: #3b2f2f;
  margin: 0;
}

.container {
  max-width: 1000px;
  margin: auto;
  padding: 40px 20px;
}

h1, h2, h3 {
  font-family: 'Montserrat', sans-serif;
  color: #5a3e36;
}

h1 {
  text-align: center;
  font-size: 3rem;
}

/* Grid Layout */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  align-items: stretch; /* Ensures all cards in a row match the tallest height */
}

/* Ensure the link wrapper fills the grid cell */
.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%; 
}

/* Card Styling */
.card {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  transition: transform 0.2s ease;
  
  /* Flexbox setup for equal height and footer alignment */
  display: flex;
  flex-direction: column;
  height: 100%; 
  box-sizing: border-box; /* Ensures padding is included in height calculation */
}

.card-link:hover .card {
  transform: translateY(-4px);
}

.card h2 {
  font-family: 'Montserrat', sans-serif;
  margin-top: 0;
  font-size: 1.4rem;
  margin-bottom: 8px;
}

/* General paragraph styling within card */
.card p {
  font-size: 0.95rem;
  line-height: 1.4;
  margin: 0 0 16px 0;
}

/* New class for description trimming */
.card-desc {
  flex-grow: 1; /* Pushes the date to the bottom if text is short */
  
  /* Truncate text after 3 lines */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card a {
  text-decoration: none;
  color: #8b3e2f;
  font-weight: bold;
}

h2 {
  margin-top: 32px;
  font-size: 1.4rem;
  color: #5a3e36;
}

.ingredients li,
.steps li {
  margin-bottom: 8px;
  line-height: 1.5;
}

.steps {
  padding-left: 20px;
}

.ingredients {
  padding-left: 20px;
}

img {
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.centered-image {
  display: block;
  margin: 0 auto 24px;
  max-width: 600px;
  border-radius: 12px;
}

/* Card Image - Fixed height for uniformity */
.card img {
  width: 100%;
  height: 200px;       /* Fixed height */
  object-fit: cover;   /* Crops image to fit container */
  border-radius: 8px;
  margin-bottom: 16px;
}

.subtitle, p, li {
  font-family: 'Montserrat', sans-serif;
}

.recipe-date {
  font-size: 0.85rem;
  color: #777;
  margin-top: auto; /* Ensures date stays at the very bottom */
}

/* Centered search bar container */
.search-container {
  display: flex;
  justify-content: center;
  margin-bottom: 40px;
}

/* Google-style search input */
input[name="q"] {
  width: 100%;
  max-width: 500px;
  padding: 12px 20px;
  font-size: 1rem;
  font-family: 'Montserrat', sans-serif;
  border: 1px solid #dfe1e5;
  border-radius: 24px;          /* Rounded corners like Google search */
  outline: none;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}

/* Hover effect */
input[name="q"]:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  border-color: #c6c6c6;
}

/* Focus effect */
input[name="q"]:focus {
  border-color: #4285f4;        /* Google blue accent */
  box-shadow: 0 4px 12px rgba(66, 133, 244, 0.25);
}

/* Placeholder style */
input[name="q"]::placeholder {
  color: #9aa0a6;
  font-style: normal;
}