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

body {
  font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f8f8;
}

/* Header Styles */
header {
  background-color: #ffffff;
  padding: 20px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: #222;
  text-decoration: none;
}

nav a {
  text-decoration: none;
  color: #555;
  margin-left: 30px;
  font-weight: 500;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color 0.3s;
}

nav a.active, nav a:hover {
  color: #e67e22;
}

/* Hero Section with Background Image */
.hero {
  position: relative;
  background-color: transparent; /* Remove the white background */
  text-align: center;
  padding: 170px 20px; /* Increased padding for better visual effect */
  color: #fff; /* Change text color to white for better contrast */
  overflow: hidden;
}

/* Background image setup */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('images/hero-background.jpg'); /* Path to your uploaded image */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: brightness(0.7); /* Slightly darken the image for better text readability */
  z-index: -1;
}

.hero h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  color: #fff; /* White text for contrast against the image */
  margin-bottom: 20px;
  border: none;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); /* Add shadow for better readability */
}

.hero p {
  max-width: 700px;
  margin: 0 auto;
  color: #fff; /* White text for contrast */
  font-size: 1.1rem;
  line-height: 1.8;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); /* Add shadow for better readability */
}

/* Add a subtle overlay to ensure text readability across any background image */
.hero .content-container {
  position: relative;
  padding: 30px;
  background-color: rgba(0, 0, 0, 0.3); /* Semi-transparent dark background */
  border-radius: 8px;
  display: inline-block;
}

/* Main Content Styles */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 20px;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: #222;
  margin-bottom: 40px;
  text-align: center;
  border: none;
}

/* Recipe Grid Styles */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 40px;
}

/* Recipe Card Styles */
.recipe-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s, box-shadow 0.3s;
}

.recipe-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.card-image-container {
  position: relative;
  padding-top: 75%; /* 4:3 Aspect Ratio */
  overflow: hidden;
}

.recipe-card img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.recipe-card:hover img {
  transform: scale(1.05);
}

/* Recipe Page Styles */
.recipe {
  background-color: white;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  max-width: 900px;
  margin: 0 auto;
}

.recipe h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  color: #222;
  margin-bottom: 15px;
  border: none;
}

.recipe-meta {
  color: #777;
  margin-bottom: 30px;
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.meta-item {
  display: flex;
  align-items: center;
}

.meta-label {
  font-size: 0.9rem;
  font-weight: 600;
  margin-right: 0.5rem;
}

.meta-value {
  font-size: 0.9rem;
  color: #666;
}

.recipe-image {
  width: 100%;
  height: 500px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 40px;
}

.recipe-section {
  margin-bottom: 40px;
  max-width: 700px;
}

.recipe-section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: #333;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f0f0f0;
}

.recipe-notes {
  background-color: #f9f9f9;
  padding: 25px;
  border-radius: 8px;
  margin-top: 40px;
}

.recipe-notes h3 {
  color: #333;
  font-size: 1.3rem;
  margin-bottom: 15px;
  border-bottom: none;
}

.recipe-notes p {
  color: #666;
}

/* Recipe Hero Styles (From inline styles) */
.recipe-hero {
  position: relative;
  height: 500px;
  width: 100%;
  overflow: hidden;
  margin-bottom: 2rem;
}

.recipe-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Split Hero Layout for Recipe Pages */
.split-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 500px;
  width: 100%;
  margin-bottom: 2rem;
}

.split-hero-content {
  padding: 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  word-wrap: break-word;
  background: linear-gradient(to right, #fff5e6, #fef8f0);
  box-shadow: inset 0 0 30px rgba(224, 199, 170, 0.2);
}

.split-hero-content h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.8rem;
  color: #222;
  margin-bottom: 1.5rem;
  border: none;
  line-height: 1.2;
  max-width: 100%;
}

/* Recipe section headings */
.recipe-section h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: #333;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f0f0f0;
}

/* Subtle decorative element */
.split-hero-content::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 150px;
  height: 150px;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23e0c7aa' fill-opacity='0.2' fill-rule='evenodd'/%3E%3C/svg%3E");
  opacity: 0.4;
  z-index: 0;
}

.split-hero-content-inner {
  position: relative;
  z-index: 1;
  max-width: 90%;
}

.split-hero-image {
  position: relative;
  overflow: hidden;
}

.split-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.split-hero-image:hover img {
  transform: scale(1.03);
}

.split-hero-content p {
  color: #555;
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 2rem;
  max-width: 100%;
}

.recipe-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 2rem;
  color: #666;
  font-size: 0.9rem;
}

.recipe-card-meta-item {
  display: flex;
  align-items: center;
}

.recipe-card-meta-item svg {
  margin-right: 0.5rem;
  width: 18px;
  height: 18px;
  opacity: 0.7;
}

