/* ===============================================
   MiRecipeStories - Global Styles
   Modern, Responsive, Performance-Optimized
   =============================================== */

/* Variables */
:root {
    --primary-green: #2d5016;
    --light-green: #4a7c2c;
    --accent-orange: #e8935c;
    --soft-orange: #f5d5c8;
    --warm-beige: #f5ead6;
    --light-cream: #faf8f3;
    --dark-gray: #2c2c2c;
    --medium-gray: #666;
    --light-gray: #f0f0f0;
    --white: #ffffff;
    --transition: all 0.3s ease;
    --max-width: 1200px;
}

/* ===============================================
   1. GLOBAL & RESET
   =============================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--dark-gray);
    background-color: var(--white);
    font-size: 16px;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

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

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

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

h1, h2, h3, h4, h5, h6 {
    font-family: 'Merriweather', serif;
    font-weight: 700;
    line-height: 1.3;
    color: var(--primary-green);
}

button, input[type="button"], input[type="submit"] {
    font-family: 'Poppins', sans-serif;
}

/* ===============================================
   2. CONTAINER & LAYOUT
   =============================================== */

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 80px 0;
}

@media (max-width: 768px) {
    section {
        padding: 50px 0;
    }
}

/* ===============================================
   3. NAVIGATION BAR
   =============================================== */

.navbar {
    background-color: var(--white);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
}

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

.logo {
    flex-shrink: 0;
}

.logo a {
    display: flex;
    align-items: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-green);
    font-family: 'Merriweather', serif;
    gap: 8px;
}

.logo-icon {
    font-size: 28px;
}

.logo-text {
    color: var(--primary-green);
}

.logo-highlight {
    color: var(--accent-orange);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 35px;
}

