/* Recipe detail + SOTD layout styles extracted from styles.css */
.recipe-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.7fr);
  gap: var(--space-7);
}

.recipe-ingredients {
  display: grid;
  gap: var(--space-3);
}

.recipe-ingredients-media {
  align-self: stretch;
  display: grid;
}

.recipe-ingredients-media picture {
  display: block;
  width: 100%;
  height: 100%;
}

.recipe-ingredients-media img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
}

.recipe-header {
  text-align: center;
  margin-bottom: var(--space-6);
}

.recipe-header h1 {
  margin: 0 0 var(--space-3);
  font-size: clamp(2.2rem, 3vw, 3.1rem);
}

.recipe-header .hero__subtitle {
  margin: 0 auto var(--space-5);
  max-width: 640px;
}

.salad-title-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.salad-title-row--center {
  justify-content: center;
}

.salad-title-row--start {
  justify-content: space-between;
}

.salad-title {
  margin: 0;
  line-height: 1.2;
}


.recipe-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 350px);
  gap: var(--space-7);
  align-items: start;
}

.recipe-media {
  display: grid;
  gap: var(--space-4);
}

.info-card--overview h3 {
  margin-top: 0;
}

.info-card--overview h4 {
  margin: 0 0 var(--space-3);
  font-size: 1rem;
}

.info-card--overview {
  position: static;
  padding: var(--space-6);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  text-align: center;
}

.metric-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-value {
  font-weight: 600;
  font-size: 1.1rem;
}

.metric-value--servings {
  font-size: 1rem;
  line-height: 1.25;
}

.cost-meter {
  display: inline-flex;
  align-items: baseline;
}

.cost-meter__off {
  opacity: 0.22;
}

.metric-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.metric-note-ref {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
  vertical-align: baseline;
}

.metric-note-link {
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.metric-note-link:hover,
.metric-note-link:focus-visible {
  color: var(--text);
}

.metric-footnote {
  margin: var(--space-3) 0 0;
  line-height: 1.45;
}

.note-modal__body {
  margin-top: var(--space-4);
  display: grid;
  gap: var(--space-3);
}

.note-modal__body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-4) 0;
}

.shop-card {
  display: grid;
  gap: var(--space-3);
}

.portion-panel {
  display: grid;
  gap: var(--space-3);
}

.portion-panel h4 {
  margin: 0;
  font-size: 1.05rem;
}


.quantity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.quantity-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.quantity-control {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.quantity-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.quantity-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.quantity-value {
  min-width: 24px;
  text-align: center;
  font-weight: 600;
}

.portion-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.portion-details ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text);
}

.portion-details li {
  margin: 0 0 4px 0;
}

.shop-card .btn {
  width: 100%;
}

.shop-card__actions {
  display: grid;
  gap: var(--space-2);
}

.shop-with {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  font-size: 1rem;
}

.store-logo {
  height: 20px;
  width: auto;
  border-radius: 0;
  display: block;
  object-fit: contain;
}

.ingredients-list li,
.substitutions-list li {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.95rem;
}

.ingredients-list span:first-child {
  color: var(--muted);
  min-width: 120px;
}

.info-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
  background: var(--highlight);
  position: sticky;
  top: 90px;
}

.info-card h3 {
  margin-top: 0;
}

.recipe-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: var(--space-4) 0;
  align-items: center;
}

.why-we-love {
  margin: var(--space-4) 0;
  padding: var(--space-5);
  background: #f9fafb;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--text);
}

.why-we-love .eyebrow {
  margin-bottom: var(--space-2);
}

.why-we-love__text {
  margin: 0;
  color: #333;
  line-height: 1.6;
}

.why-tip {
  margin: var(--space-4) 0;
  padding: var(--space-5);
  background: var(--accent-2);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--accent);
}

.why-tip .eyebrow {
  margin-bottom: var(--space-2);
  color: var(--accent);
}

.why-tip__text {
  margin: 0;
  color: #20352a;
  line-height: 1.6;
}

.meat-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.meat-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--space-6);
  align-items: start;
  max-width: 800px;
  margin: 0 auto;
}

.meat-options {
  display: grid;
  gap: var(--space-3);
}

.meat-image-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.meat-image {
  width: 300px;
  height: 300px;
  object-fit: contain;
  border-radius: var(--radius);
}

@media (max-width: 700px) {
  .meat-grid {
    grid-template-columns: 1fr;
  }
  
  .meat-image-wrap {
    order: -1;
  }
  
  .meat-image {
    width: 200px;
    height: 200px;
  }
}

.meat-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  text-align: left;
  cursor: pointer;
  transition: border 0.2s ease, box-shadow 0.2s ease;
  font-size: 0.95rem;
}

.meat-option:focus-visible {
  outline: 2px solid rgba(31, 61, 42, 0.3);
  outline-offset: 2px;
}

.meat-option__text {
  display: grid;
  gap: 2px;
}

.meat-option__label {
  font-weight: 600;
}

.meat-option__price {
  font-size: 0.9rem;
  color: var(--muted);
}

.meat-option__check {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid var(--border);
  display: grid;
  place-items: center;
  color: #ffffff;
  background: transparent;
}

.meat-option__check svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
  opacity: 0;
}

.meat-option.is-selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.meat-option.is-selected .meat-option__check {
  background: #22c55e;
  border-color: #22c55e;
}

.meat-option.is-selected .meat-option__check svg {
  opacity: 1;
}

