/* =======================
   RESET + BASE STYLES
   ======================= */

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


:root {
  --green: #4CAF50;
  --text: #333;
  --muted: #666;
  --soft-bg: #F9FBFA;
  --soft-bg-2: #F2F7F5;
  --max-width: 1100px;
  --radius: 8px;
  --gap: 20px;
  --font-main: "Inter", Arial, sans-serif;
}

html, body {
  font-family: var(--font-main);
  line-height: 1.5;
  background: #fff;
  color: var(--text);
  font-size: 16px;
}
body {
  font-size: 16px;
  line-height: 1.6;
}
p, li {
  margin-bottom: 10px;
}

/* Container utility */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* =======================
   NAVBAR + SLOGAN
   ======================= */

.slogan {
  text-align: center;
  background-color: var(--green);
  color: white;
  padding: 8px 0;
  font-size: 14px;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}

#navlogo {
  width: 120px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
}

.nav-links a:hover {
  color: var(--green);
}


.menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
}

/* Responsive Navbar */


@media (max-width: 700px) {
  .menu-btn{
    display: block;
    font-size: 28px;
  }
  .nav-links {
    display: none;
    flex-direction: column;
    gap: 12px;
  }
  .nav-links.active {
    display: flex;
  }
}


/* =======================
   HERO SECTION
   ======================= */

.hero {
  text-align: center;
  padding: 40px 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(28px, 4vw, 40px);
  color: var(--text);
  margin-bottom: 10px;
}

.hero h3 {
  font-size: clamp(16px, 2.2vw, 20px);
  color: var(--muted);
  font-weight: 400;
}

#explore-recipes {
  display: inline-block;
  padding: 10px 20px;
  background-color: var(--green);
  color: white;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  margin-top: 22px;
  font-size: 16px;
}


/* =======================
   CATEGORIES
   ======================= */

.categories {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.categories a {
  background: var(--soft-bg-2);
  padding: 25px;
  font-size: 20px;
  border-radius: 6px;
  text-align: center;
  text-decoration: none;
  color:#333;
  cursor: pointer;
}

@media (max-width: 600px) {
  .categories {
    grid-template-columns: 1fr;
  }
}

/* =======================
   RECIPE GRID (recipes.html)
   ======================= */

.search-bar {
  max-width: 800px;
  margin: 12px auto 20px;
  display: flex;
  gap: 10px;
  padding: 0 20px;
}

.search-bar input {
  flex: 1;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ddd;
}

.search-bar button {
  padding: 10px 16px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}


.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--gap);
  padding: 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.recipe-card.hidden{
  display: none;
}

.recipe-card {
  background: var(--soft-bg);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}
.recipe-card {
  box-shadow: 0px 2px 6px rgba(0,0,0,0.08);
}


img {
  display: block;          /* avoids inline gaps */
  max-width: 100%;
  height: auto;
}

.card-img {
  width: 100%;
  height: 140px;           /* fixed visual area for cards (you already have) */
  object-fit: cover;
  display: block;
  aspect-ratio: 16/9;      /* extra safety on modern browsers */
  min-height: 140px;       /* ensure space reserved before load */
}


.card-content {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  margin-bottom: 4px;
  line-height: 1.3;
}


.card-meta {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 12px;
}

.card-btn {
  margin-top: auto;
  background: var(--green);
  color: white;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
}
.card-btn:hover,
#explore-recipes:hover {
  background-color: #3e9742;
}

/* =======================
   RECIPE DETAIL PAGE
   ======================= */

.recipe-detail {
  max-width: var(--max-width);
  margin: 30px auto;
  padding: 0 20px;
}

#recipe-heading {
  font-size: 26px;
  margin: 20px 0 12px;
  text-align: center;
  color: var(--text);
}

.recipe-top > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start; 
}



.recipe-top img {
  width: clamp(260px, 30vw, 350px);
  height: auto;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius);
}

.recipe-top .card-btn {
  margin-top: 12px;
  margin-bottom: 12px;
  align-self: flex-start;
}



.meta {
  color: var(--muted);
  margin-bottom: 8px;
}

/* Mobile layout: stack image + text */
@media (max-width: 600px) {
  .recipe-top {
    flex-direction: column;
  }
}

/* Ingredients & Steps */
.recipe-detail h1 {
  font-size: 32px;
  margin-bottom: 12px;
}

.ingredients h3,
.steps h3 {
  font-size: 20px;
  margin-top: 24px;
  margin-bottom: 10px;
}

.ingredients ul,
.steps ol {
  line-height: 1.6;
}


/* =======================
   FOOTER
   ======================= */

footer {
  margin-top: 60px;
  text-align: center;
  padding: 28px 20px;
  background: #f5f5f5;
  font-size: 14px;
}

.footer-title {
  font-size: 18px;
  font-weight: 600;
}

.footer-text {
  margin-top: 8px;
  color: var(--muted);
}

.footer-nav-links {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 20px;
}

.footer-nav-links a {
  color: var(--text);
  text-decoration: none;
}

.footer-nav-links a:hover {
  text-decoration: underline;
}
