/* ==========================================================
   Cookbook Interactive — shared stylesheet
   Used by: index2.php (body.page-home), recipe2.php (body.page-recipe)
   ========================================================== */

:root{
    --primary:#ff6b35;
    --primary-dark:#e55a25;
    --secondary:#fff7f3;
    --dark:#222;
    --gray:#666;
    --light:#f8f9fa;
    --white:#ffffff;
    --radius:20px;
    --shadow:0 10px 30px rgba(0,0,0,.08);
    --shadow-lg:0 20px 60px rgba(0,0,0,.14);
}
*, *::before, *::after{
    margin:0;
    padding:0;
    box-sizing:border-box;
}
html{ scroll-behavior:smooth; }
body{
    font-family:'Poppins',sans-serif;
    color:var(--dark);
}
a{ color:var(--primary); text-decoration:none; }
a:hover{ text-decoration:underline; }
img{
    max-width:100%;
    display:block;
}
.container{
    width:min(1200px,90%);
    margin:auto;
}

/* ── Header / nav (shared) ── */
header{
    background:var(--white);
    position:sticky;
    top:0;
    z-index:100;
    box-shadow:0 3px 10px rgba(0,0,0,.05);
}
.navbar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:1rem 0;
}
.logo{
    font-weight:700;
    color:var(--primary);
}
.logo:hover{ text-decoration:none; }
.nav-links{
    display:none;
    list-style:none;
    gap:2rem;
}
.nav-links a{
    text-decoration:none;
    color:var(--dark);
    font-weight:500;
}
.nav-links a:hover{
    color:var(--primary);
    text-decoration:none;
}
@media(min-width:768px){
    .nav-links{ display:flex; }
}

/* ── Footer (shared base, per-page overrides below) ── */
footer{
    background:#111;
    text-align:center;
    padding:2rem 0;
}

/* ── Page hero (shared) — used by sub-pages like categories.php ── */
.page-hero{
    background:linear-gradient(
        rgba(0,0,0,.55),
        rgba(0,0,0,.55)
    ),
    url("https://images.unsplash.com/photo-1547573854-74d2a71d0826?w=2000&q=80&auto=format&fit=crop") center/cover;
    min-height:34vh;
    display:flex;
    align-items:center;
    color:white;
    text-align:center;
}
.page-hero h1{
    font-size:2rem;
    margin-bottom:.5rem;
}
.page-hero p{
    font-size:1rem;
    opacity:.9;
}
@media(min-width:768px){
    .page-hero{ min-height:40vh; }
    .page-hero h1{ font-size:2.75rem; }
}

/* ==========================================================
   Home page — index2.php
   ========================================================== */
body.page-home{
    line-height:1.6;
    background:#fff;
}
body.page-home .logo{ font-size:1.5rem; }
body.page-home footer{
    color:white;
    margin-top:4rem;
}

/* Hero */
.hero{
    background:linear-gradient(
        rgba(0,0,0,.5),
        rgba(0,0,0,.5)
    ),
    url("https://images.unsplash.com/photo-1490645935967-10de6ba17061") center/cover;
    min-height:80vh;
    display:flex;
    align-items:center;
    color:white;
}
.hero-content{
    text-align:center;
}
.hero h1{
    font-size:2.5rem;
    margin-bottom:1rem;
}
.hero p{
    margin-bottom:2rem;
    font-size:1.1rem;
}
.search-box{
    display:flex;
    flex-direction:column;
    gap:1rem;
    max-width:600px;
    margin:auto;
}
.search-box input{
    padding:1rem;
    border:none;
    border-radius:50px;
    font-size:1rem;
}
.search-box button{
    padding:1rem;
    border:none;
    border-radius:50px;
    background:var(--primary);
    color:white;
    font-weight:600;
    cursor:pointer;
}

/* Section */
section{
    padding:4rem 0;
}
body.page-home .section-title{
    text-align:center;
    margin-bottom:3rem;
}
body.page-home .section-title h2{
    font-size:2rem;
}

/* Categories */
.categories{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:1rem;
}
.category-card{
    display:block;
    background:var(--secondary);
    padding:2rem;
    text-align:center;
    border-radius:var(--radius);
    transition:.3s;
    color:var(--dark);
    text-decoration:none;
}
.category-card:hover{
    transform:translateY(-5px);
    text-decoration:none;
}
.category-card span{
    font-size:2rem;
    display:block;
    margin-bottom:.5rem;
}

/* Recipes */
.recipe-grid{
    display:grid;
    gap:2rem;
}
body.page-home .recipe-card{
    background:white;
    border-radius:var(--radius);
    overflow:hidden;
    box-shadow:var(--shadow);
}
body.page-home .recipe-card img{
    height:240px;
    width:100%;
    object-fit:cover;
}
.recipe-content{
    padding:1.5rem;
}
.recipe-meta{
    display:flex;
    justify-content:space-between;
    margin-top:1rem;
    color:var(--gray);
    font-size:.9rem;
}
.rating{
    color:#ffb400;
}

