/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4db882;
    --secondary-color: #E0B0D5;
    --text-color: #333;
    --bg-color: #fff;
    --light-bg: #f4f3f3;
    --border-color: #d6d4d4;
    --link-color: #3a9e6e;
    --link-hover: #2d7a55;
    --checked-ingredient: #999999;
    --accent-light: #AEE5D8;
    --accent-lavender: #E5D0E3;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    font-size: 16px;
}

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

/* Header */
.site-header {
    background-color: var(--primary-color);
    color: white;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.site-title {
    font-size: 1.8rem;
    margin: 0;
}

.site-title a {
    color: white;
    text-decoration: none;
}

.site-nav {
    display: flex;
    gap: 1.5rem;
}

.site-nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.site-nav a:hover {
    opacity: 0.8;
}

/* Main Content */
main {
    min-height: calc(100vh - 250px);
    padding-bottom: 2rem;
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.page-header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Recipe Search and Filters */
.recipe-filters {
    margin-bottom: 2rem;
}

.search-input {
    width: 100%;
    max-width: 600px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.tag-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-filter {
    background: var(--light-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.9rem;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.tag-filter:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.tag-filter.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Recipe and Plan Cards */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.recipe-card.hidden {
    display: none;
}

.recipe-card, .plan-card, .content-card {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: box-shadow 0.2s;
}

.recipe-card:hover, .plan-card:hover, .content-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.recipe-card h2, .recipe-card h3,
.plan-card h2, .plan-card h3,
.content-card h2, .content-card h3 {
    margin-bottom: 0.5rem;
}

.recipe-card a, .plan-card a, .content-card a {
    color: var(--link-color);
    text-decoration: none;
}
.recipe-card .tags a {
    color: var(--text-color);
    text-decoration: none;
}

.plan-card a:hover, .content-card a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

h1 a, h2 a, h3 a {
    color: var(--link-color);
    text-decoration: none;
}

.meta {
    color: #666;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.meta-item {
    margin-right: 1rem;
}
.meta-item.rating {
    color: var(--secondary-color)
}

/* Tags */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.tag {
    display: inline-block;
    background: var(--accent-light);
    color: var(--text-color);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.2s;
}

.tag:hover {
    background: #8fd9c6;
}

/* Meal Plan List (Home Page) */
.recent-plans .plan-list {
    list-style: none;
    margin: 1rem 0 2rem 0;
    padding: 0;
}

.recent-plans .plan-list li {
    margin: 0.75rem 0;
}

.recent-plans .plan-list a {
    display: block;
    background: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
}

.recent-plans .plan-list a:hover {
    background: var(--link-hover);
    transform: translateX(5px);
}

/* Meal Plan Cards (Plans Page) */
.plan-card .read-more {
    display: inline-block;
    color: var(--link-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

.plan-card .read-more:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Links */
.read-more, .view-all {
    display: inline-block;
    color: var(--link-color);
    text-decoration: none;
    font-weight: 500;
    margin-top: 1rem;
}

.read-more:hover, .view-all:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Single Content Page */
.single-content {
    max-width: 900px;
    margin: 0 auto;
}

.content-header {
    margin-bottom: 2rem;
}

.content-header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.recipe-meta, .plan-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--accent-lavender);
    border-radius: 4px;
}

/* Content Body */
.content-body {
    font-size: 1.1rem;
    line-height: 1.8;
}

.content-body h1 {
    font-size: 2rem;
    margin: 2rem 0 1rem;
    color: var(--primary-color);
}

.content-body h2 {
    font-size: 1.6rem;
    margin: 1.5rem 0 0.75rem;
    color: var(--primary-color);
}

.content-body h3 {
    font-size: 1.3rem;
    margin: 1.25rem 0 0.5rem;
    color: var(--text-color);
}

.content-body ul, .content-body ol {
    margin: 1rem 0 1rem 2rem;
}

.content-body li {
    margin: 0.5rem 0;
}

/* Recipe Layout: Ingredients left, Instructions right */
.recipe-columns {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
    align-items: start;
}

.ingredients-column h2,
.instructions-column h2 {
    margin-top: 0;
}

/* Clickable ingredients */
.ingredients-column ul li {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s, opacity 0.2s;
}

.ingredients-column ul li.checked {
    color: var(--checked-ingredient);
    opacity: 0.6;
    text-decoration: line-through;
}

.content-body p {
    margin: 1rem 0;
}

.content-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.content-body table th,
.content-body table td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid var(--border-color);
}

.content-body table th {
    background: var(--light-bg);
    font-weight: 600;
}

/* Checkboxes for shopping lists */
.content-body input[type="checkbox"] {
    margin-right: 0.5rem;
    transform: scale(1.2);
}

/* Content Footer */
.content-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

/* Site Footer */
.site-footer {
    background: var(--light-bg);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
    color: #666;
}

/* Print Styles */
@media print {
    .site-header, .site-footer, .site-nav, .tags, .read-more, .view-all {
        display: none;
    }

    body {
        font-size: 12pt;
    }

    .content-body {
        font-size: 11pt;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    body {
        font-size: 18px; /* Larger for easier reading on mobile */
    }

    .site-header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .site-title {
        font-size: 1.5rem;
    }

    .site-nav {
        gap: 1rem;
    }

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

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

    .content-body {
        font-size: 1.05rem;
    }

    /* Stack recipe columns on mobile with ingredients first */
    .recipe-columns {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .ingredients-column {
        order: -1; /* Ingredients come first on mobile */
    }
}

/* Tablet/iPad Styles */
@media (min-width: 769px) and (max-width: 1024px) {
    body {
        font-size: 17px;
    }

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

.meal-plan-preview {
    margin-bottom: 4rem;
}