.shop-sticky {
  position: relative;
  z-index: 15;
  background: var(--bg);
  padding: var(--space-3) 0 calc(var(--space-2) + env(safe-area-inset-bottom));
}

.shop-sticky.is-fixed {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
}

.shop-sticky.is-stopped {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
}

.shop-sticky-placeholder {
  height: 0;
}

.shop-sticky-placeholder.is-active {
  height: var(--shop-sticky-reserve);
}

body.has-shop-sticky-active main {
  padding-bottom: var(--shop-sticky-reserve);
}

.shop-sticky__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--highlight);
  box-shadow: 0 18px 35px rgba(24, 23, 20, 0.08);
}

.shop-sticky__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.shop-sticky__meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.shop-sticky__actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-self: end;
}

.shop-sticky__disclosure {
  grid-column: 1 / -1;
  margin: 0;
  line-height: 1.4;
}

.anchor-target {
  scroll-margin-top: calc(var(--header-offset) + var(--space-6));
}

.prep-list {
  list-style: disc;
  padding-left: 20px;
  margin: 0;
  display: grid;
  gap: var(--space-2);
  color: var(--muted);
}

.recipe-steps {
  display: grid;
  gap: var(--space-7);
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-6);
  align-items: center;
}

.step-card:nth-child(even) .step-media {
  order: -1;
}

.step-kicker {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: var(--space-2);
}

.step-title {
  margin: 0 0 var(--space-3);
  font-size: 1.35rem;
}

.step-text {
  margin: 0 0 var(--space-3);
}

.step-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: 0.85rem;
  color: var(--muted);
}

.step-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
}

/* Wake Lock toggle */
.wake-lock-row {
  display: grid;
  gap: var(--space-2);
}

.wake-lock-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  width: 100%;
  justify-content: center;
}

.wake-lock-toggle:hover {
  border-color: var(--text);
}

.wake-lock-toggle:focus-visible {
  outline: 2px solid rgba(31, 61, 42, 0.3);
  outline-offset: 2px;
}

.wake-lock-toggle[aria-pressed="true"] {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.wake-lock-toggle[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.wake-lock-icon {
  fill: currentColor;
  flex-shrink: 0;
}

.wake-lock-status {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  min-height: 1.2em;
}

.wake-lock-status--warn {
  color: #b45309;
}

.link-subtle {
  color: var(--muted);
  font-size: 0.9rem;
  display: block;
  text-align: center;
  text-decoration: underline;
  margin-top: var(--space-2);
}

.link-underline {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.recipe-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  color: var(--muted);
  font-size: 0.9rem;
}

.related-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.related-grid .card img {
  height: 180px;
  object-fit: cover;
}


/* Salad of the Day Layout Improvements */
.salad-title-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.salad-title-row .salad-title {
  margin: 0;
}

.salad-title-row .engagement-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

@media (max-width: 700px) {
  .salad-title-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-2);
  }

  .salad-title-row .salad-title {
    width: 100%;
    margin-bottom: var(--space-1);
    text-align: center;
  }
}

@media (max-width: 980px) {
  .recipe-header {
    margin-bottom: var(--space-5);
  }

  .recipe-header h1 {
    font-size: clamp(1.95rem, 7.5vw, 2.6rem);
  }

  .recipe-hero-grid {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }

  .recipe-media {
    order: 0;
  }

  .info-card--overview {
    order: 1;
    position: static;
    padding: var(--space-5);
  }

  .recipe-layout {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .recipe-ingredients-media {
    order: 2;
  }

  .recipe-ingredients-media img {
    min-height: 0;
    max-height: 360px;
  }

  .step-card {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .step-card:nth-child(even) .step-media {
    order: 0;
  }

  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  :root {
    --shop-sticky-reserve: calc(108px + env(safe-area-inset-bottom));
  }

  .shop-sticky {
    padding: 0;
    background: transparent;
  }

  .shop-sticky.is-fixed {
    bottom: calc(74px + env(safe-area-inset-bottom));
  }

  .shop-sticky__inner {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0;
    padding: 0 8px 6px;
    border: none;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
  }

  .shop-sticky__actions {
    display: flex;
    justify-content: flex-end;
    width: auto;
  }

  .shop-sticky__actions .btn.secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(128px, 42vw, 180px);
    min-height: 52px;
    padding: 8px 10px;
    border: 1px solid #000000;
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
    font-weight: 700;
    line-height: 1.1;
  }

  .shop-sticky__actions .btn.secondary:hover,
  .shop-sticky__actions .btn.secondary:focus-visible {
    border: 1px solid #000000;
    transform: none;
  }

  .shop-sticky__title,
  .shop-sticky__actions .btn.instacart-cta {
    display: none;
  }

  .metric-grid {
    gap: var(--space-2);
  }

  .metric-label {
    letter-spacing: 0.8px;
  }

  .ingredients-list li,
  .substitutions-list li {
    display: grid;
    grid-template-columns: minmax(86px, 30%) minmax(0, 1fr);
    align-items: start;
    gap: var(--space-2) var(--space-3);
  }

  .ingredients-list span:first-child {
    min-width: 0;
  }

  .info-card--overview .btn.instacart-cta {
    width: 100%;
    white-space: normal;
    text-align: center;
    line-height: 1.25;
  }
}

@media (max-width: 540px) {
  .info-card--overview {
    padding: var(--space-4);
  }

  .related-grid {
    grid-template-columns: 1fr;
  }
}
