/* ============================================================
   Recipe Collection — Styles
   ============================================================ */

/* --- Reset & Base ------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: #1a1a1a;
  background: #fafaf8;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: #5c6bc0;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3 {
  line-height: 1.25;
  font-weight: 700;
}

ul, ol {
  list-style: none;
}

/* --- Layout ------------------------------------------------- */
.site-main {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* --- Header & Nav ------------------------------------------ */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e5e5e0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-nav {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: #1a1a1a;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  color: #555;
  font-size: 0.95rem;
}

/* --- Footer ------------------------------------------------- */
.site-footer {
  background: #fff;
  border-top: 1px solid #e5e5e0;
  text-align: center;
  padding: 1.5rem;
  font-size: 0.875rem;
  color: #888;
}

/* --- Home Page --------------------------------------------- */
.home h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.home-intro {
  color: #555;
  margin-bottom: 2.5rem;
}

.category-section {
  margin-bottom: 3rem;
}

.category-heading {
  font-size: 1.25rem;
  text-transform: capitalize;
  color: #444;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e5e5e0;
}

/* --- Recipe Cards ------------------------------------------ */
.recipe-list {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 600px) {
  .recipe-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.recipe-card {
  background: #fff;
  border: 1px solid #e5e5e0;
  border-radius: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.recipe-card:hover {
  border-color: #5c6bc0;
  box-shadow: 0 2px 8px rgba(92, 107, 192, 0.1);
}

.recipe-card-link {
  display: block;
  padding: 1.25rem;
  color: inherit;
  text-decoration: none;
}

.recipe-card-title {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
  color: #1a1a1a;
}

.recipe-card-description {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recipe-card-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.8rem;
  color: #777;
  margin-bottom: 0.75rem;
}

.recipe-card-meta .category-badge {
  font-size: 0.75rem;
}

/* --- Tags -------------------------------------------------- */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
}

.tag-pill {
  display: inline-block;
  padding: 0.2em 0.6em;
  background: #eef0fc;
  color: #3949ab;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s;
}

a.tag-pill:hover {
  background: #c5cae9;
}

.tag-list-large {
  margin-top: 1rem;
}

.tag-list-large .tag-pill {
  font-size: 0.9rem;
  padding: 0.3em 0.8em;
}

.all-tags-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid #e5e5e0;
}

/* --- Category Badge ---------------------------------------- */
.category-badge {
  display: inline-block;
  padding: 0.2em 0.7em;
  background: #f0f0ed;
  color: #555;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.02em;
}

/* --- Recipe Page ------------------------------------------- */
.recipe-header {
  margin-bottom: 2rem;
}

.recipe-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.recipe-description {
  font-size: 1.1rem;
  color: #555;
  margin-bottom: 1rem;
}

.recipe-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.recipe-source {
  font-size: 0.875rem;
  color: #777;
  margin-top: 0.5rem;
}

/* --- Timing Row -------------------------------------------- */
.recipe-overview {
  background: #fff;
  border: 1px solid #e5e5e0;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.timing-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.timing-item {
  text-align: center;
}

.timing-item dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  margin-bottom: 0.15rem;
}

.timing-item dd {
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
}

.timing-total dd {
  color: #3949ab;
}

.yield-row {
  padding-top: 0.75rem;
  border-top: 1px solid #f0f0ed;
}

.yield-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: #444;
  cursor: pointer;
}

.yield-input {
  width: 70px;
  padding: 0.3em 0.5em;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  text-align: center;
  -moz-appearance: textfield;
}

.yield-input::-webkit-inner-spin-button,
.yield-input::-webkit-outer-spin-button {
  opacity: 1;
}

.yield-unit {
  color: #555;
}

/* --- Recipe Body (Two-Column Layout) ----------------------- */
.recipe-body {
  display: grid;
  gap: 2rem;
}

@media (min-width: 700px) {
  .recipe-body {
    grid-template-columns: 280px 1fr;
    align-items: start;
  }
}

/* --- Ingredients ------------------------------------------- */
.recipe-ingredients h2,
.recipe-steps h2,
.recipe-notes h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid #e5e5e0;
}

.ingredient-group {
  margin-bottom: 1.25rem;
}

.group-heading {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #777;
  margin-bottom: 0.5rem;
}

.ingredient-list {
  list-style: none;
}

.ingredient-item {
  padding: 0.35rem 0;
  border-bottom: 1px solid #f0f0ed;
  font-size: 0.95rem;
}

.ingredient-item:last-child {
  border-bottom: none;
}

.ingredient-qty {
  font-weight: 600;
  min-width: 2.5em;
  display: inline-block;
}

.ingredient-unit {
  color: #555;
}

.ingredient-notes {
  color: #888;
  font-style: italic;
  font-size: 0.875rem;
}

/* --- Steps ------------------------------------------------- */
.step-group {
  margin-bottom: 1.5rem;
}

.step-list {
  list-style: decimal;
  padding-left: 1.5rem;
}

.step-item {
  margin-bottom: 1rem;
  padding-left: 0.5rem;
}

.step-instruction {
  margin-bottom: 0.4rem;
  line-height: 1.65;
}

.step-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.step-badge {
  display: inline-block;
  padding: 0.15em 0.6em;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

.badge-duration {
  background: #e8f5e9;
  color: #2e7d32;
}

.badge-temp {
  background: #fff3e0;
  color: #e65100;
}

/* --- Notes ------------------------------------------------- */
.recipe-notes {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid #e5e5e0;
}

.notes-list {
  list-style: disc;
  padding-left: 1.5rem;
}

.notes-list li {
  margin-bottom: 0.5rem;
  color: #555;
  font-size: 0.95rem;
}

/* --- Tag Page ---------------------------------------------- */
.tag-page h1 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #555;
}

/* --- Print ------------------------------------------------- */
@media print {
  .site-header,
  .site-footer,
  .yield-row,
  .back-link,
  .tag-list,
  .recipe-meta .tag-list {
    display: none !important;
  }

  .site-main {
    padding: 0;
    max-width: 100%;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  .recipe-body {
    grid-template-columns: 220pt 1fr;
  }

  a {
    color: inherit;
  }

  .step-badge {
    border: 1px solid #ccc;
  }

  .recipe-overview {
    border: 1px solid #ccc;
  }
}
