/*
Theme Name: CookMate
Theme URI: https://recipemate.app
Author: Piyash Datta
Author URI: https://recipemate.app
Description: A modern, multilingual recipe theme for Recipe Mate 2.0. Supports 1500+ recipes with custom post types, taxonomies, ingredient scaling, SEO, and 5-language support.
Version: 2.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cookmate
Tags: food, recipes, multilingual, custom-post-type, translation-ready
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
*/

:root {
  --cm-primary: #f97316;
  --cm-primary-dark: #ea580c;
  --cm-bg: #fafaf9;
  --cm-card: #ffffff;
  --cm-text: #1c1917;
  --cm-muted: #78716c;
  --cm-border: #e7e5e4;
  --cm-success: #16a34a;
  --cm-danger: #dc2626;
  --cm-radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', -apple-system, sans-serif; background: var(--cm-bg); color: var(--cm-text); line-height: 1.6; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 1rem; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; }

/* Typography */
.font-heading { font-family: 'Poppins', 'Inter', sans-serif; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.625rem 1.25rem; border-radius: var(--cm-radius); font-size: 0.875rem; font-weight: 500; border: none; cursor: pointer; transition: all 0.2s; }
.btn-primary { background: var(--cm-primary); color: #fff; }
.btn-primary:hover { background: var(--cm-primary-dark); }
.btn-secondary { background: #f5f5f4; color: var(--cm-text); }
.btn-secondary:hover { background: #e7e5e4; }

/* Cards */
.recipe-card { background: var(--cm-card); border: 1px solid var(--cm-border); border-radius: var(--cm-radius); overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; }
.recipe-card:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.08); }
.recipe-card img { width: 100%; height: 200px; object-fit: cover; }
.recipe-card .card-body { padding: 1rem; }
.recipe-card .card-title { font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 1rem; margin-bottom: 0.5rem; }
.recipe-card .card-meta { display: flex; gap: 0.75rem; font-size: 0.75rem; color: var(--cm-muted); }

/* Badges */
.badge { display: inline-flex; padding: 0.25rem 0.75rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 500; }
.badge-veg { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.badge-nonveg { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* Grid */
.grid-recipes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--cm-primary), #ea580c); padding: 4rem 0; text-align: center; color: #fff; }
.hero h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 1rem; }
.hero p { font-size: 1.125rem; opacity: 0.9; max-width: 640px; margin: 0 auto 2rem; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,0.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--cm-border); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.site-header nav a { padding: 0.5rem 0.75rem; border-radius: 8px; font-size: 0.875rem; font-weight: 500; color: var(--cm-muted); transition: all 0.2s; }
.site-header nav a:hover, .site-header nav a.active { color: var(--cm-primary); background: rgba(249,115,22,0.08); }

/* Fallback banner */
.recipe-fallback { width: 100%; height: 200px; background: linear-gradient(135deg, var(--cm-primary), #ea580c); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.recipe-fallback h3 { color: #fff; font-family: 'Poppins', sans-serif; font-size: 1.125rem; text-align: center; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 0.5rem; margin-top: 2rem; }
.pagination a, .pagination span { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 0.875rem; font-weight: 500; }
.pagination .current { background: var(--cm-primary); color: #fff; }
.pagination a { background: #f5f5f4; }
.pagination a:hover { background: #e7e5e4; }

/* Footer */
.site-footer { background: var(--cm-card); border-top: 1px solid var(--cm-border); padding: 3rem 0; margin-top: 4rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; }

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.75rem; }
  .hero { padding: 2.5rem 0; }
  .grid-recipes { grid-template-columns: 1fr; }
  .site-header nav { display: none; }
}

/* Print */
@media print {
  .site-header, .site-footer, .no-print { display: none !important; }
}

/* Nutrition grid */
.nutrition-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.5rem; }
.nutrition-item { background: #f5f5f4; border-radius: var(--cm-radius); padding: 0.75rem; text-align: center; }
.nutrition-item .value { font-size: 1.125rem; font-weight: 700; color: var(--cm-primary); }
.nutrition-item .label { font-size: 0.75rem; color: var(--cm-muted); }

/* Category chips */
.category-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.75rem; }
.category-chip { padding: 1rem; border-radius: var(--cm-radius); text-align: center; transition: all 0.2s; }
.category-chip:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.category-chip .emoji { font-size: 1.5rem; display: block; margin-bottom: 0.25rem; }
.category-chip .name { font-size: 0.75rem; font-weight: 500; }

/* Filter chips */
.filter-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.filter-chip { padding: 0.5rem 1rem; border-radius: 9999px; font-size: 0.875rem; font-weight: 500; background: #f5f5f4; border: none; cursor: pointer; transition: all 0.2s; }
.filter-chip.active { background: var(--cm-primary); color: #fff; }

/* YouTube section */
.youtube-section { margin-top: 2rem; }
.youtube-section iframe { width: 100%; aspect-ratio: 16/9; border-radius: var(--cm-radius); border: none; }

/* Stats bar */
.stats-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin-top: -2rem; position: relative; z-index: 10; }
.stat-card { background: var(--cm-card); border: 1px solid var(--cm-border); border-radius: var(--cm-radius); padding: 1rem; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }

@media (max-width: 640px) {
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .nutrition-grid { grid-template-columns: repeat(3, 1fr); }
}
