/* ============================================================
   SpiceKraft — Main Stylesheet
   Design: Warm editorial food blog with rich spice-toned palette
   ============================================================ */

:root {
    --primary:       #c0392b;
    --primary-dark:  #96281b;
    --primary-light: #e74c3c;
    --accent:        #e67e22;
    --accent-light:  #f39c12;
    --gold:          #d4a843;
    --dark:          #1a1208;
    --dark-2:        #2c1e0f;
    --body-bg:       #fefcf8;
    --surface:       #ffffff;
    --surface-warm:  #fdf6ed;
    --border:        #f0e4d0;
    --text:          #2c1e0f;
    --text-muted:    #7a6252;
    --text-light:    #a8957f;
    --font-display:  'Playfair Display', Georgia, serif;
    --font-body:     'DM Sans', system-ui, sans-serif;
    --radius-sm:     6px;
    --radius:        12px;
    --radius-lg:     20px;
    --shadow-sm:     0 2px 8px rgba(44,30,15,.06);
    --shadow:        0 4px 24px rgba(44,30,15,.10);
    --shadow-lg:     0 8px 48px rgba(44,30,15,.15);
    --transition:    .25s ease;
}

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background: var(--body-bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.7;
    font-weight: 400;
}
h1,h2,h3,h4,h5,h6 { font-family: var(--font-display); font-weight: 700; color: var(--dark); }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; }

/* ─── Top Bar ─── */
.top-bar {
    background: var(--dark);
    color: #e8d5bb;
    font-size: .82rem;
    padding: .45rem 0;
    font-family: var(--font-body);
}
.top-bar a { color: #f39c12; font-weight: 600; }
.top-bar a:hover { color: #fff; }

/* ─── Navbar ─── */
#mainNav {
    background: #fff;
    border-bottom: 2px solid var(--border);
    padding: .75rem 0;
    transition: box-shadow var(--transition);
}
#mainNav.scrolled { box-shadow: var(--shadow); }
.navbar-brand { display: flex; align-items: center; gap: .5rem; }
.brand-icon { font-size: 1.8rem; }
.brand-name {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -.5px;
}
#mainNav .nav-link {
    font-weight: 500;
    color: var(--text) !important;
    padding: .5rem .9rem !important;
    font-size: .93rem;
    transition: color var(--transition);
}
#mainNav .nav-link:hover { color: var(--primary) !important; }
.dropdown-menu {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    padding: .5rem;
    border-top: 3px solid var(--primary);
}
.dropdown-item {
    border-radius: var(--radius-sm);
    padding: .5rem 1rem;
    font-size: .9rem;
    color: var(--text);
    transition: background var(--transition);
}
.dropdown-item:hover { background: var(--surface-warm); color: var(--primary); }

/* Search */
.nav-search { position: relative; }
.search-wrapper { display: flex; align-items: center; position: relative; }
.nav-search .form-control {
    border-radius: 50px 0 0 50px;
    border: 1.5px solid var(--border);
    border-right: none;
    padding: .5rem 1rem;
    font-size: .88rem;
    width: 220px;
    background: var(--surface-warm);
    transition: width var(--transition), border-color var(--transition);
}
.nav-search .form-control:focus {
    width: 280px;
    border-color: var(--primary);
    box-shadow: none;
    background: #fff;
    outline: none;
}
.search-btn {
    border-radius: 0 50px 50px 0;
    background: var(--primary);
    color: white;
    border: 1.5px solid var(--primary);
    padding: .5rem 1rem;
}
.search-btn:hover { background: var(--primary-dark); }

/* ─── Breadcrumb ─── */
.breadcrumb-bar {
    background: var(--surface-warm);
    border-bottom: 1px solid var(--border);
    padding: .6rem 0;
    font-size: .83rem;
}
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-light); }
.breadcrumb-item a { color: var(--text-muted); }
.breadcrumb-item.active { color: var(--primary); font-weight: 500; }

/* ─── Section Titles ─── */
.section-title { font-size: 2rem; font-weight: 800; position: relative; display: inline-block; }
.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 2px;
    margin-top: .3rem;
}
.section-label {
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--primary);
    font-family: var(--font-body);
}

