/* ==========================================================================
   FoodSkout - Public Stylesheet (Culinary Design System)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;0,700;1,600&display=swap');

:root {
  --primary: #d94e34;
  --primary-hover: #be3c24;
  --primary-light: #fef4f2;
  --primary-border: #f8cfc7;
  
  --secondary: #276749;
  --secondary-hover: #1e5239;
  --secondary-light: #eff8f3;
  --secondary-border: #c3e6d2;

  --accent: #d97706;
  --accent-light: #fef3c7;

  --dark: #1e293b;
  --dark-heading: #0f172a;
  --body-text: #334155;
  --muted-text: #64748b;

  --bg-page: #faf8f5;
  --bg-surface: #ffffff;
  --bg-alt: #f4efe9;

  --border: #e2e8f0;
  --border-light: #f1f5f9;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08);

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;

  --transition: all 0.2s ease-in-out;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  font-family: var(--font-sans);
  color: var(--body-text);
  background-color: var(--bg-page);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

.container {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-narrow {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 4.5rem 0;
}

.section-sm {
  padding: 2.5rem 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--dark-heading);
  font-weight: 700;
  line-height: 1.25;
}

.title-display {
  font-family: var(--font-serif);
  font-size: 2.75rem;
  letter-spacing: -0.02em;
}

.title-lg {
  font-family: var(--font-serif);
  font-size: 2.1rem;
}

.title-md {
  font-family: var(--font-serif);
  font-size: 1.65rem;
}

.lead {
  font-size: 1.15rem;
  color: var(--muted-text);
}

/* Buttons & Badges */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(217, 78, 52, 0.25);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--secondary);
  color: #ffffff;
}

.btn-secondary:hover {
  background-color: var(--secondary-hover);
}

.btn-outline {
  border-color: var(--border);
  background-color: #ffffff;
  color: var(--dark);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--primary-light);
}

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-primary {
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

.badge-secondary {
  background-color: var(--secondary-light);
  color: var(--secondary);
  border: 1px solid var(--secondary-border);
}

/* Header & Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  gap: 1.5rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--dark-heading);
}

.brand-icon-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

.nav-link {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--body-text);
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--dark);
}

/* Mobile Nav */
.mobile-nav {
  display: none;
  flex-direction: column;
  padding: 1.25rem;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

.mobile-nav.open {
  display: flex;
}

/* Hero */
.hero {
  padding: 4rem 0 3.5rem;
  background: linear-gradient(180deg, #ffffff 0%, var(--bg-page) 100%);
  border-bottom: 1px solid var(--border-light);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3.5rem;
  align-items: center;
}

.hero-search-box {
  margin-top: 2rem;
  background-color: #ffffff;
  padding: 0.5rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.hero-search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  color: var(--dark);
  background: transparent;
}

.hero-img {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  height: 400px;
  object-fit: cover;
}

/* Recipe Grid */
.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.recipe-card {
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.recipe-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}

.recipe-card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background-color: var(--bg-alt);
}

.recipe-card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.recipe-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--dark-heading);
}

.recipe-card-desc {
  font-size: 0.9rem;
  color: var(--muted-text);
  line-height: 1.55;
  margin-bottom: 1.25rem;
  flex: 1;
}

.recipe-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.85rem;
  color: var(--muted-text);
  font-weight: 600;
}

/* Recipe Detail Layout */
.recipe-detail-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 3rem;
  margin-top: 3rem;
}

.ingredient-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.ingredient-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  background-color: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.ingredient-item.checked {
  background-color: #f8fafc;
}

.ingredient-item.checked span {
  text-decoration: line-through;
  color: #94a3b8;
}

.instruction-step {
  display: flex;
  gap: 1.25rem;
  padding: 1.5rem;
  background-color: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}

.step-num {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: var(--radius-full);
  background-color: var(--primary);
  color: #ffffff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nutrition-card {
  background-color: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  position: sticky;
  top: 90px;
}

.nutrition-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
}

/* Responsive Grid Replacements */
/* Blog Catalog Layout */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.blog-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}

.blog-card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background-color: var(--bg-alt);
}

.blog-card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
}

.blog-card-desc {
  color: var(--muted-text);
  font-size: 0.9rem;
  line-height: 1.55;
  margin-bottom: 1.25rem;
  flex: 1;
}

.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.85rem;
  color: var(--muted-text);
}

/* Contact Page Layout */
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
}