/* Responsive adjustments for split hero */
@media (max-width: 768px) {
  /* Update the split-hero layout to use flexbox instead of grid */
.split-hero {
  display: flex; /* Changed from grid to flex */
  height: 500px;
  width: 100%;
  margin-bottom: 2rem;
}

.split-hero-content {
  flex: 1; /* Changed from grid-specific value to flex value */
  padding: 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  word-wrap: break-word;
  background: linear-gradient(to right, #fff5e6, #fef8f0);
  box-shadow: inset 0 0 30px rgba(224, 199, 170, 0.2);
}

.split-hero-image {
  flex: 1; /* Changed from grid-specific value to flex value */
  position: relative;
  overflow: hidden;
}

/* Update responsive adjustments for split hero */
@media (max-width: 768px) {
  .split-hero {
    flex-direction: column;
    height: auto;
  }
  
  .split-hero-image, 
  .split-hero-content {
    width: 100%; /* Full width on mobile */
  }
  
  .split-hero-image {
    height: 300px;
    order: 1; /* Image first on mobile */
  }
  
  .split-hero-content {
    padding: 2.5rem 2rem;
    order: 2; /* Content second on mobile */
  }
  
  .split-hero-content h1 {
    font-size: 2.2rem;
  }

  .recipe-card-meta {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .main-container {
    margin-top: 0;
  }
  
  /* Additional mobile-specific adjustments */
  .hero {
    padding: 100px 20px;
  }
  
  .hero h2 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .hero .content-container {
    padding: 20px;
  }
}

  .recipe-card-meta {
    flex-direction: column;
    gap: 0.75rem;
  }
}

.recipe-intro {
  margin-bottom: 3rem;
}

/* About Page Styles */
.about-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 20px;
}

.about-content {
  background-color: white;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.about-content h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  color: #222;
  margin-bottom: 30px;
  border: none;
}

.about-content p {
  margin-bottom: 20px;
  color: #555;
  line-height: 1.8;
}

/* Footer Styles */
footer {
  background-color: #222;
  color: #fff;
  padding: 60px 0 30px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  text-align: center;
}

.footer-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: #fff;
  margin-bottom: 20px;
}

.footer-nav {
  margin-bottom: 30px;
}

.footer-nav a {
  color: #ccc;
  text-decoration: none;
  margin: 0 15px;
  font-size: 0.9rem;
  transition: color 0.3s;
}

.footer-nav a:hover {
  color: #e67e22;
}

.copyright {
  color: #999;
  font-size: 0.9rem;
  margin-top: 30px;
}

/* Enhanced search styling */
.search-container {
  position: relative;
  max-width: 600px;
  margin: 0 auto 2rem;
}

.search-input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  border: 2px solid #ddd;
  border-radius: 30px;
  font-size: 1.1rem;
  transition: all 0.3s;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.search-input:focus {
  border-color: #e67e22;
  box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.2);
  outline: none;
}

.search-icon {
  position: absolute;
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  color: #777;
  font-size: 1.2rem;
}

/* Improve the "no results" message */
.no-results {
  text-align: center;
  padding: 2.5rem;
  color: #666;
  font-style: italic;
  background-color: #f9f9f9;
  border-radius: 8px;
  border: 1px dashed #ddd;
  margin: 2rem auto;
  max-width: 500px;
}

/* Recipe Link Styles - Updated for Consistency */
.recipe-link {
  display: inline-block;
  text-decoration: none;
  color: #e67e22;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: auto;
  padding-bottom: 4px;
  position: relative;
}

.recipe-link:after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: #e67e22;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.recipe-link:hover:after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Ensure consistent spacing in card content */
.card-content {
  padding: 25px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  position: relative;
  min-height: 180px; /* Ensure minimum height for content */
}

.card-content h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: #222;
  margin-bottom: 10px;
}

.card-content p {
  color: #666;
  font-size: 0.95rem;
  display: -webkit-box;
  /* stylelint-disable-next-line property-no-vendor-prefix */
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 15px;
  flex-grow: 1;
}

/* Ellipsis is handled by -webkit-line-clamp */

/* Recipe Content Styling */
.section-heading {
  font-weight: bold;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.recipe-list {
  padding-left: 1.5rem;
  margin-top: 0.5rem;
}

.recipe-list li {
  margin-bottom: 0.4rem; /* Reduced from 0.8rem */
  padding: 0.2rem 0; /* Reduced from 0.3rem */
}

.ingredients-list {
  list-style-type: disc;
  padding-left: 1.5rem;
}

/* No extra margin between ingredient items */
.ingredients-list li {
  margin-bottom: 0;
  padding: 0.2rem 0;
}

/* Responsive Styles - Consolidated media queries */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    padding: 20px;
  }
  
  nav {
    margin-top: 20px;
    width: 100%;
    display: flex;
    justify-content: center;
  }
  
  nav a {
    margin: 0 10px;
    font-size: 0.8rem;
  }
  
  .hero {
    padding: 80px 20px;
  }
  
  .hero h2 {
    font-size: 2rem;
  }
  
  .recipe-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
  }
  
  .recipe, .about-content {
    padding: 25px;
  }
  
  .recipe-image {
    height: 300px;
  }
  
  .search-input {
    padding: 0.8rem 0.8rem 0.8rem 2.8rem;
    font-size: 1rem;
  }
  
  .search-icon {
    left: 1rem;
  }
}

/* Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: white;
    padding: 8px;
    z-index: 100;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Focus styles */
:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --text-color: #000;
        --background-color: #fff;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Print styles */
@media print {
    .split-hero {
        display: block;
    }
    
    .split-hero-image {
        display: none;
    }
    
    .split-hero-content {
        width: 100%;
        padding: 0;
        background: none;
        box-shadow: none;
    }
    
    .recipe-card-meta {
        display: block;
    }
    
    .recipe-card-meta-item {
        margin-bottom: 1rem;
    }
    
    .recipe-card-meta-item svg {
        display: none;
    }
}