/* ─── Hero ─── */
.hero {
    background: linear-gradient(135deg, #1a0a00 0%, #3d1c0a 40%, #6b2d0f 100%);
    position: relative;
    overflow: hidden;
    min-height: 580px;
    display: flex;
    align-items: center;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-badge {
    display: inline-block;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    color: #ffd;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: .35rem .9rem;
    border-radius: 50px;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
}
.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    text-shadow: 0 2px 20px rgba(0,0,0,.3);
}
.hero h1 span { color: var(--accent-light); }
.hero p { color: rgba(255,255,255,.8); font-size: 1.1rem; max-width: 520px; }
.hero-search .input-group {
    background: #fff;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,.25);
    max-width: 560px;
}
.hero-search .form-control {
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1rem;
}
.hero-search .form-control:focus { box-shadow: none; }
.hero-search .btn {
    border-radius: 0 50px 50px 0 !important;
    padding: 1rem 2rem;
    background: var(--primary);
    border: none;
    font-weight: 600;
}
.hero-search .btn:hover { background: var(--primary-dark); }
.hero-stats { display: flex; gap: 2rem; margin-top: 2rem; }
.hero-stat { text-align: center; }
.hero-stat .num {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    display: block;
}
.hero-stat .lbl {
    font-size: .78rem;
    color: rgba(255,255,255,.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ─── Recipe Cards ─── */
.recipe-card {
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .3s ease, box-shadow .3s ease;
    height: 100%;
}
.recipe-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.recipe-card-img {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
}
.recipe-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.recipe-card:hover .recipe-card-img img { transform: scale(1.06); }
.card-category-badge {
    position: absolute;
    top: .75rem;
    left: .75rem;
    background: var(--primary);
    color: white;
    font-size: .72rem;
    font-weight: 600;
    padding: .3rem .75rem;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.card-featured-badge {
    position: absolute;
    top: .75rem;
    right: .75rem;
    background: var(--gold);
    color: var(--dark);
    font-size: .7rem;
    font-weight: 700;
    padding: .25rem .6rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: .3rem;
}
.recipe-card-body { padding: 1.25rem; }
.recipe-card-body h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: .5rem;
    line-height: 1.4;
}
.recipe-card-body h3 a { color: var(--dark); }
.recipe-card-body h3 a:hover { color: var(--primary); }
.recipe-meta {
    display: flex;
    gap: 1rem;
    font-size: .8rem;
    color: var(--text-muted);
    margin: .75rem 0;
}
.recipe-meta span { display: flex; align-items: center; gap: .3rem; }
.recipe-meta i { color: var(--accent); }
.recipe-rating { display: flex; align-items: center; gap: .5rem; font-size: .82rem; }
.recipe-rating .stars { font-size: .78rem; }
.recipe-rating .count { color: var(--text-muted); }

/* Category Badge Cards */
.cat-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    aspect-ratio: 1/1;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform .3s ease, box-shadow .3s ease;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.cat-card-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    opacity: .9;
}
.cat-card-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: white;
    padding: 1rem;
    text-align: center;
}
.cat-card-emoji { font-size: 2.5rem; margin-bottom: .5rem; }
.cat-card-name { font-family: var(--font-display); font-size: 1rem; font-weight: 700; }
.cat-card-count { font-size: .78rem; opacity: .8; }

/* ─── Featured Recipe Banner ─── */
.featured-banner {
    background: linear-gradient(135deg, #1a0a00, #5c2010);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    min-height: 360px;
    display: flex;
    align-items: stretch;
}
.featured-banner-img {
    flex: 0 0 50%;
    position: relative;
    overflow: hidden;
}
.featured-banner-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .85;
}
.featured-banner-content {
    flex: 1;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
}
.featured-banner-content h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: white;
    margin-bottom: 1rem;
}
.featured-banner-content p { color: rgba(255,255,255,.8); }

/* ─── Recipe Detail ─── */
.recipe-hero-img {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.recipe-hero-img img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
}
.recipe-info-bar {
    background: var(--surface-warm);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.recipe-info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 1rem;
    border-right: 1px solid var(--border);
}
.recipe-info-item:last-child { border-right: none; }
.recipe-info-item .icon { font-size: 1.5rem; margin-bottom: .35rem; }
.recipe-info-item .label { font-size: .72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }
.recipe-info-item .value { font-family: var(--font-display); font-weight: 700; color: var(--dark); font-size: 1.1rem; }

.ingredients-list { list-style: none; padding: 0; }
.ingredients-list li {
    padding: .6rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    font-size: .95rem;
}
.ingredients-list li::before {
    content: '✓';
    background: var(--primary);
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    flex-shrink: 0;
    margin-top: .1rem;
}
.ingredients-list li:last-child { border-bottom: none; }

.steps-list { list-style: none; padding: 0; counter-reset: step; }
.steps-list li {
    counter-increment: step;
    padding: 1.25rem 1.25rem 1.25rem 4.5rem;
    margin-bottom: 1rem;
    background: var(--surface-warm);
    border-radius: var(--radius);
    position: relative;
    border-left: 4px solid var(--primary);
    font-size: .95rem;
}
.steps-list li::before {
    content: counter(step);
    position: absolute;
    left: -1px;
    top: 50%;
    transform: translateY(-50%);
    width: 3rem;
    text-align: center;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--primary);
}