/* Newsletter */
.newsletter{
    background:var(--primary);
    color:white;
    text-align:center;
    border-radius:30px;
    padding:3rem 2rem;
}
.newsletter-form{
    margin-top:1.5rem;
    display:flex;
    flex-direction:column;
    gap:1rem;
}
.newsletter input{
    padding:1rem;
    border:none;
    border-radius:50px;
}
.newsletter button{
    padding:1rem;
    border:none;
    border-radius:50px;
    background:white;
    color:var(--primary);
    font-weight:700;
    cursor:pointer;
}

/* Tablet */
@media(min-width:768px){
    .hero h1{
        font-size:4rem;
    }
    .search-box{
        flex-direction:row;
    }
    .search-box input{
        flex:1;
    }
    .categories{
        grid-template-columns:repeat(4,1fr);
    }
    .recipe-grid{
        grid-template-columns:repeat(2,1fr);
    }
    .newsletter-form{
        flex-direction:row;
        max-width:600px;
        margin:auto;
        margin-top:1.5rem;
    }
    .newsletter-form input{
        flex:1;
    }
}
/* Desktop */
@media(min-width:1024px){
    .recipe-grid{
        grid-template-columns:repeat(3,1fr);
    }
    .hero{
        min-height:90vh;
    }
    .hero-content{
        max-width:800px;
        margin:auto;
    }
}

/* ==========================================================
   Recipe detail page — recipe2.php
   ========================================================== */
body.page-recipe{
    line-height:1.7;
    background:var(--light);
}
body.page-recipe .logo{ font-size:1.4rem; }
body.page-recipe footer{
    color:#aaa;
    font-size:.85rem;
}
body.page-recipe footer a{ color:#888; }
body.page-recipe footer a:hover{ color:#fff; }

/* Hero image */
.recipe-hero {
    width: 100%;
    height: 340px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--secondary), #ffd5be);
    position: relative;
}
.recipe-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}
.recipe-hero-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6rem;
}

/* Card wrapper */
.card-outer {
    max-width: 960px;
    margin: -56px auto 0;
    padding: 0 1rem 3rem;
    position: relative;
    z-index: 10;
}
.back-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: var(--primary);
    font-weight: 500;
    font-size: .88rem;
    margin-bottom: 1rem;
}
.back-link:hover { text-decoration: underline; }

/* Recipe card */
body.page-recipe .recipe-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* Card header */
.card-header { padding: 1.75rem 1.75rem 1.25rem; }
.course-badge {
    display: inline-block;
    background: var(--secondary);
    color: var(--primary);
    font-weight: 600;
    font-size: .72rem;
    padding: .28rem .9rem;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .85rem;
}
.recipe-title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: .7rem;
}
.rating-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .88rem;
    color: var(--gray);
}
.stars { color: #ffb400; letter-spacing: .04em; }

/* Meta strip */
.meta-strip {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    padding: 1.1rem 1.75rem;
    background: var(--secondary);
    border-top: 1px solid #ffe3d2;
    border-bottom: 1px solid #ffe3d2;
}
.meta-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex: 1 1 130px;
}
.meta-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--white);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.meta-icon svg { width: 22px; height: 22px; }
.meta-label {
    display: block;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    font-weight: 600;
    color: var(--gray);
    line-height: 1;
    margin-bottom: .25rem;
}
.meta-value {
    font-size: .95rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1;
}
.meta-na { color: #bbb; font-weight: 400; font-size: .82rem; }

/* Content grid */
.card-body {
    display: grid;
    grid-template-columns: 1fr;
}

/* Ingredients */
.ingredients-col {
    padding: 1.75rem;
    background: var(--secondary);
    border-bottom: 1px solid #ffe3d2;
}
body.page-recipe .section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
body.page-recipe .section-title::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, var(--primary), transparent);
    border-radius: 2px;
}
.ingredient-list {
    list-style: none;
}
.ingredient-list li {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    padding: .55rem 0;
    border-bottom: 1px solid #ffe3d2;
    font-size: .92rem;
    line-height: 1.4;
}
.ingredient-list li:last-child { border-bottom: none; }
.bullet {
    color: var(--primary);
    font-size: 1.1rem;
    line-height: 1.35;
    flex-shrink: 0;
}

/* Method */
.method-col {
    padding: 1.75rem;
}
.method-text {
    font-size: .93rem;
    line-height: 1.9;
    color: #444;
}

/* Card footer */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    padding: 1.1rem 1.75rem;
    border-top: 1px solid #f0f0f0;
    font-size: .82rem;
    color: var(--gray);
}

/* Responsive */
@media (min-width: 640px) {
    .recipe-hero { height: 420px; }
    .recipe-title { font-size: 2.1rem; }
}
@media (min-width: 768px) {
    .recipe-hero { height: 500px; }
    .card-body { grid-template-columns: 280px 1fr; }
    .ingredients-col { border-bottom: none; border-right: 1px solid #ffe3d2; }
}
@media (min-width: 1024px) {
    .recipe-hero { height: 560px; }
    .card-outer { padding: 0 2rem 3rem; }
    .card-header { padding: 2rem 2rem 1.5rem; }
    .meta-strip { padding: 1.25rem 2rem; }
    .ingredients-col, .method-col { padding: 2rem; }
    .card-footer { padding: 1.25rem 2rem; }
    .recipe-title { font-size: 2.4rem; }
}