.contact-form-card {
  background: #ffffff;
  padding: 2.5rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.contact-sidebar-card {
  background: #ffffff;
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.contact-sidebar-card-alt {
  background: var(--bg-alt);
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid var(--border);
}

/* Blog Related Recipes Layout */
.related-recipes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.related-recipe-card {
  display: flex;
  gap: 1rem;
  background: #ffffff;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  text-decoration: none;
  transition: var(--transition);
}

.related-recipe-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.related-recipe-thumb {
  width: 70px;
  height: 70px;
  min-width: 70px;
  border-radius: 8px;
  object-fit: cover;
}

/* Recipe Hero Layout */
.recipe-hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: center;
}

.recipe-hero-img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}

/* Recipe Quick Stats Layout */
.recipe-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  background: var(--bg-alt);
  padding: 1.25rem;
  border-radius: 12px;
  margin-top: 1.75rem;
  text-align: center;
}

.recipe-stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted-text);
  margin-bottom: 0.25rem;
}

.recipe-stat-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--dark-heading);
}

/* Recipe Servings Scaler Widget */
.scaler-widget {
  background: var(--bg-alt);
  padding: 0.85rem 1.25rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Jump to Recipe Anchor Clearance */
#recipe-card {
  scroll-margin-top: 80px;
}

/* Slide 8 Unpinning Seamless Footer Transition */
.hero-kinetic-track ~ .site-footer {
  margin-top: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Footer */
.site-footer {
  background-color: #0f172a;
  color: #94a3b8;
  padding: 4.5rem 0 2rem;
  margin-top: 5rem;
  font-size: 0.92rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 3rem;
  margin-bottom: 3.5rem;
}

.footer-compliance-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  line-height: 1.6;
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
}

.footer-legal-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