/* Share Buttons */
.share-btns { display: flex; gap: .5rem; flex-wrap: wrap; }
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem 1rem;
    border-radius: 50px;
    font-size: .82rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: opacity var(--transition);
}
.share-btn:hover { opacity: .85; }
.share-btn.facebook { background: #1877f2; color: white; }
.share-btn.twitter  { background: #1da1f2; color: white; }
.share-btn.whatsapp { background: #25d366; color: white; }
.share-btn.pinterest{ background: #e60023; color: white; }
.share-btn.copy     { background: var(--surface-warm); border: 1px solid var(--border); color: var(--text); }

/* ─── Search Page ─── */
.search-hero {
    background: linear-gradient(135deg, var(--dark), var(--dark-2));
    padding: 3.5rem 0;
    text-align: center;
}
.search-hero h1 { color: white; }
.search-hero .search-form { max-width: 620px; margin: 1.5rem auto 0; }

/* ─── Sidebar ─── */
.sidebar-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.sidebar-card h5 {
    font-size: 1rem;
    font-weight: 700;
    padding-bottom: .75rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-family: var(--font-body);
}
.sidebar-recipe { display: flex; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.sidebar-recipe:last-child { border-bottom: none; }
.sidebar-recipe-img {
    width: 65px;
    height: 65px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}
.sidebar-recipe-img img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-recipe-title { font-size: .85rem; font-weight: 600; color: var(--dark); line-height: 1.4; }
.sidebar-recipe-title:hover { color: var(--primary); }
.sidebar-recipe-meta { font-size: .75rem; color: var(--text-muted); }

/* ─── Pagination ─── */
.pagination-wrapper { display: flex; justify-content: center; margin-top: 3rem; }
.page-link {
    border: none;
    padding: .6rem 1rem;
    border-radius: var(--radius-sm) !important;
    margin: 0 .2rem;
    color: var(--text);
    font-weight: 500;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}
.page-link:hover { background: var(--surface-warm); color: var(--primary); }
.page-item.active .page-link { background: var(--primary); color: white; }

/* ─── Buttons ─── */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline-primary { border-color: var(--primary); color: var(--primary); font-weight: 600; }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }

/* ─── Footer ─── */
.site-footer { background: var(--dark); margin-top: 4rem; }
.footer-top { padding: 4rem 0 3rem; }
.footer-bottom {
    background: rgba(0,0,0,.3);
    padding: 1.25rem 0;
    color: rgba(255,255,255,.4);
    font-size: .83rem;
    border-top: 1px solid rgba(255,255,255,.06);
}
.footer-brand { display: flex; align-items: center; gap: .5rem; }
.footer-brand .brand-name { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; color: #fff; }
.footer-tagline { color: var(--accent-light); font-size: .9rem; font-style: italic; }
.footer-desc { color: rgba(255,255,255,.5); font-size: .88rem; line-height: 1.7; }
.footer-heading { color: rgba(255,255,255,.85); text-transform: uppercase; letter-spacing: 1.5px; font-size: .78rem; font-weight: 700; font-family: var(--font-body); margin-bottom: 1rem; }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: .5rem; }
.footer-links a { color: rgba(255,255,255,.5); font-size: .88rem; transition: color var(--transition); }
.footer-links a:hover { color: var(--accent-light); }
.social-links { display: flex; gap: .5rem; }
.social-link {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    color: rgba(255,255,255,.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .88rem;
    transition: all var(--transition);
}
.social-link:hover { background: var(--primary); color: white; }
.newsletter-form .form-control {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.15);
    color: white;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.newsletter-form .form-control::placeholder { color: rgba(255,255,255,.35); }
.newsletter-form .form-control:focus { box-shadow: none; border-color: var(--accent); }
.newsletter-form .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ─── Back to Top ─── */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s, transform .3s;
    z-index: 999;
    font-size: .9rem;
}
.back-to-top.show { opacity: 1; pointer-events: all; }
.back-to-top:hover { transform: translateY(-3px); background: var(--primary-dark); }

/* ─── No Image Placeholder ─── */
.no-img-placeholder {
    background: linear-gradient(135deg, var(--surface-warm), var(--border));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--text-light);
    width: 100%;
    height: 100%;
}

/* ─── Difficulty Badge ─── */
.badge-easy { background: #d4edda; color: #155724; }
.badge-medium { background: #fff3cd; color: #856404; }
.badge-hard { background: #f8d7da; color: #721c24; }

/* ─── Alerts ─── */
.alert-success { background: #d1fae5; border-color: #6ee7b7; color: #065f46; }
.alert-danger { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }

/* ─── Responsive ─── */
@media (max-width: 991px) {
    .hero { min-height: 420px; }
    .featured-banner-img { flex: 0 0 40%; }
}
@media (max-width: 767px) {
    .hero h1 { font-size: 2rem; }
    .hero-stats { gap: 1rem; }
    .featured-banner { flex-direction: column; }
    .featured-banner-img { flex: 0 0 220px; }
    .featured-banner-content { padding: 1.5rem; }
    .featured-banner-content h2 { font-size: 1.4rem; }
    .recipe-info-item { padding: 0 .5rem; }
    .recipe-info-item .value { font-size: .9rem; }
    .nav-search { display: none; }
}
@media (max-width: 575px) {
    .brand-name { font-size: 1.3rem; }
}

/* ─── Utility ─── */
.text-primary { color: var(--primary) !important; }
.bg-primary { background: var(--primary) !important; }
.text-accent { color: var(--accent) !important; }
.divider-fancy { border: none; height: 2px; background: linear-gradient(90deg, transparent, var(--border), transparent); margin: 2.5rem 0; }
