/* --- Base Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* Ensures consistent box model across all elements */
}

html {
    scroll-behavior: smooth; /* Enhances UX for anchor links */
}

body {
    font-family: 'Poppins', sans-serif; /* Clean, modern, highly readable for body text */
    line-height: 1.6;
    color: #212529; /* Deep, almost black, for strong contrast */
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); /* Ultra-soft, breathable background */
    min-height: 100vh; /* Ensure body takes full height */
    display: flex;
    flex-direction: column; /* For sticky footer */
    -webkit-font-smoothing: antialiased; /* Smoother font rendering on macOS */
    -moz-osx-font-smoothing: grayscale; /* Smoother font rendering on Firefox */
}

a {
    text-decoration: none;
    color: #FF7043; /* A warm, inviting 'Coral Sunset' */
    transition: color 0.2s ease-out; /* Faster color transitions */
}

a:hover {
    color: #5E35B1; /* A rich, deep 'Amethyst Purple' */
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

/* --- Utility Classes --- */
.container {
    max-width: 1300px; /* Slightly wider for a more expansive feel */
    margin: 0 auto;
    padding: 0 2.5rem; /* Generous side padding */
}

/* --- Header Section --- */
.page-header {
    background: linear-gradient(90deg, #FFC107 0%, #FF7043 100%); /* Golden Sun to Coral Sunset */
    color: #f8f9fa; /* Off-white for light text on dark backgrounds */
    padding: 5rem 0 2.5rem; /* More vertical padding for grandeur */
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2); /* Deepest for floating elements */
    position: relative;
    overflow: hidden;
    border-bottom-left-radius: 18px; /* Slightly larger, softer rounded corners for depth */
    border-bottom-right-radius: 18px;

    /* Subtle texture overlay for added sophistication */
    &::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="50" cy="50" r="45" fill="none" stroke="%23ffffff" stroke-opacity="0.1" stroke-width="1"></circle></svg>') repeat;
        background-size: 50px;
        opacity: 0.3;
        z-index: 0;
        pointer-events: none; /* Ensure it doesn't block clicks */
    }
}

.header-content-wrapper {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.back-link {
    position: absolute;
    top: 2.5rem; /* Consistent spacing */
    left: 2.5rem;
    color: #f8f9fa; /* Off-white for light text on dark backgrounds */
    font-weight: 500;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-radius: 50px; /* Perfect for buttons and inputs */
    background-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: background-color 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.back-link:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateX(-8px);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06); /* Lighter, broader, softer */
}

.back-link i {
    font-size: 1em;
}

.page-title {
    font-family: 'Playfair Display', serif; /* Elegant, traditional feel for titles */
    font-size: 4.5em; /* Even larger for stronger impact */
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.3);
    color: #f8f9fa; /* Off-white for light text on dark backgrounds */
    letter-spacing: 2.5px; /* More open letter spacing */
    line-height: 1.1;
}

.page-subtitle {
    font-size: 1.5em; /* Stronger subtitle */
    color: rgba(255, 255, 255, 0.95);
    max-width: 700px; /* Wider text */
    margin: 0 auto;
    font-weight: 300;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
    line-height: 1.4;
}

/* --- Recipe Grid Container --- */
.recipe-grid-container {
    flex-grow: 1; /* Allows it to take up available space, pushing footer down */
    padding-top: 5rem; /* Increased top padding to create space from header */
    padding-bottom: 5rem; /* Generous bottom padding */
    position: relative; /* For potential background elements */

    /* A subtle, flowing background pattern for dynamism */
    &::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: radial-gradient(circle at top left, rgba(255, 112, 67, 0.05) 0%, transparent 40%),
                    radial-gradient(circle at bottom right, rgba(94, 53, 177, 0.05) 0%, transparent 40%);
        background-size: 800px 800px;
        background-repeat: no-repeat;
        opacity: 0.8;
        z-index: -1; /* Send it behind content */
        animation: subtleFlow 30s infinite alternate ease-in-out;
    }
}

@keyframes subtleFlow {
    0% { background-position: 0% 0%, 100% 100%; }
    100% { background-position: 100% 100%, 0% 0%; }
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); /* Larger min-width for cards */
    gap: 2.5rem; /* More generous gap */
    justify-content: center;
    align-items: stretch;
}

/* --- Recipe Card Styles --- */
.recipe-card {
    background-color: #ffffff; /* Pristine white for content cards */
    border-radius: 18px; /* Slightly larger, softer rounded corners for depth */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12); /* More pronounced for interaction */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-align: center;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    will-change: transform, box-shadow;
    border: 1px solid #e0e6ed; /* A light, soft border for definition */
    position: relative; /* For a subtle border glow */

    /* Subtle border glow on hover */
    &::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 18px;
        border: 2px solid transparent;
        background: linear-gradient(45deg, #FF7043, #5E35B1) border-box;
        -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor;
        mask-composite: exclude;
        opacity: 0;
        transition: opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
        pointer-events: none; /* Important for clickability */
    }
}

