* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  background: #fafafa;
  color: #333;
}

.site-header {
  text-align: center;
  padding: 2rem 1rem;
  background: white;
  border-bottom: 1px solid #eee;
}

.site-header h1 {
  font-size: 2.5rem;
  letter-spacing: 2px;
}

.tagline {
  color: #777;
  margin-top: 0.5rem;
}

.nav {
  text-align: center;
  padding: 1rem;
  background: #fff;
}

.nav a {
  margin: 0 15px;
  text-decoration: none;
  color: #444;
  font-weight: 500;
}

.nav a:hover {
  color: #000;
}

.container {
  max-width: 1100px;
  margin: auto;
  padding: 2rem 1rem;
}

/* Hero background */
.hero {
  background: linear-gradient(135deg, #fff5e6, #ffe6e6); /* soft warm gradient */
  padding: 6rem 1rem;  /* lots of spacing */
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
  border-radius: 20px;
  margin-bottom: 4rem;
}

/* Controls wrapper inside hero */
.controls-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Search bar with shadow */
#searchInput {
  padding: 1rem 1.5rem;
  font-size: 2rem;
  border-radius: 1rem;
  width: 100%;
  max-width: 500px;
  border: 2px solid #ddd;
  margin-bottom: 2rem;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08); /* subtle shadow */
}

/* Categories buttons */
.categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 3rem;
}

.categories button {
  padding: 1rem 2rem;
  font-size: 1.5rem;
  border-radius: 1.5rem;
  background: #eee;
  cursor: pointer;
  transition: 0.3s;
  border: none;
}

.categories button:hover {
  background: #ddd;
}

.categories button.active {
  background: #333;
  color: white;
}

/* Recipe grid fade-in animation */
.fade-in {
  opacity: 0;
  animation: fadeIn 1s forwards;
  animation-delay: 0.5s; /* wait half a second before fading in */
}

@keyframes fadeIn {
  to { opacity: 1; }
}

/* Mobile tweaks for search + buttons */
@media (max-width: 600px) {
  #searchInput {
    padding: 1rem 1rem;   /* smaller height */
    font-size: 1.5rem;    /* smaller text for mobile */
  }

  .categories button {
    padding: 0.7rem 1.2rem;  /* smaller buttons */
    font-size: 1rem;          /* smaller text */
  }
  
  .hero {
    padding: 3rem 1rem;   /* reduce hero section padding */
  }

  .categories {
    margin-bottom: 2rem;  /* keep a little space below buttons */
  }
}

.recipe-category {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 6px 12px;
  background: #f1f1f1;
  border-radius: 20px;
  font-size: 0.85rem;
  color: #555;
}

/* Grid Layout */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.recipe-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  transition: transform 0.2s ease;
}

.recipe-card:hover {
  transform: translateY(-5px);
}

.recipe-card img {
  width: 300px;       /* fixed width */
  height: 200px;      /* fixed height */
  object-fit: cover;  /* fills the box, crops overflow cleanly */
  display: block;
  margin: 0 auto;     /* centers the image in the card */
  border-radius: 8px;
}

.card-content {
  padding: 1rem;
}

/* Recipe Page */
.recipe-page {
  max-width: 700px;
}

.recipe-title {
  margin-bottom: 1rem;
}

.recipe-image {
  width: 400px;      /* same as homepage */
  height: 300px;
  object-fit: cover;
  display: block;
  margin: 1rem auto; /* centers with some spacing */
  border-radius: 8px;
}

@media (max-width: 600px) {
  .recipe-card img,
  .recipe-image {
    width: 225px;
    height: 150px;
  }
}

.ingredients,
.instructions {
  margin-top: 2rem;
}

.footer {
  text-align: center;
  padding: 2rem 1rem;
  background: white;
  border-top: 1px solid #eee;
  margin-top: 3rem;
  font-size: 0.9rem;
  color: #777;
}

/* Mobile Tweaks */
@media (max-width: 600px) {
  .site-header h1 {
    font-size: 2rem;
  }
.controls {
  margin-bottom: 2rem;
  text-align: center;
}

.category-badge {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  background: #f1f1f1;
  padding: 4px 8px;
  border-radius: 12px;
}
@media print {

  body {
    background: white;
  }

  .site-header,
  .nav,
  .footer,
  .controls,
  .categories {
    display: none !important;
  }

  .recipe-page {
    max-width: 100%;
  }

  .recipe-image {
    max-height: 300px;
    object-fit: contain;
  }

  a {
    text-decoration: none;
    color: black;
  }
}
}