.nav-link {
    color: var(--dark-gray);
    font-weight: 500;
    position: relative;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-green);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-orange);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 6px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--primary-green);
    border-radius: 3px;
    transition: var(--transition);
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: var(--white);
        flex-direction: column;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: var(--transition);
        box-shadow: 0 5px 16px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        max-height: 500px;
    }

    .nav-menu li {
        border-bottom: 1px solid var(--light-gray);
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .nav-link {
        display: block;
        padding: 15px 20px;
    }

    .nav-link::after {
        display: none;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(10px, 10px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
}

/* ===============================================
   4. HERO SECTION
   =============================================== */

.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    padding: 100px 50px 80px;
    background: linear-gradient(135deg, var(--warm-beige) 0%, var(--light-cream) 100%);
}

.hero-content h1 {
    font-size: 56px;
    margin-bottom: 15px;
    line-height: 1.2;
}

.hero-content .tagline {
    font-size: 24px;
    color: var(--accent-orange);
    font-family: 'Merriweather', serif;
    font-weight: 700;
    margin-bottom: 15px;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--medium-gray);
    margin-bottom: 30px;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.hero-image {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(45, 80, 22, 0.15);
}

.hero-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

@media (max-width: 1024px) {
    .hero {
        gap: 40px;
        padding: 80px 50px 60px;
    }

    .hero-content h1 {
        font-size: 42px;
    }

    .hero-content .tagline {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .hero {
        grid-template-columns: 1fr;
        padding: 60px 50px 40px;
    }

    .hero-content h1 {
        font-size: 36px;
    }

    .hero-content .tagline {
        font-size: 18px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .hero-buttons {
        gap: 15px;
    }
}

/* ===============================================
   5. BUTTONS
   =============================================== */

.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    text-align: center;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background-color: var(--light-green);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(45, 80, 22, 0.3);
}

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

.btn-secondary:hover {
    background-color: #d97a47;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(232, 147, 92, 0.3);
}

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

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

@media (max-width: 768px) {
    .btn {
        padding: 12px 24px;
        font-size: 14px;
        width: 100%;
    }
}

/* ===============================================
   6. FEATURED RECIPES SECTION
   =============================================== */

.featured-recipes {
    background-color: var(--white);
}

.featured-recipes h2 {
    text-align: center;
    font-size: 42px;
    margin-bottom: 12px;
}

.section-subtitle {
    text-align: center;
    color: var(--medium-gray);
    font-size: 18px;
    margin-bottom: 50px;
}

.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 35px;
    margin-bottom: 50px;
}

.recipe-card {
    background-color: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.recipe-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(45, 80, 22, 0.15);
}

.recipe-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.recipe-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.recipe-card:hover .recipe-image img {
    transform: scale(1.08);
}

.recipe-tag {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: var(--accent-orange);
    color: var(--white);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.recipe-info {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.recipe-info h3 {
    font-size: 20px;
    margin-bottom: 12px;
    line-height: 1.4;
}

.recipe-info h3 a {
    color: var(--primary-green);
}

.recipe-info h3 a:hover {
    color: var(--accent-orange);
}

.recipe-info > p {
    color: var(--medium-gray);
    font-size: 15px;
    margin-bottom: 20px;
    flex-grow: 1;
}

.recipe-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 14px;
    color: var(--medium-gray);
}

.health-tag {
    background-color: var(--warm-beige);
    color: var(--primary-green);
    padding: 4px 10px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 12px;
}

.view-more {
    text-align: center;
}

@media (max-width: 768px) {
    .recipes-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .featured-recipes h2 {
        font-size: 32px;
    }
}

/* ===============================================
   7. STORIES SECTION
   =============================================== */

.latest-stories {
    background-color: var(--light-cream);
}

.latest-stories h2 {
    text-align: center;
    font-size: 42px;
    margin-bottom: 12px;
}

.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 35px;
}

.story-card {
    background-color: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.story-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.story-image {
    height: 220px;
    overflow: hidden;
}

.story-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.story-card:hover .story-image img {
    transform: scale(1.05);
}

.story-content {
    padding: 30px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.story-date {
    color: var(--accent-orange);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
}

.story-content h3 {
    font-size: 20px;
    margin-bottom: 15px;
    line-height: 1.4;
}

.story-content > p {
    color: var(--medium-gray);
    font-size: 15px;
    margin-bottom: 20px;
    flex-grow: 1;
}

.read-more {
    color: var(--primary-green);
    font-weight: 600;
    display: inline-block;
    transition: var(--transition);
}

.read-more:hover {
    color: var(--accent-orange);
}

@media (max-width: 768px) {
    .latest-stories h2 {
        font-size: 32px;
    }

    .stories-grid {
        grid-template-columns: 1fr;
    }
}

/* ===============================================
   8. TIPS PREVIEW SECTION
   =============================================== */

.tips-preview {
    background-color: var(--white);
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.tip-card {
    background-color: var(--warm-beige);
    padding: 35px;
    border-radius: 12px;
    text-align: center;
    transition: var(--transition);
    border: 2px solid transparent;
}

.tip-card:hover {
    border: 2px solid var(--accent-orange);
    transform: translateY(-5px);
}

.tip-icon {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

.tip-card h3 {
    font-size: 20px;
    margin-bottom: 12px;
}

.tip-card p {
    color: var(--medium-gray);
    font-size: 15px;
    line-height: 1.7;
}

@media (max-width: 768px) {
    .tips-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .tip-card {
        padding: 25px;
    }
}

/* ===============================================
   9. VIDEOS SECTION
   =============================================== */

.featured-videos {
    background-color: var(--light-cream);
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 35px;
}

.video-card {
    background-color: var(--white);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
}

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

.video-container {
    position: relative;
    height: 200px;
    background-color: #000;
    overflow: hidden;
}

.video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.video-container:hover .video-thumbnail {
    opacity: 0.8;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--accent-orange);
    color: var(--white);
    border: none;
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-button:hover {
    background-color: #d97a47;
    transform: translate(-50%, -50%) scale(1.1);
}

.video-card h3 {
    padding: 20px 20px 10px;
    font-size: 18px;
}

.video-card p {
    padding: 0 20px 20px;
    color: var(--medium-gray);
    font-size: 14px;
}

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

/* ===============================================
   10. NEWSLETTER SECTION
   =============================================== */

.newsletter {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--light-green) 100%);
    color: var(--white);
}

.newsletter-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-content h2 {
    color: var(--white);
    font-size: 38px;
    margin-bottom: 15px;
}

.newsletter-content > p {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0.95;
}

.newsletter-form {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.newsletter-form input {
    flex: 1;
    padding: 14px 18px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
}

.newsletter-form input::placeholder {
    color: #ccc;
}

.newsletter-form button {
    background-color: var(--accent-orange);
    color: var(--white);
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.newsletter-form button:hover {
    background-color: #d97a47;
}

.newsletter-privacy {
    font-size: 13px;
    opacity: 0.8;
}

@media (max-width: 768px) {
    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-form input,
    .newsletter-form button {
        width: 100%;
    }

    .newsletter-content h2 {
        font-size: 28px;
    }
}

/* ===============================================
   11. TESTIMONIALS SECTION
   =============================================== */

.testimonials {
    background-color: var(--white);
}

.testimonials h2 {
    text-align: center;
    font-size: 42px;
    margin-bottom: 12px;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.testimonial-card {
    background-color: var(--warm-beige);
    padding: 30px;
    border-radius: 12px;
    border-left: 4px solid var(--accent-orange);
}

.testimonial-content {
    margin-bottom: 25px;
}

.testimonial-content p {
    font-style: italic;
    color: var(--medium-gray);
    line-height: 1.8;
    font-size: 15px;
}

.testimonial-author h4 {
    color: var(--primary-green);
    margin-bottom: 5px;
    font-size: 16px;
}

.testimonial-author p {
    color: var(--accent-orange);
    font-size: 13px;
    font-weight: 600;
    font-style: normal;
}

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

    .testimonials h2 {
        font-size: 32px;
    }
}

/* ===============================================
   12. FOOTER
   =============================================== */

.footer {
    background-color: var(--primary-green);
    color: var(--white);
    padding: 60px 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    color: var(--white);
    font-size: 18px;
    margin-bottom: 15px;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 15px;
}

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

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.85);
    transition: var(--transition);
}

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

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
    font-weight: bold;
    transition: var(--transition);
}

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

.footer-newsletter {
    display: flex;
    gap: 10px;
}

.footer-newsletter input {
    flex: 1;
    min-width: 0;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
}

.footer-newsletter button {
    padding: 10px 15px;
    background-color: var(--accent-orange);
    color: var(--white);
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.footer-newsletter button:hover {
    background-color: #d97a47;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 25px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 15px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .footer-grid {
        gap: 25px;
    }

    .footer-newsletter {
        flex-direction: column;
    }

    .footer-newsletter input,
    .footer-newsletter button {
        width: 100%;
    }

    .footer-links {
        gap: 15px;
    }
}

/* ===============================================
   13. MODAL
   =============================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    aspect-ratio: 16/9;
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
}

.modal-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    font-weight: bold;
    color: var(--white);
    cursor: pointer;
    z-index: 2001;
    transition: var(--transition);
}

.close:hover {
    color: var(--accent-orange);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ===============================================
   14. UTILITY CLASSES
   =============================================== */

.hidden {
    display: none !important;
}

.no-scroll {
    overflow: hidden;
}

/* ===============================================
   15. ACCESSIBILITY & PERFORMANCE
   =============================================== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .newsletter,
    .footer {
        display: none;
    }

    body {
        background-color: white;
    }

    section {
        page-break-inside: avoid;
    }
}
