/* styles.css - The Central Theme */
:root {
    --primary-color: #556b2f;
    --accent-color: #8c7b70;
    --bg-color: #f9f8f4;
    --card-bg: #fffff0;
    --text-main: #444444;
    --text-light: #666666;
    --tag-bg: #e6e2d8;
    --tag-text: #4a4a4a;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 40px 20px;
    line-height: 1.7;
}

header {
    text-align: center;
    margin-bottom: 50px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

h1 {
    font-family: "Georgia", "Times New Roman", serif;
    font-weight: normal;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 5px;
    letter-spacing: 1px;
}

h2, h3 {
    font-family: "Georgia", serif;
    color: var(--primary-color);
}

/* Navigation / Controls */
.controls {
    text-align: center;
    margin-bottom: 40px;
}

button {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 8px 24px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    margin: 0 6px;
    transition: all 0.3s ease;
    font-family: "Georgia", serif;
}

button:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Recipe Cards & Grid */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1100px;
    margin: 0 auto;
}

/* This makes the whole card clickable without looking like a blue link */
.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.recipe-card {
    background: var(--card-bg);
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%; /* Ensures cards are same height */
}

.recipe-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.06);
}

.recipe-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 20px;
    opacity: 0.95;
}

.tag {
    display: inline-block;
    background: var(--tag-bg);
    color: var(--tag-text);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    text-transform: uppercase;
}

/* Individual Recipe Page Styling */
.recipe-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 40px;
    border-radius: 8px;
    border: 1px solid #e8e4dc;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
}

.back-link:hover {
    color: var(--primary-color);
}

/* ALLERGEN TABLE - CENTERED ALIGNMENT */
.allergen-box {
    background-color: #fcfbf9;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    margin: 20px 0;
    padding: 0;
    overflow: hidden;
}

.allergen-main-title {
    background-color: #f4f1ea;
    font-family: "Georgia", serif;
    color: var(--primary-color);
    margin: 0;
    padding: 12px;
    font-size: 0.95rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #e8e4dc;
}

.allergen-split {
    display: flex;
}

.allergen-col {
    flex: 1; /* 50/50 split */
    padding: 15px 10px; /* Reduced side padding slightly */
}

/* The vertical divider line */
.allergen-col:first-child {
    border-right: 1px solid #e8e4dc;
}

.allergen-col h5 {
    margin: 0 0 15px 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #8c7b70;
    text-align: center;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* The 2-column list grid */
.allergen-list {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two equal columns */
    column-gap: 5px; /* Tighter gap */
    row-gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
}

/* CENTER the items in their cells */
.allergen-list li {
    text-align: center;
    width: 100%;
}

/* Specific text colors */
.text-safe { color: var(--text-light); }
.text-warn { color: #c0392b; font-weight: bold; }

/* NEW: Deep Dive Sections (TCM & Metabolic) */
.deep-dive-section {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.deep-dive-title {
    font-family: "Georgia", serif;
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

/* Little visual cues before headers */
.deep-dive-title::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--accent-color);
    border-radius: 50%;
    margin-right: 10px;
}

.deep-dive-text {
    font-size: 0.95rem;
    color: var(--text-main);
    line-height: 1.6;
    margin-bottom: 20px;
}