/* Recipe Single Page Layout & Kitchen UX */

body:has(.recipe-article) .content {
  max-width: 1040px;
  padding: 0 2ch;
}

.recipe-article .title h1.title {
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

.recipe-subtitle {
  font-family: "Fira Sans", sans-serif;
  font-size: 1.25rem;
  color: var(--mutedColor);
  margin: 0.5rem 0 1rem;
  max-width: 48rem;
}

/* Top bar: metadata badges + kitchen controls */
.recipe-topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0 2rem;
  padding: 0.85rem 1.1rem;
  border: 2px solid #e2e2e8;
  border-radius: 8px;
  background-color: #f8f9fb;
}

.recipe-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-family: "Fira Sans", sans-serif;
  font-size: 1rem;
}

.recipe-meta-item {
  display: flex;
  flex-direction: column;
}

.recipe-meta-label {
  font-family: "Roboto Mono", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mutedColor);
}

.recipe-meta-value {
  font-weight: 700;
  font-size: 1.05rem;
}

/* Two-column layout when enhanced */
.recipe-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: start;
}

@media (min-width: 820px) {
  .recipe-grid.has-two-cols {
    grid-template-columns: 310px 1fr;
    gap: 3rem;
  }

  .recipe-ingredients-card {
    position: sticky;
    top: 1.25rem;
  }
}

/* Ingredients Card */
.recipe-ingredients-card {
  border: 2px solid #e2e2e8;
  border-radius: 8px;
  padding: 1.25rem 1.4rem;
  background-color: #fafbfc;
}

.recipe-ingredients-card h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.45rem;
  border-bottom: 2px dotted var(--bordercl);
  padding-bottom: 0.4rem;
}

.recipe-ingredients-card h3 {
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 1.25rem 0 0.5rem;
  color: var(--maincolor);
}

.recipe-ingredients-card ul {
  list-style: none;
  padding-left: 0;
  padding-right: 0;
  margin: 0 0 1rem;
}

.recipe-ingredients-card ul::before {
  display: none;
}

.recipe-ingredients-card li {
  font-family: "Fira Sans", sans-serif;
  font-size: 1.15rem;
  line-height: 1.45;
  margin: 0.45rem 0;
  padding: 0.3rem 0.4rem;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  user-select: none;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.recipe-ingredients-card li:hover {
  background-color: rgba(0, 124, 184, 0.08);
}

.recipe-ingredients-card li input[type="checkbox"] {
  accent-color: var(--maincolor);
  width: 1rem;
  height: 1rem;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
  transform: translateY(2px);
}

.recipe-ingredients-card li.checked {
  opacity: 0.45;
  text-decoration: line-through;
}

/* Directions Column */
.recipe-directions-col h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.65rem;
  border-bottom: 2px dotted var(--bordercl);
  padding-bottom: 0.4rem;
}

.recipe-directions-col h3 {
  font-size: 1.3rem;
  margin: 2rem 0 0.75rem;
  color: var(--maincolor);
}

.recipe-directions-col p,
.recipe-directions-col li {
  font-family: "Fira Sans", sans-serif;
  font-size: 1.3rem;
  line-height: 1.7;
}

.recipe-directions-col ol {
  list-style: none;
  counter-reset: step-counter;
  padding-left: 0;
  padding-right: 0;
  margin: 0 0 1.5rem;
}

.recipe-directions-col ol::before {
  display: none;
}

.recipe-directions-col ol > li {
  counter-increment: step-counter;
  position: relative;
  padding: 0.75rem 1rem 0.75rem 3.1rem;
  margin: 0.75rem 0;
  border-radius: 8px;
  border-left: 4px solid transparent;
  background-color: rgba(0, 0, 0, 0.025);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.recipe-directions-col ol > li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0.85rem;
  top: 0.8rem;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  background-color: var(--maincolor);
  color: #fff;
  font-family: "Roboto Mono", monospace;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.recipe-directions-col ol > li:hover {
  background-color: rgba(0, 124, 184, 0.07);
}

.recipe-directions-col ol > li.active-step {
  border-left-color: var(--maincolor);
  background-color: rgba(0, 124, 184, 0.12);
}

.recipe-directions-col ol > li p {
  margin: 0;
  font-size: inherit;
}

/* Highlight bolded temps/times in directions */
.recipe-directions-col strong {
  color: var(--maincolor);
  font-weight: 700;
}

.recipe-hint {
  font-family: "Roboto Mono", monospace;
  font-size: 0.78rem;
  color: var(--mutedColor);
  margin-bottom: 0.75rem;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
  .recipe-topbar,
  .recipe-ingredients-card {
    background-color: #111317;
    border-color: #2b303a;
  }

  .recipe-ingredients-card h2,
  .recipe-directions-col h2 {
    border-bottom-color: var(--darkBorderColor);
  }

  .recipe-ingredients-card h3,
  .recipe-directions-col h3,
  .recipe-directions-col strong {
    color: var(--darkMaincolor);
  }

  .recipe-ingredients-card li input[type="checkbox"] {
    accent-color: var(--darkMaincolor);
  }

  .recipe-ingredients-card li:hover {
    background-color: rgba(235, 217, 135, 0.1);
  }

  .recipe-directions-col ol > li {
    background-color: rgba(255, 255, 255, 0.04);
  }

  .recipe-directions-col ol > li::before {
    background-color: var(--darkMaincolor);
    color: #000;
  }

  .recipe-directions-col ol > li:hover {
    background-color: rgba(235, 217, 135, 0.08);
  }

  .recipe-directions-col ol > li.active-step {
    border-left-color: var(--darkMaincolor);
    background-color: rgba(235, 217, 135, 0.16);
  }
}

/* Print-friendly view */
@media print {
  header,
  footer,
  .webmention,
  .recipe-actions,
  .recipe-hint,
  .post-tags {
    display: none !important;
  }

  body,
  html {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
  }

  body:has(.recipe-article) .content {
    max-width: 100%;
    margin: 0;
    padding: 0;
  }

  .recipe-topbar {
    border: 1px solid #ccc;
    background: none;
    padding: 0.5rem;
    margin: 0.5rem 0 1rem;
  }

  .recipe-grid.has-two-cols {
    grid-template-columns: 220px 1fr;
    gap: 1.5rem;
  }

  .recipe-ingredients-card {
    position: static;
    border: 1px solid #ccc;
    background: none;
    padding: 0.75rem;
  }

  .recipe-directions-col ol > li {
    background: none;
    padding: 0.25rem 0 0.25rem 2rem;
    page-break-inside: avoid;
  }

  .recipe-directions-col ol > li::before {
    border: 1px solid #000;
    background: none;
    color: #000;
  }
}
