/*
Theme Name: FanRecipe Premium
Theme URI: https://fanrecipe.com
Author: Chef Yassine
Author URI: https://fanrecipe.com
Description: Premium SEO-optimized recipe website for Google rankings and AdSense monetization
Version: 1.0.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fanrecipe
Domain Path: /languages
Requires at least: 5.9
Requires PHP: 7.4
Tags: recipes, food, blog, seo-friendly, mobile-ready, adsense
*/

:root {
    --primary-color: #000000;
    --accent-color: #DC143C;
    --background-color: #FFFFFF;
    --text-color: #000000;
    --light-gray: #F5F5F5;
    --border-color: #E0E0E0;
    --spacing-unit: 8px;
    --max-width: 1200px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    font-weight: 400;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Georgia', serif;
    font-weight: 600;
    line-height: 1.3;
    margin: calc(var(--spacing-unit) * 2) 0 calc(var(--spacing-unit) * 1.5);
    color: var(--text-color);
}

h1 {
    font-size: 3rem;
    margin-bottom: calc(var(--spacing-unit) * 2);
}

h2 {
    font-size: 2.25rem;
    margin-top: calc(var(--spacing-unit) * 3);
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.5rem;
}

h5 {
    font-size: 1.25rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin-bottom: calc(var(--spacing-unit) * 1.5);
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-color);
}

/* Container & Layout */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 calc(var(--spacing-unit) * 2);
}

.row {
    display: grid;
    gap: calc(var(--spacing-unit) * 2);
}

.row-2 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.row-3 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.row-4 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Buttons */
.btn {
    display: inline-block;
    padding: calc(var(--spacing-unit) * 1) calc(var(--spacing-unit) * 2.5);
    background-color: var(--accent-color);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.btn:hover {
    background-color: #A01030;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 20, 60, 0.3);
}

.btn-secondary {
    background-color: var(--primary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #333;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
}

.btn-outline:hover {
    background-color: var(--accent-color);
    color: white;
}

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

.featured-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: calc(var(--spacing-unit) * 2);
}

/* Header */
.site-header {
    background-color: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    padding: calc(var(--spacing-unit) * 1.5) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.site-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 calc(var(--spacing-unit) * 2);
}

.site-logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.site-logo a {
    color: var(--primary-color);
}

.site-logo span {
    color: var(--accent-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: calc(var(--spacing-unit) * 2.5);
    align-items: center;
}

.nav-menu a {
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--accent-color);
}

.nav-menu .current-menu-item > a {
    color: var(--accent-color);
    font-weight: 600;
}

.search-icon {
    cursor: pointer;
    font-size: 1.2rem;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
    padding: calc(var(--spacing-unit) * 6) calc(var(--spacing-unit) * 2);
    text-align: center;
    margin-bottom: calc(var(--spacing-unit) * 4);
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.25rem;
    color: #666;
    margin-bottom: calc(var(--spacing-unit) * 3);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Cards */
.recipe-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.recipe-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    transform: translateY(-4px);
}

.recipe-card-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.recipe-card-content {
    padding: calc(var(--spacing-unit) * 1.5);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.recipe-card-title {
    font-size: 1.25rem;
    margin-bottom: calc(var(--spacing-unit) * 1);
    font-family: Georgia, serif;
    font-weight: 600;
}

.recipe-card-meta {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: calc(var(--spacing-unit) * 1);
    display: flex;
    gap: calc(var(--spacing-unit) * 1.5);
}

.recipe-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.recipe-card-excerpt {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    flex-grow: 1;
}

.recipe-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: calc(var(--spacing-unit) * 1);
}

.recipe-difficulty {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-color);
}