@media (max-width: 992px) {
  .hero-grid,
  .recipe-detail-grid,
  .recipe-hero-grid {
    grid-template-columns: 1fr;
  }
  .recipe-hero-img {
    height: 280px;
  }
  .nutrition-card {
    position: static;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .nav-links {
    display: none;
  }
  .mobile-menu-btn {
    display: block;
  }
}

@media (max-width: 860px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 640px) {
  .title-display {
    font-size: 2.15rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .recipes-grid,
  .blog-grid,
  .related-recipes-grid {
    grid-template-columns: 1fr;
  }
  .recipe-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 0.75rem;
    padding: 1rem;
  }
  .recipe-stat-label {
    font-size: 0.7rem;
  }
  .recipe-stat-value {
    font-size: 1.1rem;
  }
  .contact-form-card {
    padding: 1.5rem 1.25rem;
  }
  .contact-sidebar-card,
  .contact-sidebar-card-alt {
    padding: 1.5rem 1.25rem;
  }
  .recipe-hero-img {
    height: 220px;
  }
  .blog-card-body {
    padding: 1.25rem;
  }
  .footer-legal-links {
    gap: 0.75rem 1.25rem;
  }
}

@media (max-width: 480px) {
  .scaler-widget {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
  }
}

/* ==========================================================================
   Print Stylesheet (Clean 1-2 Page Recipe Sheet for Home Kitchens)
   ========================================================================== */
@media print {
  /* header, nav, .btn, .site-footer display: none */
  @page {
    margin: 1.2cm 1.5cm;
    size: portrait;
  }

  html, body {
    background: #ffffff !important;
    color: #111827 !important;
    font-size: 10.5pt !important;
    line-height: 1.45 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Hide navigation, mobile menu, footer, search, CTAs, and interactive buttons */
  .site-header,
  .mobile-nav,
  .mobile-menu-btn,
  .site-footer,
  .hero-stage-nav,
  .hero-stage-mobile-pill,
  .btn,
  button,
  form,
  .scaler-widget button,
  .scaler-widget span:last-of-type,
  nav,
  #heroKineticTrack {
    display: none !important;
  }

  /* Remove screen shadows, borders, and rounded card styling */
  *, *::before, *::after {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  .container,
  .container-narrow,
  main,
  section {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
  }

  /* Recipe Hero Banner for Print */
  section.section-sm:first-of-type {
    border-bottom: 2px solid #111827 !important;
    padding-bottom: 0.75rem !important;
    margin-bottom: 1rem !important;
  }

  .title-display::before {
    content: "FoodSkout Test Kitchen \A0•\A0 Trusted Home Recipe";
    display: block;
    font-size: 8.5pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #d94e34 !important;
    margin-bottom: 0.35rem;
  }

  .title-display {
    font-size: 18pt !important;
    line-height: 1.2 !important;
    color: #111827 !important;
    margin-bottom: 0.35rem !important;
  }

  p.lead {
    font-size: 10pt !important;
    line-height: 1.4 !important;
    color: #4b5563 !important;
    margin-top: 0.25rem !important;
    margin-bottom: 0.75rem !important;
  }

  /* Compact Hero Image for Print (Floated Right) */
  section.section-sm img {
    max-height: 150px !important;
    max-width: 200px !important;
    width: auto !important;
    height: auto !important;
    object-fit: cover !important;
    border-radius: 6px !important;
    border: 1px solid #d1d5db !important;
    float: right !important;
    margin: 0 0 1rem 1.25rem !important;
  }

  /* Badges in Print */
  .badge {
    border: 1px solid #9ca3af !important;
    background: transparent !important;
    color: #374151 !important;
    font-size: 8pt !important;
    padding: 0.15rem 0.5rem !important;
    border-radius: 4px !important;
  }

  /* Recipe Detail Grid - Clean Block Flow */
  .recipe-detail-grid {
    display: block !important;
    margin-top: 1rem !important;
  }

  /* Scaler Widget - Editorial Servings Display */
  .scaler-widget {
    background: transparent !important;
    border: none !important;
    border-left: 3px solid #d94e34 !important;
    border-radius: 0 !important;
    padding: 0.25rem 0 0.25rem 0.65rem !important;
    margin-bottom: 1rem !important;
    display: flex !important;
    align-items: baseline !important;
    gap: 0.5rem !important;
  }

  .scaler-widget strong {
    font-size: 10pt !important;
    color: #111827 !important;
    display: inline !important;
  }

  .scaler-widget #scalerValue,
  .scaler-widget #current-servings {
    font-size: 11pt !important;
    font-weight: 800 !important;
    color: #d94e34 !important;
  }

  h2.title-md {
    font-size: 13pt !important;
    border-bottom: 1.5px solid #e5e7eb !important;
    padding-bottom: 0.35rem !important;
    margin-top: 1.25rem !important;
    margin-bottom: 0.65rem !important;
    page-break-after: avoid;
    break-after: avoid;
    color: #111827 !important;
  }

  /* Ingredient List & Checkboxes */
  .ingredient-list {
    margin-bottom: 1.25rem !important;
    padding: 0 !important;
    list-style: none !important;
  }

  .ingredient-item {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px dotted #e5e7eb !important;
    padding: 0.35rem 0 !important;
    margin-bottom: 0 !important;
    display: flex !important;
    align-items: baseline !important;
    gap: 0.5rem !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .ingredient-item.checked {
    background: transparent !important;
  }

  .ingredient-item.checked span {
    text-decoration: none !important;
    color: #111827 !important;
  }

  .ingredient-item input[type="checkbox"] {
    display: inline-block !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 11px !important;
    height: 11px !important;
    min-width: 11px !important;
    border: 1.5px solid #4b5563 !important;
    border-radius: 2px !important;
    background: #ffffff !important;
    margin: 0 !important;
    vertical-align: middle !important;
  }

  .ingredient-amount,
  .ingredient-unit {
    color: #111827 !important;
    font-weight: 700 !important;
  }

  .ingredient-desc {
    color: #374151 !important;
  }

  /* Instruction Steps */
  .instruction-step {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid #f3f4f6 !important;
    padding: 0.65rem 0 !important;
    margin-bottom: 0.5rem !important;
    gap: 0.85rem !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .step-num {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    font-size: 8.5pt !important;
    font-weight: 800 !important;
    background: #111827 !important;
    color: #ffffff !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    print-color-adjust: exact !important;
    -webkit-print-color-adjust: exact !important;
  }

  .instruction-step h4 {
    font-size: 10.5pt !important;
    font-weight: 700 !important;
    margin-bottom: 0.25rem !important;
    color: #111827 !important;
  }

  .instruction-step p {
    font-size: 9.5pt !important;
    line-height: 1.5 !important;
    color: #374151 !important;
  }

  .nutrition-card {
    border: 1px solid #e5e7eb !important;
    border-radius: 6px !important;
    padding: 0.75rem 1rem !important;
    background: #f9fafb !important;
    margin-top: 1rem !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .recipe-detail-grid::after {
    content: "Recipe from FoodSkout (foodskout.com) • Chef-Tested Culinary Publication • For personal, non-commercial home cooking use.";
    display: block;
    font-size: 8pt;
    color: #6b7280;
    text-align: center;
    border-top: 1px solid #e5e7eb;
    margin-top: 1.5rem;
    padding-top: 0.5rem;
    page-break-inside: avoid;
    break-inside: avoid;
  }
}
