/* * TFP Meal Planner v2.5 - MASTER STYLES (Single + Archive) */

:root {
    --tfp-primary: #111827;       /* Dark Text */
    --tfp-accent: #C2410C;        /* Burnt Orange */
    --tfp-border: #E5E7EB;
    --tfp-bg: #FFFFFF;
    --tfp-bg-alt: #F9FAFB;
    --tfp-text: #374151;
    --tfp-muted: #6B7280;
    --tfp-radius: 8px;
}

@media (min-width: 922px) {
 .archive .site-content > .ast-container {
    max-width: 1200px !important;
  }
}

/* ==========================================================================
   PART 1: SINGLE MEAL PLAN PAGE (Clean 1-Column Layout)
   ========================================================================== */

/* Wrapper for Single Page (Narrower for readability) */
.tfp-mp-single-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--tfp-text);
    padding: 0 20px;
}

/* Hero Section */
.tfp-mp-hero {
    text-align: center;
    padding: 60px 20px;
    background: var(--tfp-bg-alt);
    border-radius: var(--tfp-radius);
    border: 1px solid var(--tfp-border);
    margin-bottom: 40px;
}
.tfp-mp-hero h1 {
    font-size: 2.5rem;
    color: var(--tfp-primary);
    margin: 0 0 15px 0;
    line-height: 1.2;
}
.tfp-mp-hero-meta {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}
.tfp-mp-pill {
    background: #fff;
    border: 1px solid var(--tfp-border);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--tfp-muted);
}

/* Sections */
.tfp-mp-section { margin-bottom: 50px; }
.tfp-mp-section h3 {
    font-size: 1.5rem;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 15px;
    margin-bottom: 25px;
    color: var(--tfp-primary);
}

/* Weekly Table (Scrollable) */
.tfp-mp-table-scroll {
    overflow-x: auto;
    /*border: 1px solid var(--tfp-border);*/
    border-radius: var(--tfp-radius);
}
.tfp-mp-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    min-width: 600px;
}
.tfp-mp-table th {
    background: #f9fafb;
    text-align: left;
    padding: 18px;
    font-weight: 600;
    color: var(--tfp-muted);
    border-bottom: 1px solid var(--tfp-border);
}
.tfp-mp-table td {
    padding: 18px;
    border-bottom: 1px solid var(--tfp-border);
    font-size: 1rem;
    vertical-align: top;
}
/*.tfp-mp-table tr:last-child td { border: none; }*/
.tfp-mp-day-col { 
    font-weight: 700; color: var(--tfp-primary); width: 15%; 
}

/* Links */
.tfp-mp-link {
    color: var(--tfp-accent);
    text-decoration: none;
    font-weight: 500;
}
.tfp-mp-link:hover { text-decoration: underline; }

/* Shopping List */
.tfp-mp-shop-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px 30px;
}
.tfp-mp-shop-item {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--tfp-border);
    border-radius: 6px;
}
.tfp-mp-shop-check {
    margin-top: 5px; margin-right: 12px;
    width: 18px; height: 18px;
    accent-color: var(--tfp-accent);
    cursor: pointer;
    flex-shrink: 0;
}
.tfp-mp-shop-label { cursor: pointer; line-height: 1.5; font-size: 0.95rem; }
.tfp-mp-shop-check:checked + label { 
    text-decoration: line-through; opacity: 0.5; 
}

/* Buttons */
.tfp-mp-actions { text-align: center; margin-top: 40px; padding-top: 30px; border-top: 1px solid var(--tfp-border); }
.tfp-mp-btn {
    background: #F15808;
    color: #fff;
    padding: 12px 30px;
    border-radius: 50px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.tfp-mp-btn:hover { opacity: 0.9; }


/* ==========================================================================
   PART 2: ARCHIVE PAGE (Recipe Style Grid)
   ========================================================================== */

/* Header */
.tfp-mp-archive-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--tfp-border);
}
.tfp-mp-archive-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--tfp-primary);
    margin: 0;
}

/* Filter Bar */
.tfp-mp-filter-bar {
    margin-bottom: 40px;
    background: #f9fafb;
    padding: 20px;
    border-radius: var(--tfp-radius);
    border: 1px solid var(--tfp-border);
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: center;
}
.tfp-mp-select {
    padding: 10px 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    min-width: 180px;
    background: #fff;
    color: #374151;
}
.tfp-mp-btn-filter {
    padding: 10px 20px;
    background: var(--tfp-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}
.tfp-mp-reset {
    color: #6b7280;
    text-decoration: underline;
    font-size: 0.9rem;
}

/* 3-Column Grid */
.tfp-mp-archive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

/* Recipe Style Card */
.tfp-mp-card {
    background: #fff;
    border: 1px solid var(--tfp-border);
    border-radius: var(--tfp-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}
.tfp-mp-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}
.tfp-mp-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.tfp-mp-card-img {
    height: 220px;
    background: #f3f4f6;
    overflow: hidden;
}
.tfp-mp-card-img img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.5s;
}
.tfp-mp-card:hover .tfp-mp-card-img img { transform: scale(1.05); }