.recipe-card-link {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Footer */
.site-footer {
    background-color: var(--primary-color);
    color: white;
    padding: calc(var(--spacing-unit) * 4) calc(var(--spacing-unit) * 2);
    margin-top: calc(var(--spacing-unit) * 6);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: calc(var(--spacing-unit) * 3);
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.footer-section h3 {
    color: white;
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    font-size: 1.1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: calc(var(--spacing-unit) * 0.75);
}

.footer-section a {
    color: #ccc;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: calc(var(--spacing-unit) * 2);
    text-align: center;
    font-size: 0.9rem;
    color: #aaa;
}

/* Breadcrumbs */
.breadcrumbs {
    font-size: 0.85rem;
    margin-bottom: calc(var(--spacing-unit) * 2);
    padding: calc(var(--spacing-unit) * 1) 0;
}

.breadcrumbs a {
    color: var(--accent-color);
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs span {
    margin: 0 4px;
    color: #999;
}

/* Sidebar */
.sidebar {
    position: relative;
}

.widget {
    background: var(--light-gray);
    padding: calc(var(--spacing-unit) * 2);
    margin-bottom: calc(var(--spacing-unit) * 2);
    border-radius: 4px;
}

.widget h3 {
    font-size: 1.2rem;
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    padding-bottom: calc(var(--spacing-unit) * 1);
    border-bottom: 2px solid var(--accent-color);
}

.widget ul {
    list-style: none;
}

.widget ul li {
    padding: calc(var(--spacing-unit) * 0.75) 0;
    border-bottom: 1px solid var(--border-color);
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget a {
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
}

.widget a:hover {
    color: var(--accent-color);
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: calc(var(--spacing-unit) * 3);
    margin: calc(var(--spacing-unit) * 4) 0;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* Posts */
.post {
    background: white;
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.post-title {
    font-size: 2rem;
    margin-bottom: calc(var(--spacing-unit) * 1);
}

.post-meta {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: calc(var(--spacing-unit) * 2);
    display: flex;
    gap: calc(var(--spacing-unit) * 2);
    flex-wrap: wrap;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-content {
    font-size: 1rem;
    line-height: 1.8;
    color: #333;
}

.post-content p {
    margin-bottom: calc(var(--spacing-unit) * 1.5);
}

.post-content h2 {
    margin-top: calc(var(--spacing-unit) * 3);
}

/* Recipe Specific */
.recipe-header {
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.recipe-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: calc(var(--spacing-unit) * 2);
    background: var(--light-gray);
    padding: calc(var(--spacing-unit) * 2);
    border-radius: 4px;
    margin: calc(var(--spacing-unit) * 2) 0;
}

.recipe-meta-item {
    text-align: center;
}

.recipe-meta-label {
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.recipe-meta-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

.ingredients-section,
.instructions-section {
    margin: calc(var(--spacing-unit) * 3) 0;
}

.ingredients-section h2,
.instructions-section h2 {
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: calc(var(--spacing-unit) * 1);
}

.ingredients-list {
    list-style: none;
}

.ingredients-list li {
    padding: calc(var(--spacing-unit) * 0.75) 0;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    padding-left: calc(var(--spacing-unit) * 2.5);
}

.ingredients-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

.instructions-list {
    list-style: none;
    counter-reset: step-counter;
}

.instructions-list li {
    padding: calc(var(--spacing-unit) * 1.5) 0 calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 4);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    counter-increment: step-counter;
}

.instructions-list li:before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: calc(var(--spacing-unit) * 1.5);
    width: calc(var(--spacing-unit) * 3);
    height: calc(var(--spacing-unit) * 3);
    background-color: var(--accent-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Table of Contents */
.toc-container {
    background: var(--light-gray);
    border-left: 4px solid var(--accent-color);
    padding: calc(var(--spacing-unit) * 2);
    margin: calc(var(--spacing-unit) * 2) 0;
    border-radius: 4px;
}

.toc-container h3 {
    margin-top: 0;
}

.toc-container ul {
    list-style: none;
}

.toc-container ul li {
    margin-bottom: 6px;
}

.toc-container a {
    color: var(--accent-color);
}

/* Nutrition Info */
.nutrition-info {
    background: var(--light-gray);
    padding: calc(var(--spacing-unit) * 2);
    border-radius: 4px;
    margin: calc(var(--spacing-unit) * 2) 0;
}

.nutrition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: calc(var(--spacing-unit) * 1.5);
}

.nutrition-item {
    text-align: center;
}

.nutrition-label {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 4px;
}

.nutrition-value {
    font-size: 1.3rem;
    font-weight: 600;
}

/* FAQ Section */
.faq-section {
    margin: calc(var(--spacing-unit) * 3) 0;
}

.faq-item {
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.faq-question {
    background: var(--light-gray);
    padding: calc(var(--spacing-unit) * 1.5);
    cursor: pointer;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s;
}

.faq-question:hover {
    background-color: #eee;
}

.faq-question:after {
    content: "+";
    font-size: 1.5rem;
    color: var(--accent-color);
}

.faq-item.active .faq-question:after {
    content: "−";
}

.faq-answer {
    padding: calc(var(--spacing-unit) * 1.5);
    display: none;
}

.faq-item.active .faq-answer {
    display: block;
}

/* Author Box */
.author-box {
    background: var(--light-gray);
    padding: calc(var(--spacing-unit) * 2);
    border-radius: 4px;
    margin: calc(var(--spacing-unit) * 3) 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: calc(var(--spacing-unit) * 2);
}

.author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.author-content h3 {
    margin-top: 0;
}

.author-bio {
    font-size: 0.9rem;
    color: #666;
}

/* Related Posts */
.related-posts {
    margin: calc(var(--spacing-unit) * 4) 0;
    padding-top: calc(var(--spacing-unit) * 3);
    border-top: 2px solid var(--border-color);
}

.related-posts h3 {
    margin-bottom: calc(var(--spacing-unit) * 2);
}

/* Search Form */
.search-form {
    position: relative;
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.search-form input {
    width: 100%;
    padding: calc(var(--spacing-unit) * 1) calc(var(--spacing-unit) * 1.5);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.95rem;
}

.search-form input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.1);
}

/* Newsletter */
.newsletter-form {
    display: flex;
    gap: calc(var(--spacing-unit) * 1);
    margin-top: calc(var(--spacing-unit) * 1.5);
}

.newsletter-form input {
    flex-grow: 1;
    padding: calc(var(--spacing-unit) * 1) calc(var(--spacing-unit) * 1.5);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.95rem;
}

.newsletter-form button {
    padding: calc(var(--spacing-unit) * 1) calc(var(--spacing-unit) * 2);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: calc(var(--spacing-unit) * 1);
    margin: calc(var(--spacing-unit) * 3) 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: calc(var(--spacing-unit) * 0.75) calc(var(--spacing-unit) * 1);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    min-width: 40px;
    text-align: center;
    transition: all 0.3s;
}

.pagination a:hover {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.pagination .current {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* Categories */
.categories-grid {
    margin: calc(var(--spacing-unit) * 3) 0;
}

.category-block {
    text-align: center;
    padding: calc(var(--spacing-unit) * 2);
}

.category-block-title {
    font-size: 1.25rem;
    margin-bottom: calc(var(--spacing-unit) * 1);
}

.category-block-icon {
    font-size: 2.5rem;
    margin-bottom: calc(var(--spacing-unit) * 1);
}

/* Social Share */
.social-share {
    display: flex;
    gap: calc(var(--spacing-unit) * 1.5);
    margin: calc(var(--spacing-unit) * 2) 0;
    align-items: center;
}

.social-share-label {
    font-weight: 600;
    margin-right: calc(var(--spacing-unit) * 1);
}

.social-share a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--light-gray);
    color: var(--text-color);
    transition: all 0.3s;
}

.social-share a:hover {
    background-color: var(--accent-color);
    color: white;
}

/* Print Button */
.print-button {
    display: inline-block;
    margin: calc(var(--spacing-unit) * 2) 0;
}

.print-button a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-color);
    font-weight: 600;
    transition: color 0.3s;
}

.print-button a:hover {
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .nav-menu {
        gap: calc(var(--spacing-unit) * 1.5);
        font-size: 0.9rem;
    }

    .recipe-meta-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .featured-image {
        height: 300px;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .hero {
        padding: calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 1.5);
    }

    .site-header-content {
        padding: 0 calc(var(--spacing-unit) * 1.5);
    }

    .nav-menu {
        gap: calc(var(--spacing-unit) * 1);
    }

    .recipe-card-content {
        padding: calc(var(--spacing-unit) * 1);
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    .site-header,
    .site-footer,
    .sidebar,
    .social-share,
    .related-posts,
    .print-button {
        display: none;
    }

    .featured-image {
        margin-bottom: 1rem;
    }
}