.recipe-card:hover {
    transform: translateY(-15px) rotateX(3deg); /* More dynamic lift and tilt */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2); /* Deepest for floating elements */
}

.recipe-card:hover::after {
    opacity: 1; /* Show glow on hover */
}

.recipe-link {
    display: block;
    position: relative;
    overflow: hidden;
    height: 240px; /* Taller image area for better visual impact */
    border-bottom: 1px solid #e0e6ed; /* Subtle border for definition */
}

.recipe-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1); /* Slower, more deliberate zoom */
}

.recipe-card:hover .recipe-image {
    transform: scale(1.2); /* More pronounced zoom effect */
}

.recipe-name {
    font-family: 'Playfair Display', serif; /* Elegant, traditional feel for titles */
    font-size: 2.2em; /* Larger, more commanding recipe name */
    font-weight: 600;
    margin: 2.5rem 1.5rem 1rem; /* More balanced internal padding */
    color: #5E35B1; /* A rich, deep 'Amethyst Purple' */
    line-height: 1.2;
}

.recipe-description {
    font-size: 1em;
    color: #6c757d; /* Muted grey for descriptions and softer text */
    padding: 0 2.5rem;
    margin-bottom: 2.5rem; /* More space before button */
    flex-grow: 1;
    line-height: 1.5;
}

.view-recipe-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem; /* Generous padding */
    background-color: #FF7043; /* A warm, inviting 'Coral Sunset' */
    color: #f8f9fa; /* Off-white for light text on dark backgrounds */
    border-radius: 50px; /* Perfect for buttons and inputs */
    font-weight: 600;
    font-size: 1em;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    margin: 0 1.5rem 2.5rem; /* Adjusted bottom margin */
    box-shadow: 0 5px 15px rgba(255, 112, 67, 0.4);
    letter-spacing: 0.5px;
    border: none; /* Ensure no default button border */
}

.view-recipe-btn i {
    margin-left: 1rem; /* More space for icon */
    font-size: 0.9em;
}

.view-recipe-btn:hover {
    background-color: #5E35B1; /* A rich, deep 'Amethyst Purple' */
    box-shadow: 0 8px 20px rgba(94, 53, 177, 0.5);
    transform: translateY(-5px);
}

/* --- Simple Footer --- */
.simple-footer {
    background-color: #212529; /* Deep, almost black, for strong contrast */
    color: rgba(255, 255, 255, 0.85); /* Slightly brighter for better contrast */
    text-align: center;
    padding: 2.5rem 0; /* More generous padding */
    font-size: 0.95em;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    margin-top: 5rem; /* Increased margin-top for separation */
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
}

/* --- Responsive Adjustments --- */
@media (max-width: 1200px) {
    .container {
        padding: 0 1.5rem;
    }
    .page-title {
        font-size: 4em;
    }
}

@media (max-width: 992px) {
    .page-title {
        font-size: 3.5em;
    }
    .page-subtitle {
        font-size: 1.3em;
    }
    .back-link {
        top: 1.5rem;
        left: 1.5rem;
        font-size: 1em;
        padding: 1rem 1.5rem;
    }
    .recipe-grid {
        gap: 2.5rem;
    }
    .recipe-name {
        font-size: 2em;
    }
}

@media (max-width: 768px) {
    .page-header {
        padding: 3.75rem 0 1.5rem;
        margin-bottom: 2.5rem; /* More integrated margin */
    }
    .page-title {
        font-size: 2.8em;
        letter-spacing: 1.5px;
    }
    .page-subtitle {
        font-size: 1.1em;
    }
    .back-link {
        position: static;
        display: block;
        width: fit-content;
        margin: 0 auto 2.5rem;
        padding: 1rem 2.5rem;
        background-color: rgba(255, 255, 255, 0.25);
    }
    .recipe-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    .recipe-card {
        margin: 0 auto;
        max-width: 380px; /* Max width for single column responsiveness */
    }
    .recipe-name {
        font-size: 1.8em;
        margin: 2.5rem 1rem 0.5rem;
    }
    .recipe-description {
        padding: 0 1.5rem;
        margin-bottom: 1.5rem;
    }
    .view-recipe-btn {
        padding: 1rem 1.5rem;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 2.5rem 0 1rem;
        margin-bottom: 1.5rem;
    }
    .page-title {
        font-size: 2.2em;
        letter-spacing: 1px;
    }
    .page-subtitle {
        font-size: 0.9em;
        padding: 0 1rem;
    }
    .back-link {
        margin-bottom: 1.5rem;
    }
    .recipe-grid {
        grid-template-columns: 1fr; /* Force single column */
        gap: 1rem;
    }
    .recipe-card {
        margin: 0 1rem;
        max-width: none;
    }
    .recipe-name {
        font-size: 1.6em;
        margin: 1.5rem 0.5rem 0.5rem;
    }
    .recipe-description {
        padding: 0 1rem;
        margin-bottom: 1rem;
    }
    .view-recipe-btn {
        margin: 0 1rem 1.5rem;
    }
    .simple-footer {
        padding: 1.5rem 0;
        margin-top: 2.5rem;
    }
}