.tfp-mp-card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.tfp-mp-card-meta {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--tfp-accent);
    margin-bottom: 8px;
}
.tfp-mp-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--tfp-primary);
    margin: 0 0 10px 0;
    line-height: 1.3;
}
.tfp-mp-card-excerpt {
    font-size: 0.95rem;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Pagination */
.tfp-mp-pagination-wrapper { text-align: center; margin-top: 40px; }
.tfp-mp-pagination-wrapper .page-numbers {
    padding: 8px 16px; border: 1px solid var(--tfp-border); margin: 0 4px; text-decoration: none; color: var(--tfp-primary); border-radius: 4px;
}
.tfp-mp-pagination-wrapper .page-numbers.current {
    background: var(--tfp-primary); color: #fff; border-color: var(--tfp-primary);
}

/* ==========================================================================
   RESPONSIVE RULES
   ========================================================================== */
@media (max-width: 1024px) {
    .tfp-mp-archive-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    /* Archive: 1 column */
    .tfp-mp-archive-grid { grid-template-columns: 1fr; }
    .tfp-mp-filter-bar { flex-direction: column; align-items: stretch; }
    
    /* Single: Stack table */
    .tfp-mp-table-scroll { overflow-x: scroll; }
    
    /* Global */
    .tfp-mp-hero h1, .tfp-mp-archive-header h1 { font-size: 2rem; }
    ul { margin: 0 0 0em 0em; }
}

/* --- FAQ / ACCORDION STYLES --- */
.tfp-mp-faq-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tfp-mp-faq-item {
    background: #fff;
    border: 1px solid var(--tfp-border);
    border-radius: var(--tfp-radius);
    overflow: hidden;
}

.tfp-mp-faq-title {
    padding: 15px 20px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    background: #f9fafb;
    list-style: none; /* Hides default triangle */
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--tfp-primary);
}

/* Custom indicator for Details/Summary */
.tfp-mp-faq-title::-webkit-details-marker { display: none; }
.tfp-mp-faq-title::after {
    content: '+';
    font-size: 1.2rem;
    color: var(--tfp-muted);
}
.tfp-mp-faq-item[open] .tfp-mp-faq-title::after {
    content: '−';
}

.tfp-mp-faq-content {
    padding: 20px;
    border-top: 1px solid var(--tfp-border);
    line-height: 1.7;
    color: var(--tfp-text);
}
/* ==========================================================================
   🖨️ PRINT STYLES (Color Enabled)
   ========================================================================== */
@media print {
    
    /* 1. Force Browser to Print Colors & Backgrounds */
    body {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* 2. Hide Global Theme Elements (Astra) */
    #masthead, #colophon, .ast-breadcrumbs, #wpadminbar, 
    .ast-header-break-point, .site-footer, .tfp-mp-actions,
    .elementor-location-header, .elementor-location-footer {
        display: none !important;
    }

    /* 3. Reset Container Width */
    .tfp-mp-single-wrapper {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 20px !important;
    }

    /* 4. Hero Section - Keep Colors */
    .tfp-mp-hero {
        border: 1px solid #eee; /* Light border instead of none */
        margin-bottom: 30px;
        page-break-inside: avoid;
    }
    .tfp-mp-hero h1 {
        color: var(--tfp-primary); /* Keep original color */
    }
    .tfp-mp-meta-pills {
        display: flex !important; /* Keep pills visible */
    }
    .tfp-mp-pill {
        background: #fff !important; /* Ensure background prints */
        border: 1px solid #ccc !important;
        color: #555 !important;
    }

    /* 5. Sections */
    .tfp-mp-section h3 {
        color: var(--tfp-primary) !important;
        border-bottom: 2px solid #eee !important;
    }

    /* 6. Table - Keep Striping/Colors */
    .tfp-mp-table-scroll {
        border: none;
        overflow: visible;
    }
    .tfp-mp-table th {
        background-color: #f9fafb !important; /* Keep grey background */
        color: #374151 !important;
    }
    .tfp-mp-table tr {
        page-break-inside: avoid;
    }
    .tfp-mp-day-col {
        color: var(--tfp-primary) !important;
    }
    .tfp-mp-link {
        color: var(--tfp-accent) !important; /* Keep link color */
        text-decoration: none;
    }

    /* 7. Shopping List */
    .tfp-mp-shop-list {
        display: block;
        columns: 2; /* 2 Columns for paper efficiency */
    }
    .tfp-mp-shop-item {
        break-inside: avoid;
        border: 1px solid #eee !important;
    }
    
    /* Replace checkbox with a printable box */
    .tfp-mp-shop-check { display: none; }
    .tfp-mp-shop-item::before {
        content: "☐";
        font-size: 1.4em;
        margin-right: 8px;
        line-height: 1;
        color: #333;
    }
    .tfp-mp-shop-label {
        color: #333;
    }

    /* 8. FAQs */
    .tfp-mp-faq-item details,
    .tfp-mp-faq-item .tfp-mp-faq-content {
        display: block !important; /* Force open */
    }
    .tfp-mp-faq-title {
        background-color: #f9fafb !important;
    }
    .tfp-mp-faq-title::after { display: none; } /* Hide toggle icon */
}