/* Samosa.fr modern design styles */
/* Root variables and global resets */
* {
    box-sizing: border-box;
}

:root {
    --primary-color: #4361ee;
    --primary-hover: #3a56c8;
    --text-color: #333333;
    --background-color: #fdfdfd;
    --header-bg: #ffffff;
    --header-text: #333333;
    --card-bg: #ffffff;
    --card-shadow: rgba(0, 0, 0, 0.06);
    --note-bg: #f7f9fc;
    --note-border: #4361ee;
    --footer-bg: #f7f9fc;
    --footer-text: #333333;
}

body {
    margin: 0;
    font-family: 'Montserrat', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

a:hover {
    text-decoration: underline;
}

/* Header and Navigation */
header {
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: 12px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

/*
 * Logo styles
 * The logo uses a larger font size and primary colour. The anchor is not
 * underlined in normal or hover states. The styles are split between the
 * container and the link for clarity.
 */
.logo {
    font-size: 1.6em;
    font-weight: 700;
}

.logo a {
    text-decoration: none;
    color: var(--primary-color);
}

/* Prevent underline on hover for the logo link */
.logo a:hover {
    text-decoration: none;
    color: var(--primary-hover);
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 20px;
}

nav li {
    margin: 0;
}

nav a {
    color: var(--header-text);
    font-weight: 500;
    transition: color 0.3s ease;
}

nav a:hover {
    color: var(--primary-color);
    /* Empêche le soulignement sur les éléments de menu au survol */
    text-decoration: none;
}

/* Mobile navigation toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 28px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--header-text);
    margin: 3px 0;
    transition: all 0.3s ease;
}

/* Theme toggle */
.theme-toggle {
    background: none;
    border: none;
    font-size: 1.2em;
    margin-left: 10px;
    cursor: pointer;
    color: var(--primary-color);
    display: flex;
    align-items: center;
}

.theme-toggle:hover {
    color: var(--primary-hover);
}

/* Responsive nav behaviour */
@media (max-width: 768px) {
    nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background-color: var(--header-bg);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        padding: 10px 0;
        z-index: 999;
    }
    nav ul.open {
        display: flex;
    }
    nav li {
        margin: 10px 0;
        text-align: center;
    }
    .nav-toggle {
        display: flex;
    }
}

/* Hero Section */
.hero {
    position: relative;
    background-image: url('images/hero.png');
    background-size: cover;
    background-position: center;
    color: #ffffff;
    padding: 120px 20px;
    text-align: center;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 0;
}

.hero h1 {
    position: relative;
    z-index: 1;
    font-size: 3em;
    margin-bottom: 10px;
    line-height: 1.2;
    animation: fadeInUp 0.8s ease-out forwards;
}

.hero p {
    position: relative;
    z-index: 1;
    font-size: 1.2em;
    max-width: 750px;
    margin: 0 auto 25px;
    animation: fadeInUp 1s ease-out forwards;
}

.hero .cta-btn {
    position: relative;
    z-index: 1;
    display: inline-block;
    padding: 14px 30px;
    font-size: 1em;
    color: #ffffff;
    background-color: var(--primary-color);
    border-radius: 6px;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    animation: fadeInUp 1.2s ease-out forwards;
}

.hero .cta-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

/* Main Container */
.container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Card Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.card {
    background-color: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 4px 12px var(--card-shadow);
    padding: 24px 20px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s forwards;
}

/* Staggered animation for cards */
.card:nth-child(1) { animation-delay: 0.2s; }
.card:nth-child(2) { animation-delay: 0.4s; }
.card:nth-child(3) { animation-delay: 0.6s; }
.card:nth-child(4) { animation-delay: 0.8s; }
.card:nth-child(5) { animation-delay: 1s; }
.card:nth-child(6) { animation-delay: 1.2s; }

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
}

.card-icon {
    font-size: 2.5em;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.card h3 {
    margin-top: 0;
    color: var(--text-color);
    font-size: 1.25em;
}

.card p {
    color: #666666;
    margin-bottom: 20px;
    font-size: 0.95em;
    flex-grow: 1;
}

.card a {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: #ffffff;
    border-radius: 6px;
    font-size: 0.9em;
    min-height: 44px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.card a:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

/* Recipe Pages */
.ingredients, .instructions {
    margin-bottom: 30px;
}

.ingredients ul, .instructions ol {
    margin-left: 20px;
}

.ingredients li, .instructions li {
    margin-bottom: 8px;
}

/* Notes */
.note {
    font-size: 0.9em;
    font-style: italic;
    background-color: var(--note-bg);
    padding: 12px 15px;
    border-left: 4px solid var(--note-border);
    margin-bottom: 20px;
}

/* Footer */
footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid #e5e5e5;
}

/* Citations (not used but kept for consistency) */
.citations {
    margin-top: 40px;
    font-size: 0.8em;
    color: #555;
    border-top: 1px solid #ddd;
    padding-top: 10px;
}

.citations ol {
    padding-left: 20px;
}

.citations li {
    margin-bottom: 5px;
}

/* Keyframe animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dark Mode Styles */
body.dark {
    background-color: #121212;
    color: #f1f1f1;
}

body.dark header {
    background-color: #1e1e2e;
    color: #f1f1f1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

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

body.dark nav a {
    color: #f1f1f1;
}

body.dark nav a:hover {
    color: var(--primary-color);
}

body.dark .nav-toggle span {
    background-color: #f1f1f1;
}

body.dark .theme-toggle {
    color: var(--primary-color);
}

body.dark .hero::before {
    background: rgba(0, 0, 0, 0.6);
}

body.dark .card {
    background-color: #1e1e2e;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body.dark .card h3 {
    color: #f1f1f1;
}

body.dark .card p {
    color: #cfcfcf;
}

body.dark .card a {
    background-color: var(--primary-color);
    color: #ffffff;
}

body.dark .card a:hover {
    background-color: var(--primary-hover);
}

body.dark .note {
    background-color: #2a2a3c;
    color: #ddd;
    border-left-color: var(--primary-color);
}

body.dark footer {
    background-color: #1e1e2e;
    color: #f1f1f1;
    border-top-color: #333;
}