/* 
Theme: Minimalist Clean
Font: Inter
Tone: Informative & Straightforward
*/

/* --- CSS Variables --- */
:root {
    --primary-bg-color: #ffffff;
    --secondary-bg-color: #f8f9fa;
    --primary-text-color: #212529;
    --secondary-text-color: #6c757d;
    --accent-color: #007bff;
    --accent-hover-color: #0056b3;
    --border-color: #dee2e6;
    --font-family: 'Inter', sans-serif;
    --container-width: 1140px;
    --header-height: 70px;
}

/* --- Global Resets & Typography --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--primary-bg-color);
    color: var(--primary-text-color);
    line-height: 1.7;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--primary-text-color);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

p {
    margin-bottom: 1.25rem;
}

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

a:hover {
    color: var(--accent-hover-color);
    text-decoration: underline;
}

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

ul {
    list-style-position: inside;
    padding-left: 20px;
    margin-bottom: 1rem;
}

/* --- Layout & Container --- */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
    padding: 0 1rem;
}

.main-content {
    flex-grow: 1;
    padding: 2rem 0;
}

.content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* --- Header & Navigation --- */
.site-header {
    background-color: var(--primary-bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1rem;
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-text-color);
    text-decoration: none;
}

.site-title:hover {
    color: var(--accent-color);
    text-decoration: none;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    padding: 0;
    margin: 0;
}

.main-nav a {
    text-decoration: none;
    color: var(--secondary-text-color);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

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

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary-text-color);
}

/* --- Main Section --- */
.hero {
    text-align: center;
    padding: 3rem 0;
    background-color: var(--secondary-bg-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.hero h1 {
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.125rem;
    color: var(--secondary-text-color);
    max-width: 800px;
    margin: 0 auto;
}

/* --- Article Grid (Homepage) --- */
.articles-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.articles-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--accent-color);
}

.article-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.article-card {
    background-color: var(--primary-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.article-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-5px);
}

.article-card-content {
    padding: 1.5rem;
}

.article-card-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.article-card-title a {
    color: var(--primary-text-color);
    text-decoration: none;
}

.article-card-title a:hover {
    color: var(--accent-color);
}

.article-card-excerpt {
    color: var(--secondary-text-color);
    margin-bottom: 1rem;
}

.read-more-btn {
    display: inline-block;
    font-weight: 600;
    text-decoration: none;
    color: var(--accent-color);
}

.read-more-btn:hover {
    color: var(--accent-hover-color);
    text-decoration: underline;
}

/* --- Sidebar --- */
.sidebar-widget {
    background-color: var(--secondary-bg-color);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.sidebar-widget h3 {
    font-size: 1.25rem;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.sidebar-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-widget ul li {
    margin-bottom: 0.75rem;
}

.sidebar-widget ul li a {
    color: var(--primary-text-color);
    font-weight: 500;
}

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

.sidebar-promo-text {
    font-style: italic;
    color: var(--secondary-text-color);
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* --- Article Page Specific --- */
.article-header {
    text-align: center;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

.article-meta {
    color: var(--secondary-text-color);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.article-content {
    font-size: 1.1rem;
}

.article-content h2, .article-content h3 {
    margin-top: 2.5rem;
}

.article-content blockquote {
    border-left: 4px solid var(--accent-color);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--secondary-text-color);
}

.cta-section {
    background-color: var(--accent-color);
    color: #fff;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    margin-top: 2rem;
}

.cta-section h3 {
    color: #fff;
    margin-bottom: 1rem;
}

.cta-section a {
    display: inline-block;
    background-color: #fff;
    color: var(--accent-color);
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.cta-section a:hover {
    background-color: #f1f1f1;
    color: var(--accent-hover-color);
}


/* --- Other Pages --- */
.page-header {
    background-color: var(--secondary-bg-color);
    padding: 2rem 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    margin-bottom: 1rem;
    font-family: var(--font-family);
    font-size: 1rem;
}

.contact-form button {
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.contact-form button:hover {
    background-color: var(--accent-hover-color);
}

/* --- Recipe Finder Page --- */
.recipe-finder-section {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 2rem;
}

.recipe-finder-section p {
    font-size: 1.125rem;
    color: var(--secondary-text-color);
    margin-bottom: 1.5rem;
}

.recipe-form {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.recipe-form input {
    flex-grow: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-family: var(--font-family);
    font-size: 1rem;
}

.recipe-form button {
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.recipe-form button:hover:not(:disabled) {
    background-color: var(--accent-hover-color);
}

.recipe-form button:disabled {
    background-color: #a0a0a0;
    cursor: not-allowed;
}

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid var(--secondary-bg-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-message {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    padding: 1rem;
    margin-bottom: 2rem;
}

.recipe-results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: left;
}

.recipe-card {
    background-color: var(--primary-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    transition: box-shadow 0.3s ease;
}

.recipe-card:hover {
     box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.recipe-card h3 {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.recipe-card h4 {
    font-size: 1.1rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.recipe-card ul, .recipe-card ol {
    padding-left: 20px;
}

.recipe-card li {
    margin-bottom: 0.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* --- Footer --- */
.site-footer {
    background-color: var(--secondary-bg-color);
    color: var(--secondary-text-color);
    padding: 1.5rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: auto; /* Pushes footer to the bottom */
}


/* --- Responsive Design --- */
@media (min-width: 768px) {
    .article-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .content-wrapper {
        flex-direction: row;
    }
    .main-area {
        flex: 3;
    }
    .sidebar {
        flex: 1;
        max-width: 300px;
    }
    .article-grid {
        grid-template-columns: 1fr; /* On homepage, keep stacked inside main-area */
    }
}